The problem with making a scenario of a country and saving it in .scn is you burn some newGRFs into the scenario; if you want to change newGRFs, you have to do the scenario all over again.
Well, the only alternative to prepare agnostic maps would be the heightmap system.
So far, heightmaps have been used as a foundation to create realistic (or not) maps, by making everything except terrain shaping by hand. Some people have tried to create "heightmap bumps" or marks for the city locations. I've decided to take this one step further.
In the beginning of the efforts,wWhat I have done is collect the coordinates and population figures of 152 of the most important Portuguese cities & towns, one by one, searching in google. I then created a .txt file ready to be imported into microDEM via GPS->WayPoints; Read From File. (for those of you who don't know, MicroDEM is a program that opens and edits heightmaps). MicroDEM would import the city coordinates as waypoints, which could then be "painted" (in the correct place, of course) into the heightmap with a symbol of your choice. This way, one could create a heightmap WITH terrain symbols on the places the cities should be.
Regarding the populations, I collected the populations of all the 152 towns & cities (again, one by one). Next, I categorized the cities according to population ranges (5000 to 10000 people, 10000 to 15000, etc). This way, I could easily scale the Portuguese towns. All I had to do was choose which OpenTTD population the biggest city would have (in my case, Lisbon). I did a "template conversion" so that Lisbon had 10,000 ingame population. It was a good number to scale up/down mentally; if I wanted a smaller Lisbon, say 5,000, I'd just divide all the other pre-calculated population ranges by 2.
A better method
Moki found an even better way to do this. He found a method that no longer requires the search of city locations & populations one by one. Here he explains it step by step:
The city import patch - importing cities directly instead of creating heightmap referencesMoki wrote:That's how it's done:
1. Download and merge the DEMs for the whole area
2. Download the proper location files from http://earth-info.nga.mil/gns/html/namefiles.htm
3. Import the txt into Open Office Calc. This is done by open, changing the file type to Text CSV and opening the file. The settings should be changed to "Character Set = UTF-8" and "separated by Tab". This and the following steps can probably be done with Microsoft Excel too, but I have no idea, how that works.
4. Data -> Filter -> Standard Filter ... filter by the PC column (that's the importance value/size). For my map, I used PC <= 3, so all cities with values 1-3 are used. This works well for whole country maps. For a regional map, you might want to use PC <= 4 or 5 and for an international map PC <= 2. If you want to use all towns (even the smallest ones without any rating), filter the FC column for P instead. This leaves all "populated places" and removes all the rivers, forests, etc. that you probably don't want to label on your map.
5. Now delete all columns that aren't needed. You need LAT (latitude) LONG (longitude) and FULL_NAME_RG (name). The PC column can also be deleted now as we don't need it anymore.
6. Rearrange the columns in the following order: LAT, LONG, NAME. MicroDEM needs this format or it won't work.
7. Press ctrl-a -> ctrl-v (copy everything)
8. Open the text editor of your choice (notepad or similar), make a new document and press ctrl-v (paste)
9. Save that txt file somewhere. Doesn't really matter where, just remember the directory.
10 Go back into microDEM, and select GPS -> Waypoints from the Menu. A Waypoints window will pop up.
11. In that window click Read from file and select your previously created txt file. All the locations should appear in the waypoints list. The additional data like MGRS, Easting, Northing and Elevation will automatically be calculated.
12. Click on WPTs and define how you want your points to look
13. Check Waypoint names on map near the bottom of the window, if you want the names to be displayed
14. Click Add on map and Plot on map
15. If the points aren't displayed on the map yet, click Force redraw (that blue arrow thing) in the map window.
16. Now you can zoom and move around your map as usual and of course save the map image. All further steps are done with Photoshop/Gimp and of course in OpenTTD.
Zydeco kindly uploaded a patch he had made some time ago which allows importing the cities into the scenario editor. This way, you no longer have to use heightmap bump references to place cities manually.
So, using Moki's method and Zydeco's patch, we can directly fetch a geographic map and city locations & populations from the net, and then import this data into OpenTTD. By other words, we would take steps 1 to 4 of Moki's method, and then use the import town patch. As Moki said:Zydeco wrote:When I was making a few maps from heightmaps a few years ago, I made a patch that would read towns and coordinates from a CSV file, and place them automatically, or place a sign if the towns failed to found.
I've updated it for the current version, and tried with your data (although I set all the town sizes to small, it would require manually growing them.
It also fails to place a few, because my edge coordinates are a bit off, but it saves lots of work finding where to place towns.
I've uploaded the patch, heightmap and the towns file I made by rearranging yours into the format needed by my patch, and the heightmap resulting from running the import_towns path/to/towns-pt.txt command in the editor, without doing any further adjustments
To-doMoki wrote:With a tiny bit of reformatting (which can be automated), the data should also be usable with Zydeco's patch. It's definitely possible to automatically translate the PC ratings directly into town sizes and the coordinates are already in the right format.
We can now fine-tune the patch so that it can take input from Moki's method directly, whilst preventing the coordinate offset he mentioned. Next, all that's left is taking the input of the cities' population and scaling them directly to ingame population, maybe according to some user-defined parameters like "minimum city population" or "maximum city population"... We're really close to having the whole process complete
Next is the town import patch provided by Zydeco, along with a Win32 Build compiled by Moki with the import_towns patch applied.
The patch adds a command to OpenTTD console: import_towns. So, in order to use it, you open the scenario editor, open the console (pressing the \ button over the tab keyboard button) and write import_towns <file_name>. At least this is the principle of it, not sure if the very specific details are correct (a more solid guidance for this shall be written here later). Stay tuned!