Hunting a Rare Desync in Mushroom Wars 2 Caused by a Forgotten Snapshot Field
The developers of Mushroom Wars 2, a deterministic RTS using rollback netcode, noticed the rate of mismatched state hashes between clients rising above its usual background level. The cause was a newly added unit field that had been left out of the hand-written CopyFrom method used for snapshots, so it survived rollbacks only incorrectly. This made clients diverge even with identical inputs, producing bugs such as a building being captured on one client but remaining neutral on another. To find it, the team wrote an automated reflection-based test that fills every class with a CopyFrom method with random values and checks each field, including private ones inherited from base classes. The test catches such omissions immediately, rather than leaving them to surface as rare, hard-to-reproduce desyncs.
This is an AI-generated summary. ShortSingh links to the original source for the complete article.
Discussion (0)
Log in to join the discussion and vote.
Log in