Consistent Results

A place to discuss everything related to Newton Dynamics.

Moderators: Sascha Willems, walaber

Consistent Results

Postby saxman » Sat Oct 11, 2008 9:23 pm

My application is client/server, where the server is the source of truth, and the clients perform the same simulation for rendering purposes.

What are the best settings to ensure that given the same starting values, the results after a given amount of "steps" will be the same? NewtonUpdate will always be called with the same timing interval value (e.g., 1.0/120.0), but the exact timing of the calls may be more or less than the timing interval.
saxman
 
Posts: 12
Joined: Thu Oct 02, 2008 5:37 am

Re: Consistent Results

Postby JernejL » Mon Oct 27, 2008 7:04 pm

As long as you use same cpu features and same update time results should be consitstient.

There's also one function in new version of dll which resets internal state of the engine so it guarantees identical simulations, julio could tell you more about that one, i don't remember the function name.
Help improving the Newton Game Dynamics WIKI
User avatar
JernejL
 
Posts: 1578
Joined: Mon Dec 06, 2004 2:00 pm
Location: Slovenia

Re: Consistent Results

Postby saxman » Fri Dec 26, 2008 6:00 pm

The only function in 2.0 which looks like it could do what you mentioned was NewtonInvalidateCache(). There is no documentation on it, but I tried adding it to see if it'd help.

I really need Newton to act deterministically so a simulation run on several computers with the same starting criteria ends up with the exact same results.

For the update time, all of the simulators are doing NewtonUpdate( newtonWorld_, 1.0f / 120.0f ). Does Newton somehow know about real world time and is trying to base it's computations outside of the update step I'm giving it?
saxman
 
Posts: 12
Joined: Thu Oct 02, 2008 5:37 am

Re: Consistent Results

Postby Julio Jerez » Fri Dec 26, 2008 10:35 pm

that should be fine, you should also use x87 mode wish is arch 0 the default.

NewtonInvalidateCache() is for when you wna to rest teh time to certime time after soem time has pass.
you could call it every 30 of 40 steps as sincronization, If you want that way if you need to rest to some time you can go to the last sinc time.

This si something I never tryed so I do not know whatt the resul will be, but I know of some peplel who has used suscefully.
Julio Jerez
Moderator
Moderator
 
Posts: 12249
Joined: Sun Sep 14, 2003 2:18 pm
Location: Los Angeles

Re: Consistent Results

Postby Dave Gravel » Sat Dec 27, 2008 12:37 am

I have make some tests about it in a old newton beta,
and with NewtonInvalidateCache() + my game loop and a fixed deltatime and it seen to work good for me.
I use NewtonInvalidateCache() anytimes that I reset my simulation.
I absolutly need to use a fix deltatime here to make it work.
You search a nice physics solution, if you can read this message you're at the good place :wink:
OrionX3D Projects & Demos:
https://orionx3d.sytes.net
https://www.facebook.com/dave.gravel1
https://www.youtube.com/user/EvadLevarg/videos
User avatar
Dave Gravel
 
Posts: 800
Joined: Sat Apr 01, 2006 9:31 pm
Location: Quebec in Canada.

Re: Consistent Results

Postby saxman » Sat Dec 27, 2008 10:45 pm

Thanks for all the feedback. It sounds like this should be possible so I just need to figure out what is going on. It feels like I'm really close though.
saxman
 
Posts: 12
Joined: Thu Oct 02, 2008 5:37 am


Return to General Discussion

Who is online

Users browsing this forum: No registered users and 10 guests

cron