Mikelis' Blog

Planning AAA-Style Character AI

If you’ve worked on AAA game AI, you know the truth: what ships is 50% of the plan and a lot of duct tape. So where does AAA game AI production go wrong, and what can we do to make it go well? After five years of building these systems, here's what I've learned.

Clear Vision

Building game AI is a very labor-intensive process. The systems are complex, and experts from various disciplines, such as concept art, design, programming, animation, and others, must collaborate to develop them. Given the nature of this work, we should ensure everyone is empowered and knows precisely what they are building.

Tim Cain, the creator of Fallout, has remarked several times in his YouTube video series that team members sometimes tend to pull the game design in their own direction. This can happen for many reasons, including ambition. But what I've seen most often is that it happens because the design is ambiguous. When people on the team are only told that they're building a "next-generation immersive narrative player-centric experience to rival the best AAA games" or "a game sort of like Call of Duty," everyone filters that through their perception of what makes for a great game in that genre. Then, they try to build it. Several competing visions for the game emerge, and much uncoordinated work may be done. Sometimes, teams and studios even split into separate companies due to creative differences.

Another reason to establish a clear vision is that it facilitates easier decision-making and progress within creative constraints. Modern video game engines allow us to build almost any game we can imagine. However, exploring that vast opportunity space is not a good use of game production time and money, and it's also challenging for the human mind to do ("writer's block"). Instead, it's better to pick one clear direction, even if it is imperfect, and execute it well.

Finally, AAA game production veterans say efficiency requires aligning the team. An industry friend, G.D., who is a production director at a very well-known American game development company, has cautioned me in the past: "Continually remind the team what is important, and what isn't – part of it is repeating these messages often, particularly when you have a larger multidisciplinary team."

In steering a complex production, it's important to tell people what the core direction is and where your team members should take creative liberties. That delineation is key to aligning a vast number of experts who will build game AI. I will tell you more about how you can commit your creative direction to paper as you plan production and design for game character AI.

Planning

Let's discuss several key game design decisions we should make in pre-production, including our options, their associated costs, and the importance of making these decisions early.

While I will show you only one way to map out and cost-account your AI game feature, every game company does it a little bit differently. Nevertheless, this is a good way to do it.

Archetypes

One of the first game AI decisions you'll have to make is what character archetypes you will have. Some typical character archetypes include:

Category Archetypes
Civilian Cowering, vendor, driver, theatric (acting for world-building).
Friendly Named character, defenseless, fighting, special-ability, voice-in-ear.
Opponent Base grunt, variant grunt, big boss, small/snack, proximity-based.
Turret Gun, missile, sniper, grenade.
Scuttlers Rat/rat swarm, bird/bird flock.
Animals Dog, cat, deer, shark.
Traps/Hazards Proximity-based, moving/stationary.

As an example, for an action-adventure narrative-driven FPS AAA game, we could build the following archetypes:

Image Archetype Description
Ranged Grunt Our player will fight a large number of ranged grunts with slightly different abilities (automatic rifle/double health/no weapon - throws rocks) in operational outposts. Each grunt will play a predefined storytelling/patrol animation sequence that level designers will set up.
Acid Stinger A dog-sized snack archetype placed throughout levels outside combat areas to break up exploration. Can be on walls. Attacks by jumping at the player when in range. Causes a minor acidic explosion if touched or when hit by a bullet, harming the player. Bioluminescent and can aid the player in dark areas, creating a hazard puzzle.
Turret Autonomous turrets have been deployed to keep operational areas free of stingers. These turrets shoot at anything they can see and can be turned off by cutting their power cord. They cannot be damaged by shooting, explosions, or acid, owing to their reinforced frame.
Buddy Buddy is a bonobo chimpanzee and the player's companion. It follows the player and sometimes alerts them to a nearby collectible. Buddy is afraid of combat and hides when combat starts, but can enter small spaces in exploration beats to unlock doors, press buttons, and pull levers as instructed. It can interact with particular objects in combat areas, and the grunts will gather to see it, thus being distracted.

Autonomy

Every game AI archetype needs a decision-making component. There is a large variety of options (sometimes also called core AI architectures), and they can be classified into levels of autonomy. Different levels of autonomy will demand different development team compositions and are best suited for particular types of AI characters, similar to the given examples.

Level of Autonomy Description Work Notes Examples
Scripted (1) The mission system instructs the AI characters to move, talk, shoot, and interact with objects. Requires much level markup and mission scripting work. Scientists (Half-Life), mission enemies (GTA 3)
Rule-based (2) Reads game state, executes a list of if-then rules to produce the next game state. Often used in turn-based games. Rule evaluator requires extensive technical design work. Aliens (XCOM), opponent (Chess)
State machine-based (3) A "default" for most AAA games. Uses a state machine to decide what the AI characters will do. Includes behavior trees, decision trees, hierarchical and flat finite state machines. Lowest team specialization required; generalist programmers and junior game designers can usually use them. Combat enemy/buddy (Half-Life 2), opponents (Far Cry), opponents (Uncharted 3/4)
Utility-based (4) The AI character periodically runs several utility functions, each of which is associated with a behavior and produces a score. The highest-scoring utility function determines the character's behavior. Experienced technical designers are needed to code utility functions. eSports game opponents, realistic immersive sims, and RPG titles.
Planning (5) The AI character perpetually plans and executes plans. Each plan consists of a series of actions. Commonly, hierarchical task networks, GOAP planners, and other planners are used. Experienced AI programmers are needed to implement this architecture. Opponents (F.E.A.R.), city-simulation civilians.
Machine Learning (6) Usually nested in lower-autonomy architectures, allows the character to respond freely to the player with various theatrics. Uses inference engines and model runtimes. Generally still experimental in games. Requires machine learning researchers, very experienced programmers, and designers who understand machine learning. Esoteric text-based dungeon/RPG directors.

Generally, the lower the level of autonomy, the easier it is to make these characters context-aware and the easier it is to tell high-fidelity authored stories. The higher the level of autonomy, the more autonomous they are, and the easier it is to reuse them.

It's worth noting that low-autonomy architectures can nest high-autonomy behaviors. For example, a scripted character can sometimes switch to an autonomous combat mode and then return to its scripted state. However, high-autonomy architectures cannot easily do the opposite. For example, trying to add level-specific or sequence-specific behaviors into a behavior tree will make it very brittle and unmaintainable.

It's a good idea to stray as little as possible in either direction from the state machine-based autonomy. It is a well-known decision-making architecture in the industry and strikes a reasonable balance between authorability and reusability. It also requires the least amount of specialization from the design and programming teams.

Let's note down the levels of autonomy for each of our archetypes. Don't mind the columns to the right, we will fill them in later:

Archetype Autonomy Scope/Behaviors Art Estimate Programming Estimate
Ranged Grunt State Machine/Behavior Tree
Acid Stinger Rule-based
Turret Rule-based
Buddy Scripted

Scope

Selecting a decision-making architecture provides a clear understanding of the team composition required and translates well into a spec sheet for the AI system core. But what other components and behaviors will our team need to build for each AI character, and what is the size of the team we need? Those questions can be answered by listing every game AI feature our game will have.

One way to do this is to borrow a paradigm from robotics called sense-think-act. Every character archetype will have certain perceptions (sense), a particular decision layer with rules (think), and several actions it can perform (act). If we list all of these features, we will have a checklist of what needs to be built for each archetype, which will tell us the scope of the AI feature.

Here are some examples of AI features by group:

Group Examples
Sense Sight, hearing, touch, damage, proximity.
Think (Rules such as: "when the player is near, attack")
Act Verbs such as: patrol, idle, interact, attack, shoot, drive, sleep, play animation, bark (speak), go to.

And here is the updated design table:

Archetype Autonomy Scope/Behaviors ...
Ranged Grunt State Machine/Behavior Tree Sense: (only enemies) sight, hearing, damage, touch.
Think: switch between idle, suspicious, searching, and combat states when conditions are met (conditions should be listed elsewhere in design documentation).
Act: interact with an object, patrol, stand idly, investigate stimulus, select target, take position in combat, shoot at target, bark.
Acid Stinger Rule-based Sense: distance to closest enemy.
Think: Periodically evaluate: if enemy in range, jump towards and sting on touch. Otherwise, play an idle animation.
Act: jump, sting, idle.
Turret Rule-based Sense: distance to closest visible enemy.
Think: Periodically evaluate: if closest visible enemy within range, aim and shoot. Otherwise, play an idle animation and make noise.
Act: aim, shoot, idle.
Buddy Scripted Sense: other AI character combat state, nearby pickups.
Think: Execute what the mission script tells it to, but have one autonomous behavior: following the player and going to nearby pickups to point them out if not in combat. In combat, run away and disappear.
Act: point at item, go to, interact with objects, follow player, run away and cower (disappear).

Estimates & Cost-Accounting

With a clear description of all AI archetypes and their features in hand, we can now ask our artists (concept, character artists, riggers, animators, weapon artists, and others) to give us a work-hour estimate for each character. We can also ask our programmers to estimate the systems, components, and behaviors they will build, as well as the QA time needed to fix the long tail of bugs often present in complex systems.

The estimates can also be done in story points, T-shirt sizes, and many other ways. However you do them, what’s important is that with these estimates, you can proportionally allocate production time and money to the archetypes. In other words, you can do cost accounting. Often, when costs are finally assigned to the AI archetypes, we become aware that certain features are not worth the price, or even that they push us over budget or production time.

For reference, here's how our design table might look with the appropriate estimates:

Archetype ... Art Estimate Programming Estimate
Ranged Grunt Concept art (160hr),
modeling & rigging (320hr),
Animation (740hr),
Weapon (180hr),
Audio (320hr),
Adjustments (320hr).
Total: 2040 work hours.
Systems (320hr),
Behaviors (1280hr),
Components (320hr),
QA/bug fixing (1280hr).
Total: 3200 work hours.
Acid Stinger Concept art (160hr),
modeling & rigging (160hr),
Animation (160hr),
Audio (80hr),
Adjustments (160hr)
Total: 720 work hours.
Systems (80hr),
Behaviors (160hr),
Components (160hr),
QA/bug fixing (320hr).
Total: 720 work hours.
Turret Concept art (160hr),
modeling & rigging (160hr),
Animation (80hr),
Audio (80hr),
VFX (80hr),
Adjustments (160hr)
Total: 720 work hours.
Systems (80hr),
Behaviors (160hr),
Components (160hr),
QA/bug fixing (320hr).
Total: 720 work hours.
Buddy Concept art (160hr),
modeling & rigging (320hr),
Animation (1280hr),
Audio (1280hr),
Adjustments (640hr).
Total: 3680 work hours.
Systems (640hr),
Behaviors (2560hr),
Components (320hr),
Mission scripting (1280hr),
Level markup (1280hr),
QA/bug fixing (1280hr).
Total: 7360 work hours.
NOTE: Buddy is possibly over budget.
- Add 5 simpler archetypes instead?
- Increase autonomy?
- Cut behaviors?

Design Pillars

Design pillars are the "North Star" of any production, including game AI. They align the team and specifically delineate what in the design vision is non-negotiable, and where team members should express their creative freedom.

As this is a very high-level design, it's a good idea to establish 8–12 design pillars that define what the game AI feature will be like and what it won't be like (limitations). Minute aspects of these pillars can be decided later.

Here are some aspects of game AI to think about when establishing your pillars:

Aspect Notes
Player Agency In what way can the player cause consequences?
Empowerment Power fantasy, progression, triumph, and mastery.
Fluidity Animations, barks, state transitions.
Player Expression Different playstyle accommodation, customization, and player abilities as they relate to AI.
Accessibility Systems catering to different skill levels and physical/mental barriers.
Onboarding What sort of tutorial do you have in mind?
Responsiveness How many and what kind of events will the AI characters respond to? Are they tanky or nimble?
Game Loops Primary, secondary, and tertiary game loops insofar as they involve AI.
Pacing Action, puzzle, exploration, quick-time event, cinematic, slow and fast beats as they relate to AI.
Archetypes What buddy AI, opponent AI, neutral AI will you have? Team-based or individual hero-based?
Realism Realism, entertainment, or a mix of both, and how?
Narrative Emotional and cerebral character depth, narrative themes, and the rhythm of narrative beats.
Contrast For memorability: big/small, slow/quick, flying/walking/swimming, loud/quiet, ranged/melee/stationary, fire/earth/water/gas, and others.
Epic Moments Ah moments/fast action sequences, Ooh moments/slow impressive vistas and theatrics.
Levels Linear or non-linear, open world or arenas, visit-once or replayable (and if so, Metroid-style or replay-from-menu)
Synergistic systems How do different gameplay elements become more than their sum?
Living World Civilian AI, scripted AI sequences in the world, animal AI, vehicle AI.
Sound Sound propagation, focus modes, barks.
Sandbox Anything about emergent gameplay.
Dynamic AI Dynamic difficulty, narrative branching, AI character memories, dynamic animations.
Fidelity Next-gen or basic fidelity of AI theatrics.
Clarity Readability of AI characters in the world, clarity of strategy, and mind states.
Modular Content DLC plug-in aspects, seasonal updates.
Community Online, social hubs, leaderboards, clans, mods, user-generated content, Discord.
Multiplayer PvP, PvE, networking architecture, sunsetting/end of service plans.
Share-ability Combat and tension music licensing, streamer mode, photo mode, replay.
Monetization Insofar as AI is concerned.
Navigation Navmeshes, nav graphs, wall crawling, swimming, flying, boids, esoteric.
Endgame Insofar as a satisfying resolution to the game involves AI.

And here is what a good example definition of game AI pillars might be, though remember to come up with your own:

Pillar Description
Tragi-comic Characters A classic tragic comedy with serious tones and character arcs, and periodic levity narrative beats. Emotionally intelligent narrative, in line with industry expectations
Unreal Engine Features The game will use basic AI features of Unreal Engine only, without architecting our own decision layers or systems where avoidable. This will free up resources.
Animal AI We will make the world feel alive with simple NPC effects for birds, rats, and stray cats. This will not be full AI archetypes, but very rudimentary implementations of creatures that scuttle or run away.
Buddy AI High fidelity buddy character Buddy will be the primary focus of the game narratively and in terms of production costing.
Stylized Graphics We will work with baseline Unreal Engine realism, but inject stylized graphics where possible to create player expectations of less than ideal realism. This will make AI animation errors less noticeable and character art much simpler.
95% Polish We will accept 5% issue rate for various aspects of game AI, including animations, barks, and reaction glitches, so long as, for 95% of the playtime, the players' expectations for high-fidelity are met.
User Testing All AI characters will undergo external user testing immediately after the first playable encounter is ready, so that we can reduce costs for change of direction and meet player expectations better.

All together, the AI design pillars and cost-accounted design table form a strong enough design vision that it will quickly align the team. This is the bare minimum that should be decided and set in stone in pre-production. Of course, the design vision documents can later be enhanced with an art bible and more specific descriptions of AI features. But likewise, concise communication is essential.

Making Decisions in Time

In AAA game development, late design decisions cost millions. So when you're building AAA-style game AI systems, it is essential to make the above decisions early – ideally in pre-production.

Hasard Lee puts it well in his book The Art of Clear Thinking: "No decision is a decision, and it's usually the worst one to make." In games, not committing to a creative decision means deciding to drift without a choice. But teams burning $10,000+ a week will feel compelled to do something, so without the right decisions, they often do busywork that looks productive but doesn't contribute much to the final game.

Changing direction late is costly when building complex systems. In their Systems Engineering Handbook, NASA shows that after the concept stage, design changes cost exponentially more over time. The costs may be so significant that a team cannot afford them, leading to missed deadlines, overspending, the shipment of unfinished games, and demoralization. The studio's reputation can suffer, too. Cyberpunk 2077's poor quality at launch and low team morale were widely attributed to late creative direction shifts. That's why it's best to front-load all key design revisions and lock in the vision early.

Still, late changes can't be eliminated completely. Internal and external decision-makers may demand them, often without understanding the costs. Playtests may also force a pivot. In the end, players decide the game's reviews, shelf life, and commercial performance. Hiring designers who can predict what players find fun ahead of time is smart, but some predictions will inevitably be incorrect. In that case, revising the design vision is necessary.

We can't always make every design decision on time. But know the price of developing without a clear, committed design vision. Every day you delay, the bill grows, and the game suffers.

Conclusion

Clear vision and sound decision-making are key in building AAA-style character AI systems. So when you plan game AI in pre-production, make sure to commit to archetypes, levels of autonomy, scope, resource allocation estimates, and key design pillars. It will align and motivate the team, bring more of your creative vision to life in the final game, and potentially save millions in production costs.

Want to learn more? Check out my other game AI development articles on this blog, where I talk about AAA-style game AI production and design. Or see these excellent community resources:


Special thanks to the following community contributors:

Paul Roberts Editorial review

#Game AI #Game Design #Game Development #Game Production