Objects suddenly bounce off?

A place to discuss everything related to Newton Dynamics.

Moderators: Sascha Willems, walaber

Objects suddenly bounce off?

Postby Marc » Wed Nov 11, 2009 10:15 am

Hi !

I have a strange effect in my game. I have seen it for months, but never cared about it. But now people are complaining. I made a video of it:

http://www.transmogrifier.de/temp/bounce.avi

It's a newton heightfield and a the unit trying to get over that bump is a sphere with an upvector joint. The unit has a target position it wants to move to and therefore applies the same amount of force in the direction parallel to the xy plane each frame. I call NewtonInvalidateCache from time to time. @Julio: It's exactly the same scene setup from a few weeks back where we optimized it.

While this looks funny and sometimes adorable, this effect sometimes gets much larger. I've seen a unit bounce of about 40m, assuming it's about 2m high. I got reports about units flying over the whole map, which would be 1km. The biggest problem is when you best unit suddenly falls in the water and dies instantly because of this :/

Any idea what could cause this? Should I try the character controller instead of spheres + upvector?

Marc
Millenium Project Enterprises - Hobbyist Gamedev Group http://www.mpe-online.org
Walkover is now on Steam => http://store.steampowered.com/app/348700/
User avatar
Marc
 
Posts: 281
Joined: Sun Mar 14, 2004 4:07 pm
Location: Germany

Re: Objects suddenly bounce off?

Postby Carli » Wed Nov 11, 2009 11:25 am

Hm, I had the same problem with an other physics engine: the character was moving through impulses and it was not easy to handle the control.
I solved the problem through raycasting the Ground and setting the character position from new each frame.
Code: Select all
            /|
          /  |
        /    |
      /      |
    /        |

The idea was to move the object on high over the new position and then putting it on ground. (if the path is free....)
- it was a completely new feeling of steering a character
Carli
 
Posts: 245
Joined: Fri Oct 02, 2009 5:28 am

Re: Objects suddenly bounce off?

Postby Julio Jerez » Wed Nov 11, 2009 11:49 am

Oh I had being trying to reproduce that but for long time and I game up. It is the convex edge bug.
The build in terrain has extra information to reduce the effect, from 2.0 an on the convex edge info is more complex than it used to be in 1.5 and it not longer a funtionality of user meshes.
only the build shape in Netwon have it. Here are the options for solving it.
if you are using your own terrain your are out of luck you only option is using higher fps and or ray cast trick. It is very difcult to fix.

if you are using the build in mesh them it is possible to fix it. and it should be fixed but oviustly there is still a bug.
This is one of those litle thng but very annoying thing that I do not advertice but that make a physoien engine different on the margine.

the last time I was looking at it was when a person making a golf game had it and I ajusted to work with very smal objects.
It is a sensitive parameter that has behave diferently depending on size, convexity, speed etc.

It looks like you can reproduce it very reliable with a normal size ball, this should not happens at all in Newton. :oops:
if you send me a demo I can fix it, for me t is very difdicul to make those kind of demos.
It can be fixed but I need to see the conditions that are making it happen in such normal case.

note:
I not longer have the demo you sent me, I have to delete about two dozen demos that were taking lot of space in me drive.
can you put together again?
Julio Jerez
Moderator
Moderator
 
Posts: 12426
Joined: Sun Sep 14, 2003 2:18 pm
Location: Los Angeles

Re: Objects suddenly bounce off?

Postby Marc » Wed Nov 11, 2009 1:11 pm

I'm using newton's heightfield, not my own anymore.

What do you need to test it? Again only the binary is enough? I'll prepare something then :)
Millenium Project Enterprises - Hobbyist Gamedev Group http://www.mpe-online.org
Walkover is now on Steam => http://store.steampowered.com/app/348700/
User avatar
Marc
 
Posts: 281
Joined: Sun Mar 14, 2004 4:07 pm
Location: Germany

Re: Objects suddenly bounce off?

Postby Julio Jerez » Wed Nov 11, 2009 1:45 pm

I binaty is find,
make the level not to complex please, maybe the minimum number of entity so tha I do no have to debug to much to track it.
Julio Jerez
Moderator
Moderator
 
Posts: 12426
Joined: Sun Sep 14, 2003 2:18 pm
Location: Los Angeles

Re: Objects suddenly bounce off?

Postby Marc » Wed Nov 11, 2009 1:50 pm

Hmm, that's tricky then.

I prepared the scene for you already, but not thinking of "removing unnecessary objects". I'll pm you about it anyways and make a simpler scene tomorrow. I guess I'll implement somehing like a kill everything further away than 20m of the camera or something like that. But sadly, I have to leave now :(
Millenium Project Enterprises - Hobbyist Gamedev Group http://www.mpe-online.org
Walkover is now on Steam => http://store.steampowered.com/app/348700/
User avatar
Marc
 
Posts: 281
Joined: Sun Mar 14, 2004 4:07 pm
Location: Germany

Re: Objects suddenly bounce off?

Postby Julio Jerez » Wed Nov 11, 2009 2:54 pm

Ok I will test it tonight. see what I can find out
Julio Jerez
Moderator
Moderator
 
Posts: 12426
Joined: Sun Sep 14, 2003 2:18 pm
Location: Los Angeles

Re: Objects suddenly bounce off?

Postby Marc » Wed Nov 11, 2009 3:07 pm

Heh, I did it right now anyways.

There are only a few units and the heightfield in the scene now. From time to time, enemies will spawn somewhere - you won't see them because of the fog of war though. You can remove them by pressing 0 which removes everything from the scene that is more than 50m away from the camera. You can add own units again by pressing n.
Millenium Project Enterprises - Hobbyist Gamedev Group http://www.mpe-online.org
Walkover is now on Steam => http://store.steampowered.com/app/348700/
User avatar
Marc
 
Posts: 281
Joined: Sun Mar 14, 2004 4:07 pm
Location: Germany

Re: Objects suddenly bounce off?

Postby Marc » Tue Nov 17, 2009 6:07 pm

Did you find anything or should I try to generate a more simple standalone test case?
Millenium Project Enterprises - Hobbyist Gamedev Group http://www.mpe-online.org
Walkover is now on Steam => http://store.steampowered.com/app/348700/
User avatar
Marc
 
Posts: 281
Joined: Sun Mar 14, 2004 4:07 pm
Location: Germany

Re: Objects suddenly bounce off?

Postby Julio Jerez » Tue Nov 17, 2009 6:22 pm

Oh I have to try yet, I could not work on anything the last few days.
I will try this weekend.
Julio Jerez
Moderator
Moderator
 
Posts: 12426
Joined: Sun Sep 14, 2003 2:18 pm
Location: Los Angeles

Re: Objects suddenly bounce off?

Postby Marc » Wed Nov 18, 2009 7:49 am

just as a small hint maybe: I'm using solvermodel 1. When I switch to solvermodel 0, this bouncing gets drastically reduce, but not removed completly. It's occurs a lot less often. When I move 10 units to such a critical location, with solvermodel 1, I can see at least one of them bounce every 5 seconds, most likely multiple of them in parallel. When I try that with solvermodel 0, I takes about 30 seconds until one of them bounces.
Millenium Project Enterprises - Hobbyist Gamedev Group http://www.mpe-online.org
Walkover is now on Steam => http://store.steampowered.com/app/348700/
User avatar
Marc
 
Posts: 281
Joined: Sun Mar 14, 2004 4:07 pm
Location: Germany

Re: Objects suddenly bounce off?

Postby Carli » Wed Nov 18, 2009 9:02 am

Maybe a freezed body lying on the ground is "collecting" impulse energy and then beeing hitten the force is breaking off....
Carli
 
Posts: 245
Joined: Fri Oct 02, 2009 5:28 am

Re: Objects suddenly bounce off?

Postby Julio Jerez » Wed Nov 18, 2009 9:40 am

no thsi is no a slover issues, it is a collison issue.
solver one and zero makes look more or less because the iterativen solver calcuale and aproximation to the force so it works with more penetration that solver mode 0
if there is more penetration then there angle of the edge contact varies more wildly
I will check the Bug, is is something I have beeing tracking for some time but that is it dificult to reproduce reliably.

I have question to you game a replay mode? for exmapel make oen run an dthen running again wit the output and make it do the example same thing again.
Julio Jerez
Moderator
Moderator
 
Posts: 12426
Joined: Sun Sep 14, 2003 2:18 pm
Location: Los Angeles

Re: Objects suddenly bounce off?

Postby Julio Jerez » Wed Nov 18, 2009 11:26 am

Ok I got the game and I was able to see teh bounce off bug the very first time I move a unit to one of the hills.

Is there a way to play in a smaller window it takes the entire screen and I have ot do alt tap fo get to the editor.
any way I will debug it and see what is is.
Julio Jerez
Moderator
Moderator
 
Posts: 12426
Joined: Sun Sep 14, 2003 2:18 pm
Location: Los Angeles

Re: Objects suddenly bounce off?

Postby Marc » Wed Nov 18, 2009 12:21 pm

I can imagine that. Extract the following files to the bin dir an start it with cu.cmd.

http://www.confrontation-unlimited.net/temp/CUWindow.zip

It opens a window 1024x768 in the upper left corner. If you also need to have it moveable, that'ld be more complicated :/

The game has no replay functionality.
Millenium Project Enterprises - Hobbyist Gamedev Group http://www.mpe-online.org
Walkover is now on Steam => http://store.steampowered.com/app/348700/
User avatar
Marc
 
Posts: 281
Joined: Sun Mar 14, 2004 4:07 pm
Location: Germany

Next

Return to General Discussion

Who is online

Users browsing this forum: No registered users and 2 guests

cron