Character controller issues - debuggable demo and video

A place to discuss everything related to Newton Dynamics.

Moderators: Sascha Willems, walaber

Character controller issues - debuggable demo and video

Postby pHySiQuE » Sat Dec 10, 2016 11:51 pm

I am implementing a new character controller based on convex raycasts. The results so far provide much smoother and more accurate collision, but there are some major problems that prevent me from releasing this. I would like to upgrade my engine to Newton 3.14 and finished the new character controller in time for the Steam winter sale later this month.

Demo:
http://www.leadwerks.com/MyGame.zip

Newton is used as a DLL now.

You will get stuck if you step on a slope steeper than 45 degrees. Sliding behavior is not yet implemented.

Video:


Here are the problems, as shown in the video:

1) The convex raycast allow non-zero penetration, which seems like it should never happen. This allows the player to penetrate the downward-facing overhangs and walk straight into an object.

2) Convex raycasts against compound convex shapes are producing obviously wrong results. The player keeps hopping up and down.

3) Moving objects do not detect collision with the player body, as you can see with the moving platform. The platform uses a motorized slider joint to move back and forth.

Controls
WASD / Mouse: Move / look
Space: jump
P: show collision
C: Keep camera in place

The convex casting inaccuracy effects all games. You can even see it in this video right at 3:02:
pHySiQuE
 
Posts: 608
Joined: Fri Sep 02, 2011 9:54 pm

Re: Character controller issues - debuggable demo and video

Postby Julio Jerez » Sun Dec 11, 2016 10:23 pm

ok I can run the demo now, I see you are using dNewton cool!!
you know if you run optimized collision your collision is of much high quality and also much faster.

anyway I see the capsule can penetrate slanted ramps, I will see what that about.
Julio Jerez
Moderator
Moderator
 
Posts: 12249
Joined: Sun Sep 14, 2003 2:18 pm
Location: Los Angeles

Re: Character controller issues - debuggable demo and video

Postby Julio Jerez » Mon Dec 12, 2016 11:15 am

neither one of those executables are linked to any of the newton DLLs, they are statically linked.
you can delete all of the d library an dthe demo still runs. I can no debug static libraries.
Julio Jerez
Moderator
Moderator
 
Posts: 12249
Joined: Sun Sep 14, 2003 2:18 pm
Location: Los Angeles

Re: Character controller issues - debuggable demo and video

Postby pHySiQuE » Mon Dec 12, 2016 3:39 pm

Doh!

There's not enough time before the Steam winter sale. I'm going to back off from this and resume it after Christmas. But at least you see what the issues are now.

I hope to make a general-purpose character controller class that gets added into Newton. My work on this has been a lot better than the example Newton comes with.

Will come back to this after Christmas.
pHySiQuE
 
Posts: 608
Joined: Fri Sep 02, 2011 9:54 pm

Re: Character controller issues - debuggable demo and video

Postby Julio Jerez » Mon Dec 12, 2016 4:18 pm

my recommendation is that you should try the controller on the SDK, at least play the simple player control demo, see you can get it stuck.

Moving the shape on the environment is a piece wise linear optimization problem that needs a QR decomposition to solve an overdetermined system to select the best surface from all the possible collision. This is what the engine uses.
believe me you are not going to find a solution using heuristic.

this is how the player in the library works, and seem to negotiates all the glitches on the small map in the demo without getting stuck anywhere.

is you required any update you can added it of I can help you to customized it, of you can even make you own once you see how it works.

anyway when you at ready wit the demo let me know and I test it.
Julio Jerez
Moderator
Moderator
 
Posts: 12249
Joined: Sun Sep 14, 2003 2:18 pm
Location: Los Angeles

Re: Character controller issues - debuggable demo and video

Postby pHySiQuE » Mon Dec 12, 2016 6:49 pm

Here's why I don't use yours:
-No crouching behavior.
-No sliding on steep slopes.
-The shape should be a cylinder. The compound shape you use results in unwanted behavior, like the image below, where I am penetrating a wall.
-The character must be able to push objects, and be pushed by them, and your demo does not show this.

Untitled.jpg
Untitled.jpg (48.38 KiB) Viewed 7565 times

Even my existing controller is miles ahead of this one. The new one will be nearly perfect, if I can work these issues out.
pHySiQuE
 
Posts: 608
Joined: Fri Sep 02, 2011 9:54 pm

Re: Character controller issues - debuggable demo and video

Postby Julio Jerez » Mon Dec 12, 2016 10:35 pm

pHySiQuE wrote:-No crouching behavior.
-No sliding on steep slopes.
-The shape should be a cylinder. The compound shape you use results in unwanted behavior, like the image below, where I am penetrating a wall.
-The character must be able to push objects, and be pushed by them, and your demo does not show this.

but it does the majority of all of that with the expectation of crouch which is a trivial thing to do.
I do no see which is it that you show in the image, but the player will keep a distance from any surface
that can be configurable. It also push objects and object react to the player with out blowing.

In my opinion a compound shape is a better choice for a please because it can stand in areas where the base can be too wide, by you can select the with of the base.

anyway I do not want to make a big case out of this, what I am sayin is that moving a convex shape of a concave space It may look simple but is no a really a trivial problem. it required optimization criterial that the by way I know how to chose an option is but formulation an objective function and optimizing it by some numerical method, this is what the newton player does. and it is what libraries like Havok does as well.
Julio Jerez
Moderator
Moderator
 
Posts: 12249
Joined: Sun Sep 14, 2003 2:18 pm
Location: Los Angeles

Re: Character controller issues - debuggable demo and video

Postby pHySiQuE » Mon Dec 12, 2016 10:52 pm

Here is one of the problems:


We cannot have bad behavior like that.

With the convex raycast, precision matters a lot more than speed. Right now the player collision update is running ten times per loop to minimize jitter.
pHySiQuE
 
Posts: 608
Joined: Fri Sep 02, 2011 9:54 pm

Re: Character controller issues - debuggable demo and video

Postby Julio Jerez » Mon Dec 12, 2016 11:54 pm

well I do not know what to say, that's kow I supposed to work, it is not support to climb anything that touches the up capsule.
The convex Ray cast as far as I can see is correct, is possible that there is a bug that I do not see, but so far has pass all my test, this is the same algorithm used is used for general collision and for the player controller. I can not see that error that you mention, I wish I could.
But any one when you have time then you prepare the demo and I debug it.
Julio Jerez
Moderator
Moderator
 
Posts: 12249
Joined: Sun Sep 14, 2003 2:18 pm
Location: Los Angeles

Re: Character controller issues - debuggable demo and video

Postby pHySiQuE » Tue Dec 13, 2016 12:58 am

It may be working according to the design you set out, but it makes for bad gameplay. The player can hang off the side of a cliff at waist-height.

Untitled.jpg
Untitled.jpg (6.72 KiB) Viewed 7551 times
pHySiQuE
 
Posts: 608
Joined: Fri Sep 02, 2011 9:54 pm

Re: Character controller issues - debuggable demo and video

Postby Julio Jerez » Tue Dec 13, 2016 6:25 am

yes, but that is exactly what I said.
as you find issue that you want to be resolve, they can be resolved and move to a satisfactory solution.
that issue was not part of the design and I am sure they maybe be others as well, but now that I see whet you mean I can fix then.

In any case my point is that it is better to work on those problems rather than start brand new ones from scratch, specially when the solution of a simple capsule is already a bigger problem.
I see if I can solve the crouch and the hanging over ledges.
thank you for the test.
Julio Jerez
Moderator
Moderator
 
Posts: 12249
Joined: Sun Sep 14, 2003 2:18 pm
Location: Los Angeles

Re: Character controller issues - debuggable demo and video

Postby pHySiQuE » Tue Dec 13, 2016 11:59 am

The proper way to do crouching is to treat the input as a request. Each frame, a convex raycast above the player's head is performed, and if anything is hit, that request is denied and the player remains crouching. The user has a function to set the crouch state and to retrieve it. Setting the crouch state doesn't always result in it changing right away, because there might be something above their head blocking them.

Some games have different crouch states for kneeling and for lying prone.

pHySiQuE
 
Posts: 608
Joined: Fri Sep 02, 2011 9:54 pm

Re: Character controller issues - debuggable demo and video

Postby Julio Jerez » Tue Dec 13, 2016 12:51 pm

yes that would be one way, to me Crush would apply a noon uniform scale to the shape that scale the shape vertically from the top.
That should do it an everything should work the same way.
The rest of the logic can be on the user side, he can decide when to couch or not by doin the cast stuff.
Julio Jerez
Moderator
Moderator
 
Posts: 12249
Joined: Sun Sep 14, 2003 2:18 pm
Location: Los Angeles

Re: Character controller issues - debuggable demo and video

Postby pHySiQuE » Wed Dec 14, 2016 12:12 pm

Sounds good.
pHySiQuE
 
Posts: 608
Joined: Fri Sep 02, 2011 9:54 pm


Return to General Discussion

Who is online

Users browsing this forum: No registered users and 16 guests

cron