Game Development Community

Pathfinding with RTSUnits

by Dan Chao · in RTS Starter Kit · 01/23/2006 (11:04 am) · 4 replies

I noticed that the TDN pathfinding page wasn't finished yet and it doesn't seem like the AIpack is ready yet, but I'm currently doing a schedule and wanted to know the progress of pathfinding. I just want to get a rough idea of how much I'm going to have to implement and how much I won't.

the features I need are fairly typical of an RTS. when the player clicks on a location, the unit actually pathfinds to that point, instead of taking a straight path there, because often, a straight path doesn't exist. pathfinding also takes into account dynamic objects such as other units which gives the illusion of collision as well as things like trees which can be potentially be cutdown. trees also can be in large groups and some optimization should be in there to aggregate large areas of mostly static objects (ie trees don't move but can be cutdown and regrow).

thanks,
dan

#1
01/23/2006 (2:23 pm)
I know there is something called an AI Pack in the works, not sure when this will be done, or whether it has that type of group support. Pathfinding a single objects is one thing, pathfinding a formation group is something a bit more challenging (good game developer articles on this).

alternatives are something like PathEngine, which has dynamic object pathfinding, well optimized, but does not have the group formation pathing so you would still have to add that.

Plus most pathfinding stuff doesnt take into account the size of the unit (like its too wide to go between the
buildings, whereas the infantry unit can) so you usually have to add that as well.

not sure if there will ever be a complete solution anytime soon but there building blocks available to piece it together your self.
#2
01/23/2006 (3:10 pm)
I'm not too worried about the formation pathfinding because I'm not planning on preserving the formation code for unit movement.

I took a look at PathEngine and it doesn't quite seem priced in the range of an indie dev house. is there an ETA on the AI pack?
#3
01/23/2006 (4:12 pm)
I'm too looking at the best way to implement pathfinding. Ideally I'd like to prevent units moving across terrain that's too steep and allow certain textures to have properties that can slow down a unit or prevent it moving across it but I've not really investigated the feasibility of this yet anyone tried anything like this? Anyone got any pointers on where to begin implementing this kind of thing?

Also, slightly off topic, how is the RTS packs support for flying units that stay a fixed height above the terrain? I've not checked this either yet.

If I can knock some basic RTS feature together I don't mind putting them up as resources but right now I've not even properly researched this stuff I'm afraid and there doesn't seem much on the subject out there.
#4
01/24/2006 (9:11 am)
Oh another piece that I hope someone address (like this ai pack) is the ability to quickly and efficiently
update the pathfinder when a object (like a building) is destroyed or added to the playfield.

so as you build up your base it continually adjusts what areas are availabe for pathing.

I only bring this up because Ive seen a lot of pathfinding programs that only generate the
paths once on map load, or that have to run an external program on the map to compute
open grid locations. This would not be useful at all to a dynamic game where buildings
come and go (like just about any RTS game).

not sure how the aipack was being structure but at one point it sounded a bit static (doing the calculations
one time at map load up). so on top on not knowing the status, im not sure it would even be useful
at this point. until i hear more about how it was implemented. (other things are important too like
dynamic object pathfinding. ie multiple units crossing paths as they move to there location, since most
pathfinders are based on a static grid they usually dont work well for that without a lot of tweaking).

hopefully someone can chime in on the aipack thing, it was looking pretty cool for awhile there.