Page 1 of 1

[0.15.2] Research progress is being lost on the game loading

Posted: Wed Apr 26, 2017 4:42 pm
by apriori
Subject itself.

Re: [0.15.2] Research progress is being lost on the game loading

Posted: Wed Apr 26, 2017 4:52 pm
by Rseding91
Can you give me a save file and steps to reproduce it?

Re: [0.15.2] Research progress is being lost on the game loading

Posted: Wed Apr 26, 2017 5:02 pm
by apriori
Rseding91 wrote:Can you give me a save file and steps to reproduce it?
Yep. https://yadi.sk/d/r2yBUfV13HP86R

• Load the savegame.
• Start researching "Architecture" (Factorissimo2 first tech).
• Save the game.
• Exit the game.
• Start the game and load the savegame.
• Ooops, my sci-packs and progress get lost. :)

Re: [0.15.2] Research progress is being lost on the game loading

Posted: Wed Apr 26, 2017 5:14 pm
by Rseding91
You've got a broken mod. Remove "Simple Packing" and it will fix it.

If you used that mod in MP it would desync as soon as the first player joined.

Re: [0.15.2] Research progress is being lost on the game loading

Posted: Wed Apr 26, 2017 5:51 pm
by apriori
Rseding91 wrote:You've got a broken mod. Remove "Simple Packing" and it will fix it.

If you used that mod in MP it would desync as soon as the first player joined.
1. Why is this mod seeming broken to you? Because of resetting algorithm in controls.lua? Or local variable outside all functions? I should know it to avoid bugs in my mods.
2. Removed the mod. Still getting the same issue. Updated archive: https://yadi.sk/d/r2yBUfV13HP86R

Re: [0.15.2] Research progress is being lost on the game loading

Posted: Wed Apr 26, 2017 6:46 pm
by Rseding91
apriori wrote:
1. Why is this mod seeming broken to you? Because of resetting algorithm in controls.lua? Or local variable outside all functions? I should know it to avoid bugs in my mods.
Yes, it's running code on load which means every time you load a save it will re-run. When someone joins in MP they load the save and it will re-run. Except, it only runs for the person joining because the server and all players connected don't load the map when someone joins.

Re: [0.15.2] Research progress is being lost on the game loading

Posted: Wed Apr 26, 2017 6:51 pm
by Rseding91
It's still broken because the Loaders mod is also broken. Every time you load a save file with it - it will also reset all technologies/recipes. And again, if you used that mod in MP it would immediately desync upon anyone joining the game.

Resetting technologies/recipes should be done through migration scripts: http://lua-api.factorio.com/latest/Migrations.html

Delete the control.lua from that mod and it will fix it.

Re: [0.15.2] Research progress is being lost on the game loading

Posted: Wed Apr 26, 2017 7:00 pm
by apriori
Ok. Resetting technologies is the key. Thanks!