# Path smoothing dubio

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

## Recommended Posts

Hi all, Am in a bit of a dubio about how to make my units in an rts move more smoothly on paths found by A* taking in account turnradius if possible. Now I read this piece by Pinter http://www.gamasutra.com/features/20010314/pinter_01.htm he explains some of the cheats that are being used. He also describes a "correct" way to handle turning, but that one seems computationally very heavy and might require some hierarchical pathfinding as well: 1. Does anyone have an idea whether this "correct" way would run at acceptable speed on today's hardware? Since the piece is from 2001. Or are there perhaps more viable ways to achieve the same? Also I was thinking about another way to solve the problem he hasnt described. Giving units seeking behaviour towards the path with a certain treshold. If they deviate to much they must seek. Much like shown here: http://www.red3d.com/cwr/steer/PathFollow.html (sorry dont know how to make links clickable) This does however poses some problems when the path is not in the "front" view of a unit. It has to either a. backup b. turn into some angle until the path is in its "front" view. Which in turn may cause it to run in trouble again. 2. So is my own idea kinda stupid or does anyone have some smart remarks on how to overcome problems like the ones I described?

##### Share on other sites
The actual problem isn't too difficult to solve (it's been solved many times over in mobile robotics). The basic problem stems from the partitioning of the motion planning problem into a path planning problem and a path following problem. If the motion problem is solved in the configuration/action space of the agent, you don't get this problem. Anyway, since you have it...

Most path planning systems churn out a piecewise linear representation of the path. Your first option is to change this by smoothing the path, or replace it by a spline curve that has a constrained parametric velocity no greater than the maximum velocity of the agent. The agent will then be able to trivially follow the path by always choosing a step that maximises its velocity along the path.

The other option is, as you indicated, to add an additional behaviour to your agent so that it preferentially stays over the path. You can do this by adding a controller that minimises the across path distance while maximising the along path velocity. This is essentially a steering behaviour, although traditionally in robotics you wouldn't use a Reynolds-like implementation; you'd write a simple outer loop controller for the distance minimisation encapsulating your inner loop velocity controller... and use a simple PID to damp the outer loop response. Since you're not doing robotics though, you could probably get away with a simple steering behaviour implementation of this control paradigm.

Cheers,

Timkin

1. 1
2. 2
3. 3
Rutin
15
4. 4
khawk
14
5. 5
frob
12

• 9
• 11
• 11
• 23
• 12
• ### Forum Statistics

• Total Topics
633660
• Total Posts
3013223
×

## Important Information

GameDev.net is your game development community. Create an account for your GameDev Portfolio and participate in the largest developer community in the games industry.

Sign me up!