Thanks for chiming in Erin! Was wondering what your take was on this topic.
The whole point of my post was to let everyone know that the fpu reproduces the same results given a fixed time step in our games. That’s really it.
I felt based on my work experience I could get people to steer away from the idea that you need to have fixed point to solve this problem. Just to feel sane, I double checked with my lead as well as our network programmer and they both agreed that there are no compiler flags needed to reproduce the same results across machines. Howeva!
There *is* something I missed!!!
They pointed out to me that we must manually set the fpu mode through _controlfp() so the fpu mode is the same across machines.
At app startup time we call:
_controlfp() description: http://msdn.microsoft.com/en-us/library/e9b52ceh(VS.80
Also, every tick we assert that these fpu settings are still set:
gpAssert( (_controlfp(0, 0) & _MCW_PC) == _PC_24 );
gpAssert( (_controlfp(0, 0) & _MCW_RC) == _RC_NEAR );
There are some MS API functions that can change the fpu model on you so you need to manually enforce the fpu mode after those calls to ensure the fpu stays the same across machines. The assert is there to catch if anyone has buggered the fpu mode.
FYI We have the compiler floating point model set to Fast /fp:fast ( but its not a requirement )
We have never had a problem with the IEEE standard across any PC cpu AMD and Intel with this approach. None of our SupCom or Demigod customers have had problems with their machines either, and we are talking over 1 million customers here (supcom1 + expansion pack). We would have heard if there was a problem with the fpu not having the same results as replays or multiplayer mode wouldn't work at all.
We did however have problems when using some physics APIs because their code did not have determinism or repoducability in mind. For example some physics APIS have solvers that take X number of iterations when solving where X can be lower with faster CPUs.
Well i better wrap up i type too much. I don't usually post in forums but I thought I had a unique perspective on this topic that would help my fellow game devs out. If, after this post I have not convinced you that the fpu is safe across PC machines and 360s well.. I'm not sure what post will. =)
At the end of the day, I hope I’ve helped someone out there.
Thanks Erin for making Box2D open source and supporting it over the years. can't wait to see what you and the other guys working on will do next. I've been wanting to see 2d physics games done well for so long!