News:

Simutrans Wiki Manual
The official on-line manual for Simutrans. Read and contribute.

Neroden's "city-growth" branch (and branch reorganisaiton)

Started by jamespetts, November 18, 2013, 09:55:51 PM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

jamespetts

I have been re-organising the development branches, and have put what was "devel-new" into a new 12.x branch, and merged "passenger-generation" and Neroden's "stacked-stations" branches into "devel-new". I am planning to look into adding a few more minor features to "devel-new" for testing fairly soon, all of which hopefully will make it into the next major release.

I also tried to merge Neroden's "city-growth" branch into "devel-new", but was not able to make it work properly. For now, I have added it to its own "neroden-town-growth" branch for debugging. I had to make a few changes (mainly removing syntax errors - probably merely typing errors) to get it to compile. The problem appears to be some sort of infinite loop in the town growth algorithm: after a short while of running a game (such as Pak128.Britain-Ex's demo.sve), the game will freeze and a debugger will always show the code to be executing town growth related code.

I have not looked into this in any detail, as I do not know precisely the intent of the changes made in Neroden's city-growth branch. Compiling directly from city-growth (after fixing the syntax errors) gives the same error, so the problem is in the city-growth branch, not in the merging (or some clash between development since city-growth and what was on that branch).

If anyone who has looked into the city-growth branch (or Neroden, if you are still around and possibly reading this at some point) could offer any assistance as to this issue, I should be very grateful.

prissi

Stacked station (plus related bugfixes) are also in standard.

Drewthegreat87

Would this new growth system keep cities from just exploding across the map? In one game in experimental that I have, I'm about 1850 and the cities my rail lines serve ( and in many cases, don't serve) are pretty huge. Perhaps I have my growth factors tweaked wrong? I'm curious about what kind of changes this new system will implement. I recall reading about a consideration to keep small towns from just growing into huge cities over the span of the game (for example in my vanilla games, branch line towns grow into cities ruining the aesthetic of the branch line...).

Additionally for maybe future consideration: I was thinking about the graphics for the game and whilst I think this could be achievable using current graphics, how hard would it be to making the network and infrastructure look more "realistic" in how it's laid out? Think Transport Giant's tracks and systems vs simutrans at the moment. I know you've wanted the experimental branch to be more realistic in game play, but what about in construction of the transport networks, too?


jamespetts

Prissi - this is good to note. I didn't have any problems with the stacked-stations branch.

Drew - Neroden's "city-growth" branch does not contain any substantial simulation changes: just bug fixes and some implementation changes. There are changes in calibration which might well reduce the excessive growth that you describe. I am trying to incorporate the main changes manually one by one so that I can either work out where the problem is or at least incorporate the main improvements without encountering this problem. So far, I have ported two bug fixes.

On city growth more generally, it is planned in the future to change the city growth algorithm more fundamentally so as to have growth based on local transport success rates, but that will not be in the next major release.

As to the other issues (in the second paragraph), they are somewhat off topic for this thread; perhaps it might be better to start a new thread to discuss them?

neroden

Long story here.  Basically, the problem is that cities currently grow nearly linearly, and at a rather fast rate.

My long-term goal was to allow cities to grow in a manner which more realistically models actual city growth patterns -- and to allow cities to SHRINK.

Most models of city growth and shrinkage are percentage-based.  My initial idea is that there is a base growth percentage (um, probably negative) and that transportation supply will increase that growth percentage, while congestion will decrease it.  But I'm not certain about that idea.

Anyway, I tried to come up with a good percentage based model, with growth rates from -5% to 5%, and the first thing I realized is that I needed much more precision on the growth.  A typical city should only be growing at 1% or so per year, which is a very small amount per month -- less than 1 for small cities.   So in order to do this, the first step was to keep track of the "fractional" number of added citizens (ones who aren't housed yet).

Since the city should be able to shrink, the second step was to set it up so that a "negative" number of added citizens could be tracked as well.

All of this requires storage of extra data in the game file.  So I submitted a patch for this to "standard" as well as my branch on "experimental"...

...and then work and family interfered and I wasn't able to follow it up for a long time.  (And yes, I'm still busy.) I have no idea whether it made it into standard.

After I'd got the implementation changes done, then I was going to try programming in a few different city growth/shrinkage models and experimenting until I found one which seemed to work OK.  The key, however, was being able to record high-precision population change data with both positive and negative numbers, and that's basically what the city-growth branch did.

----

The errors are almost certainly due to the attempt to store the extra data in the game file (the high-precision "population growth/shrinkage" numbers).  The versioning for adding new data to the game file is a pain.

If the patch for standard made it into standard, you need to check what version numbers were used in standard to determine whether that data is there or not.  If it didn't make it into standard, you need to revise the versioning to determine when the data is present.

The versioning is the most likely issue here.  This is why I wanted to get this patch into standard.  With the high-precision city growth/shrinkage data stored, it becomes possible to try out different growth models without changing the game file format.

jamespetts

Thank you for letting me know the position - that is helpful. I hope that all is well with you (also: happy new year).

As to the versioning: in Standard, it is based on a single version number (such as 112003 for version 112.3). In Experimental, the Standard number is retained, and an additional Experimental version number is added for the major version. So, for example, 112.3 Experimental 11.15 would have the Standard version number 112003 and the Experimental version number 11 (the minor number is not used for versioning in Experimental).

On town growth more generally, my plan at present is to code local town growth and related features as discussed here.