Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Randomness in solvers
#2
(26-09-2024, 10:55 AM)aivenhoe Wrote: According to my understanding the softbody physiscs engine should be deterministic

Hi,

Most existing physics engines are not deterministic, this includes both Obi and Unity's own engine (PhysX).

The only way to get cross-platform determinism required for networked games (in the same machine and between machines with potentially different architectures as well) is to emulate floating point math - using fixed point or emulating it in software. This comes at a performance cost and often requires the engine to be written with this requirement in mind from the beginning.

For instance, you can find versions of Unity's DOTS physics engine that use software-emulated floating point numbers to achieve determinism.

The reason is that hardware-based floating point math can give slightly different results on different processor architectures. Furthermore, within the same machine multithreading may also yield non-deterministic results as the order in which threads are scheduled change order of operations and hence, floating point accuracy may change results.

This is why physics usually need to be synchronized over the network. Otherwise you'd be good just by making sure world state at time = 0 is the same for server/clients, and then let all devices run the simulation without any synchronization.

kind regards,
Reply


Messages In This Thread
Randomness in solvers - by aivenhoe - 26-09-2024, 10:55 AM
RE: Randomness in solvers - by josemendez - 26-09-2024, 11:32 AM
RE: Randomness in solvers - by aivenhoe - 30-09-2024, 04:01 PM
RE: Randomness in solvers - by josemendez - 07-10-2024, 12:13 PM