-
Notifications
You must be signed in to change notification settings - Fork 2
aspadm edited this page Oct 11, 2018
·
3 revisions
Map header file

File contain one header:
struct header
{
uint magic; // 72 F6 4A CE
float max_altitude;
uint x_chunks_count;
uint y_chunks_count;
uint textures_count;
uint texture_size;
uint tiles_count;
uint tile_size;
ushort materials_count;
uint animated_tiles_count;
};Next to it struct material materials_array[header.materials_count];:
enum terrain_type
{
TOT_TERRAIN, // Base terrain type
TOT_WATER_NOTEXTURE, // Water without texture
TOT_GRASS // Textured grass
TOT_WATER, // Textured water
};
struct material
{
uint type; // use enum terrain_type
float r, g, b; // color
float opacity;
float self_illumination;
float wave_multiplier;
float warp_speed;
uint reserved[3];
};After that placed uint id_array[tiles_count];, which set tile type:
| id | type |
|---|---|
| 0 | grass |
| 1 | ground |
| 2 | stone |
| 3 | sand |
| 4 | rock |
| 5 | field |
| 6 | water |
| 7 | road |
| 8 | (empty) |
| 9 | snow |
| 10 | ice |
| 11 | drygrass |
| 12 | snowballs |
| 13 | lava |
| 14 | swamp |
| 15 | highrock |
At the end placed struct animated animated_tiles[animated_tiles_count]; (can be empty):
struct animated
{
ushort animated_tile_index;
ushort animation_phases;
};