Train Station bug causes tousands of cars to be keept arond -> crashing economy (with workaround)

Hi there

I noticed that my train stations always store resources even if there is only one line going away from it.
The longer the game runs the more cars are stuck in the train stations.
Reloading the game helps with the rendering, going from 2-3 fps to 10-11 and reducing the stuck cars in the stations by a good 20-30%.

I wrote a program that analyses and cleans the save file, let me explain this log:

Preparing new file ".../InfraSpace/saves/Alpha 9.1.204/Versuch 7.14.cleaned.sav" ...
    Some("Stadt"): len(591) queued(1182)
    Some("Bahnhof Berg"): len(362) queued(724)
    Some("Bahnhof Industrie"): len(96) queued(192)
    Some("Fuss am Berg"): len(612) queued(1224)
    Some("Bahnhof Alpha"): len(5) queued(10)
    Some("Bahnhof Beta"): len(211) queued(422)
    Some("Bahnhof Gamma"): len(9) queued(18)
    Some("Berg Hinten"): len(3) queued(6)

Collecting Garbage Cars...
    First removing ID: 3229870
    First NOT removing ID: 3594942
to GC: 3778; gc_found: 1889; gc_not_found: 1959

First, it lists all the train stations with their queues. For some reason they are stored in pairs :man_shrugging:
Second, it collects all the ID's that are in these queues because it empties the array: in this case 3778 cars
Third, it tries to delete all the cars from the cars pool (appears to store all the cars in a save game).

Here is the interesting part: it can only find half of them :upside_down_face:
Maybe it is related to the fact that they are stored in pairs?
The gc_not_found: 1959 cars are cars on the road somewhere, so it keeps them.

I have not checked all of the cars it removed, but the first one was stuck on its way to a habitatLevel4 building like many others.

Loading the fixed save file worked like a charm. The game gained roughly 2fps and because the houses and factories were able to order fresh supplies: finally the resource warnings and downgrades stopped :partying_face:

What lead to the lost cars? I am not 100% sure but theses things made it way worse:

  • Removing trains from a line
  • Replacing train tracks
  • and deleting trains with a track (and then replacing it with a faster one)
  • Replacing train stations
  • (maybe replacing affected buildings)

Fixing the economy without the hack requires to delete heavily affected buildings to be replaced, moving does not solve the problem.


PS: if you are interested in the tool (or the saves), reply/write me. It was able to clean my pretty big save file in less than a second :blush:

PPS: Maybe this is unrelated: the adamant drill orders resources infinitely as long as it is in a stage:

1 Like