Freeciv
Advertisement

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

The map part of a savegame starts like this:

[map]
topology_id=1
width=78
height=52
have_huts=0
temperature=50
alltemperate=0
is_earth=0
r0sx=43
r0sy=39
r1sx=2
r1sy=38
t000="aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa"
t001="          t   t                 t      t t       t f     t       t           t"
t002="                                                                              "
t003="f                              tffmtt     fmt                                 "
t004="ttt                      tft  fdmmmmmtt  tmt                               ttt"
t005="gfff                   fpgf   fdmttfmpfspgpg                           sssggpm"
t006="pfff                  pgmff   pdhgmfphpgfpg                           pggppppg"

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:
   /\/\/\/\/\/\               _   _   _   _   _
   | | | | | | |             / \_/ \_/ \_/ \_/ \
   \/\/\/\/\/\/\             \_/ \_/ \_/ \_/ \_/
    | | | | | | |            / \_/ \_/ \_/ \_/ \
    \/\/\/\/\/\/             \_/ \_/ \_/ \_/ \_/

Starting positions

 r0sx=43
 r0sy=37
 r0snation="Scottish"

The rNsx and rNsy entries define the starting position of a player. The optional rNsnation field ensures the player of a specific nation will be assigned to that starting position. This is useful for scenarios and the Earth map.

Terrain id

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
Desert Desert d
Forest Forest f
Plains Plains p
Grassland Grassland g
Hills Hills h
Jungle Jungle j
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.


Specials

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

Scenario files

I think these are an artifact of older Freeciv versions.

l00= 
u00=
n00=
f00=

Save games

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=

2.0

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


More information will follow...
Advertisement