I’ve been doing a bit of reading lately about making a multiplayer game, and I’ve read that the client should be responsible for their own simulations, but also that it can sometimes be problematic because different machines will yield slightly different results which could compile to big differences over the course of the game.
Why does this happen?
Shouldn’t a float store the same amount of data no matter the machine?
And if it can, then math is math so a calculation is always performed the same way.
Well, I guess the main problem for those issues is the Floating-Point Unit. As far as I know some of those FPUs are calculating with a higher precision than the IEEE 754-1985 standard has defined for floats and doubles. So the result stored in variables (which will stick to the IEEE standard) might change depending on the machine.
On the other hand, even if the FPU is the same on every machine: The implementation for certain calculations might differ slightly on several platforms which in turn can create other floating point imprecisions/discrepancies.
I have no experience with floating point issues in multiplayer based games, so I can’t help you much. Depending on the language I would suggest to look into libraries like GMP or CLN (C++). The general topic is called “Robust Computing” although it also contains several other aspects. Since you ask in a Unity forum you might want to know solutions for C#, Boo or UnityScript, but here I have really no idea. You might need to synchronise the data of your clients with the data of your server every now and then.
Fundamentally, because brains are good at providing the illusion of self. Due to this, we have the concept of being able to design something for a single user, and computers have always been designed for this illusory entity. At best, the design has assumed a set of users in the same location.
Deterministic systems are impractical. That’s why there are so few games that use them. About the only genre that really makes use of this is RTS. Its required to prevent the massive data transfer that would be required to update the position and status of every unit ten times a second. Everything else either uses an authoritative server, or simply corrects inconsistencies as they arrive.