Planes / desync

I’ve a strong suspicion something related to planes is prone to desync. :neutral_face:

In Operation Konstantin I’ve never seen a desync, in Operation Luettich I’ve seen multiple already, and only the latter contains planes. Also, everytime a desync happened there was at least one plane ordered: desync never happened before planes were ordered.

I’ve no clue (yet) tho what could cause it, I’ve reviewed the plane LUA multiple times already and can’t find anything wrong. Worst case S44 planes are hitting some kind of obscure engine bug…

This probably needs some testing then. Though it might be an obscure problem like the one related to random units capping flags which does not happen in ‘clean’ test games…

Likely related to the delay API - zerg mentioned that it could cause desyncs.

I don’t see how it can. It looks fine…

That’s what lurker and I (mostly lurker, I’m not so knowledgeable about sync minutiae so I wasn’t sure) thought too… desyncs are so strange. What tends to cause them?

If I recall, some conflict between synced data, a calculation or rounding error, often enough. Of course, as I don’t code, and I haven’t discussed this in a long time…

Rounding error yeah, could be, but only if it’s really an issue which can be tracked down to either different processors not giving bitwise identical results for the same program code (very unlikely), or to different versions of the compiler used to compile Spring not giving bitwise identical results for the same code (somewhat more likely, would be a real PITA tho if it was this type of desync).

More often then that however it’s caused by coding errors, in particular relying on ordering of memory locations (for example, in synced gadget code, a table with tables as key will most probably cause desync when you iterate over it), or reading uninitialized memory by accident (not really possible in LUA), or one way or another changing synced gamestate in an unsynced way (e.g. accidentally using synced random number generated in unsynced code).

In short, anything which can make any synced calculation non-deterministic can cause desync.