I can start by saying what I think is
bad AI, and that is AI that is just plain annoying. This would include walking straight into the player and sticking there; having perfect reflexes all the time; seeing regular players or power-ups through walls; etc. Good AI, on the other hand, include some limits to make the AI seem more realistic. They do not need to be mistaken for human to be good, they just need to not be cheap on the player.
If I have a bear enemy that I stick in a forest level, I might want it to sleep, walk a bit back and forth at random, and attack if approached. Now, all that AI needs is to move and pause at random, and chase the player if he comes close. I'm thinking I shouldn't make it react instantly, though, but take a random time from 0.5 to 2 seconds (depending on if the player is in front of or behind it, perhaps?) before it charges. This gives the player crucial time to retreat, plus it makes the bear look slightly more realistic and not like an
automated killer-bot.
Now,
smart AI is a tricky question. Being smart in a game can be defined as doing things that lead to your victory without incurring too much of a risk. In that case, a shooter AI that stands right next to a corner, then jumps out and sprays its machine gun at an unsuspecting passerby is smart. It is also a bit frustrating, however, because by ambushing someone at that distance, it will most likely be too late for any retaliation. Most AI I have seen (and made) falls into this, though: they walk around a bit, target the closest enemy, and attack as long as they are in range and the enemy is not behind cover.
It's been said before in Game Design, but smart AI is usually circumstance-based. It would change its approach based on its current status. Target in sight, but not engaged? Sneak a bit closer first. Spotted? Don't just rush in and die, try to strafe and cover. Low on health? Retreat while spray-n-praying a few shots to prevent pursuit. Enemy behind cover? Throw grenade next to the cover. Enemy on the rooftops? Stick close to the wall and try to find a ladder.
...Etc. Basically, put yourself in their situation and think "what would I do?". I know for a fact that the Combine AI in Half-Life 2 is based on military tactics, where the bots will actually use group tactics. Some stay behind cover and shoot, while others strafe across the field. That's right: they provide cover-fire each other. It's a shame that most of the game's areas are rather cramped, because the AI doesn't get to shine that often. Via an aerial view of a constructed battle, one YouTuber showed that the AI not only does the cover/advance thing, they also try to flank and use their limited grenades where appropriate (enemy cluster or enemy hunched behind cover). When plying against them they don't
feel terribly smart, but occasionally you go "woah there" because one sneaks up on you.
In one of my own games, I have found that sometimes the AI does things I would not have expected it to, but that it is perfectly possible for both it and the player to do. It's a platform game with a bunch of special abilities. The Fire power gives you regular flames and an explosive fireball to use. Now, the AI would often spray fire while running towards you, making you run and jump. Once you jump, the AI often jumps too, and I've found that the chance is high of it choosing to randomly throw a fireball around then. And in the air, you simply can't dodge as well. This goes for other projectile powers too, so we have an AI that essentially combo's its enemies without meaning to. The only AI it has for using powers is to judge distance first so it don't waste energy on short-range powers when the enemy is far away. But it acts mostly the way a player would (thought it sometimes kills itself by accident), so I'd say it's successful.
Edited by Katuko, 26 May 2012 - 07:48 AM.