So what makes the AI “good” and I am talking about enemy moster AI here. I mean sure the AI should not just randomly stop or walk the completly wrong way. But what gets you sold on AI what dings do you expect a monster does when it attacks you or when its chasing you? What are key features you find importent when slaying your digital beasts?
It really depends on the type of enemy, I’d expect it to behave in a way that is consistent with what it is. Humans should behave in a ‘human’ way based in the level of trainmen they would’ve had e.g. Civilians would be behaving like some sort of neighbourhood watch with guns, military will be acting in a disciplined, trained way etc. A monster that hunts by stealth should be stealthy & not just blindly run at the player etc etc.
One thing I noticed while playing Jagged Alliance 2 was that human enemies will occasionally panic and run back and forth when outnumbered, especially if they’re lower-level grunts. Having them make mistakes like a human under pressure isn’t “smart”, but I’d prefer that to “human” enemies that are unbeatably intelligent.
Gauging and responding to threats is another thing. Half Life 2’s gunships are programmed to focus on the biggest threat to them - if you launch missiles at them, they will focus on the missiles instead of you. That can be exploited by directing the rocket to fly in circles around them, but on the harder difficulties (which I haven’t tried yet), they apparently come in pairs.
I mostly want them to react in believable ways to whatever’s going on. I remember in Oblivion, I got myself to the point where I could attack while completely invisible. So I could go up to pretty much any random bad guy, and start toasting him with flames and frost bolts and anything else, and he’d stand there saying “who’s there?” If I were suddenly being attacked with flames and frost and whatnot from something I couldn’t see, I’d sure as heck do more than that… I’d either start swinging in random directions, or dropping AofE spells, or failing all that, run like mad. But these guys just stand there and take it until they’re dead.
This is really in the same category as NPCs/monsters who get stuck running into walls, or have some simple exploit you can exploit over and over again. Basically, I think it’s not so important for AIs to be smart… they just shouldn’t be stupid!
Thanks for the input guys! One last thing what do you guys thing AI should be like in a game like Left 4 death or CoD zombies. A game where the AI is after you?
And what do expect that a friendly NPC is capable of. So lets say the villages in skyrim or the citizens in GTA. What do expect from them?
For starters, I’d expect them to actually realise when they have a bucket placed over their head ![]()
EDIT: I’d also expect them to not overreact if you so much as glance at a worthless item they own, but only react if you actually steal it.
Haha lol, now as you say that my AI would completely brake if it had its head covered by lets say a bucket since all the raycasting is done from the heads points of view. ;p
I was always taught, that good AI loses in a way that the player finds fun. There’s a lot of subjective terms in that sentence, and much relies on the game in question, so it may not be as helpful as it could be…but, it’s a good rule of thumb. Does your player have fun in their conflict with your AI? If so, it’s probably good.
The key with AI is to use it in such a way that it appears much more intelligent than it really is. AI is probably the most “smoke and mirrors” thing about game development.
The words to live by are: “AI is never meant to win- it’s meant to be fun to defeat.”
For instance- check out this video of the introduction of the “assassin” enemy in Dark Souls. Dark souls enemy logic isn’t smart- that isn’t what makes the game challenging. What makes it challenging is the way it uses it’s enemy types- giving them different weapons, putting them in different environment situations, mixing and matching enemy types. In the assassin situation, they just needed to set up that “jump from behind” moment once. It doesn’t need to happen ever again in any other encounter in the whole game.
Designing that moment just once tells you everything you need to know about that enemy and how it works and why you’re going to be filled with apprehension every time you see one of those guys. So rather than take all the time and effort to code for the assassin AI to “try” to jump the character from behind in any and all situations, they only need to set up a narrow street, open a door on trigger, have a guy run out, spawn a guy behind and have him jump the player. It’s simple, it’s dramatic, it sets a tone, and it’s fun!
You mentioned Skyrim NPC’s AI- sure it’s stupid! But that’s really to be expected. You could pour tons of time and effort into coding NPC’s to account for things like head buckets and other shenanigans, OR you could make 3 new enemy types for dungeons- which one offers more bang for your buck?
The “smoke and mirrors” part reminds me of a paper I once read on the AI of F.E.A.R. (it’s here, if anyone’s interested). A large part of what made the AI great in that game was just playing the right voice clip at the right time - there is no point in asking an ally “What’s your status”, if you saw them get blown into chunks of strawberry jam.
The main job of the AI is to loose to the player gracefully. Players are egomaniacs. The game is all about convincing the player that they have won by being awesome.
On one of my early game projects I forgot that. I coded a learning AI for a space shooter. I put it through thousands of simulated iterations. Except it wasn’t fun. It created an AI that fled the player for most of the game. When it got cornered it would launch volleys that the player could not avoid.
So keep that in mind. The AI only exists for the player. That means an enemy should be interesting to defeat. And an ally should not get in the way of the players strategy.
When the AI does what you would expect it to do. It just needs to feel like it’s thinking. You want to be able to anticipate what it’s going to do next, although sometimes you might be surprised. It will take on a personality. You will find yourself saying, “C’mon you stupid little bastard… just take one more step forward, you know you want to…” when it’s done right.
For a long time I looked at AI in games and thought “why are the enemies always so incredibly simple/stupid/predictable?” because I looked at it like any half-way decent programmer could easily make the enemies more intelligent behaving. However, over the past year (mainly due to discussions on the subject here on the GD forum) I’ve changed my view of this at least to a degree.
For games I think the value of AI is all for fun. And while that could be making the enemies behave more intelligently (in the hopes of providing more of a challenge) the AI could also be focused on simply making the game world more interesting. Enemies that behave in interesting ways. Whether it makes sense or not. Like they could have exaggerated reactions for example.
Maybe when 3 enemies are facing the player and the player takes out two of them… leaving a single enemy armed only with a knife. Now we could focus on the AI here to really try to make this enemy effective at the player. Maybe he tries to lead the player near a pool of acid and hopes to charge and knock the player into it. Or maybe lures them under a rope holding a heavy crate in the air and throws his knife causing the crate to drop on the player.
That would be one way and surely could be interesting. But it may be just as much fun if we simply make that last enemy look down at his knife look at the player scream like a little girl and take off running in a sort of cartoon fashion in the opposite direction.
what about AI for a fighting game .
Hmmm… what I posted was more suitable for Utility Theory. I believe AI for a fighting game may best benefit from a fuzzy logic design approach.
Ohhh fighting games are hard to make good AI for… Especially if you want them to actually win fight…
But you never want them to win- winning is never the point of AI, You want them to follow a specific strategy that sets them apart from the other combatants. One opponent is designed to pin the character into a corner where he cannot move, while another is designed to juggle the player in midair and deny him access to his ground moves. This makes each fight unique, and requires the player to modify his strategy enough to beat the strategy of the AI. If he does, he wins, if not, he loses- the victory of the AI is the byproduct, not the purpose.
If they never win the game is too easy… So it wont be fun unless your target audience it younger then 14or so. But lets take a game like age of empires the AI has to win a few times before you should be able to win or else the game wont be fun because you can beat everyrhing to easely.