Format of the saved map

Anything related to creating maps goes here

Format of the saved map

Postby KGB » Sat Dec 11, 2010 5:27 am

SnotlinG,

I know that you've mentioned that the maps are saved in a database. What kind and what format are they in.

I'm only asking because I am wondering if it would be possible to convert DLR maps directly into the database format that is used here. I have the DLR source code so I know what the format of the existing maps are. So what I'd need to know is the format of the maps here and then figure out if I could create entire maps from a program even if it's just repeated post calls to your map interface that gave instructions on what to place where.

KGB
KGB
 
Posts: 3030
Joined: Tue Feb 16, 2010 12:06 am

Re: Format of the saved map

Postby 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.
SnotlinG
 
Posts: 2148
Joined: Sat Feb 13, 2010 12:42 am

Re: Format of the saved map

Postby KGB » Mon Dec 13, 2010 3:55 pm

SnotlinG,

Actually I don't mind manually placing cities. There aren't that many of them to place. Plus sometimes I am going to want to move them slightly because of differences in how DLR and this game plays. The same goes for ruins/temples.

The hardest part literally is the time to place 100x150 worth of terrain even with the square tool. I always assumed I would have to go back and adjust the terrain features (ie different hills/forest/swamp looks) to give the map a nicer look.

The reason to do this is that DLR has a very nice random map generator that lets you select the amount of rivers/forest/hills/mountains (very low/low/average/high/very high), whether you want islands or not etc. So if I could get this to work it would be possible to create a random map generator tool if I could eventually get city/ruin/temple placement working.

So I'll probably take a shot at doing the initial terrain after New Years and see how it goes.

KGB
KGB
 
Posts: 3030
Joined: Tue Feb 16, 2010 12:06 am


Return to Map making

Who is online

Users browsing this forum: No registered users and 19 guests

cron
Not able to open ./cache/data_global.php