Combat Design & AI in Uncharted 4

Video Games

Matthew Gallant speaking at GDC 2017

Back in 2017, I gave my first talk at GDC about combat design and AI in Uncharted 4. A recording of this talk is now free and publicly available in the GDC Vault.

Authored vs. Systemic:
Finding a Balance for Combat AI in Uncharted 4

The title of the talk comes from the biggest quandary we faced through development: how to decide what to handle systemically (using generic combat AI systems) and what to author (hand-placed markup and scripting). Previous games in the Uncharted series were highly authored, but we had some new design goals for Uncharted 4. As we pursued much larger wide-linear spaces and deeper stealth gameplay, we knew our familiar scripted approach would struggle to account for all the ways the player could engage in combat.

This led us to explore a more systemic approach to combat design. For instance, we developed the concept of “vantage” in an attempt to programmatically analyze combat spaces and find the strong positions to hold. We tried a similar technique for getting enemies to search, generating “heat” at the player’s last known location that would realistically disseminate through the layout. Unfortunately, both of these approaches failed to generate consistent results. We had oversteered away from authored combat design, and needed to find a balance.

We eventually developed the concept of “hard points”, which allow level designers to mark up strong positions and important places to defend. However, the choice of whether to use these hard points and which NPCs to assign to them is left entirely up to the systemic combat logic. This hybrid approach let us leverage the designer’s holistic knowledge of a space without requiring bespoke scripting to account for every possible scenario. We felt like this was the middle ground between “authored” and “systemic” approaches, and that it gave us the best of both extremes.

The full talk goes into much greater detail on the development process and implementation details, so check it out if you’re interested. As a bonus, you’ll also discover what Uncharted has in common with Pac-Man.

→ No CommentsTags: ·  ·  ·  ·  ·  · 

Blocktober 2018

Video Games

Last year, my friend and coworker Michael Barclay boldly declared that “level blockouts are art”. He started the hashtag #Blocktober to celebrate the art form and encourage other developers to share screenshots of their blockmesh levels. The response was enthusiastic, as hundreds of developers gave us a sample of their early-production work. It provided some well-deserved exposure to a vital facet of game development that players normally never get to see.

Since Michael is starting up #Blocktober again this year, I thought I would dig through my own work files to find something to share. While I’m not actually a level designer, in my systems design work I often develop playable prototypes to pitch a certain gameplay idea or feature.

The video above is an early prototype of the train combat sequence that was later developed for chapter 9 of Uncharted: The Lost Legacy. While we were still in early preproduction, I wanted to pitch an action setpiece that combined ideas and mechanics from two of my favourite levels: the train from Uncharted 2 and the convoy chase from Uncharted 4. This would also enable us to leverage some of the physics and animation tech that had already been developed in our engine.

A few credits: the rocky terrain that the train meanders through is borrowed from Mark Davies’s blockmesh of the islands from chapter 12 of Uncharted 4. I reused many of the vehicle-to-vehicle combat systems previously developed by Kurt Margenau. I also wasn’t involved with the real train level that actually shipped with The Lost Legacy; that was developed from scratch by Nicholas Lance, Asher Einhorn, Michael Barclay, Vinit Agarwal and many more.

Tags: ·  ·  ·  · 

Thinking in Systems

Books, Video Games

Book cover of Thinking in Systems: A Primer by Donella Meadows

There is a certain class of books (Understanding Comics, The Design of Everyday Things) that aren’t ostensibly about video games, but have still found their way into the informal game design canon. Having recently read Thinking in Systems: A Primer by Donella Meadows, I believe it also deserves a spot on that list. The book covers a wide range of tools and methods for systems thinking, but I’d like to focus on one technique in particular and how it could apply to game design.

Stock-and-flow diagrams are used to model the interconnections between elements of a system. As the name suggests, they define systems in terms of stocks and flows. Stocks are “the elements of a system that you can see, feel, count, or measure at any given time”; they are shown as boxes.

Flows are what cause stocks to change over time. Inflows and outflows are depicted as thick grey arrows (going to or coming from a stock, respectively). The rate of a flow is represented by a faucet, because it can be adjusted higher or lower.

No SVG support

If the rate of a flow changes based on the level of a stock, then this creates a feedback loop. There are two types of feedback loops. Balancing loops seek to maintain equilibrium and resist change within a system (in game design this is often called negative feedback). Reinforcing loops are the opposite; they enhance any direction of change imposed on the system (positive feedback). In stock-and-flow diagrams, feedback loops are represented by thin curved lines.

Clouds represent the boundary of the system. The boundary is an intentional choice of what is considered inside and outside the system for the purpose of analysis and conversation. In reality, “there are no separate systems. The world is a continuum.” The boundary only exists in our mental model, and thus it must occasionally be reevaluated to suit the problem at hand.

Here’s a simple real-world example as given in the book.

No SVG support

In this example, the temperature in a room is a stock. Heat flows into the room from the furnace, and the rate of inflow is determined by the thermostat. It turns the flow on/off based on the difference between the temperature in the room and the goal temperature setting. Heat also flows out to the air outside. The rate of outflow is determined by the discrepancy between the indoor and outdoor temperatures. The rates of inflow and outflow are both affected by the current level of the temperature stock, which indicates that we have two feedback loops (both balancing).

→ Read the rest of this entry

→ 2 CommentsTags: ·  · 

Intentionality & Improvisation

Video Games

[Left] Lightning strikes in Breath of the Wild / [Right] Grass burns in Far Cry 2

While I was playing The Legend of Zelda: Breath of the Wild over the holidays, I kept thinking about Far Cry 2. Of course that’s not uncommon; I cut my teeth writing about games in ~2008, so I tend to see Far Cry 2 everywhere (game design pareidolia). However, rather than a vague impression, Breath of the Wild evoked specific ideas that director Clint Hocking explored in a 2009 GDC talk entitled “Fault Tolerance: From Intentionality to Improvisation”. I’d like to use that talk as a framework to compare the two games and discuss some common mechanics that are used to similar effect.

Clint begins his talk by discussing intentionality in games, which is “the ability of the player to devise his own meaningful goals through his understanding of the game dynamics and to formulate meaningful plans to achieve them.” Games that support high-level intentional play (e.g. immersive sims, stealth games) tend to have “robustly interconnected systems”. The player must develop a deep understanding of both how these systems work in isolation and how they interact with each other.

The flow of play can be divided into two phases: a composition phase (deciding and figuring out what to do) and an execution phase (doing it). Games that favour execution are more “ride-like” (Call of Duty), whereas favouring composition is more “puzzle-like”. Intentional play emerges when the two phases are kept in a “game-like” balance.

Clint notes that messy systems (generalized physics, crowds, fire) tend to collapse the player’s intentionality. However, he also felt that the “simulation of broader more chaotic and unpredictable systems” was the future of game design. Thus, with Far Cry 2, Clint’s initial goal was to explore how highly intentional play could be preserved in a “highly dynamic and free-form” environment.

At one point later in development, Clint and his team decided that some of the high-level faction systems they’d been developing needed to be cut. However, he was concerned that this would discourage the player from making complex plans. Shortening the composition phase might make the game more “ride-like”, which would subvert intentional play.

However, he observed that systems that inflict “small unpredictable losses” (malaria, wounding, gun jams, grenade rolling down a hill) kick the player out of the execution phase and force them to improvise. The player therefore “switches back and forth between composition and execution several times in a given battle”. A short composition phase is balanced by a short execution phase, and intentionality is preserved.

Improvisational play is therefore “intentionality compressed”, and randomness is “the pressure cooker that pushes the already intentional player to react and improvise a new plan on the fly.”

A graph showing an oscillation between composition and execution.

In this vein, Breath of the Wild has two systems that inflict small semi-unpredictable losses on the player. The first is the weapon degradation system. Weapons are fragile, which makes them unreliable. When their weapon breaks, players are forced to adapt. They can pull an alternate (perhaps less familiar) weapon from their inventory, or try to make use of whatever environmental tools are currently on hand. One streamer observed that weapon degradation naturally pushed him to explore the game’s other mechanics, such as stealth and fire.

The weather system can also work against the player. Snow and sandstorms are blinding. Thunderstorms unleash lightning strikes against metal equipment. Most commonly and annoyingly, rain makes climbing just about impossible. Unlike previous games in the series, the player also has no tools (e.g. Song of Storms) to control the weather. When inconvenient weather rolls in, their only real options are to pass the time or adapt their plans.

These chaotic systems therefore serve the same purpose in Breath of the Wild as they do in Far Cry 2: inflicting random small losses on the player to force them back into the composition phase. Unexpected setbacks compel the player to slow down, to observe, and to think; it may even push them to engage with systems that they may otherwise have ignored. Even in her annoyance with Zelda’s weather system, Patricia Hernandez pointed out that: “without these rain mechanics, I wouldn’t have all these ridiculous stories, huh?”

Video by Alex Wiltshire

Another aspect of improvisational play is how the player handles having their plans upset (i.e. being kicked out of the execution phase). As Clint points out, in a “ride-like” game, this usually means just dying and restarting from the last checkpoint. In a more intentional stealth game, the player may be able to recover from a loss, but the cost of failure is so high that they’re just as likely to just quickload the last save.

To encourage improvisation, the player must be willing to fall back into that composition phase (rather than simply reloading). This means that any random unpredictable losses have to be quite small. As Clint points out: “you rarely die from these events – unjamming a weapon takes no more time or effort than reloading does.” Furthermore, the game generally needs to be forgiving of the player’s mistakes.

→ Read the rest of this entry

Tags: ·  ·  · 

Four Lessons from Bruce

Video Games

Bruce Straley

A few weeks ago game director Bruce Straley announced that, after 18 years, he was going to be leaving Naughty Dog. He will be dearly missed.

In the last few years before his departure, I was fortunate to have had the opportunity to work with Bruce on The Last of Us and Uncharted 4. Working under his creative direction made me grow tremendously as a game developer. His way of thinking and his design values are visible across the entire team, to the point where it’s impossible to distinguish Bruce’s process from Naughty Dog’s process as a studio. He wasn’t just a director; he was a true leader.

I’d like to share four important lessons that I learned from working with Bruce Straley.

Get Someone Else to Play It

It’s common wisdom that tools play an outsized role in game development. Developers who are comfortable with their technology can prototype their ideas faster, throwing away what doesn’t work and iterating on what does. With any luck, you won’t need to make compromises around a bad decision later in development.

However, there’s a corollary to this that’s seldom discussed. When developing a new feature, it’s very tempting to iterate on it in isolation. You develop a sense of ownership about what you make, so you balk at the idea of presenting it to others too early. You can see the obvious flaws in your unfinished feature, and you think you’ll get better feedback if you fix those first.

To counteract this impulse, Bruce always encouraged us to call over a random coworker and put a controller in their hands as early and as often as possible. Getting someone else to playtest your work will immediately reveal the most crucial problems with it. It’ll allow you to pivot much faster, and avoid wasting time polishing a prototype that requires a fundamental revision.

Furthermore, they may have ideas that you hadn’t even considered, which segues nicely into…

Everyone’s Feedback is Valuable

Game development is specialized work, and it’s very easy for the various disciplines to become siloed. This can also make it difficult to give feedback across departments. An audio technician might feel reluctant to tell an environment artist that they can’t spot the enemy NPCs in their lush environments. One fears a territorial reaction; “you don’t understand my work and are unqualified to judge it.” Better to keep it to yourself rather than step on someone else’s toes.

As a director, Bruce maintained a holistic view of making games, and encouraged everyone on the team to reach out with their feedback regardless of department. Everyone working at a game studio has a love for games and a great deal of experience playing them. If they have an issue with how a particular feature works, then there are likely hundreds of players who will share the same concern after launch.

Don’t let your studio foster a parochial attitude; encourage every department to share their concerns across disciplines. Identifying problems is often more valuable than finding solutions.

Own The Game You’re Making

Disciplinary parochialism has another side effect: developers often cultivate a blindness for issues that they aren’t responsible for. An animator who is focused on fixing a bad animation blend may observe that a level’s lighting is broken, but mentally file that away as “someone else’s problem.” Nobody feels like they own the game as a whole, only the small aspect that they’re directly working on.

In my early days at Naughty Dog, I recall demoing some prototype feature to Bruce. I didn’t get much feedback on my work, because he immediately noticed that a variety of other issues were popping up. I had of course noticed those issues during my work, but the “not my problem” filter had caused me to completely disregard them. He tasked me to track down those issues before my work could be properly evaluated.

Bruce taught me to not be blind to brokenness. I should feel a sense of ownership for the entire game, even the parts that I’m not directly contributing to. Even if an issue is neither my fault nor my responsibility, I can make the development process better by tracking it down.

Talk Face to Face

The modern workplace features a cornucopia of digital collaboration tools. On many teams, the vast majority of communication takes place in emails, IMs, or some proprietary all-in-one project tracking software. These tools are indispensable, but also fundamentally flawed. Like all written communication, they lack the nuances of speech: posture, tone of voice, hand gestures. Emails also suffer from low-bandwidth and a low signal-to-noise ratio; often a two minute conversation will convey more information than a fifteen email thread.

As a director, Bruce believed that any substantial communication should happen face to face. In my first few months at Naughty Dog, I recall being (gently) reprimanded for sending a hundred word email response to someone on an issue I felt strongly about. That issue was “too big for email”; Bruce instructed me to get out of my chair, walk over to their desk and figure it out together.

Scheduled meetings are a rarity at Naughty Dog, but these sorts of informal desk-chats happen all the time. If a thorny multi-disciplinary issue needs resolving, it’s not uncommon to see a cabal with a representative from every department hovering around a single monitor.

As an introvert and a newcomer to an established studio, this way of working took me a long time to get used to. Fortunately, it helped push me out of my comfort zone and familiarize myself with the other departments. I now firmly believe that talking face-to-face is one of the “secret sauce” ingredients responsible for Naughty Dog’s tremendous success.

Bruce, I told you this in person but I’ll say it again here: thank you for everything you taught me about making games. It’s up to the whole team now to keep the lessons you imparted alive at Naughty Dog. I hope we’ll make you proud with what we’re making next.

→ 2 CommentsTags: ·  ·  · 

© 2007-2020 Matthew Gallant. Powered by Wordpress. Privacy Policy.