Sign in to follow this  

Path planning with a minimal turn radius

Recommended Posts

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.
Edited by ferrous

Share this post

Link to post
Share on other sites

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.

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