Slashdot Mirror


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."

8 of 68 comments (clear)

  1. Sounds like a good approach by ex_ottoyuhr · · Score: 5, Interesting

    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? :)

  2. [partial] article without popups by Anonymous Coward · · Score: 4, Informative

    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.

    In the Mind of the Enemy
    The Artificial Intelligence of Halo 2
    by Robert Valdes
    11/17/04
    So here I am ... 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 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 ... [The] characters and their code are isolated from the world."
    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

    1. Re:[partial] article without popups by Profane+MuthaFucka · · Score: 5, Informative

      Just go for the printable version. The whole article on one page. No popups either, because I'm running firefox.

      http://stuffo.howstuffworks.com/halo2-ai.htm/print able

      --
      Fascism trolls keeping me up every night. When I starts a preachin', he HITS ME WITH HIS REICH!
  3. AI by MyLongNickName · · Score: 5, Interesting

    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
    1. Re:AI by mrdogi · · Score: 5, Insightful

      Humans 'tag' as well. We just do it much faster (with experience) and have years of experience to help with that tagging, both in speed and in richness of tagging. Although, I suppose we also get superfluous tagging ("What idiot painted that box yellow?") to distract us a bit.

    2. Re:AI by gothzilla · · Score: 4, Funny

      We also can make a lot of mistakes in our tagging.
      "After looking at the angle of that corner up there, I calculate that I can take it in my Ferrari at 82 mph without losing control."
      "I can jump over that fire hydrant without smashing my nuts."
      "This gun isn't loaded so it can't hurt me."

  4. Re:Could someone explain... by Relic+of+the+Future · · Score: 4, Informative
    In many games, the NPC/targets/AIs/whatevers are just another object, like a brick, that gets dropped into the game world. For Halo 2 though, they made them just like any other player, only instead of taking their input controls from your xbox controller, they take them from a piece of code. Instead of having that code look at an image on screen (like you as a player do when playing the game) they instead examine all of these tags that exist in the game world; where you see a clump of pixels and think "wall", the AI has been told "cover.value=+2.8", and can react accordingly.

    This approach allows for the AI to react much more realistically and intelligently with the environment without requiring an impossible amount of effort. It also allows improvements in the AI code to be isolated from the design of the levels (as long as the rules of this "tagging" interface are obeyed by both sides of the programming aisle).

    I wonder how much of this tagging was done by hand, vs. how much was done by automated analysis.

    (As an aside, the grav-lift on Collossus needs to be turned off for CTF, Assault, and Oddball games. Am I right?)

    --
    Those who fail to understand communication protocols, are doomed to repeat them over port 80.
  5. Re:Unamazing AI by AzraelKans · · Score: 4, Insightful

    Well.. you have to remember a few details before judging, first of all halo 2 is all about battles, so you would expect they expent more time on that than say "conversations" or other nuisances and on that level both as partners and as enemies the AI acts pretty convincingly. Second, halo2 is definetily a lot larger and complex than half life.(not HL2 though) so is a lot harder to coordinate the AI and place tag points effectively. And 3rd the AI in a console game expending so much cycles in a console in network and graphics code, can only be good enough to be believable, but cant expent so much cycles to be "ground breaking" so their target was believable and enjoyable and I think they got that right.

    I havent even noticed before reading the article but the enemies DO talk to each other (in english) before teaming up on your poor butt. Thats an interesting detail to watch (although it ussually ends with you dead in the ground).

    Oh I almost forgot, you have to play in the "heroic" dificulty level to see what the AI can really do. The easy and normal levels are quite dumbed down in comparison.

    --
    Go ahead MOD my day!
    More opinions here