PDA

View Full Version : Physics engine is non-deterministic?



aydiosmio
04-27-2004, 09:41 PM
I've just gotten started with both FarCry map building and map building in general. I've managed to attach a boombox to a buggy with a ChainSwing entity and placed the combination on a plateau, with the boombox hanging over the edge. I then increased the mass of the boombox to 20,000 and hit Ctrl-G to start up the game engine while I stood below the cliff and watched it drop.

The really strange thing is that it doesn't seem to ever fall the same way twice, even though it always starts from the same position, e.g. sometimes it will flip over and explode, while other times it will land on its wheels intact.

Is there some kind of outside force at work here, like wind, or is the physics engine non-deterministic?

aydiosmio
04-27-2004, 09:41 PM
I've just gotten started with both FarCry map building and map building in general. I've managed to attach a boombox to a buggy with a ChainSwing entity and placed the combination on a plateau, with the boombox hanging over the edge. I then increased the mass of the boombox to 20,000 and hit Ctrl-G to start up the game engine while I stood below the cliff and watched it drop.

The really strange thing is that it doesn't seem to ever fall the same way twice, even though it always starts from the same position, e.g. sometimes it will flip over and explode, while other times it will land on its wheels intact.

Is there some kind of outside force at work here, like wind, or is the physics engine non-deterministic?

endoskeptic
04-28-2004, 02:36 AM
What do you mean by non-deterministic?

Wookiee22
04-28-2004, 04:27 AM
the random factor is in play hence the physics is kept out of multi player (so they dont have to send the position of every dynamic object over the net) http://ubbxforums.ubi.com/infopop/emoticons/icon_smile.gif

radtweak
04-28-2004, 04:59 AM
"Chaos Theory" http://ubbxforums.ubi.com/images/smiley/16x16_smiley-wink.gif

aydiosmio
04-28-2004, 09:32 AM
By "non-deterministic", I mean that for one input to a function, there is more than one output. In this case, it means that there is some kind of random factor included the the physics calculations the game makes that causes it to give different results (explosion or landing on four wheels) on different runs given the same initial conditions (the buggy with radio positioned over the cliff). Normally, most computer systems are deterministic, and it takes some kind of special effort (like inserting randomized values into the code) to make it non-deterministic.

Expry
04-28-2004, 09:58 AM
It appears to be non-deterministic. Causes all kinds of havoc (no pun intended) with scripting, imho...

FuSiON_3D
04-28-2004, 10:26 AM
It depends on when the engine decides to update the physics. When they update the physics based on the framerate (wich some physics engines do) the result can can differ from one computer to another.

Expry
04-28-2004, 11:38 PM
It appears to change even if on the same machine.

Though I'll agree it changes more if on a different spec machine. The auto-spec code mentions changing the step values for the physics & AI. Scripts/main.lua has the details.