Game Development Community

Map data format

by John Devoy · in Torque Game Builder · 03/04/2005 (11:29 am) · 2 replies

Hello,

Is the format for the storage of map data given anywhere?
I'd like to add the ability to make T2D maps in my own map editor.

John Devoy

About the author

Recent Threads


#1
03/04/2005 (12:01 pm)
@John: The map-file is an extremely complex file-format to document, particularly as it is hierarchical. The fxTileMap2D saves its own private data (as well as the parent sub-object) as well as all the fxTileLayer2D objects which in turn, save their own private data (and their parent sub-objects) as well as the tile database itself. The tile database is composed of different tile-types that have their own private-data as well as physics-info which is a seperate object that's used by all fxSceneObject2D objects and it saves its own private data as well as collision-definitions etc. There are certain tile-types that are true objects in their own right; these are fxActiveTile2D objects which are self-contained objects that can exist within the tile-layer (think of gun-turrets etc) and these save their own-private data and any custom data that a user might define as these can be customised in C++ to create gun-turrets, tile-particle emitters etc.

All in all, it's a pretty complex format but is clearly defined in the code and is encoded by the T2D stream which deals with endian issues to correct for the platform its running on.

You can follow it by looking at the console method in "fxTileMap2D.cc" (approx line 829) and following the stream saves.
ConsoleMethod(fxTileMap2D, saveTileMap, bool, 3, 3, "(tileMapFile$) - Saves a Tilemap File.")

At this point, we'll not be issuing such info as it's likely to change, besides, we've provided the well-documented code. There is a bunch of work to be done on the tilemaps, including work on active-tiles so I'd be careful there.

- Melv.
#2
03/04/2005 (4:51 pm)
Hi John,

We will definitely be changing the tilemap format soon, and it'll be in an easier to document state at that point. (It's a good format right now, it's just complex). As Melv says, reading the load / save code is probably the best bet for now. We can't spend time documenting this atm, since any doc we write now will be subsumed shortly.