Replies: 3 comments 5 replies
-
|
Jolt in godot is not compiled with You'd still expect determinism on the same PC. You have to guarantee that bodies / constraints are created in the same order (the body ID is used to sort). You need ensure that the physics space is completely destroyed between runs (just clearing it is not enough). If you don't, there will be caches that survive that affect determinism. I don't know how you recreate the space, but that could be the problem. |
Beta Was this translation helpful? Give feedback.
-
|
There's another issue: The code uses a hash of the body ID to sort contacts. This means that if you first create the world bodies and then the ragdoll, inserting a table will change the body IDs of the ragdoll. This changes the hash and thus the sorting. This changes the outcome of the simulation. You can work around this by ensuring that you always create the ragdoll first and that any bodies that you add to the level are added last so that all bodies retain the IDs they had previously. |
Beta Was this translation helpful? Give feedback.
-
Not that I'm aware of. But please look at the response above, my guess is that inserting new bodies in the middle is what is going wrong. |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
-
Hi, I'm currently working on a game project, where the player places various physical objects in order to move a ragdoll puppet through a level. The level is hand-made and half-finished - the player is not allowed to move props, that the level designer has put there, but they can add new ones.
I'm having trouble figuring out how to ensure, that the level can actually be finished.
In my tests any slight change might cause the puppet to completely change its flight path, even if that change does not directly intersect its flight path. See video for demonstration.
puppetqa.mov
Here, in the second run, I added a bush, that the puppet did not hit and yet it changed its path.
Basically - the designer had created a certain path for the puppet to go through, tested it on their PC and it was OK. Then, a player adds a (seemingly) irrelevant prop somewhere, which completely changes the flight path and thus the level can no longer be finished.
I understand that actual determinism depends on inputs being exactly the same, and adding a new body breaks that rule, but it seems to me like such change to the flight path might actually be an error on my side.
I'm using Godot, and I've already ensured that the entire physics system (physics space in Godot terms) is recreated on every run and all bodies are recreated in the new space. From my understanding - in those two runs in the demo above, from the perspective of the physics system there are no differences other than the additional static body.
I would greatly appreciate any tips and info whether what I'm trying to do here is practically achievable or not.
Beta Was this translation helpful? Give feedback.
All reactions