[Map script] Grid

cirle

Chieftain
Joined
Jan 16, 2006
Messages
5
Hi, I was experimenting with creating completely artificial maps and figured I would put the result up here incase anyone else was interested.

I am afraid the naming conventions are all over the place, there are still several TODO items, some of the configuration options are internal and require uncommenting or editing of the script and some of the generation is pretty much in the wrong place, but after the caveats it does seem to work :D

Something I couldn't find in any of the guides which did prove useful was the HidePythonExceptions setting in the ini file, it made debugging the script somewhat easier. Is there a standalone map parser for testing?

Anyway, the script...

It generates a series of 5x5 tiles with an additional border up and to the right, in 3x3 formation, linking each of these larger formations together if requested. Additional space can be created between the groups by changing the gridOffset value in beforeGeneration.

Civilisation placement is regulated to the center of each formation, except I think on Tiny where only two plots are created and so it should default back to random placement for the three civs.

Resources can be chosen between Huge (one of every resource, metal on all hills, wheat filling the fat cross; a very silly setting but amusing overkill), default and none, goodies and rivers can be turned off, and finally you can also choose the fill plot type (ocean is default, peaks will create a protected civilisation, etc.)

Most of the internal generation is done using lists of coordinate offsets, and so is fairly easy to modify. It could all be more abstract, but mainly it was interesting from the perspective of trying to disable the majority of the default implementation, and seeing how Python worked.

Enjoy,

M
 

Attachments

  • Grid.zip
    5.5 KB · Views: 413
see my fair continents and smartmap scripts for another example of complete customization of map scripting.

http://forums.civfanatics.com/showthread.php?t=153558

http://forums.civfanatics.com/showthread.php?t=154989

They may be helpful to you if you continue to work on additional map scripts.

Also, for my debugging, I've found that using the hapdebugger is reasonable. If you use that, you'll get 3 tries from civ4 to fix any syntax errors during loading, and you can see the output of print statements for behavior debugging.
 
Thank you, those look interesting.

I have been playing with altering the links between the areas to form random paths and bottlenecks, which can cause a certain amount of amusement, but mainly I need to sit down and rework the scripts to be consistent and neatly commented. I do rather like the entire map scripting system though, so a big thank you to whoever decided to make it accessible :)

The next challenge will be to look at making a penguin unit I think, although that will be for a different forum and when I have much more free time :(
 
Top Bottom