In a new game
/toggle-heavy-mode
/c game.difficulty_settings.technology_price_multiplier = 0.5
Heavy mode check should fail.
[1.1.110] Desync when using technology_price_multiplier
Re: [1.1.110] Desync when using technology_price_multiplier
Thanks for the report.
In this specific case it is not a real desync, its a false-positive because technology_price_multiplier uses quite ugly coding pattern (a per-process global variable because it influences some values obtained from prototypes while prototypes are not created per-scenario-instance) that interfers with how heavy-mode works (two game instances within the same process): in this specific case, when price multiplier is changed in server's scenario instance, the client's scenario instance sees the change even before lua command was performed. This only triggers under heavy mode when there are 2 active scenario instances which means it is a false-positive.
That being said, i already changed this for 2.0 some time ago by not having this value stored in a per-process global variable which means this reproduction will trigger nothing in 2.0 so it is "fixed for 2.0"
In this specific case it is not a real desync, its a false-positive because technology_price_multiplier uses quite ugly coding pattern (a per-process global variable because it influences some values obtained from prototypes while prototypes are not created per-scenario-instance) that interfers with how heavy-mode works (two game instances within the same process): in this specific case, when price multiplier is changed in server's scenario instance, the client's scenario instance sees the change even before lua command was performed. This only triggers under heavy mode when there are 2 active scenario instances which means it is a false-positive.
That being said, i already changed this for 2.0 some time ago by not having this value stored in a per-process global variable which means this reproduction will trigger nothing in 2.0 so it is "fixed for 2.0"
Re: [1.1.110] Desync when using technology_price_multiplier
The heavy mode false positive tricked me. Getting a real desync is more complicated.
-Host multiplayer game with attached save
-Start research logistic science pack until research progress is greater than 85%
-Cancel research logistic science pack (it must not complete)
-Start research steel
-Queue research logistic science pack
-Join game with another instance before steel research completes
-When steel research completes a desync should occur
The following has been added to freeplay.lua in the save.
-Host multiplayer game with attached save
-Start research logistic science pack until research progress is greater than 85%
-Cancel research logistic science pack (it must not complete)
-Start research steel
-Queue research logistic science pack
-Join game with another instance before steel research completes
-When steel research completes a desync should occur
The following has been added to freeplay.lua in the save.
Code: Select all
script.on_event(defines.events.on_research_started,
function(event)
if (event.research.name == "steel-processing") then
game.difficulty_settings.technology_price_multiplier = 0.5
end
end
)
script.on_event(defines.events.on_research_finished,
function(event)
game.difficulty_settings.technology_price_multiplier = 1
end
)
script.on_event(defines.events.on_research_cancelled,
function(event)
game.difficulty_settings.technology_price_multiplier = 1
end
)
- Attachments
-
- technology_price_multiplier.zip
- (203.8 KiB) Downloaded 29 times
-
- desync-report-2024-09-03_17-24-48.zip
- (671.97 KiB) Downloaded 24 times
Re: [1.1.110] Desync when using technology_price_multiplier
Getting a crash is also possible.
-Host multiplayer game with technology_price_multiplier.zip save above
-Join game with another instance
-Disable research queue /c game.forces["player"].research_queue_enabled = false
-Repeatedly change the research between steel processing and logistic science pack
-Host multiplayer game with technology_price_multiplier.zip save above
-Join game with another instance
-Disable research queue /c game.forces["player"].research_queue_enabled = false
-Repeatedly change the research between steel processing and logistic science pack
- Attachments
-
- factorio-dump-current.dmp
- (1.12 MiB) Downloaded 27 times
-
- factorio-current.log
- (19.82 KiB) Downloaded 19 times
-
- 2024-09-15 19-56-53.mp4
- (10.39 MiB) Downloaded 23 times
Re: [1.1.110] Desync when using technology_price_multiplier
Whatever, the underlying code was changed and we are right now all hands on making sure 2.0 release will be as smooth as possible. Please wait until 2.0 release and if its not fixed there then please create new report.