Last modified 20 months ago Last modified on 09/26/10 20:49:29

Map Format

The core Warzone map format consists of the following files:

  • game.map
  • ttypes.ttp
  • <mapname>.gam

Maps may also include the following optional files:

  • struct.bjo
  • dinit.bjo
  • feat.bjo

For a map to be playable it must also include the following file:

  • <mapname>.addon.lev

Warning:

The structure descriptions many vary depending on their version, and so these descriptions may be inaccurate.

<mapname>.addon.lev

When Warzone starts it searches for these files and adds them to the list of available levels. This file contains among other things:

  • The level name
  • Number of players it supports
  • The file path of the <mapname>.gam file
  • The data that needs to be loaded to use it.

For mulitplayer maps, the dataset token sets which group of resources to load (these groups are defined in mp/addon.lev).
These groups are defined such that the tech level and tileset can be chosen by specifying the dataset.

game.map

This file contains the map's tile information ( height map, texture numbers, etc) and gateways.
The structure is the following:

Type Field Description
32 bit integer Width
32 bit integer Height
Array of maptile structures Tiles[Width][Height] See maptile structure below
32 bit integer Gateway version Gateway structure version
32 bit integer NumGateways Number of gateways
Array of gateway structures Gateways[NumGateways] See gateway data structure below

Maptile data structure

Type Field Description
16 bit unsigned integer Texture Compressed field containing the texture number among other properties.
8 bit unsigned integer Height Height of the map, this is not necessarily at the center of the tile.

The texture number gets mapped to a tile number by ttypes.ttp (below.)

Gateway data structure

Type Field Description
8 bit unsigned integer X1 X coordinate of the gateways start point.
8 bit unsigned integer Y1 Y coordinate of the gateways start point.
8 bit unsigned integer X2 X coordinate of the gateways end point.
8 bit unsigned integer Y2 Y coordinate of the gateways end point.

ttypes.ttp

This file contains a mapping between the map's texture number and the tileset's tile number.
The structure is the following:

Type Field Description
32 bit integer Version
32 bit integer Quantity Number of tile types mapped in this file
Array of 16 bit unsigned integers TileNumber[Quantity] Array that holds the mapping

TileNumber[texture_number] maps texture_number to a tile number, where texture_number is the number extracted from the maptile structure and a "tile number" is a number that corresponds to a tile from the tileset.

<mapname>.gam

This contains the game parameters, such as game type, game time, scroll limits, level name, etc.

struct.bjo

Map struture placement data. (TODO)

dinit.bjo

Map droid placement data. (TODO)

feat.bjo

Map feature placement data. (TODO)