A place to discuss everything related to Newton Dynamics.
Moderators: Sascha Willems, walaber
by 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
by 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.
-
JernejL
-
- Posts: 1578
- Joined: Mon Dec 06, 2004 2:00 pm
- Location: Slovenia
-
by 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
by 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
-
- Posts: 12249
- Joined: Sun Sep 14, 2003 2:18 pm
- Location: Los Angeles
-
by 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.
-
Dave Gravel
-
- Posts: 800
- Joined: Sat Apr 01, 2006 9:31 pm
- Location: Quebec in Canada.
-
by 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 16 guests