What exactly do you mean with "map"? Everything that's stored in a savegame?
In OpenTTD, savegames consist of two parts.
Part 1 being the map array, a big array (or arrays) where each element is associated with a tile, describing what is on the tile. See
docs/landscape.html
Part 2 is various variable-sized "pools" that store stuff that either is not associated with a certain tile on the map (e.g. company information, cargo packets...), or is too big to fit into the map array, so it's stored in the pool and to be able to access it in the map array is stored an index pointing to the corresponding item in the pool (e.g. stations).
So if you're gonna export that to xml or something similar, it's probably going to look something like this:
Code: Select all
<savegame>
<map_array>
<tile>
<x>0</x>
<y>0</y>
<type_height>xxxxxxxx</type_height>
<m1>xxxxxxxx</m1> // if you chose to write it in binary - it's 8 bits. x = either 0 or 1
<m2>xxxxxxxxxxxxxxxx</m2> // 16 bits
<m3>xxxxxxxx</m3>
<m4>xxxxxxxx</m4>
<m5>xxxxxxxx</m5>
<m6>xxxxxxxx</m6>
<m7>xxxxxxxx</m7>
</tile>
<tile>
...
</tile>
...
... // all the other tiles
...
</map_array>
<pools>
<company_pool>
<company>
<id>0</id>
<whateverstuffisstoredthere>...</whateverstuffisstoredthere>
</company>
...
</company_pool>
<cargopacket_pool>
<cargopacket>
<id>0</id>
<whateverstuffisstoredthere>...</whateverstuffisstoredthere>
</cargopacket>
</cargopacket_pool>
...
... // all the other pools
...
</pools>
</savegame>
(btw I'm not volunteering to code this for you, only helping. The others are probably right that you'll have to code it yourself.)
Disclaimer: This is only from what I remember and using the above mentioned landscape.html, so there may be mistakes. Don't rely on it too much and get a second opinion, if this is correct.