How to smooth path by curve?

Started by
2 comments, last by Saitei 7 years, 8 months ago

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?

Advertisement

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.

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.

Turn based or real time?

2D RTS

This topic is closed to new replies.

Advertisement