Page 1 of 1

[kovarex] [0.15.31] Nuclear Reactor modded production not changing

Posted: Tue Jul 25, 2017 10:41 pm
by Zanthra
Nuclear Reactors constructed while the prototype has a given consumption rate will not update if the consumption rate is increased by a mod.

For example, in the following save I constructed the left nuclear reactor without a mod adjusting the consumption rate, and the right nuclear reactor was constructed with the attached mod changing the consumption rate to 20MW. When the save is loaded without any mods active, and the consumption rate at 40MW, the left reactor produces the full 40MW, while the right reactor produces about 20MW (although it seems it can go slightly above), while it would be expected to identify the new prototype consumption value and increase its output to 40MW. The left reactor burns its fuel faster as well. Replacing the reactor building will cause it to use the new consumption rate. It seems that reducing the consumption rate of the nuclear reactor will limit the output of previously built reactors, and that if a reactor is built at 40MW for example, the game is modified to be 20MW, then the mod is removed to return the reactors to 40MW, then the reactor will return to the expected 40MW production.

Steps to reproduce:
1) Build a nuclear reactor.
2) Save the game.
3) Enable a mod that increases, or disable a mod that reduces the nuclear reactor prototype consumption value so that the value is higher than it was when the reactor was constructed.
4) Observe the built nuclear reactor retains it's previous output instead of updating to the new rate.

Re: [0.15.31] Nuclear Reactor modded production not changing

Posted: Wed Jul 26, 2017 5:47 am
by impetus maximus
a mod? it would help if you said what mod you are using.
have you talked to said mod creator about it?

Re: [0.15.31] Nuclear Reactor modded production not changing

Posted: Wed Jul 26, 2017 7:47 am
by Patashu
impetus maximus wrote:a mod? it would help if you said what mod you are using.
have you talked to said mod creator about it?
Look at the OP more carefully - an example mod is provided that changes nuclear reactor production, which demonstrates the bug.

Re: [0.15.31] Nuclear Reactor modded production not changing

Posted: Wed Jul 26, 2017 7:51 am
by Zanthra
Using the mod Global Tick Time Scale, the issue was first discovered here: viewtopic.php?f=91&t=50281

When a nuclear reactor is built on a map, and the target framerate for the mod is reduced, power production and consumption is increased. Nuclear Reactors caused problems as they would not properly update to the new consumption value when the game was loaded, while every other object in the game seemed to take the change just fine. I found the workaround of deconstructing and reconstructing the reactors, but that does not prevent this from being a bug.

The save and mod attached to the post above are meant to be simple minimal examples of the problem, both to make it easy to locate and for me to make sure that it worked how I thought it did. The mod has one statement in the data-updates.lua file:

Code: Select all

data.raw["reactor"]["nuclear-reactor"]["consumption"] = "20MW"
As far as I understand, a mod changing the value of a prototype should have an affect on all entities of that prototype already constructed when the game is loaded. This is not the case with nuclear reactors in some situations.

Re: [0.15.31] Nuclear Reactor modded production not changing

Posted: Wed Jul 26, 2017 2:28 pm
by impetus maximus
Patashu wrote:
impetus maximus wrote:a mod? it would help if you said what mod you are using.
have you talked to said mod creator about it?
Look at the OP more carefully - an example mod is provided that changes nuclear reactor production, which demonstrates the bug.
sorry, didn't see mod in the file name.

Re: [0.15.31] Nuclear Reactor modded production not changing

Posted: Wed Jul 26, 2017 9:39 pm
by Zanthra
impetus maximus wrote:sorry, didn't see mod in the file name.
Yeah, I will change it to nuclear-reactor-production-bug-demo-mod_1.0.0.zip . Black on dark grey for the file description is not helpful.

Re: [kovarex] [0.15.31] Nuclear Reactor modded production not changing

Posted: Thu Jul 27, 2017 11:17 am
by kovarex
Thanks for the report, it is fixed for the next version.