Zero-K icon indicating copy to clipboard operation
Zero-K copied to clipboard

Metal spot finding code causes a desync between Windows and Linux64 players!

Open CarabusX opened this issue 11 years ago • 7 comments

See here: https://springrts.com/mantis/view.php?id=3436#c15216 (starting from the linked comment)

WG.metalSpots (and likely GG.metalSpots too) contains different values for Windows players and for Linux64 players. The Mantis report contains the output for both, and the values seem to differ a lot and by more than just order. The desyncing map is "LongCat32" which has cloud metal, but [I]burp says his other map "Ravaged v2_mini" desyncs in the same way too.

CarabusX avatar Sep 27 '15 00:09 CarabusX

Does this happen on maps not made by burp? He creates them in a nonstandard way.

sprunk avatar Sep 27 '15 00:09 sprunk

I don't think there is much we can do about this. The solution is to not use those maps. A failproof method is to use the lua metal config.

GoogleFrog avatar Sep 27 '15 01:09 GoogleFrog

According to hokomoko: https://springrts.com/mantis/view.php?id=3436#c15250 we should check for usage of math.huge, and after a quick look it is used in 2 places, one of which looks dangerous: https://github.com/ZeroK-RTS/Zero-K/blob/master/LuaRules/Gadgets/mex_spot_finder.lua#L359 though I am not sure it actually is.

CarabusX avatar Sep 27 '15 14:09 CarabusX

Another option could possibly be to use spairs there.

Anarchid avatar Sep 28 '15 08:09 Anarchid

for the reference:

https://springrts.com/phpbb/viewtopic.php?f=23&t=33906

abma avatar Sep 28 '15 16:09 abma

The math.huge usage seems fine and workingIdx is set to huge then either not used or set to a different value.

I think the issue is within the keys for uniqueGroups. These keys can be large very large strings and I think the reason for this is to detect the case when some new data is identical to data already in the table. There has to be a better way to do this. It is a difficult task though because Niobium wrote the mex spot detection code for a widget and I added it several years ago.

GoogleFrog avatar Oct 01 '15 12:10 GoogleFrog

If a map desyncs then give it a metal spot config.

GoogleFrog avatar Jan 17 '16 05:01 GoogleFrog