AI: Attack, Defend, Retreat, Guard and Search

Apprentice
Posts: 16
Joined: 2008.01
Post: #1
Hi,

I'm stumbling into the AI area, I have a team game where my team members are "helping" the player against the baddies. Effectively they are using the same AI as the baddies themselves except selecting the baddies for attack while the baddies select the goodies for attack.

If it was all out war then it would be one level of AI but trying to simulate a range of behavior is not so easy...

What I have so far is:

*Random walk and walk to particular destination Bored
*Collision detection against walls and other sprites
*Fleeing behavior if character is hit (and hurt not killed)

Then comes the more aspiration behavior:
*Guarding an area and watching out for the enemy (easy except I still want the baddies to wander around a little)
*Attack enemy (move and shoot) easy
*Defend area (none stand and shoot) easy
*Retreat to new defensive position (retreating but still giving some covering fire) - tricky
*Searching for resources like health packs

The latter two require some form of path finding algorithm and cooperation.

Has anyone done any work in this area and have any pointers?
Quote this message in a reply
Member
Posts: 283
Joined: 2006.05
Post: #2
I'd have a look here to start with: http://www.red3d.com/cwr/steer/
Quote this message in a reply
Apprentice
Posts: 16
Joined: 2008.01
Post: #3
Maximile, thanks. Wow that is a lot to wade through. So does everyone use Opensteer? Anything simpler? :-)

I noticed that Windows downloads 11000, Linux downloads 1100, Mac downloads 888. Roughly similar number of Mac and Linux developers but yet 98% of developers are on PC? This either means:

a) Hey, we're doomed! or
b) There is a great opportunity here!

I'll go for b) for the time being.
Quote this message in a reply
Member
Posts: 283
Joined: 2006.05
Post: #4
I don't like the look of Opensteer myself. But there's a lot of relevant links from that page (though many are now dead), and the Java demos are totally awesome. The explanations that accompany each one might be enough to get you started.
Quote this message in a reply
⌘-R in Chief
Posts: 1,237
Joined: 2002.05
Post: #5
OpenSteer might be a liiiiittle hefty. It's neat, but I don't think you need it. All of what you describe can be done with a state machine and some simple algorithms. A* on some predefined navigation meshes will do. At least that's how I'd try to tackle it; It's exactly the kinda thing I've wanted to actually sit down and write again for quite a while.
Quote this message in a reply
Apprentice
Posts: 16
Joined: 2008.01
Post: #6
Hi Freaksoftware,

I've learnt about A* for the first time today from the links from Opensteer. That seems to be the norm. I've just come across this page (via google) http://www.gameai.com/ which seems to be pitched at my level! :-)
Quote this message in a reply
Post Reply