AI scouting

Started by
2 comments, last by IADaveMark 15 years, 10 months ago
Hi all, I'm designing the AI for my RTS game. Therefore an efficient scouting AI is needed. I mean, when the game begins, the player is supposed to explore the area and find gold mines etc. I actually don't know how to tackle the problem. I have a heightmap-based terrain. For pathfinding there is also a regular grid of nodes which store visibility information as well (visible? visited?). My only idea was to iterate all nodes and find out which were not visited yet. Then send some units there. However, I think this is a very inefficient approach. I'm happy about any suggestion ;)
Advertisement
Try to think of what you want exploration to look like. Picking an unvisited spot at random means that during exploration you have a bunch of random lines drawn on the map, it will work but it will look funny. I would weight locations near the base(in travel time not location, don't want the explorer to run half way across the map just to cross a lake when I don't know what is 5 feet away from my front door) above those far away so that you sweep out from your base. I am not sure I would even do path finding for him just give him a direction of travel that keeps him in the unknown and close to base.
If height confers a scouting advantage perhaps you could set them to continually seek out the high ground then task other scouts with filling in the blanks. Your heightmap is a preexisting potential field. The fill-in-the-blank scouts could use the unvisited/unseen nodes for lowering the cost in A*.
One method of determining exploration priority is to layer some influence maps. Lay one down that radiates from town centers. That will prioritize unexplored areas that are close to you. Then lay down a map that radiates from unknown areas, but zeros when it hits a visible square. That way, greater weight is put towards larger unexplored zones rather than the minutia. The third one is a distance radiating from the actual agent itself and is an inverse map. That will bias things that are close to the agent.

Note that the two main maps can be calculated for and shared by your team in general whereas the 3rd one is individually held.

When you combine the results of the three, you will get a combined map that pulls the agent to unknowns that are 1)close to him, 2)close to the base, 3)larger rather than smaller.

From a balancing standpoint, make sure that the "close to me" scale will take into account even the small stuff that is nearby, otherwise the agent may ignore single square unknowns even though he is standing right next to them.

There are two ways to process the path at this point.

1) Just pick a high-scoring place and move toward it.
2) Pick a VERY high-scoring place as the eventual goal, identify other high-scoring areas of interest that may be in the way and construct a path that moves you through them all. This is far trickier and doesn't necessarily give you that much more benefit.

Dave Mark - President and Lead Designer of Intrinsic Algorithm LLC
Professional consultant on game AI, mathematical modeling, simulation modeling
Co-founder and 10 year advisor of the GDC AI Summit
Author of the book, Behavioral Mathematics for Game AI
Blogs I write:
IA News - What's happening at IA | IA on AI - AI news and notes | Post-Play'em - Observations on AI of games I play

"Reducing the world to mathematical equations!"

This topic is closed to new replies.

Advertisement