Halo 2 Artificial Intelligence Explained
An anonymous reader writes "Stuffo has an interesting interview with Bungie's lead AI developer, Chris Butcher. Butcher explains in detail how the enemies in Halo 2 think and exactly why they do the things they do."
I've long suspected that the proper way to handle game AI, and game development in general, is to model things in a manner as similar to the real world as possible... It's also nice to finally have a self-preservation instinct in game enemies...
:)
Does anyone know if Far Cry used a similar approach? Its AI struck me as very close to Halo's in a lot of ways. (Then again, the whole game was like that...)
And is the server messed up, or is this a first post?
Learn to spell 'Frist'!
See my journal for slashdot ID's by year. Mine created in 2005. http://slashdot.org/journal/289875/slashdot-ids-by-year
The linked article is rife with popups and requires one to click 'next page' about 50 times, so here's most of the text. NB - I only got the first 6 pages; pages 7 and 8 came up 404.
... surrounded by pizza boxes, soft taco wrappers, empty beer and soda cans and controllers. I'm tired, and I smell bad. I've finally beaten "Halo 2." I've been ambushed, sniped, flushed out, cornered and just plain beat down by the Covenant more times than I care to remember. In both "Halo" and "Halo 2," the enemy's battlefield savvy is one of the most impressive aspects of the game. The enemies are so much more than just an onslaught of fodder. This is not your daddy's shooter. If you think that a quick trigger finger is going to let you plow through the Covenant in "Halo 2," then there is a body bag with your name on it.
... [The] characters and their code are isolated from the world."
In the Mind of the Enemy
The Artificial Intelligence of Halo 2
by Robert Valdes
11/17/04
So here I am
The enemy characters in "Halo," as with all video games, are driven by artificial intelligence or AI. The complexity of the AI can often make or break a game's level of fun, realism and replay value. Halo is at the top of list when it comes to AI. The enemies react, respond and adapt to the player like real combatants on a battlefield.
If you're amazed by just how "dirty" the Covenant's "dirty pool" can get in the heat of battle, then you will be interested to hear what Chris Butcher had to say about the artificial intelligence of "Halo 2." Chris is one of four Engineering Leads at Bungie Studios, who are each responsible for certain sections of Halo's creation. Chris created the AI for the original "Halo" and got to expand his work in "Halo 2." Stuffo got a chance to sit down with Chris a few days before "Halo 2" launched and talk about the artificial intelligence of "Halo 2."
The Basics
"I wrote the artificial intelligence for Halo 1," Chris explains. "Basically, it is a very specialized type of intelligence. There was a custom piece of code for each character." In "Halo 2," Chris broadened the AI he built for the first game. The first thing to understand about the AI characters in Halo is this: "The AI lives in a simulated world."
Most first person shooter games, such as Quake or Unreal, are built on a graphical engine. The player is essentially a stationery "camera," and the engine creates the sensation of moving through a world by rendering graphics that create that effect. Halo is different, Chris explains. "Halo is a simulation engine. The engine creates the world, then puts the player and the AI in it
Each character is written to do certain things, but despite their individual roles, they all function in the same way. It breaks down like this:
The character uses its AI "senses" to perceive the world -- to detect what's going on around it.
The AI takes the raw information that it gets based on its perception and interprets the data.
The AI turns that interpreted data into more processed information
The AI makes decisions about what its actions should be based on that information.
Then the AI figures out how it can best perform those actions to achieve the desired result based on the physical state of the world around it.
"That all works through the same capabilities the player has," Chris explains. This is a key point in how the Halo AI works: Because the characters are forced to perceive the world around them, they are, in many ways, limited like the player by their senses -- in their overall awareness of what is going on around them. This limitation creates more lifelike behavior for the AI characters, as they can be surprised, make mistakes and decisions based on their perceptions of what's going on around them. As Chris puts it, "there is really very little difference between a player and an artificial intelligence character in Halo."
AI Perception
Chris goes on:
"If we were writing artificial intelligence for a robot, we would have to
It is interesting to see how much work is required to get something that simulates 'common sense'. Note how much 'tagging' was required to get a character in a controled environment from point A to point B in a logical manner.
Now take your average FPS player. He is able to look at the terrain without these tags and make a coherent game plan. Leave one tag off of an object, and that AI player is suddenly trying to do something impossible and not able to make a decision to try a different tact.
AI has certainly improved. I can't even begin to guess how many single player games have been destroyed simply because I found an explotable AI weakness. What will make AI really good is when it can adapt strategies when it has consistently lost.
See my journal for slashdot ID's by year. Mine created in 2005. http://slashdot.org/journal/289875/slashdot-ids-by-year
"Its alot like AI for a nascar race except they shoot at you."
Over all the AI is very good, and occasionally quite clever. But it can occasionally get caught in an indecision loop when it faces two threats.
What this means in plain english? Most first person shooter games, such as Quake or Unreal, are built on a graphical engine. The player is essentially a stationery "camera," and the engine creates the sensation of moving through a world by rendering graphics that create that effect. Halo is different, Chris explains. "Halo is a simulation engine. The engine creates the world, then puts the player and the AI in it ... [The] characters and their code are isolated from the world."
What the hell is a simulation engine, and if Halo uses a simulation engine where the hell do the graphics come from?
I was very impressed by the depth of understanding that the AI showed in HALO 2 before reading this article. What I found particularly interesting is the "Uncanny Valley" problem whereby the AI becomes very life like and then, when it does something inhuman, it just becomes creepy. I have never personally experienced the problem, but I have a friend who refuses to play certain games for exactly this reason.
Out of curousity, how good is halo 2's AI? The first game I noticed that had decent enemy AI was the original halflife. The enemy marines were quite clever in how they handled situations, and the way the sonic doggies would run around like puppies chasing train cars seemed realistic. How advanced are we these days?
First the article isn't very interesting. Basically the Halo2 AI uses virtual sences and can make ally requests. It also uses lots of level designere set locations.
Second the AI doesn't sound very advanced. It seems a lot like the stuff the Half-life AI was doing back in '97. Maybe it's just the target audience of the article, but is seems like they are trying to make the AI seem very simple.
Basically in a quake like game wether it is half-life or quake itself the game centers around the player. The player is the center around wich the world moves. Until you move and trigger something wether it is AI or a scripted sequence the world will remain static.
In a simulated world the world will go happen wether you move or not. A very good example is MS flight simulator. With the proper settings if you start the game you are sitting on the ground at an airport. But as you sit there you can see weather patterns moving. Other aircraft taking off an landing. Air control giving instruction to ensure seperation.
Note that this is purely an approach to how the "story" in the game is developed. You could easily use the quake engine to create a simulated world and use MS flight simulator to create a trigger driven story game. In fact they exist.
So halo has the same kind of graphical answer as quake. What is different is how the population changes. It seems that the halo makers claim they have a more MS flight simulator like approach where the AI does its thing even if you just stand at the start. Note that in the recent MS flight simulator you are part of the AI as both air traffic control and other aircraft react to you (sometimes).
It should be easy to check if there is an invisible mode/no clipping mode in halo 2. If they are right then you should see that enemy walking around and chatting long before you have walked along the corridor and triggered them to do their stuff.
Personally I think Halo2 is a cross. A true simulated FPS would have far more of a realistic combat mode as you would be on a battlefield with a battle going on and you would be just one of the soldiers. If you remember Call of Duty then think about the russian square assault. While their is obvious AI going on the AI is totally incapable of achieving anything. You score the majority of kills and you "unlock" the next bits in a level.
If Call of Duty had a simulated world then you could just sit to the side and slowly see the AI on one side win. F16 falcon had this to a certain degree. It was a very realistic combat flightsim and I sucked at Air to Air. However as long as I setup the right mission where I bombed and had my wing mates cover me the AI would do the job. One time I started a mission but had a call of nature. The rest of the flight started in the air and the base was attacked. As I was sitting on the toilet I could hear my wing engaging the attacking flight and shooting them down. All without me even having touched the controls. That is a simulated world.
So is this the future? Well for some games. Imagine if you played a simulated RPG. If you then went to the toilet and let the game running a NPC would pick up the role of hero and complete the story quests. Hmmm.
Imagine in Halo if it was truly simulated world. If you take the wrong turn your AI buddies could very well have completed the level while your trying to find your way back.
Flight sims and realistic combat games might be fun with truly simulated worlds. FPS ala Halo are perhaps better when the player is the hero who triggers events. Some simulation can take place but do you really want the intresting bits to be done by the your AI buddies?
Half-life is a scripted STORY engine. Halo claims to be a simulated STORY engine. The graphics are exactly the same. They choose the wrong words.
MMO Quests are like orgasms:
You may solo them, I prefer them in a group.
I haven't tried any missions where there are jackals, hunters, flood, forerunner drones, or *spoiler* brutes yet but I'm guessing they have their own tricks. Oh and before you question what I saw, on legendary there are LOTS of situations where you're against 6+ elites at once so you see their tactics quite often.
Just got done reading an excellent book about AI in games that includes more detail about what was talked about in the interview - look for "Artificial Intelligence for Computer Games" by John David Funge. An excellent, high-level overview. -j