• Listen to a special audio message from Bill Roper to the Hive Workshop community (Bill is a former Vice President of Blizzard Entertainment, Producer, Designer, Musician, Voice Actor) 🔗Click here to hear his message!
  • Read Evilhog's interview with Gregory Alper, the original composer of the music for WarCraft: Orcs & Humans 🔗Click here to read the full interview.

navigating creep AI through a maze

Status
Not open for further replies.
Level 25
Joined
Oct 18, 2008
Messages
945
my terrain is a randomly generated maze of fully walled off cells which each get some randomly selected walls removed at game start. here's a picture:

JPGRnq0.jpg


I want my AI to move its units around in a way which respects the nearby walls, not getting stuck in corners or flocking everything through a few chokepoints as would happen if they were told to just automatically path to random far away locations.

ideas?
 
Level 16
Joined
Mar 25, 2016
Messages
1,327
I assume, that there is some kind of grid, the maze is based on. I don't know if you want the AI to move like it knows the shortest path or more like following an algortihm to find the right path at some point. If you want the shortest path, the normal warcraft 3 path finding is your best option I think. Maybe you can use a dummy unit, that is ordered move towards your target point and the AI units are ordered to follow that dummy unit and you manually control them to move in a good way, while you use the dummy unit to find the shortest path.
It's definitely not easy what you are trying to do.
 
Level 11
Joined
Jun 2, 2004
Messages
849
Pathfinding is no simple task. The regular wc3 pathfinding engine should respect your walls provided they're implemented the normal ways (path blocking doodads or buildings), but of course they'll always magically know the shortest path.

It's hard to tell what you actually want help with. We can give you something low level (like an actual A* algorithm that will find the shortest path from node to node) or high level (vague advice on how to use regions or whatever). Do you want the units to walk down the middle of the lanes instead of cutting corners? Do you want them to go from any arbitrary node to any other arbitrary node in a single command, or do you want them to choose a direction every time they enter a new node? etc.
 
Status
Not open for further replies.
Top