[ODE] Re: Different simulation results with different versions of Visual C++?

Jon Watte (ODE) hplus-ode at mindcontrol.org
Mon Aug 8 09:21:07 MST 2005

> This makes game development in which simulations must repeat exactly 
> from one run to the next very difficult - as you can't guarantee that 
> the compiler on one platform will produce the same results as on another.
> Have others found a way to work around this problem?  I need *exactly* 
> the same results from one simulation to another.

Two solutions:

1) make sure all developers use exactly the same compiler (this can be 
done multi-platform by generating code for Windows out of Intel's C++ 
compiler, or GCC).

2) Quantize/round/truncate all physical quantities to a known resolution 
after each simulation step.

Also beware that various DLLs will likely change your preferred rounding 
mode and internal CPU floating point precision. If that's not enough, 
Athlon CPUs don't actually support the 80-bit internal floating point 
format that Pentium CPUs do, so you'll have to set the pentium to 64-bit 
internal mode, too. Throwing exceptions or catching signals will also 
change your CPU FP environment bits (the FPU control register).

Note that if this is a multi-player game, this isn't enough, because you 
will see different objects with different latencies on different 
machines, and thus the matrices that get solved by ODE are different, 
and thus the simulation will diverge anyway.


			/ h+

More information about the ODE mailing list