Simple RTS Pathfinding
by John Eckhardt · in RTS Starter Kit · 11/07/2006 (2:23 pm) · 0 replies
I've completed a working resource for RTS Pathfinding. Just a few script files, and it's quite easy for beginners (like me) to get this to work.
It allows your units to find their way around rectangle-bounded objects from their starting point to their goal. It works with multiple units, and multiple objects. As long as the objects are separated by enough space to walk between them, it'll work.
The Link
TODO:
Create a way to avoid objects placed directly next to eachother. Should be pretty easy, all I think I should have to do is put in a loop to check the if the path to the corner it's heading has another object in the way, and if so, calculate the best way around that, and then check if that best way has an object in its way, and so on.
Currently, if you tell a unit to travel onto a static object it tries to avoid, it will walk around and around and around it in circles, so it would be nice if it stopped at the closest point to its destination (or maybe the first place it hits the object.) Should be pretty easy, but I haven't thought about this one yet.
It allows your units to find their way around rectangle-bounded objects from their starting point to their goal. It works with multiple units, and multiple objects. As long as the objects are separated by enough space to walk between them, it'll work.
The Link
TODO:
Create a way to avoid objects placed directly next to eachother. Should be pretty easy, all I think I should have to do is put in a loop to check the if the path to the corner it's heading has another object in the way, and if so, calculate the best way around that, and then check if that best way has an object in its way, and so on.
Currently, if you tell a unit to travel onto a static object it tries to avoid, it will walk around and around and around it in circles, so it would be nice if it stopped at the closest point to its destination (or maybe the first place it hits the object.) Should be pretty easy, but I haven't thought about this one yet.