Please explain difference between .map file and .xml file

Started by
5 comments, last by Kwizatz 16 years, 10 months ago
Hi all, this post may not be in the correct place. As I didn't know where to put it, I'll drop it in here and it can be moved(which it probably will) So my question : Does anyone know how to explain a .map file format and the difference between .map and .xml ? Just curious!! styfir.
Advertisement
Well just since you asked
the xml file is a web based file and a .map is well not to sure

in reality there just files that hold data.
your program just needs to know how to accesss them but there is not really a differnce.

one just holds data in a perticular way based on how its made, you can view it in a note pad and see for yourself :)

in reality its just important for the software to know how to access and read the data regardless of the extension.

Regards Jouei.
That's a good beginners question, but the title of your post wasn't very good so I changed it.

There are different kinds of .map files. Some ide's generate them to hold a "map" of the binary layout of the ".exe" files they produce during compilation. Some games use the extension ".map" to hold the data points to use in building a map - a floor plan of a level in the game. These two formats are different. I'm not certain there is a common ".map" format, that is, I'm not certain there is a ".map" file format specification. Check wotsit.org.

Xml stands for "extensible markup language" - it's like html only you get to define your own markup tags.

It would be helpful if you could provide some more information.
"I thought what I'd do was, I'd pretend I was one of those deaf-mutes." - the Laughing Man
XML is a meta-format, which means you use it to define your own formats using plain text, a Quake/HalfLife map file can be redefined as an XML, however don't expect 2 xml files from different sources to share the same format even if they describe the same map. In short, you should do your own research on XML, it is not that complicated but explaining all its intricacies goes far beyond what can be achieved on a single forum post.

As for the Quake/HalfLife map file, it is plain text and it mainly defines convex shapes called "brushes" used to build a BSP tree, the brushes are defined by a collection of intersecting planes, one per line, each plane depending on the version of the file contains either the normal and distance from the origin of the plane or 3 linearly independent points used to calculate the normal+distance plane equation and also texture information. Information about entities and other props may also be found in a map file.

If you're not talking about the brush based map file format, then it is likely to be a proprietary file format, so you'll have to tell us what program are you using to interact with it (if so).
wow this is great stuff. The .map files in question were to do with brush based systems but is there any available (.map files that is) for non-brush based engines? And also whats the difference, if any, between .map and compiled .bsp files? I mean - How are they used in relation to the engine and why not favor one over the other?

styfir.
I assume you're talking about Half-Life .map files? As far as I know, it's a format specific to Half-Life or maybe Quake as well, I'm not sure.

Anyway, a .map file contains brushes and entities, nothing more. It's used by the editor, Hammer, and also by the compile tools - these can generate a .bsp file from a given .map file.
A .bsp file doesn't contain brushes, but faces, polygons, stored together with optimization data (binary space partitioning), so the engine doesn't draw much more than what can be seen by the player. This file also contains lighting data, and of course the entities. In other words, it's a file that can be used directly by the engine.

What happens here is that certain things are calculated beforehand, such as the lighting and the visibility. These things are pretty complex and can take quite some time, which is why the developers decided to do it beforehand, rather than while loading the level. If all such information wasn't necessary, then they could just as well have decided to use the .map format, or another type (a binary version or such, since that's more compact and therefor faster to load).

Many other games use totally different formats. This depends on what the developers need, and what suits their game best. There's a wide variety of possible formats and extentions, so I wouldn't worry about that. What's more interesting is how they're used. Some games use a single file for both the editor and the game - in their case, there is little to no additional information that's required while loading a level. Other games use various file formats, because they're working with existing tools and there happen to be some conversion tools for these formats already.
Create-ivity - a game development blog Mouseover for more information.
Quote:Original post by styfir
wow this is great stuff. The .map files in question were to do with brush based systems but is there any available (.map files that is) for non-brush based engines?


There may be, however the most prevalent ".map" format is the one by ID Software (Valve branched and extended from it for Half Life, which was created using the Quake Engine). No one format really has the "exclusivity right", for lack of a better term, for the .map extension (unlike say .exe,.jpg,.mp3), so it is common to find different both text and binary .map files since the term is quite general, a map is something that you're likely to use in a game, and the word happens to be 3 characters long, which makes for a good descriptive extension.

Usually though the actual structures of those files are proprietary, which means it is not publicly available either because the authors don't want you to know about it, they feel you really don't need to know about it since the files are meant for their game only, or both.

Quote:Original post by styfir
And also whats the difference, if any, between .map and compiled .bsp files? I mean - How are they used in relation to the engine and why not favor one over the other?


As Captain P said, BSP's are compiled MAP's, BSP's are binaries and contain much more information than the MAP, for example the actual BSP tree, and besides the brushes (Quake3 BPS's do contain the brush data), the actual polygons so it's easier to feed them to OpenGL or Direct3D, as well as shadowmaps.

This topic is closed to new replies.

Advertisement