Quote:Original post by CygonIt doesn't take obscure hardware. The classic x87 FPU is one such oddball platform as it uses an 80-bit floating point format internally, and few other platforms do as well such as the Itanium. So for code to be consistent the result of every operations has to be spilled to memory to truncate the result (or SSE/3DNow! needs to be used throughout). The compiler will also have to disable most floating-point optimizations, such as reordering associative expressions, replacing constant division by reciprocal multiplication or otherwise exploiting algebraic identities. Now as far as I can tell the "/fp:strict" option in recent MSVC versions ought to handle this, though I have to admit that the documentation is still somewhat unclear on whether you can expect full consistency across platforms.
I'd put my money on IEEE 754. Most platforms follow this standard, so you'll have optimal speed on them. You can worry about emulation when you actually need to port your game to obscure platform XY, but I doubt that need will ever arise.
In addition to needing working support for strict math on all compilers involved (not something I would expect of immature console tools) you'll have to pray that there aren't any bugs in the implementations (such as the Pentium FDIV bug, or Pentium II/Pro FIST bug), and that they've actually set out to be IEEE compliant in the first place and not save cycles and silicon with non-standard flush-to-zero behavior and such.
Furthermore you most definitely can't expect any support math functions beyond the core operations to be consistent so you'll have to provide your own methods for everything from pow() to formatted IO.
Emulators almost certainly won't be able to play the game either but whether that's a good thing or a bad thing is debatable. I suppose the most likely negative scenario is a attempting to play on backwards-compatible consoles or some retro gamer in ten years from now when we've all moved on to fancy new 1024-bit über-processors.
Developing and debugging a deterministic simulation is hard enough without having to worry about floating-point consistency. The last thing you want is to have to worry about some unforeseen issue cropping up towards the end of development. So do yourself a favor and stick with fixed-point arithmetic for the game logic, or at least don't expect networking to work between different platforms.
By the way has anyone successfully managed to use floats in a multi-platform RTS?