On Wed, Apr 1, 2009 at 9:48 AM, Florian Schanda
<flor...@elysiumlarp.org.uk> wrote:
> I am looking into writing a python API for *writing* warzone maps, in
> particular multiplayer maps. I had some questions on the files for each map -
> if somebody could
> a) point me to the relevant source code that parses them
> b) tell me what they are meant to do / store
> c) tell me if they are strictly necessary
> that would be awesome.
>
> 2c-highground.gam
> 2c-highground/dinit.bjo
> 2c-highground/game.map
> 2c-highground/feat.bjo
> 2c-highground/struct.bjo
> 2c-highground/ttypes.ttp
>
> As far as I can work it out the .map is parsed by map.c, and is the important
> bit... I haven't looked at the rest of the source as I am unsure as to where
> to start.

The map itself (tile data) is contained in the "game.map" file. Droids
are in the "dinit.bjo", while features in "feat.bjo" and structures in
"struct.bjo". Terrain types are in "ttypes.ttp" but for maps using the
ordinary tilesets that come with the game, you do not need to modify
it, just make sure you use the correct one that matches the tileset.
The .gam file contains savegame information - depending on the map
version you are targeting, you may or may not have to put a lot of
data in it. I recommend using one of the lowest version supported by
the game to start with, such as version 11. There is also the need for
an "addon.lev" file to describe the map - take a look at how map mods
are doing it.

The files, except for addon.lev, are binary files containing raw C
structs merely dumped onto the disk. This makes them rather hard to
parse correctly. I recommend looking at my independent implementation
of a map reader that you can find in tools/map/mapload.c in trunk,
rather than looking at src/map.c and src/game.c, at least to begin
with.

Also note that while savegames and initial starting maps may look
quite similar, they have large differences under the hood. I do not
see why anyone would want to even think about reading or writing
savegames from an external program.

Hope this helps. Feel free to ask if you have more questions.

  - Per

_______________________________________________
Warzone-dev mailing list
Warzone-dev@gna.org
https://mail.gna.org/listinfo/warzone-dev

Reply via email to