What obstacles are there to cross platform determinism?

TLDR: What parts of ECS would need to be changed to make it fully cross-platform deterministic?

I know that unity physics and burst are not fully deterministic (deterministic on all hardware) due to differing implementations of floating point operations. However, if you used some deterministic number type rather than floats (and avoided system.math), are there any other considerations to getting full determinism?

For example, is there any way of ensuring structural changes (entity layouts in chunks) are deterministic? A fully deterministic physics system would probably still depend on the order of the physics bodies so this could break determinism.

I’d like to create a replay system by storing only inputs and having these replays play out identically across any desktop hardware. What do I need to take into account/what built-in systems will need to be changed for this to be possible? I am just doing this for a hobby project; I don’t mind if it takes more effort than it’s worth, but I’d like to know what it would involve.

1 Like

I’d be interested in this as well. If it was easy enough to do, we could patch the physics package ourselves and use this custom version.

What would be the correct approach in theory? Multiply floats by 100000etc, convert to int, run physics simulation, convert back to float (and divide by 100000etc), then do the export of physics state for rendering etc? If one of the unity devs could chime in then maybe we could try stuff like that instead of waiting for them to fully support determinism

Yeah, this is also my interest, Unity hasn’t really said just how “fully deterministic” the physics is.