Sign in to follow this  
Saitei

How to smooth path by curve?

Recommended Posts

I'm not sure what you're looking for with this topic.  Exactly how you do it will depend on your engine (which you haven't mentioned), your tools (which you haven't mentioned), language choice, and more.

 

In general you'll build a locomotion system for your game. Part of that locomotion system will have a way to move objects of various sizes, including how to turn objects of various sizes.  You may want some things to be particularly nimble and cutting corners, other things to slow and lumbering.  

 

Perhaps you may have something like a fast insect race that can make tight corners at almost no cost. Perhaps you may have something like a battle armor tank that is extremely powerful and can move forward quickly, but is terrible at turning and must make square turns at a high cost.  Briefly thinking about it, it could be done with animation sequences of variable length, it could be done through procedural methods in your code written unique for each motion type, it could be done with tunable values provided to game designers for each type of locomotor. Likely you could think of more ways to do it in general.

Share this post


Link to post
Share on other sites

Im using this pathfinding method https://harablog.wordpress.com/2009/01/29/clearance-based-pathfinding/

 

The object sizes can be different. So, how can I smooth my path by curves without any artefacts? 

 

Turn based or real time?  Turn based, I'd probably just have some occasional artifacts, and use catmull-rom using the waypoints as inputs to the curve.  One way to do it without artifacts is to find the minimal turn radius required to get from one waypoint to the next, and then interpolate along that arc.  Not sure the best way to find that minimal turn radius offhand though, and that's the real killer.

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this