Game Development Community

dev|Pro Game Development Curriculum

Plan for Phil Carlisle

by Phil Carlisle · 07/07/2004 (10:07 am) · 8 comments

AI is a really funny thing to work on.

Not because its particularly deep or interesting by itself (although it can be), but because its a combinatorial nightmare, this leads to what is known as "emergent behavior". But personally, I think what it leads to is "emergent stupidity" more often than not.

Which brings me neatly on to case #1:

So here I was working on DMBOT (the state machine for the simple Quake-like bot for the AI tests, but I'll let justin or one of the other guys explain that, just accept that its a bot for now :))

So anyway, DMBOT has this proximity sensor attached to him. What the proximity sensor does, is give him the ability to percieve objects within a certain distance of him.

So I'm testing his proximity senses (I was actually testing his combat skills actually, but you have to sense someone to engage in combat no?).

Now the emergent stupidity I was talking about in this case was quite funny!

As soon as I ran up to him (in my best blue-guy-crossbow-weilding manner), he immediately alerted , and as you would expect, he proceeded to engage me in combat! great!

Only, there is a snag. His rendition of "engage enemy in ranged combat" was to point straight down and start shooting the floor beneath himself until he killed himself with splash damage.

Not so good I think you'll agree.

So while pondering why this was all going so stupidly wrong, I put loads of debug echo's in the script side of things to determine what he thought he was shooting at.

Strangely, initially it looked like the problem was that he was actually detecting himself as a threat and engaging himself in combat (and the behavior definitely suggested that he was trying to get a good bead on his own position to try and shoot at it).

On further investigation, that turned out to be a red herring, as I'd simply made a booboo when typing out the debug info and I was passing the AI's id instead of its target.

So what was it?

Well, turned out it was a math error when calculating the pitch angle between himself and his target, easy! :)

I suspect that before the whole thing is over, the AI's will have done so many truly stupid things I'll have a catalogue of "the most stupid AI moments" to tell you.

Anyway, thats this one over with. I'll leave you with a candid snap I just had to take with DMBOT having a good old blast away!

www.zoombapup.com/upload/suicide2.jpg

#1
07/07/2004 (10:32 am)
Heheh.. Gotta love the bots!
#2
07/07/2004 (10:34 am)
Heh. It would have been real funny if he was really attacking himself. Although it may have been harder to debug the root cause :)
#3
07/07/2004 (10:35 am)
Yeah, youve got to admire the sheer dimwittedness of a bot thats so dumb it attacks itself :)
#4
07/07/2004 (10:45 am)
Phil, you sure he wasn't just really depressed? ;)
#5
07/07/2004 (11:37 am)
I took (and TA'ed for) several AI classes in college. Learned a little about neural networks, alpha-beta pruning in brute-force search trees, heuristics, pattern recognition, genetic algorithms, various pathfinding techniques, the game of Go, and LISP. Lots of LISP.

ANYWAY --- one of the few things that I REALLY retain from those classes a decade ago was something the professor explained that getting the AI to generate 'smart' behavior was easy... 80% of AI programming was "preventing it from making stupid moves."

My favorite AI moment was when I was experimenting with genetic algorithms one night to see if I could come up with some general-purpose heuristics for Jet Moto early in its development. So I left the Playstation development box on with the AI running lap after lap. Well, not really --- when I left, they STILL hadn't figured out how to finish a lap yet.

The next morning I came in the door, prepared to do a dump of all the AI had 'learned' during the night. Something was REALLY wrong, I thought... they still weren't completing a lap. Well, actually, they were... somehow they'd discovered a bug in the track, a 'hole' they could exploit to take a massive shortcut through the race, then they'd go the WRONG direction to just barely touch they waypoint, and VROOM - on to the finish line.

We all got a big kick out of that one.
#6
07/07/2004 (11:42 am)
That was good for a mid-afternoon chuckle...
Thanks Phil!

- Brett
#7
07/07/2004 (1:51 pm)
Excellent insights into the debugging process (red herrings catch us all from time to time). It's great to see some of them documented as it's easy to pass the wrong value to a "debug" line like echo.

I think you should also win an award for making the plainest of all Torque screenshots. Between the blue-men and flat green grass and plain blue skies, it's hard to imagine a more non-Torque looking Torque screenshot.

-Ner
#8
07/10/2004 (10:36 am)
lol, sounds like you're having some fun there Phil!

Dan - yeah, I still love Phil's minimalist debug testbed. Those blue box guys kick ass!