Article

AI in GTA IV: Nothing Spectacular

I’ve written about AI in video games and their real-life impact a while ago, with the conclusion that it is quite basic and does not really contain “intelligence”. Now with all the hype around the newest version of the Grand Theft Auto series, GTA IV, and a development budget of about $100 million, lets take a closer look if anything has changed.

GTA is basically a sandbox game with a good story tucked on. As a gangster in a virtual city, this iteration it is Liberty City, modelled after New York, you are free to roam around in all kinds of vehicles, from bikes, lots of cars up to military helicopters and do all kinds of things - most of them illegal, of course. Everything that is forbidden in the real world becomes not only possible, but a goal in GTA, from assassination tasks, drug trafficking, gang wars and - of course - car theft there’s everything there what the villain’s heart desires (I wont go into the psychological aspects here, but it is a real concern for parents and politics, especially the German government is pressing hard to ban Killerspiele).

Image Copyright IGN

There is a wide variety of actions in Liberty City, especially when it comes to driving and destroying things. Also, such a city simulation requires believable and complicated (artificial) agent behaviour, to allow the player to suspend his disbelief. And in fact, it is an interesting and often funny pastime to just watch non-player character (NPC) interactions, their discussions and police activity.

The general pedestrian behaviour and driving AI has improved considerably over GTA: San Andreas, but there are still the odd situations where agents don’t react properly. Some mention that the cover seeking behaviour of the police has some glitches, so that policemen in search for a new cover run around the side of the police car facing you instead of the back, or that they fall off buildings when you hide just behind the edge. However, these situations are rare and are often more funny than annoying. The AI, while not perfect, does it’s job alright. All the situations where you say “Wow, I didn’t think it would be that smart” are most likely scripted though, meaning that they have been predefined by the game designers and are not (fully) dynamically generated. Another indicator for the limitations of the AI system is the density of pedestrians, or rather, the lack of it. Similar to the previous incarnations, there are not nearly enough people or cars in the streets. Admittedly, this increase in crowd density is hard to implement correctly and is probably an effect of limited CPU power.

GTA4 is a good example of fake AI, artificial intelligence that only pretends to reason. This is very common in video games, as their primary goal is not to plan realistically and beat the player, but to provide enjoyment and make (smart) mistakes. This becomes apparent in how the game handles the appearance of police units. When your wanted-level increases, there are suddenly more police cars and cops around (especially for the higher levels), that come pouring out from behind street corners or are just there when you turn around. This behaviour, while perfectly legit for a game, would be useless in real life. All the steps which are most important for navigation and reasoning in robots and “proper” AI are cropped away in video games. Therefore there is -still- no possibility that non-player villain behaviour (would that be the police then, in GTA IV?) accidentally or even on purpose crosses over into the real world from a game AI.

Side note: As you may have noticed, I didn’t have a lot time to update AI Panic very often over the last weeks. At the moment I’m quite busy at the university, I have to hand in a kind-of-important internal report in about a month of what I’m planning to do in the next 2-3 years. Once this is out of the way, I’ll have more time for the blog again. Sorry about that!

Stumble it!

Popularity: 100%

Comments (12 comments)

You know what GTA IV is missing? Nukes. And rocket launchers. And troopers with rocket packs. Wait. That’s why Command & Conquer is better.

Michael Anissimov / May 8th, 2008, 18:44 / #

Sorry, they do have rocket launchers, but no tesla tanks, prism tanks, weather control device, etc. ;)

Michael Anissimov / May 8th, 2008, 18:45 / #

“GTA4 is a good example of fake AI, artificial intelligence that only pretends to reason.”

Isn’t that redundant? I mean, the computer pioneers in the ’40s and ’50s believed thinking machines were right around the corner, but today we know those predictions were hopelessly naive. We are very far (hundreds, perhaps thousands, of years) from creating genuine machine intelligence, so the term ‘artificial intelligence’ no longer refers to software that can really think, it refers to software that *acts* as if it can think. In other words, ‘AI’ already means ‘fake intelligence’ (rather than real intelligence created by artificial means), so ‘fake fake intelligence’ is just redundant.

Eric Tetz / May 8th, 2008, 21:06 / #

Eric: Depends on your definition. We are nowadays closer to true AI than we were 50 years ago, there are a lot of people who believe that Artificial General Intelligence (AGI) is only about 30 years away (look up Ray Kurzweils Singularity if you want to read into that). I personally tend to think they are right, but seeing where we are with classical AI (i.e., the logic based approach), it is still a very long way to go, if there is any at all. I see current brain research and the attempts to duplicate brain behaviour much more promising, especially as we now _begin_ to actually understand the brain, i.e., we can successfully read thoughts (albeit only in very controlled environments).

In current AI research, there are algorithms that are able to reason, for example with logical statements (inductive logic programming, constraint solver etc.), or numerical optimisation (bayes nets, artificial neural nets). Of course this reasoning is somewhat limited, mostly by missing background knowledge, which is not trivial to encode in a database.

However, this reasoning and planning stands in contrast to what we see in games and what i call fake AI.
Take for example the police behaviour i described above. It would be perfectly possible to build a planning system that allocates, controls and navigates police cars from the police stations to the villain (the player), by realistically using path planning and other optimisation algorithms. This behaviour could be called intelligent (AI researchers use the word “intelligence” usually in a very loose way), and it could no doubt be called an AI algorithm.

In GTA4, we dont have that. We are presented just the *illusion* of this behaviour, cars and cops appearing where they might be able to appear in reality. This “might appear” is controlled by a clever heuristic ,for GTA, that might be “behind the player, or around the next corner”.

So no, it is not redundant, there is proper working artificial intelligence, and there is fake AI, that only simulates a working AI to a (human) observer. In a real world environment the former works quite well, while the latter fails miserably. Spawning cops is not possible (yet :-) ).

Robin / May 8th, 2008, 21:34 / #

“We are nowadays closer to true AI than we were 50 years ago”

Well, of course we are, by virtue of 50 years having passed. ;) But that doesn’t tell us anything. It’s like saying you’re twice as likely to win the lottery if you buy two tickets; it’s true, but it doesn’t tell you anything about your odds of winning (for that, you need to know how many other people are playing). If it’s going to take us another five thousands years to create a self-aware machine, being 50 years closer doesn’t amount to much.

“especially as we now _begin_ to actually understand the brain, i.e., we can successfully read thoughts (albeit only in very controlled environments)”

We can see, roughly, which parts of the brain correspond to certain kinds of thoughts. This can show us which parts of the brain are responsible for certain kinds of computation, but that doesn’t tell us how the computation works, any more than knowing how a neuron work teaches us why Mozart was so good at composing.

This is a *really* hard problem, putting us face to face with our inherent cognitive limitations, the constraints on the amount of complexity we’re capable of dealing with. In Pattern on the Stone, computer designer Daniel Hillis talks about the affect of our limitations on the devices we engineer. We necessarily have to take a divide and conquer approach to complexity. We must be able to break down complex problems into simpler onces that we can understand.

For instance, software engineers use disciplines like ’structured programming’ or ‘object oriented programming’ to create large systems from layers of smaller, simpler components. The resulting systems are nowhere near *ideal*, they are wasteful, they are very brittle compared to natural systems, but they can be understood, we humans can create them. Programmers that don’t adhere to a disciplined approach produce so-called ’spaghetti code’, code in which unchecked interconnection between components overwhelms our intellectual capacity, resulting in code that can’t be safely modified by humans with predictable results.

Nature doesn’t share our limitations; it doesn’t think or design, it just uses brute force (over immense spans of time). The solutions it produces don’t have the kind of orthogonality between components that human engineered devices must. Good Calories, Bad Calories by Gary Taubes shows how decades of nutrition researchers have reached inconclusive or contradictory results in part because the systems they have been studying in isolation are interdependent in ways that are very hard to understand.

The brain is the ultimately example of this. Processing doesn’t follow neat little circuits in the brain, as it does in computers, it passes over the brain in a massively parallel wave. It’s complete spaghetti code, yet far more efficient and resilient than any human engineered device of similar size and weight.

Part of Hillis discusses the different between human engineered sorting algorithms, and evolved sorting algorithms (see: genetic algorithms), pointing out that evolved algorithms are often inscrutable to humans. He makes the point that if we can’t understand how something as simple as an evolved sorting algorithm works, it doesn’t bode well for us ever understanding the way computation works in the brain. I agree. I think it’s like trying to teach a dog calculus, there are some things that are simply beyond us.

However, Hillis also points out that this doesn’t necessarily mean we can’t build a machine intelligence. We might be able to use computers to *evolve* a machine intelligence. It’s not the same as designing one, we wouldn’t know how it works, but it’s probably our best hope.

The AI stuff we’re doing today is so painfully crude, compared to even an ant brain, that I have a hard taking any of the predictions of machine intelligence in the short term seriously. They were thinking it was just around the corner 50 years ago, and they’ll probably be thinking it’s just around the corner 50 years from now, but I think this is a problem we will be working towards for centuries, if not millennia.

“In GTA4, we dont have that. We are presented just the *illusion* of this behaviour, cars and cops appearing where they might be able to appear in reality.”

How the cop’s spawn is not related to the cop’s AI. Yeah, the game doesn’t have the cops drive all the way from the station to you, it just spawns them nearby when you’re not looking, but the cops behave autonomously after that, navigating the environment to get to you, taking cover, pushing your position, etc.

Though I get your point, that games often use scripted behavior to make the ‘general AI’ seem smarter than it is. For instance, you might have a boss who is scripted to run to safer ground when you get too close to his position. It’s not that he has a greater self preservation instinct than his minions, and having ‘perceived’ you through his general AI mechanism, chose a better location to wait out your assault. Rather, that guy has simply been scripted to run to position X,Y when you step on trigger Z. It’s a trick to give the base AI seemingly richer behavior.

Eric Tetz / May 9th, 2008, 0:08 / #

Hey, the work comes first, hope it all goes well.
I look forward (as always) to reading more of your postings when you have time.

Barnesm / May 11th, 2008, 6:39 / #

[...] “Nothing Spectacular”: AI Panic, a blog about artificial intelligence is unimpressed by the AI in “Grand Theft Auto IV.” [...]

MTV Multiplayer » R.T.F.A.* Monday: High-Def Help / May 12th, 2008, 12:01 / #

I don’t know much about AI theory or the technical aspects of its implementation, but I do know what gamers mean when they talk about AI. Your police example doesn’t really describe what most gamers would consider AI, it’s more of an event trigger. In games, AI usually refers to the actual behavior of NPCs. Your example of NPCs sometimes taking cover on the wrong side of their cars is a good example of what gamers would consider bad AI. Unfortunately, most games have terrible AI, to the extent that most can’t even get pathing right, which to a layman seems like a fairly basic task, e.g., open doors before trying to walk through doorways, don’t walk into walls, etc. Off the top of my head I can think of only three games with enemy combat AI that was in any way surprising or unpredictable: F.E.A.R, Far Cry, and Halo 3. The AI in those games is at least unpredictable enough that enemies don’t follow the same path each time, they react in some rudimentary way to your actions. The catch-22 to game AI is that contemporary game design depends on AI being pretty dim-witted. Level design, weapon and vehicle balance, player abilities, and even core game mechanics would have to be significantly changed if considerably smarter AI suddenly became available to game designers. Not that this wouldn’t be a welcome development in gaming, just to point out that much of game design is built around the assumption that NPC AI is not going to be very dynamic. It would be nice if the morons would at least stop walking into walls, though. Sheesh!

Slayve / May 12th, 2008, 17:31 / #

“Your police example doesn’t really describe what most gamers would consider AI, it’s more of an event trigger.”
I think that Robin was talking about the behaviour of the situation. What I mean is that the agent doesn’t look smart/believable when the player doesn’t see it. It isn’t logical that the police car spawn in front of you or right at the street corner. Even if it uses good AI by purchasing you, his behavior when he’s not in line of sight isn’t credible.

Btw, good site, but university first. I don’t think that the future of AI is located in videogames :)

Slimky / May 15th, 2008, 3:17 / #

gta is best… simple… any other opinion is pointless

dev / May 18th, 2008, 9:56 / #

Hi Again,

I largely agree with the point that game AI’s don’t really deserve the “AI’ designation. However, I still think there could be a good market for AI’s in certain types of games, just because they could be quite entertaining as NPCs or have other roles (say monitoring players).

At any rate, a really fun scenario of a game AI running amok (along with lots of other software) is in this book:

Daemon

It really is a “must read” since it talks lots about the havoc that can be unleashed with even “dumb” (non AGI) software designed to manipulate people. Great, thought-provoking fiction.

Horus Aha / May 28th, 2008, 23:35 / #

“his behavior when he’s not in line of sight isn’t credible.”

He doesn’t *have* behavior before he’s spawned. You’re conflating the NPC spawning algorithm with the NPC AI, when they are totally separate. Yes, both contribute to the illusion of reality for the gamer, but so do graphics and sound, and you wouldn’t confuse *them* with the AI, right?

“I largely agree with the point that game AI’s don’t really deserve the ‘AI’ designation.”

Why not?

“I don’t think that the future of AI is located in videogames :)”

Oh ye of little faith. ;)

I don’t know if videogames are the future of AI, but AI is certainly the future of videogames. Thus far, the most significant advancement in game technology has been visual. But as we get closer and closer to the holy grail of photorealism, the hard problems are ALL related to behavior; how things move and how they respond to our attempts to interact with them. We’ve made great gains recently by incorporating physics into games, so that objects move more realistically, but game characters are still incredibly limited in what they can do. No matter how realistic you can get them to *look*, the illusion is spoiled as soon as you try to interact with them; everything they can ever say must be anticipated in advance and recorded in a studio (game audio is still where graphics were in the 80s; almost entirely sampled, the auditory equivalent of bitmapped sprites).

Creating game characters that can be interacted with realistically will be the final and hardest challenge games face, and it’s ultimately an AI challenge, an entertainment version of the Turing Test.

Eric Tetz / June 2nd, 2008, 20:14 / #

Post a comment



<< See All AI PANIC Articles