[boskid][1.1.50] Restarting save game crashes Factorio on specific scenario and mods

This subforum contains all the issues which we already resolved.
User avatar
Muppet9010
Filter Inserter
Filter Inserter
Posts: 279
Joined: Sat Dec 09, 2017 6:01 pm
Contact:

[boskid][1.1.50] Restarting save game crashes Factorio on specific scenario and mods

Post by Muppet9010 »

Ignore this post - see 3rd post with new simpler reproduction steps.
When I load the below save based on a scenario and mods everything is fine, however, when I click to Restart the map Factorio hard crashes.
30.413 Error RollingStock.cpp:996: Internal error in RollingStock::getNeighborDirection, neighbor not specified
Log:
factorio-current.log
(9.71 KiB) Downloaded 122 times
Dump:
factorio-dump-current.dmp
(804.48 KiB) Downloaded 99 times
Reproduction
  1. place the mods and scenario folder in to Factorio:
    mods & scenario.zip
    (3.59 MiB) Downloaded 109 times
  2. load the attached save game:
    JD January 2022.zip
    (23.18 MiB) Downloaded 110 times
  3. the game should load and run ok.
  4. Go to the Factorio Menu [ESC].
  5. Click Restart with the intention of starting the scenario again from fresh.
  6. After a few moments the hard crash of Factorio occurs and the error has occurred message appears.
Last edited by Muppet9010 on Mon Jan 03, 2022 8:50 pm, edited 2 times in total.
User avatar
Muppet9010
Filter Inserter
Filter Inserter
Posts: 279
Joined: Sat Dec 09, 2017 6:01 pm
Contact:

Re: [boskid][1.1.50] Restarting save game crashes Factorio on specific scenario and mods

Post by Muppet9010 »

Ignore this post - see 3rd post with new simpler reproduction steps.
edit: this occurs with just starting the scenario, no mods required it seems.
scenarios.zip
(2.13 MiB) Downloaded 112 times

New Game > User scenarios > Chronosphere

Didn't want to edit original post as I see Boskid has claimed it in title.

factorio-current.log
(7.43 KiB) Downloaded 117 times
factorio-dump-current.dmp
(835.16 KiB) Downloaded 110 times
Last edited by Muppet9010 on Mon Jan 03, 2022 8:50 pm, edited 2 times in total.
User avatar
Muppet9010
Filter Inserter
Filter Inserter
Posts: 279
Joined: Sat Dec 09, 2017 6:01 pm
Contact:

Re: [boskid][1.1.50] Restarting save game crashes Factorio on specific scenario and mods

Post by Muppet9010 »

reproduction steps from a clean copy of the scenario following the usage path the server hosting player did in my previous error case.
Please note I am not the owner of the scenario, Comfy is.

This looks to be related to downloading a scenario from an MP game is somehow getting in to the weird map state that leads to the issue?
Maybe as the MP game was started from just the save and without the scenario folder being on the the MP server made it go odd?
  1. Obtain scenario in to your SP Factorio instance; can be done by connecting to the public "Comfy CronoTrain" server or using the attached good scenario folder (downloaded 2022-01-03 from connecting to their server).
    good scenario.zip
    (1.99 MiB) Downloaded 109 times
    You'll know its a good copy of the scenario as you can create a new game using it.
  2. Start a new SP game using the scenario (no mods) and save it. Then close the SP game.
  3. Start a new MP headless server running the save you just created in your SP instance.
  4. In your SP instance folder delete the scenario.
  5. Start your SP instance and confirm the scenario isn't listed.
  6. Connect to the MP game and let it download the map and scenario to your SP game folder.
  7. In your SP game quit the MP server, so back to main menu.
  8. In your SP instance try to start a new game using the scenario and it will crash. This is the scenario you acquired from your MP headless server and it has become bad.
Last edited by Muppet9010 on Mon Jan 03, 2022 8:54 pm, edited 1 time in total.
User avatar
boskid
Factorio Staff
Factorio Staff
Posts: 3078
Joined: Thu Dec 14, 2017 6:56 pm
Contact:

Re: [boskid][1.1.50] Restarting save game crashes Factorio on specific scenario and mods

Post by boskid »

Thanks for the report. Issue is now fixed for 1.1.51.

In this particular case the issue was that the train was created in some early stage of scenario creation where due to creation of multiple connected rolling stocks, some temporary trains were created and then destroyed. They were not properly deleted so they were incorrectly saved to the level-init.dat. Crash itself happens because when loading, there were now 7 trains overlapping, specified over the set of same 4 rolling stocks. If you have a save file which is crashing unfortunately it is considered corrupted and will not be fixed. New save files will no longer be corrupted that way since the temporary trains will now be properly deleted before the game state is saved.
User avatar
Muppet9010
Filter Inserter
Filter Inserter
Posts: 279
Joined: Sat Dec 09, 2017 6:01 pm
Contact:

Re: [boskid][1.1.50] Restarting save game crashes Factorio on specific scenario and mods

Post by Muppet9010 »

thanks Boskid :D
raised to the Comfy scenario devs in case there is anything odd on their side this flags :)
Hanakocz
Long Handed Inserter
Long Handed Inserter
Posts: 50
Joined: Sun Jun 24, 2018 7:06 pm
Contact:

Re: [boskid][1.1.50] Restarting save game crashes Factorio on specific scenario and mods

Post by Hanakocz »

boskid wrote: Mon Jan 03, 2022 8:00 pm Crash itself happens because when loading, there were now 7 trains overlapping, specified over the set of same 4 rolling stocks.
As of now, script just generates tracks, then places locomotive/wagons based on coordinates, but no script code actually does anything with connecting the wagons, and the game connects the wagons into one train on its own. Would be proper way to tell the game to connect the wagons in succession after entities are created, or letting it be connected automatically is good enough? I believe that 7 trains is because it tries to do pairs and triplets of any combination of wagons possible?
User avatar
boskid
Factorio Staff
Factorio Staff
Posts: 3078
Joined: Thu Dec 14, 2017 6:56 pm
Contact:

Re: [boskid][1.1.50] Restarting save game crashes Factorio on specific scenario and mods

Post by boskid »

There are bunch of unrelated details that have to be met in order for this issue to show up. Basically you have to have a scenario which was put into scenarios by loading a save file so it clears certain flag (savingAsScenario) so it does not remove players from the game state (this was fixing the issue by clearing temporary objects), and the scenario's control.lua has to create more than 2 connected rolling stocks in the on_init. Since rolling stocks auto connect, old trains related to original rolling stocks are marked to be deleted and they were not purged from the game state before a save was done. In the case of provided scenario there were 7 trains: (locomotive, 1st cargo wagon, locomotive+1st cargo wagon, 2nd cargo wagon, locomotive+1st+2nd, 3rd cargo wagon and the final one locomotive+1st+2nd+3rd) of which first 6 were not expected in the save file since they were marked as to be deleted.
Post Reply

Return to “Resolved Problems and Bugs”