Page 1 of 1

[0.15.6] Mod settings corruption

Posted: Wed May 03, 2017 2:44 pm
by orzelek
There is a bit random bug with mod settings that happens on mod enable/disable and/or save load.
To reproduce it you'll need files attached to this post (RSO mod, nanobots mod, test save file).

Steps to reproduce (might need to be repeated multiple times - not sure how many I needed around 5 tries or so):
1. Go to mod menu and toggle state of Nanobots mod.
2. Load test save file
3. Execute following command:

Code: Select all

/c game.player.teleport({-1925, 3215})
4. You will be teleported to place where big copper ore patch should be. If it's there - bug did not happen.
5. Repeat from start until bug happens.

When ore patch is not there going to mod settings menu for RSO shows this:
settings.png
settings.png (364.7 KiB) Viewed 2849 times
Originally game was saved with default settings - on the screenshot resource chance, size and enemy base chance are changed and have different values.

Big thanks to staviq for doing a lot of testing and narrowing down above reproduction steps.

Re: [0.15.6] Mod settings corruption

Posted: Wed May 03, 2017 4:01 pm
by Rseding91
Thanks for the report and steps to reproduce the problem. I've found what's wrong and will have it fixed for 0.15.7.

Note, this could also trigger desyncs with people using mod settings so if you get desync reports around this - tell them it's fixed for 0.15.7 :)

Re: [0.15.6] Mod settings corruption

Posted: Wed May 03, 2017 4:09 pm
by orzelek
Thanks.
Out of curiosity - whats the culprit?
It was pretty hard to track down whats going on :D

Re: [0.15.6] Mod settings corruption

Posted: Wed May 03, 2017 4:48 pm
by Rseding91
orzelek wrote:Thanks.
Out of curiosity - whats the culprit?
It was pretty hard to track down whats going on :D
When mod settings were loaded they would use "random" prototypes instead of the correct ones resulting in some settings getting reset/loading wrong values.

It has to do with the textual name <> ID mapping we use and the order the settings were being loaded (before the mapping was).