Help - Search - Members - Calendar
Full Version: NewtonPhysics deterministic/nondeterministic
Hash, Inc. Forums > Technical Direction and Development (Learning Animation:Master) > A:M Tutorials and Demonstrations > Newton Physics
mouseman
Caroline mentioned in the NewtonPhysics version of Cosmic Bowling that it works slightly differently every time. I got similar results with that tutorial.

This confuses me. As far as I can tell, the inputs (the project) are the same every time (especially if I don't save and revert the project). Therefore, there must be some other variable. Possibilities:

- A random function with its seed based on time
- A multi-threaded race condition, where things happen in different orders

Stefan, do you have any insight to what might be going on?

If it is based on some random function, would it be desirable to give the user the option to choose a seed for the simulation so he/she gets the same results?
heyvern
I don't know for sure but my guess is that it's cumulative "randomness" just like in reality. Newton is scarily realistic. Kind of freaky. I've been doing some really tight "small tolerance" physics sims with very very very very close objects. What happens is that every surface that comes into contact with another surface reacts independently based on whatever newton uses to determine the outcome. In my tests a flat object resting on another flat object but "unbalanced" will shift and fall differently each time.

For instance one object falling on the ground the same way in newton is nearly the same each time, more so than multiple objects. Add in more objects and the variations of possible outcomes are multiplied exponentially. There is also a "tolerance" setting or "resolution". The larger the number in those types of settings will probably give more varied and different results due to the smaller resolution and larger possible outcomes. A lower number will probably be more "the same" but not as "realistic".

I suppose it could be possible to set it in stone but you would have to "lock" the random outcome at every single contact point of every single collision. Where would that data be stored? I will simulate several different versions and save the ones that I like with the keys intact knowing that I can't possibly get that exact result again. Ultimately you are after that one single out come that looks good. If you see something close do a save as.

The guys who use computers to render super realistic water/ocean simulation effects will run the sims and wait to see what they get. If they don't like it they run it again and again until they see what they like. They can't predict what will happen and don't expect the same results with the same settings.

p.s. I ran into the same problem with my plastic letters in a sign board. I would adjust the thickness of the pegs holding the letters in place so I could "force" some letters to stay in and some to fall out spelling out words with letters left behind. It was so annoying, each time I adjusted one letter to not fall out, another letter or two would fall out or stay in that didn't before. I would get it almost perfect but one silly letter that fell out the last time would teeter on the edge just barely staying in... I even found myself blowing on the screen or bumping the computer trying to make it fall off. wink.gif

-vern
This is a "lo-fi" version of our main content. To view the full version with more information, formatting and images, please click here.
Invision Power Board © 2001-2012 Invision Power Services, Inc.