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

any chance you can share your script?

It is a rust program, currently it only works on Linux. What platform are you using?

If you are on windows, are your .sav files in this folder?

"%AppData%\..\LocalLow\Dionic Software\InfraSpace\saves\

You can try it by entering this path in the address bar of your windows explorer

I engineered a web-application that cleans your save files:

@Daniel and team, if you want to integrate it with the game, the main cleanup code is here:

Feel free to PM me :blush: also if you encounter any bugs, let me know

1 Like

Hi @tuxle, amazing work. This is a little embarrassing, because it shouldn’t be necessary, but thanks nevertheless for your work.

1 Like

In case it helps debugging: I can get this to happen by adding a station twice to a line. So if I have two stations that are connected to each other and I make a line that goes A->B->A, then let that run for a bit so there are resources in transit, then I remove the stop at A (so the line is now A->B), this happens.

What it looks like from a game play perspective is that all of the resources that were in the station at the time I removed the second stop at A get stuck and are never delivered. But since they’re still “in transit”, the buildings that the resources are going to still say X oxygen or whatever is being delivered. That, in turn, keeps the buildings that produce resources from sending more since the game thinks the building that needs resources already has all it needs on the way to it. But it doesn’t, so habitats start downgrading and other facilities run out of resources.

Hope that helps a bit. Love the game! Thanks for making it.

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.