Page 1 of 1

[1.1.59] set 'out-of-map' tile on ungenerated chunk will cause desync

Posted: Wed Jun 08, 2022 3:34 pm
by kevinma
How to Reproduce:
1. start new game (freeplay)
2. toggle heavy mode
3. execute codes below in console
4. wait for desync

Code: Select all

script.on_nth_tick(60, function()
    game.surfaces[1].set_tiles({
        { name = 'out-of-map', position = { 32 * 100, 0 } }
    })
end)

script.on_nth_tick(300, function()
    game.surfaces[1].delete_chunk({32,0})
end)

Re: [1.1.59] set 'out-of-map' tile on ungenerated chunk will cause desync

Posted: Wed Jun 08, 2022 5:16 pm
by boskid
I am not considering those steps to be a valid bug report. Usage of `script.on_nth_tick` from the console command is inherently a desync because those handlers will not be registered after save-load so you will get a heavy mode desyncs with anything inside of those handlers that change the game state.

Re: [1.1.59] set 'out-of-map' tile on ungenerated chunk will cause desync

Posted: Wed Jun 08, 2022 6:50 pm
by kevinma
I'm sorry for making wrong report. It did happen in my scenario, but i can't reproduce it in a simple way. Maybe it is a bug from my code or codes from other libraries.

Here's the step to reproduce desync in my scenario:
1. host the scenario in a dedicate server
https://github.com/kevinmama/PandaAI/tr ... c-set-tile
PandaAI-desync-set-tile.zip
(643.77 KiB) Downloaded 138 times
2. join the server, repeat clicking 'create team' and 'reset' button fast
截屏2022-06-09 上午2.39.45.png
截屏2022-06-09 上午2.39.45.png (313.35 KiB) Viewed 1569 times
This is the fixed branch:
https://github.com/kevinmama/PandaAI/tr ... t-tile-fix
PandaAI-desync-set-tile-fix.zip
(647.92 KiB) Downloaded 114 times
The only different is:
https://github.com/kevinmama/PandaAI/co ... t-tile-fix
截屏2022-06-09 上午2.44.19.png
截屏2022-06-09 上午2.44.19.png (142.13 KiB) Viewed 1569 times
function 'Area:iterate' will loop positions in the given area, if inside parameter is true, it won't pass the positions at right edge or bottom edge of the area.

The Desync Report:
desync-report-2022-06-09_02-42-27.zip
(5.42 MiB) Downloaded 132 times