• Advertisement
Sign in to follow this  

Unreal Engine: Need help with smoothing out the shifts between slopes.

This topic is 423 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

Right now, I'm working with the unreal Engine, and I ran into an incredibly annoying problem that'd need to be smoothed out eventually.

 

Posted just above is a video of my current project, and it shows the problem in full view.

I am working on a game that runs with spider physics. And the only sane way I could come up with to do this was by modifying the tug of gravity. But this lead to an issue, which was that at a large speed the object tends to launch it's self off of slopes and the gravity will pull it back down, which is where that jitter and bunny hop comes into play. Going up the slopes is just as jarring.

Anyone have any ideas on how to fix it?

I couldn't use the regular Character Movement Controller, as it's gravity is pretty much set in stone. And also that the way it handles slope movement is by always assuming that the character's up vector is in one direction, it then uses height to basically force the character in the right direction.

 

So I had to inherit from another movement controller with pretty much nothing done for me.

Share this post


Link to post
Share on other sites
Advertisement

Going up the slopes is just as jarring.

It looks like its keeping the vehicle level with, and at a constant distance from, the "ground".  you get a bounce as you move from one flat segment to another in your loop-the-loop. a rounder loop-the-loop would reduce that, but it wouldn't be the same thing as truly flying - if that's you goal.

Share this post


Link to post
Share on other sites

For the launching of slopes part you can do ground detection over some fixed distance after the simulation, if there's ground beneath the vehicle place it on the ground. Only do this extra detection and snapping to ground step if you were previously on the ground.

 

Going up slopes looks jarring because the camera orientation changes significantly (due to low amount of segments) and rapidly. Smoothing the altitude part of the camera over a longer period would make it less jarring, but also make it look more like you're going up a slope as you'll see your vehicle from a more tilted position. You might want to have separate smoothing periods for going up and going down.

Share this post


Link to post
Share on other sites

Maybe experiment with limiting the rate at which the gravity vector can change?

You could think of the change as a linear interpolation between the source and destination g vectors:

g = (g1 * (1.0 - alpha)) + (g2 * alpha)

and clamp/terminate it at alpha == 1.0.

With that in place you can try setting a constant change rate for alpha and fiddle with it to see if it can help smooth out the jarring motions.

It may cause weirdness in other areas though.

Share this post


Link to post
Share on other sites

1. recalculation of the next steps for the changing ground. This will be an array of vectors.

2. Normalizing these vectors to smooth the differences. (rounding of edges in calculation.) Bezier curve.

3. use this array of vectors as ground instead of the actual 3d surface.

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • Advertisement