dajinchu / ships-and-suns

0 stars 0 forks source link

Non-determinism #6

Open dajinchu opened 9 years ago

dajinchu commented 9 years ago

Some kind of non determinism issue having to do with collision, ally-ally or ship-sun, not really sure..

dajinchu commented 9 years ago

Two runs on Desktop with set seed 50. No user input. Stayed deterministic! https://www.diffchecker.com/60ey2g2k

dajinchu commented 9 years ago

Before the previous, tried just ships and also deterministic w/input https://www.diffchecker.com/k9rk73ik Commit 83226b106fcf1d795122f928606edcf96bad110a

dajinchu commented 9 years ago

Seems like Suns aren't the issue because capture order is deterministic, but if it works without Suns and does not with, and yet everything non-capture related is deterministic, then wtf?

This is testing on Android no input. Deterministic. https://www.diffchecker.com/83jm30hv

dajinchu commented 9 years ago

Without pulsing but with capturing, it is all great.

So logically, pulsing is the issue, but with the initial spawn suns which pulsed in previous tests it worked, so pulsing has worked before. Maybe pulse with something that has been set dest-ed

https://www.diffchecker.com/6b5okegr

dajinchu commented 9 years ago

Shit. So not doing anything with pulse on is actually NOT deterministic, just takes a while! https://www.diffchecker.com/66q3x8qh

dajinchu commented 9 years ago

From a long period of not making moves: Contacts: https://www.diffchecker.com/o635buft Checksums: https://www.diffchecker.com/04lzi6kw NOTE: Checksums desync first, THEN contacts!

dajinchu commented 9 years ago

Number of frames until desync is inversely proportional to MAXMASS of ships. With MAX = 10: https://www.diffchecker.com/hkhc4ujd, breaks at around 2k MAX = 5: https://www.diffchecker.com/06gbnycf, breaks at around 4k Pattern repeats across tests!

With larger ships, I guess there are less collisions, so less probability? But it is always around 4k/2k, if it were just probability it would break at other moments sometimes. Probably box2d recycling? But it never breaks if no pulse.

dajinchu commented 9 years ago

No collisions and WITH pulse Works fine, so it's not a problem of just pulse

dajinchu commented 9 years ago

With collisions and WITHOUT suns works fine too!

dajinchu commented 9 years ago

wtf

dajinchu commented 9 years ago

Has to be the interaction between collisions and pulse. Maybe because a ship is dropped into a crowd of other suns? But the desync happens check sum first, then collision...