This idea is mostly for custom maps.
Instead of using random city generation, you would be able to read the city name, x and y coordinates, and population from a text file.
So, if you load up, say, Germany.ppm as a height map, the game would look for, say, Germany.city in the same folder.
Germany.city would look like:
Berlin,(xcoord),(ycoord),(population)
Hamburg,(xcoord),(ycoord),(population)
München,(xcoord),(ycoord),(population)
etc, where the xcoord and ycoord are the coordinates of the city hall, and the population is the city population.
This would allow users to play on "realistic" maps without having to add any of the cities manually while maintaining a random yet consistent flavor every time they start a new game.
Further thought: If (x,y) is under water, the city is ignored.
Would be a good extension request for scenario files..
And it would indeed be a very useful extensions in combination with heightmaps. It's one if have often thought about.
I haven't looked at the code since I am not at all proficient in C++, but in theory, this shouldn't be too hard to implement, should it? Anyone with knowledge of world generation?
PPM files could work as PAK's do.
To make a pak file you need: 1) A PNG image file; 2) A DAT text file.
Then, PPM file: 1) A BMP image file for heights; 2) A TXT text file for data: object, coord x/y, population etc.
I thought it would be impossible, but PPM could be extended exactly as you describe. If the other information comes after the picture.
Since BMP is the preferred image format for maps (since it is, at least RLE encoded, much smaller as PPM), the imformations should be rather independent of the image format.
i like it
And? Anything else to add to the discussion?
I would ask you to post in an old topic only messages that are useful. Bumping pointlessly an old topic is considered spam.
Please read this: http://forum.simutrans.com/index.php?topic=4529.0
And to clarify, jap train fan, please consider this an official mod warning. We are glad to have you on the forum, but this bumping of old topics to not add anything useful is getting to be too much.
ok i'll stop