godotengine / godot

Godot Engine – Multi-platform 2D and 3D game engine
https://godotengine.org
MIT License
91.45k stars 21.27k forks source link

Make Godot Physics 3D constraint solving more deterministic #48303

Open pouleyKetchoupp opened 3 years ago

pouleyKetchoupp commented 3 years ago

Godot version: Master

OS/device including version: n/a

Issue description: PR #44112 has improved determinism for constraint solving in Godot Physics 2D. A similar patch needs to be applied to Godot Physics 3D to make things consistent.

Note: Performance needs to be investigated too, as it seems this patch causes some slow down in physics steps in some cases.

Steps to reproduce: n/a

Minimal reproduction project: n/a

narcissawright commented 9 months ago

can confirm this is still random. did some tests earlier using move and slide across simple flat triangle meshes

I simulated the same physics step many times and had two potential results, one happened ~8400 times and the other happened about ~4000 times

image

Calinou commented 9 months ago

@narcissawright Can you upload a minimal reproduction project somewhere?

Note that while we welcome efforts to improve determinism, there are no plans to make GodotPhysics 100% deterministic (and godot-jolt is not 100% deterministic either).

narcissawright commented 9 months ago

@narcissawright Can you upload a minimal reproduction project somewhere?

Note that while we welcome efforts to improve determinism, there are no plans to make GodotPhysics 100% deterministic (and godot-jolt is not 100% deterministic either).

Sure here is the test project. Uses left joystick input (device 0) to move, once the player capsule touches the blue goal, it then replays all the inputs and compares each frame. Sometimes when the player object passes over the floor triangles the collision result is different, and if so it will stop replaying and simulate that frame over and over, printing the differing results.

godotphysics3D_nondeterminism.zip