It's a long story, but I'm doing Zipf's Law (https://en.wikipedia.org/wiki/Zipf%27s_law) and I want to play Simutrans too, sooooooo......
Is there any way of magically plucking city size data out of a save file? I've had a go with setting the save type to .xml, but even with a relatively small map, Chrome takes about 10 minutes to render it (and none of it makes even the remotest sense...), and Excel/Gnumeric just crash.
In an ideal world, I'd like a little "export data" button ingame, but I have a feeling that may be a heck of a lot of work for very little gain... ;D
Thanks for any suggestions!
EDIT:
This is a small map's 13 cities that are connected to my network, x=log(rank) y=log(population)
Not a bad correlation already!
(http://i.imgur.com/f9CxJdq.png)
You can write a pseudo-scenario script to export the numbers.
See attached file. Unpack this into <your pakset>/scenario. Use nightly r>=6980. Start with '-debug 2 -log 1'. Open your savegame. Then start the scenario:
Options -> Load Scenario -> world_stats. The scenario prints the size of the cities to the log-file.
Amazing, those scenario scripts are powerful.
But just to answer the xml:
All cities are <![CDATA[]]> tags followed by a <koord> tag.
The city size is the first <i64> tag.
Thanks guys, I'll try it when r6980 compiles tonight. Didn't know the scripting system was going to be so powerful and useful!
...and work it does, awsome! That's dead useful.
So, a little analysis of 15ish of the pak64 III server's biggest cities:
(http://i.imgur.com/lu7l7mr.png)
The gradient of the trendline could be approximated to -1/6, implying that the population of a city on the server is roughly inversely proportional to the sixth root of it's rank on the city size list.
Or very roughly:
(http://i.imgur.com/2ORco5R.gif)
Darn, I love Simutrans... 8)
Edit: woops, used wrong log base.