AI in Games

Permabanned
Joined
3 Oct 2009
Posts
14,033
Location
North Wales
Since playing multiplayer games has become a major pasttime for me, I have found myself increasingly unable to sit down and play a single player game for any decent period of time.

Why?

The AI. Take Borderlands 2, very pretty to look at game, terrific gameplay, awesome pretty much sums up the game. But the AI is shockingly poor. The game looks great, sounds great, plays great but when you go up against the same copy and paste enemies it just feels grating to me.

Is AI that effectively mimmicks human behaviour realistically possible? I feel Unreal Tournament 99 has fantastic AI compared to a lot of modern games but a lot of develoipers just give me the impression they dont think its a important area to focus on.

Borderlands 2 isn't the only culprit I haven't singled it out for any reason other than I played it before making this thread and was stunned how dated the AI mechanics were.

AI should be a major focus point for game developers IMO, it really adds to the experience and immersion and turns a solid game into a epic one.
 
Last edited:
The short answer to your question is no, if by 'realistically possible' you mean within the confines of a typical game development budget/lifecycle.

A key factor is that every game is different in terms of physics engine, maps, weaponry etc etc so the AI needs to have at least one of the following built largely from scratch:
-Be heavily customised to suit that environment (very time consuming especially in modern games that have much more complex environments)
-Have advanced learning capabilities (not worth the investment)

If you compare Borderlands 2 to UT there is a world of difference in terms of complexity, not least because the possible scenarios that the AI has to cope with is exponentially greater in all but the most contrived of sequences. And more compute power doesn't help much when the key blocker is actually having a human spend the time to code sufficiently robust algorithms to cope with all the different variables (many of which the AI coder won't even be aware of because he isn't working with a finished product). The irony is, it is humans that are holding back AI, not computers :)

edit: Personally I would be very surprised if we see genuinely top notch AI in a complex FPS game anytime in the next 10 years.
 
Last edited:
I won't go near single player games anymore, absolutely no fun in trying to outwit or outskill a computer... where is the sense of satisfaction in it ?

knowing you beat a real person who might be sat their being grumpy about it is what makes gaming fun.

i wouldnt even play video games if multiplayer didn't exist.

even in games where the ai is meant to be awesome... it still sucks.
 
Its quite a complicated one - hardware these days often has the spare cores both CPU and GPU compute to make fairly advanced AI feasible.

I suspect one factor that is holding it back is that complex AI can be unpredictable and result in a lot of time spent making sure it behaves properly, the bots in q3 and AI in Oblivion could do some pretty mental things (lol) if you took the constraints off and left them to their own devices - some of the more advanced behaviour for both was unfinished due to time constraints though.

EDIT: I think one issue is that AI programmers tend to get caught up in the highly theoretical side of it, neural networks/nodes and all that stuff... its possible to make fairly convincing AI with some simple hacks (i.e. throwing in some random chances of different behaviour, etc.) but AI programmers seem to take themselves too seriously to do stuff like that.

EDIT2: For instance back in the day I tweaked the Quake 2 AI to do:

Jump visualisation to navigate objects to get to the player
Try and predict where the player would head to next either to try and cut them off or to shoot rockets/grenades into that area
Moral/Damage balancing so that if a lot of the AI around an AI were dying it would be more likely to try and fallback and find cover and vice versa be more aggressive if it "felt" like it was winning
Generally behave more aggressively especially in regards to hunting the player on loss of sight (also flanking).

Even fairly minor tweaks like that can make AI feel 10x more "alive"
 
Last edited:
I won't go near single player games anymore, absolutely no fun in trying to outwit or outskill a computer... where is the sense of satisfaction in it ?

knowing you beat a real person who might be sat their being grumpy about it is what makes gaming fun.

i wouldnt even play video games if multiplayer didn't exist.

even in games where the ai is meant to be awesome... it still sucks.

Have you been to see a psychologist? I'd be worried if dominating other people was the only way I could have fun or feel satisfied. ;)

I recently bought a Wii U and it hit me whilst playing Super Mario 3D Land that I hadn't had as much fun playing a game in years (and the AI is extremely basic), it reminded me very much of gaming in the early 90's when the emphasis was purely on fun rather than realism.

I've been hard on Nintendo in the past but I think they still hold true to what gaming was originally about, a pasttime. Most of the rest of the industry seems to have evolved towards creating realistic simulations and competitive environments where everyone is expected to compete against one another.

I find it hard to enjoy competitive online gaming because you generally have to be on your toes all of the time and you can't play how you want to, you have to play in the way in which works the best. My favourite types of multiplayer games are ones which involve team work (I love helping other players by being a medic and giving ammo and stuff like that), or co-op against AI like WoW.

Online multiplayer is probably the reason why AI hasn't improved greatly in recent years, it's time consuming but like I said Nintendo are proof that you don't need complex AI routines to make a fun game.
 
Last edited:
^I'd go further than that and say you can ONLY make moderately-convincing game AI via the use of hacks and pre-programmed behaviour. Humans know what tactics can be effective whereas game AI typically doesn't (in most cases there are no feedback loops at all).

Regarding complex AI being unpredictable I think one factor at play there is that humans are very good at 'pooling' similar behaviours/tactics so we can make a decision about whether it is worth doing or not. So for example we would instantly dismiss a huge number of permutations because we know from experience that it is unlikely to be successful. Whereas an AI might look at 100 permutations (slight variations like a very slightly different route from A to B) and decide that one of them is viable.
Of course, in the (very) long term this could actually turn out to be an advantage because it means an AI may not dismiss valid tactics out of hand like a human might.

Generally speaking I find a key flaw in AI is usually that if a goal is potentially achievable (lets say, taking an important item like an armour or weapon) it does not appear to adequately use knowledge about other players to determine how risky it is. A human player will be wary of rushing predictably to collect the item if they know a strong opponent is nearby, as an opponent could be lying in wait with a powerful hitscan weapon, or spamming explosives in that direction.

Audio cues are a good example of something humans interpret based on experience, i.e. I know that if I hear a certain sound that there are only a small number of viable tactics that the opponent could be using. Lets say I hear grenades being fired, I'll be expecting them to be heading for an exit I could come out of. Whereas an AI might not 'get it', it just knows grenades are being fired but does not consider this to be a serious threat (or rather, it doesn't associate that threat with 'danger zones' it needs to avoid).
 
http://youtu.be/gT_45RFFTx8?t=6m42s

AMD did some AI on the GPU, way back in the 4870 era, but nothing ever since. Modern GPUs should allow us to have more complex and in larger number NPC, advanced physics and so on, but it would not happen for a while since all major development doesn't go through unless it's on consoles or at least a larger install base. Perhaps we'll get a glimpse with the "next-gen" consoles, however, I wouldn't hold my breath until then.
 
I won't go near single player games anymore, absolutely no fun in trying to outwit or outskill a computer... where is the sense of satisfaction in it ?

knowing you beat a real person who might be sat their being grumpy about it is what makes gaming fun.

i wouldnt even play video games if multiplayer didn't exist.

even in games where the ai is meant to be awesome... it still sucks.

Where to even start with this? Some people don't only play games for satisfaction of winning or completing it. Some people play for fun, a compelling storyline and character development. Do you watch movies?
 
Indeed.

I hardly play multiplayer now because it all feels so fleeting and pointless. Sure you might win a round, then you might lose a round.

At least with singleplayer you get to experience a (sometimes) decent storyline.
 
(in most cases there are no feedback loops at all).

This is true in most games and very unfortunate. Hardly any games try something different if their current strategy is failing.

We've all played those games (esp 1st person), where you make for yourself a "killing zone". One after the other the AI players run into your trap, and at the end of it you've got a huge pile of bodies all in the same place.

With any kind of feedback, the AI might say "Have tried this twice now, both epic fail, let's not do that again." But then you face the problem of the human player learning to manipulate that feedback, if he understands how it works, to his own advantage.

There's just no getting away from the fact that players can see the big picture, can formulate new strategies, and learn. An AI can do none of those.

At least not the kind of AIs that are feasible to develop for a computer game (time and money and all that).
 
The complexities of AI are over my head but I will say the most intuitive looking enemies I've seen are from the FEAR series.

Maybe this a dumb question but is AI specifically written for a game and map? Or is it the case of a single set of instructions across all maps?

If the latter is the case could the ai engineers not just be improving on their initial code with each subsequent iteration?
 
kind of a shame that games these days are either a pushover, or the ai just cheats.

i always just play on easy these days partly because i'm not very good but mostly because pretty much all the games i play don't get any more intelligent, they just cheat.
 
I won't go near single player games anymore, absolutely no fun in trying to outwit or outskill a computer... where is the sense of satisfaction in it ?

knowing you beat a real person who might be sat their being grumpy about it is what makes gaming fun.

i wouldnt even play video games if multiplayer didn't exist.

even in games where the ai is meant to be awesome... it still sucks.

Oh my....
 
The complexities of AI are over my head but I will say the most intuitive looking enemies I've seen are from the FEAR series.

Maybe this a dumb question but is AI specifically written for a game and map? Or is it the case of a single set of instructions across all maps?

If the latter is the case could the ai engineers not just be improving on their initial code with each subsequent iteration?

In general they are written to do specific tasks based on navigation mashes and the sort. On simple games, corridor shooters, is not that complicated to do AI because as a developer you can control most of the circumstances, but when you go open world, like ArmA for instance (which at the moment I believe has the most advanced/complete AI - although it can suck big time), it gets very complicated. However, I don't see a good AI as one that replicates the exact human behavior, but one that comes very close to it. If you look at games these day, what pops ups first is that for instance, a NPC doesn't use cover or retreat mechanics as a human will do; doesn't use sight or hearing as means to spot the enemy, but rather simplistic cheats. Also, almost all games don't simulate the AI per individual, so after you're spotted by a guy, all enemies know that you're there. So, basically what a good AI requires is data collecting thorough sciences and mimic better human behavior by using more secondary states between the major ones: take cover, engage.
 
Maybe this a dumb question but is AI specifically written for a game and map? Or is it the case of a single set of instructions across all maps?

Both. Some deathmatch bots for example rely on waypoints created by human players (to 'teach' them effective ways to move between locations).
 
Where to even start with this? Some people don't only play games for satisfaction of winning or completing it. Some people play for fun, a compelling storyline and character development. Do you watch movies?

Storylines in games are still miles off top quality cinema, yes it's getting better but until the technology is at a level where the characters, animations, lip sync is as close and fluid as an actual movie or top level cgi then it's not going to immerse me at all.

Games just don't work when trying to have deep story lines or character development, it's always so hammily done relative to proper cinema... And that's to be expected because the technology isn't there yet. When it is in a couple of decades or whenever then I will see the appeal... That's going to be quite so,em wait though !
 
Storylines in games are still miles off top quality cinema, yes it's getting better but until the technology is at a level where the characters, animations, lip sync is as close and fluid as an actual movie or top level cgi then it's not going to immerse me at all.

Games just don't work when trying to have deep story lines or character development, it's always so hammily done relative to proper cinema... And that's to be expected because the technology isn't there yet. When it is in a couple of decades or whenever then I will see the appeal... That's going to be quite so,em wait though !

A few games have done it pretty well, granted it is something I feel is a failing as a general thing in games.
 
Trespasser was a good (early) example of why complex AI can run amok...

4. AI problems

The largest problem with the AI system was that its progress was blocked by a lack of dinosaurs with which to test it. The first time a dinosaur made the transition from a separate test app into the game was in early 1998, and there was significant missing functionality which prevented the completion of visually-important AI behaviors like howling and glaring for much longer. The first quadruped went in around the early summer of 1998, about four months from the then-intended ship date (as it turned out we slipped by about another month).


Trespasser's team didn't have enough time
to implement dinosaur emotions. [zoom]
The dinosaur AI was a state-based system where, based on an emotional state, but it became apparent once dinosaurs were working well enough to put into levels that the differences between the activity states were not discrete enough. Dinosaurs were governed by a set of emotions which theoretically would prompt them to pick appropriate responses at any time. However, in practice they would end up oscillating rapidly between many activities, sometimes even literally standing still and twitching as they tried to decide what to do. Making a usable dinosaur required disabling all but one or two of their activities. This allowed aggressive dinosaurs to really be aggressive, but it also meant that the most dinosaurs were as single-minded as the traditional video game monsters we were trying to one-up.

The AI system suffered from the lack of a clear game design. There are two scenes in the Jurassic Park movies which demonstrate quintessential dinosaur gameplay: the scene in JP where the kids hide from raptors in a kitchen, and the one in Lost World where Jeff Goldblum deals with several cautious raptors in the ruins of the town. Both of these scenes rely on dinosaurs which can be fooled by ducking behind objects and which can home in on or be distracted by localized noises. Neither of these two fundamental abilities are actually present in the Trespasser dinosaur AI -- the dinosaurs instead have a simpler and more industry-standard detection radius which doubles as sight and hearing and is not blocked by objects in any way. Without a design spec calling for the movie-like behaviors, though, the AI development went in directions which ended up being largely unsuitable for gameplay. This unsuitability wasn’t even discovered until a few months before ship, when there was only time to work around it rather than rewrite it.

In addition to more sophisticated senses, the dinosaurs were really lacking an ability to emote. So much of an animal’s behavior consists of its various postures and reactions to stimulus that it seems surprising that all Trespasser dinosaurs can do is put their heads back to howl, turn to look at their target, bite at an enemy, bend to pick at a carcass, or walk with a weird limp. There was a circling behavior which was cut because the animals became too intent on circling, but there was little else. Given that none of our dinosaur behaviors were pre-animated and therefore didn’t require large amount of art time to implement, it should have been simple to add in many expressive behaviors which are typically never seen in games. These, unfortunately, are the kinds of features which either have to be in the specification from day one or which can only be added if there is time remaining after technology is completed and stable.

I remember being so in awe of the potential, shame the game is far more memorable for the moronic behaviour of the state of the art AI dinosaurs... And boobies

e: More interesting reading here http://www.gamasutra.com/view/feature/131746/postmortem_dreamworks_.php?print=1
 
Last edited:
Back
Top Bottom