When I started with Clash I remember pleading with Mark to let me work on a random map generator. He insisted that there were much more important things to do. Perhaps he was right.
As far as the data for a map is concerned, I feel that the data should be in at least two separate sections - the raw map and any improvements. The raw map will not change during the course of the game (see my incremental saves theory in the background?) and hence does not need to be saved.
In the immediate future, it is likely that the only improvements that will be encountered are: cities, roads, deforestation and cultivation (or settlement). Each of these has quite a limited amount of data, and nicely overlays the main map.
The substantive map consists of a rectangular grid of squares (no, I won't mention polygons again in this post). Each square has four (or fewer) parameters. The parameters are: x-coordinate, y-coordinate, landform, and landcover. So an xml file with entries like:
Code:
<square>
<x> 11 </x>
<y> 21 </y>
<baseterrain>
<landform>flat</landform>
<landcover>none</landcover>
</baseterrain>
</square>
would cover it. It would be even tider as:
Code:
<square x=11 y=21 >
<baseterrain>
<landform>flat</landform>
<landcover>none</landcover>
</baseterrain>
</square>
By allowing defaults, this could shortened even further.
I would have the improvements in the form of:
Code:
<improvement x=11 y=21 >
<civilization> roman </civilization>
<city>
<population>flat</population>
</city>
<baseterrain>
<percentagenatural> 0 </percentagenatural>
</baseterrain>
</square>
Writing a simple map editor for this sytem would be no big deal and just involve exporting and modifying the map frame, with a popup menu. Perhaps two day's work. Probably best if I do it, since I am most familiar with the gui. It would also be a step toward completing the xml read in system, which is my next job anyway.
The code to read this in is a really quick job using the parser.
Cheers
Bookmarks