NewtonInvalidateCache causes physics simulation corruption

Report any bugs here and we'll post fixes

Moderators: Sascha Willems, Thomas

NewtonInvalidateCache causes physics simulation corruption

Postby Lax » Mon Jul 23, 2018 1:57 pm

Hi,

I updated newton to its newest version on github.
What I found out is, that when NewtonInvalidateCache(m_world); is called, after that no body will collide with another one anymore etc. This is new, since before the update NewtonInvalidateCache worked correctly.

Best Regards
Lax
Please support SecondEarthTechnicBase built of Lego bricks for Lego ideas: https://ideas.lego.com/projects/81b9bd17-5ff5-40a0-ac6f-44b97b79be62
Image
Lax
 
Posts: 165
Joined: Sat Jan 08, 2011 8:24 am

Re: NewtonInvalidateCache causes physics simulation corrupti

Postby Julio Jerez » Mon Jul 23, 2018 2:28 pm

yes that is very possible, there has been a lot of changes that may affect that function, but if is that severe it need to be fixed it, I will check it out tonight.
Julio Jerez
Moderator
Moderator
 
Posts: 12249
Joined: Sun Sep 14, 2003 2:18 pm
Location: Los Angeles

Re: NewtonInvalidateCache causes physics simulation corrupti

Postby Lax » Mon Jul 23, 2018 4:15 pm

ok, thanks!
Please support SecondEarthTechnicBase built of Lego bricks for Lego ideas: https://ideas.lego.com/projects/81b9bd17-5ff5-40a0-ac6f-44b97b79be62
Image
Lax
 
Posts: 165
Joined: Sat Jan 08, 2011 8:24 am

Re: NewtonInvalidateCache causes physics simulation corrupti

Postby zak » Tue Jul 31, 2018 6:10 am

I call NewontInvalidateCache() every update.
This has an impact on performance but it's fundamental for me.
Now, this bug prevents me from updating to the latest version, I want to try the parallel solver. :twisted:

It is important to fix this function because it is fundamental for post correction and for client-server multiplayer games, and maybe it could be an opportunity for some optimization. :mrgreen:
zak
 
Posts: 87
Joined: Mon Dec 06, 2004 9:30 am

Re: NewtonInvalidateCache causes physics simulation corrupti

Postby Julio Jerez » Wed Aug 01, 2018 4:17 pm

The reason I have no done anything there is because the my plan is to remove the Master List class form the engine.
The bulk of the work of function invalid cache is spent in walking the Master List where is a graphs where the node and the bodies and the link are the joint.
If I spend time on the function it will be just a waste when the class is removed.

I will try to get to that point that weekend, on another note, you call invalidate cache every frame?
that has serious perforce and physics quality impact in the game, is there any reason why you do that?
Julio Jerez
Moderator
Moderator
 
Posts: 12249
Joined: Sun Sep 14, 2003 2:18 pm
Location: Los Angeles

Re: NewtonInvalidateCache causes physics simulation corrupti

Postby zak » Thu Aug 02, 2018 3:07 am

I've been developing a football game for several years now.
The game is based on physics. I have developed sophisticated algorithms that allow ragdoll to synchronize the movement of the legs so as to really touch the ball. The result is truly remarkable. After so many years I almost finished and I hope to show you something soon.
However the ragdoll moves the legs very quickly when it runs and when it has to control the ball. So to avoid slight disarticulations and to obtain the millimeter accuracy for the ball control I apply the post correction of position and velocity in the ragdoll joints in each update. The result is maximum precision and solidity. I also apply some post corrections to the ball. Of course, physically it is not 100% correct but it is very closer and basically it's just a video game of pure action.

For all these reasons I am forced to call NewtonInvalidateCache () every update otherwise the collisions will not work properly. I also did some initial tests for a client-server mode and again NewtonInvalidateCache () is needed.

When you remove the Master List class and adapt accordingly NewtonInvalidateCache (), will you obtain better performance on it? Or would it be possible, for uses like mine, to create a hypothetical NewtonDisableCache() so as not to use a cache at all and to avoid calling NewtonInvalidateCache() every update and getting better performance?
zak
 
Posts: 87
Joined: Mon Dec 06, 2004 9:30 am


Return to Bugs and Fixes

Who is online

Users browsing this forum: No registered users and 1 guest

cron