by SnotlinG » Mon Dec 13, 2010 9:19 am
The database format is simple text-strings.
So for example the mapdata looks like:
<x-coord>#<y-coord>#<terrain ID>###<x-coord>#<y-coord>#<terrain ID>### etc
Going from coords 0 to 99 for X and 149 for Y.
Example:
0#0#1000###0#1#1000###0#2#1000###0#3#1000###0#4#1000###0#5#1000###0#6#1000###0#7#1000###0#8#1000###0#9#1000###0#10#1###0#11#5###0#12#3###0#13#1000###0#14#1000###0#15#1000###0#16#1000###0#17#1000###0#18#1000###0#19#9###0#20#22###0#21#9###0#22#1080###0#23#1###0#24#2###0#25#1000###0#26#1000###0#27#1000###0#28#1000###0#29#1000###0#30#1000###0#31#1000###0#32#1000###0#33#200###0#34#202###0#35#200###0#36#3###0#37#1 <snip>
However, the big issue I guess is that the borderdata is saved also, as it is calculated in the editor at the time you place the terraintile. So we have another string with mapborderdata:
Example:
5_4#ca02r#cityborderright###5_5#ca04r#cityborderright###2_5#ca03l#cityborderleft###2_4#ca01l#cityborderleft###1_10#for#right#fot#top###0_9#fot#top###0_13#fob#bottom#fol#left###3_11#for#right#fot#top###2_10#fot#top###1_14#fob#bottom###2_14#fob#bottom###3_14#fob#bottom###4_11#fot#top#fol#left###4_14#fob#bottom###5_14#fob#bottom###6_14#fob#bottom###7_13#for#right#fob#bottom###5_10#fot#top#fol#left###6_9#fol#left#fob#bottom#fot#top###8_13#fob#bottom###6_6#fol#
Which I guess will be a bit hard to simulate in a script.
Then we have 2 strings for citydata as well:
mapobjectsdata
3_4#City#ca01#3_4#notused###4_4#City#ca02#3_4#notused###3_5#City#ca03#3_4#notused###4_5#City#ca04#3_4#notused###27_3#City#ca01#27_3#notused###28_3#City#ca02#27_3#notused###27_4#City#ca03#27_3#notused###28_4#City#ca04#27_3#notused###39_8#City#ca01#39_8#notused###40_8#City#ca02#39_8#notused###39_9#City#ca03#39_8#notused###40_9#City#ca04#39_8#notused###57_11#City#ca01#57_11#notused###58_11#City#ca02#57_11#notused###57_12#City#ca03#57_11#notused###58_12#City#ca04#57_11#notused###71_8#City#ca01#71_8#notused###72_8#City#ca02#71_8#notused###71_9#City#ca03#71_8#notused###72_9#City#ca04#71_8#notused###9_15#City#ca11#9_15#notused###10_15#City#ca12#9_15#notused###9_16#City#ca13#9_15#notused###10_16#City#ca14#9_15#n
Plus citydata
TodzoTavern##3_4##Empty##100##100##Neutral##2##0###GreenKahnsHome##27_3##Empty##100##100##Neutral##3##0###WolfHoundsTown##39_8##Empty##100##100##Neutral##2##0###BeowulfBank##57_11##Empty##100##100##Neutral##3##0###JabberWockys##71_8##Empty##100##100##Neutral##3##0###DogsOfWarsHouse##9_15##7#14#24##100##100##White##0##0###WoogersRetreat##94_2##Empty##100##100##Neutral##3##0###AdraksHideout##88_9##7#14#24##100##100##Blue##0##0###ThunderGodsHaven##94_18##Empty##100##100##Neutral##2##0###AlexTheGreat##86_19##Empty##100##100##Neutral##3##0###SirNathansHovel##79_20##Empty##100##100##Neutral##3##0###LadyMichelle##74_31##Empty##100
So I guess porting the terrain would be possible, since that conversion is quite easy. But getting all the borders and cities/buildings correct would probably be a real pain.