Path planning with a minimal turn radius

Started by
1 comment, last by ferrous 10 years, 3 months ago

So this is a small prototype I have made for calculating a path with a minimum turn radius. I should make the radius a slider, but haven't yet.

I haven't actually optimized it much yet at all. For example, my checks for whether the path is over a tile are laughably terrible, I haven't swapped to Xu's Circle algorithm yet, or bresenham/Xu's line.
Also, camera controls are basic RTS style, wasd or arrow keys to move, mouse wheel zoom in/out.

The big obvious known bugs:
1. Weird loopty loops are sometimes chosen as best path (floating point error?)
2. the line check is wonky, and should do width as well, so right now you can pass between two diagonal blocking tiles (xu's line should fix)
3. I got lazy and don't animate the tank moving on the path.
4. Occasionally you can drag the arrow/facing to a place and it chuuugs. But doesn't enter an endless loop, at least.
Advertisement

You forgot a colon after http in your link. Looks good so far :), any particular feedback that you're looking for?

Oops, link should work now.

Partially I was just excited to get it working, and wanted to make sure it wasn't too confusing as a test app.

I think I'll need to add the ability to add waypoints, as the path can radically change as the distance gets farther. On the bright side that will also make the path finding faster, as then when the user drags the destination around, I only have to recalculate from the last waypoint.

This topic is closed to new replies.

Advertisement