Freeciv
Advertisement

The freeciv map format is quite simple. In theory it is even possible to edit it by hand.

Basic information

Topology id

Maps are always two-dimensional. They may wrap at the north-south and east-west directions to form a flat map, a cylinder, or a torus (donut).
Individual tiles may be rectangular or hexagonal (hex), with either a classic or isometric alignment - this should be set based on the tileset being used.

    0 Flat Earth (unwrapped)
    1 Earth (wraps E-W)
    2 Uranus (wraps N-S)
    3 Donut World (wraps N-S, E-W)
    4 Flat Earth (isometric)
    5 Earth (isometric)
    6 Uranus (isometric)
    7 Donut World (isometric)
    8 Flat Earth (hexagonal)
    9 Earth (hexagonal)
   10 Uranus (hexagonal)
   11 Donut World (hexagonal)
   12 Flat Earth (iso-hex)
   13 Earth (iso-hex)
   14 Uranus (iso-hex)
   15 Donut World (iso-hex)
 
 Classic rectangular:       Isometric rectangular:
       _________               /\/\/\/\/\
      |_|_|_|_|_|             /\/\/\/\/\/
      |_|_|_|_|_|             \/\/\/\/\/\
      |_|_|_|_|_|             /\/\/\/\/\/
                              \/\/\/\/\/
 Hex tiles:                 Iso-hex:
   /\/\/\/\/\/\               _   _   _   _   _
   | | | | | | |             / \_/ \_/ \_/ \_/ \
   \/\/\/\/\/\/\             \_/ \_/ \_/ \_/ \_/
    | | | | | | |            / \_/ \_/ \_/ \_/ \
    \/\/\/\/\/\/             \_/ \_/ \_/ \_/ \_/

Terrain IDs

Single-character unique terrain identifier. The terrain types and their identifiers are defined in terrain.ruleset.

Here is a table showing the terrain identifiers of the default ruleset:

Graphic Name Identifier
Arctic Glacier a
Deep Ocean :
Desert Desert d
Forest Forest f
Plains Plains p
Grassland Grassland g
Hills Hills h
Jungle Jungle j
Lake +
Mountains Mountains m
Ocean Ocean SPACE
Swamp Swamp s
Tundra Tundra t

Layers

The map consists of a number of layers, each containing distinct data. The first layer is alway the t layer, which contains the actual terrain through the ids outlined above. This layer is followed by one or several more layers that contain other data, such as rivers, resources, etc. These layers differs between versions, Freeciv 2.0.* and 2.1.* have different ways of saving specials and resources.

Rivers

Not sure if this is correct...

A scenario may define the terrain of the map but not list the specials on it (thus allowing users to control the placement of specials). However rivers are a special case and must be included in the map along with the scenario. Thus in those cases this function should be called to load the river information separate from any other special data.

Scenarios can have the "riversoverlay" capability.


[2013/09/20 - RCatYVR] Rivers are defined in spe01_nnnn as value=" 8 ".  The system links or fans the channels depending on the surrounding tiles and any other adjacent value "8"s present,

Specials

Are not saved in scenario files rather they are randomized each time you load it, save games do save them though

Save games (2.3.x)

With freeciv 2.3.0 a new savegame format was introduced. The map part of a savegame starts like this:

[settings]
set={"name","value","gamestart"
"mapsize","FULLSIZE","FULLSIZE"
"size",0,0
"tilesperplayer",100,100
"xsize",16,16
"ysize",16,16
"topology","WRAPX|WRAPY","WRAPX|WRAPY"
[...]
}

[map]
have_huts=FALSE
t0000="h+hf  aaaa    ff"
t0001="dgg    aat    ff"
t0002="hhh           pp"
t0003="hmp        ggghh"
t0004="hmh       s dghf"
t0005=" dg      phffpm "
t0006="                "
t0007="aa     sdg    aa"
t0008="aa      h     aa"
t0009="       jff p    "
t0010="mh      s pdp pm"
t0011="gf       pdhh   "
t0012="        gpsg   p"
t0013="      h  hh     "
t0014="hff         gg s"
t0015="m+h   aaaa   m f"
startpos_count=5
startpos={"x","y","exclude","nations"
0,2,FALSE,""
9,11,FALSE,""
14,0,FALSE,""
2,5,FALSE,""
12,3,FALSE,""
}
b00_0000="0000000000000000"
[...]
spe00_0000="0000000000000000"
[...]
spe01_0000="0000000000000088"
[...]
spe02_0000="0000000000000000"
[...]
res0000="c c   x i y  v  "
[...]
owner0000="3,3,3,3,-,-,-,-,-,-,-,-,-,-,-,3"
[...]
source0000="242,242,242,242,-,-,-,-,-,-,-,-,-,-,-,242"
[...]
worked0000="-,-,-,-,-,-,-,-,-,-,-,-,-,-,-,-,"
k00_0000="a88880000000222a"
[...]
k01_0000="0000000000000000"
[...]
k02_0000="0000000000000000"
[...]
k03_0000="0000000000000000"
[...]
k04_0000="0000000000000000"
[...]
k05_0000="0000000000000000"
[...]
k06_0000="0000000000000000"
[...]
k07_0000="0000000000000000"
[...]

Settings

The map settings like topology, map size, ... are saved in the settings section of the savefile.

Map definition

Terrain

Using the Terrain IDs the map is discribed in the tXXXX layer.

Starting positions

The starting positions are listed in a table with the x and y coordinates, a boolean if it should be excluded and the nation name.

Special Layers

  • bXX_XXX list of all bases located on the map (1=Fortress, 2= Airbase, 3=Both)
  • spe_XX_XXXX list of all specials located on the map
  • resXXXX list of all resources located on the map
  • ownerXXXX owner of the tiles (border information; player number)
  • sourceXXXX list of all border sources
  • workedXXXX tile is work by the city with the given ID
  • kXX_XXXX last seen information, player knowledge

Layer Details

Resources
Dccoper 02:24, November 19, 2010 (UTC)
Special Abbreviation Allowed on Terrain
buffalo b plains
coal c hills
fish y lake, ocean
fruit f jungle
furs u tundra
game e tundra
gems g jungle
gold $ mountains
iron / (slash) mountains
ivory i (eye) glacier
oasis o desert
oil x glacier, desert
peat a swamp
pheasant p forest
resources r grassland
silk s forest
spice t swamp
whale v ocean
wheat j (jay) plains
wine w hills

Save games (2.1.x)

Here is a list of layers that is available in save games from Freeciv 2.1.*:

t000=
res000=" v     $  /   v  "
spe00_000="00002089"
spe01_000="00002089"
spe02_000="00002089"
owner="-,-,-,-" /* player number that owns a specific tile*/
source000=   /* border logic, what tile gave you access to this tile */
a000= /*these are most probably bitvectores 4 bit per character a,b,c,d,e,g,h,i=4 bit=32 bit */
b000=
c000=
d000=
e000=
g000=
h000=
i000=

Save games (2.0.x)

t000=
l000=
u000=
n000=
f000=
a000=
b000=
c000=
d000=
e000=
g000=
h000=
i000=


More information will follow...
Advertisement