GDC 2014BioShock Infinite's Elizabeth Uses Theater Technique for AIGDC 2014 - RSS 2.0
Irrational Games Lead Programmer John Abercrombie shed some light on the AI that made Elizabeth more than just Booker's portable ammo dispenser.
John Abercrombie, lead programmer at Irrational Games, has always wanted to immerse players in his games the way Disney does in its fantasy worlds. His goal is to do it better, however, and Disney has been doing for decades. It was with that thought in mind that he started work on Elizabeth for BioShock Infinite.
In a session entitled "Bringing Bioshock Infinite's Elizabeth to Life: An AI Development Postmortem," Ambercrombie said that he utilized theater techniques, rather than more common video game techniques for Elizabeth's behavior to make her actions more life-like. In a semi-open world, there's no way that a scripted AI would be able to represent a life-like character. Since protagonist Booker DeWitt is controlled by the player and can move freely around the world, it was imperative that Elizabeth be able to as well. This might lend itself to a follow mechanic, but that has its own problems.
In order to interact with your companion in the follow scenario, you'd invariably have to turn to face her, he said. There's the notion of predictive following, then, which allows her to move towards where she expects you might go. This makes her movements seem more natural, but leads to a number of other issues, namely pathing problems.
"Goal Side" behavior, utilizing a soccer term, basically says that the goalie should always be between the player and the goal. To implement this, Abercrombie introduced "goals" or target locations, and has Elizabeth follow the path from the player to the turnstile. It's akin to scripted movement, in that there are established destinations, but Elizabeth can fluidly move anywhere along the path, so the player behavior still influences her movement.
Natural movement wasn't enough, though, Abercrombie said. You don't just want a follower, you "want a character." To this end, he and his team introduced object interaction to the AI. He posed the question, "What do humans look at and why?" Ultimately, he suggests we look at things of interest to us for any number of reasons, as well as potential dangers. To implement this, they introduced "look at markers," and parameters for levels of interest time of interaction, and distance to the object.
By placing these markers on many objects throughout the world, it gives the AI something to do during downtime, which makes it seem more alive. Meandering around an area, looking at a painting, the dock, or whatever else is around, Elizabeth starts to seem more like a fascinated child and less like a disinterested robot. Similar to these look at markers, "smart terrain" features were integrated to in-world objects to allow her to physically interact with them.
Sitting on a bench or leaning against a wall are fine and good, but if the player doesn't see it, for all intents and purposes, it didn't happen. The team embellished some of her behaviors or had her call out to Booker to draw attention to her behavior.
Keep in mind that this is just the exploration side of things. The combat AI is an entirely different beast.
At first, they wanted to keep Elizabeth on screen during combat, but ran into issues of her being the center of attention, which can be incredibly frustrating during a firefight. Realizing that players aren't likely to be paying enough attention to her to even notice that she's on screen (unless she's being a nuisance, of course), they opted instead to focus on item tossing, to make her feel like a partner in combat. This brought its own problems, specifically in geometry in the game that blocked the path of the item toss. So the team introduced some trickery to make it easy and fun for the player.
Realizing that as long as she was off screen, she could be anywhere, they decided to teleport her to a location convenient for the item toss. It's not enough to simply be an ammo dispenser, though, so they had her start calling out certain enemies in combat as well. They additionally use a theater like spotlight to call attention to the enemies she calls out, since it's difficult to give spatial directions that make sense to players in the heat of a fight.
Ultimately, the algorithm should always take a back seat to the player experience. "Be player-facing..." and "Think about theater..." were bullet points on his conclusion slide. Since players only know what they see on screen and hear through the speakers, you can introduce any number of tricks to make the AI more engaging to the players. And you should.