Random map files and annotations: Python
A while back I posted in a thread about Gandalf�s random map generator; I commented that I had tried writing a similar program in Python but failed. Soon after I reattempted the problem, and was successful in generating simple random opponents.
I was also thinking about the semi-random map idea and what one would need to be able to do to make semi-believable random maps. In order for a program to modify the map file in a believable way I concluded it really ought to have an model of the world internally, based on the information in the mapfile.
Anyway, the point is I have a I have Python code that reads in a mapfile and extracts province numbers, terrain types, and neighbors. Each province is an object with terrain and connection data associated with. Human and AI player information is in another object.
I can form provinces into lists or unordered sets pretty easily and work with them; for example, I could look at the set of provinces with the water terrain flag to see if the map has enough water provinces to allow water nations as AIs.
Currently I have two problems:
1) It doesn�t really do anything. I can pull all this information out of the map file, but I don�t have any real great idea for what to DO with it after that.
2) Its not packaged for distribution, I call use it from an interactive python session. It wouldn�t be too hard to make it into a script that could be called from the command line with arguments once I can do more than just make random opponents; although the odds of seeing a standalone executable in the near future is poor.
So what I�m wondering is, what should I do with all this map information? (I could parse more map commands if it was interesting, also). I can do things like #nostart provinces that don�t have enough (or too many) neighbors. With a bit of work I could assign the AI and/or human starting provinces (this would be nation-specific) and guarantee that no one starts right next to someone else.
Going back to the semi-random-maps discussion, is anyone making armies or army/site combinations that could be dropped into a map file?
I know Gandalf and Lief(spelling?) have there own map-randomizers. I�m not sure how what I�m doing overlaps with what you are doing;
My impression from Poke in The Eye and family at least, is that those generators are not very context-aware, putting randomly generated troops in provinces where they will drown, for example.
SO: What sort of things would you like to be able to do based on terrain and neighbors? What level of interest is there?
If Anyone is interested, I can email you a copy of code although its not terribly user friendly at this point.
|