Ok i looked into this desync and i was able to reliably reproduce it when hosting the reference save file in local MP.
When i was running that map with single ticks and doing crc checks, it made a clean diff saying that pollution values are different and evolution by pollution values were different.
After mod bisection i found that when running that save file with all mods except "better-air-filtering" runs stable for period of time i was testing it with while running with only base+"better-air-filtering" it was desyncing in the same way. Because of that i would say it is a "better-air-filtering" mod desync.
-- edit:
I looked a little into that mod code and why it desync: i have added some prints and host produces this:
Code: Select all
suction update tick=4087059 e=nil dx=-2 dy=2
totalSuction= 0
totalSuction= 0
totalSuction= 0
totalSuction= 0
suction update tick=4087059 e=nil dx=-1 dy=3
totalSuction= 0
totalSuction= 0
totalSuction= 0
totalSuction= 0
pollute: tick=4087060 surface=nauvis p={x = 0, y = 0} a=-0.31546306824535
suction update tick=4087060 e=nil dx=-1 dy=0
totalSuction= 0
totalSuction= 0.66666666666667
chunkFrom= {filters = {{__self = "userdata"}, {__self = "userdata"}, {__self = "userdata"}}, surface = {__self = "userdata"}, x = -1, y = 0}
chunkFrom::pollution= 0.083333328155883
totalSuction= 0
totalSuction= 0.66666666666667
chunkFrom= {filters = {{__self = "userdata"}, {__self = "userdata"}, {__self = "userdata"}}, surface = {__self = "userdata"}, x = -1, y = 0}
chunkFrom::pollution= 0.083333328155883
while client produces this:
Code: Select all
suction update tick=4087059 e=nil dx=-2 dy=2
totalSuction= 0
totalSuction= 0
suction update tick=4087059 e=nil dx=-1 dy=3
totalSuction= 0
totalSuction= 0
pollute: tick=4087060 surface=nauvis p={x = 0, y = 0} a=-0.31546306824535
suction update tick=4087060 e=nil dx=-1 dy=0
totalSuction= 0
totalSuction= 0.66666666666667
chunkFrom= {filters = {{__self = "userdata"}, {__self = "userdata"}, {__self = "userdata"}}, surface = {__self = "userdata"}, x = -1, y = 0}
chunkFrom::pollution= 0.083333328155883
So on the host there are twice as many update calls done and they are all coming from local variable `air_filtered_chunks` which is not save-loaded but it is filled by `init` function. Host runs the init function twice (because of on_init and because of on_configuration_changed) but the `air_filtered_chunks` is not cleared by the init function. For my own testing purposes i was able to fix those desyncs by changing:
Code: Select all
function init()
-- gather all filters on every surface
global.air_filtered_chunks_map = {}
into this:
Code: Select all
function init()
-- gather all filters on every surface
air_filtered_chunks = {}
global.air_filtered_chunks_map = {}
(literally one line added) and the desyncs are not happening anymore. You can also fix this temporarily by opening that save file, resaving it with current set of mods and loading that new save file: that way when loading new save there will be no migrations because of mod changes and so the host will not do twice as many updates in the "better-air-filtering" mod.