4 ms·
As gms7777 points out, for the RNG, surely you can just share seeds? Your comment about the differences in how CPUs deal with floats is very interesting. I fo
by feral 14y ago
As gms7777 points out, for the RNG, surely you can just share seeds?
Your comment about the differences in how CPUs deal with floats is very interesting.
I found the following interesting comment, from a GPG employee, talking about how they take care to ensure their float math is deterministic:
"I work at Gas Powered Games and i can tell you first hand that floating point math is deterministic. You just need the same instruction set and compiler and of course the user's processor adhears to the IEEE754 standard, which includes all of our PC and 360 customers. The engine that runs DemiGod, Supreme Commander 1 and 2 rely upon the IEEE754 standard. Not to mention probably all other RTS peer to peer games in the market. As soon as you have a peer to peer network game where each client broadcasts what command they are doing on what 'tick' number and rely on the client computer to figure out the simulation/physical details your going to rely on the determinism of the floating point processor."
http://www.box2d.org/forum/viewtopic.php?f=3&t=1800#p16480 http://www.box2d.org/forum/viewtopic.php?f=3&t=1800#p164...
- ricree 14y agoInteresting link, feral. For anyone else reading, I'd also suggest reading some of the followup posts such as this one: http://www.box2d.org/forum/viewtopic.php?f=3&t=1800&sid=f28239cd878276e8016d10817cfb9c42&start=10#p16662 http://www.box2d.org/forum/viewtopic.php?f=3&t=1800&...
- derleth 14y ago> floating point math is deterministic. This is news? Isn't this the entire point of the IEEE754 standard, to save us from the days when programs that were well-conditioned on a VAX would become numerically unstable on a Cray? 'Cray instability' sounds like a Star Trek episode but it is apparently something that could happen. http://www.jargon.net/jargonfile/c/crayinstability.html http://www.jargon.net/jargonfile/c/crayinstability.html
- tedunangst 14y agoDepends on compiler options. x86 floating point is 80-bit internally, but 64-bit in memory. Compile the same function with different optimization, for a different CPU, or whatever and get different answers. For gcc, the answer is to use -ffloat-store. But you have to remember to use it.