#How does Unity physics achieve full determinism?

1 messages · Page 1 of 1 (latest)

frosty steeple
#

If burst is not yet fully deterministic how does Unity Physics guarantee determinism? Is there a special way to use burst to be able to guarantee deterministic results?

cloud cipher
#

hi Greco! Unity Physics is single-architecture deterministic, meaning that under the same CPU architecture it will produce the same results, always that your gameplay code is also deterministic in that architecture. Conversely, this mean that we don't guarantee you will get the same result in different architectures (i.e. PC and PS5)

#

Cross-platform determinism is a burst compiler problem to solve, and while the team is interested in working on that, we don't have any plan for now.

potent cape
#

Hello,
For the purposes of this determinism question, is restricting to Windows 64bits PCs enough to guarantee a single CPU architecture and therefore determinism? And what about other PC platforms such as Linux and MacOS?

cloud cipher
#

Sadly not, there might be small differences between AMD and Intel x64 CPUs for example, making those architectures to produce different results. The same can happen in other platforms.

sleek jasper
cloud cipher
#

Integers by themselves are not enough to create a physics system. While fixed types could be simulated with integers, its performance would be extremely bad.

#

Do you have any specific requierement of your project that require deterministism behaviour? there might be other possible solutions.

potent cape
#

For my part, we are starting work on a multiplayer deterministic lockstep game, so having the whole ECS world deterministic would be the best. Is there any chance that the cross platform determinism would be available within the next year?

sleek jasper
cloud cipher
#

@potent cape sadly not, we don't have any ETA for cross-platform determinism, so plan ahead your project without counting on it 😦

sleek jasper
cloud cipher
cloud cipher
sleek jasper
cloud cipher
#

yes, i am thinking about recording the compressed players transform every X amount of ms, just the axes that you need, and using several compression techniques, like delta compression. Also, quaternions can be compressed into a single float using certain compression techniques. then in the recorded timeline you can create custom events to spawn/destroy objects. up to 32 booleans like firing/jumping/reloading could be fit in a single int (or 8 in a byte). most of the cosmetics like sounds and animations can be inferred from that info without needing to record that info.

sleek jasper
cloud cipher
# sleek jasper From what u say, I guess today is not possible to come out with a cross platform...

that depends on your game requirements, actually the snapshot compression article i sent you address that issue by simulating the physics on the server, and the rest just interpolates towards them. This introduces the problem of the client input responding slowly, or needing to predict the player and recoincile with the server when the player prediction fails, but its possible and used in several commercial games.

sleek jasper
cloud cipher
#

im not sure if the APIs expose all that info, but should be possible. you might need to recreate some of the playback code of the netcode package, but im not sure right now

cloud cipher
tired nacelle
potent cape
frosty steeple
cloud cipher
#

any floating point operations should be deterministic in the same hardware, as you said, given our code is also deterministic

frosty steeple
frosty steeple