Monday, March 30, 2009

Level Design Primer: S-Curve Variations

Monday, March 30, 2009 6
Level Design Primer is an introduction to the high level concepts of first person shooter level layout and design.
As to credentials: for two years I built the majority of levels for the forthcoming single player FPS title Darkest of Days. Anything written here is backed by my own experience and observation from building and playtesting.

Virtually all levels are about basic spatial progression, getting from the start to the finish alive. The job of a level designer is to make that progression as varied, interesting, and worthwhile as you can. Or as I like to think of the work: your job is giving the player an idea and make him think it was his. The better immersed he is in your world, the more he believes it to be his.

With this introductory primer, we'll be looking at some basics of path layout, high-level approaches that keep even a linear path interesting to most players if handled well.

1. The S-Curve
One of the single best guiding design principles for single player level design layout is the s-curve. The s-curve is central because it is the intersection of a variety of desirable qualities: ease of navigation, visual fidelity, interest and surprise. As a guiding high-level concept it will not make a level for you (nothing will), but it will enrich every level that it is incorporated into.

An example scene built in Far Cry 2 on a straight line. While this scene is fairly well composed visually, the path ahead is devoid of surprise. The player can see all three buildings on either side of the street plainly.
Starting out on a straight street or forest path with everything visible from the starting point makes traversing the space a chore; there are no surprises, it is merely ground to be covered.

Take the same path and introduce a slight s-curve. While the direction of travel is still clear, now portions of the path are occluded. Which makes for natural cover placement, enemy placement, or other points of interest. Now introduce vertical variation as well, and there is yet more occlusion as well as potential elements for vertical play. (This helps with the design maxim well understood by Valve that we'll get to later, which is that "players never look up.")

The same scene with a slight s-curve. The left portion of the street now "opens up" to the player, drawing his interest, while at the same time the middle right side of the street is occluded--to find out what's there, he's going to have to go down the street. Two sides of the bridge are now visible, making it more attractive as an endpoint as well. Where the player is standing is also slightly higher than the riverbank at the bridge, introducing more visual interest.
While only a brief sketch, we see how much more "opened up" the very slightly s-curved street layout makes the scene. This works hand in hand with "keeping it wide," another crucial level design maxim.

2. The Kinked Line
Take a soft s-curve and twist it around a bit more and you have what I call a kinked line. Like a garden hose held in hand, it restricts and slows down the flow of play in ways that can provide interesting variations, or opportunity for ambushes and the like. Hold a garden hose too tightly and the water stops completely, but held carefully and the flow can be manipulated. It helps creates more interest points in the path with reversals of direction, even if the overall direction of travel is still forward.

A benefit is that previous or later segments of the line can be made visible to the player, providing visual interest and incentive to continue, as well as helpful visual landmarks.
Kinked lines are quite regularly employed in linear games with real-world settings, since a kinked line or broken grid (see below) progression circumventing "normal" course of travel is accounted for.
The majority of the level paths in Left 4 Dead, for example, can be considered kinked line-style layouts.

3. The Stacked Line
Coil the player path even tighter than a kinked line and you get a stacked line. Like a ropey coil of intestines, the stacked line provides maximal travel time over the smallest area. It is useful for restricting player movement even further, for mood or practical reasons, or maximizing unexpected corners. With environmental density often at a premium, a stacked line can provide a "high value" area for production (though be warned that the player may not share your same estimation of "value.").

Anyone who has been to Disney World has seen stacked lines managed ingeniously--a large room might be used as the foyer to a ride. Yet instead of revealing that the entire room is filled with people waiting for the ride, partitions are introduced, blind corners, stacking the line in a coil which maximizes the room space without alerting any one segment of the line to the rest of it. Done poorly and the patron (or player) will realize what is being done and will be impatient, possibly indignant about the deception. Done well, and the subterfuge is invisible.

Stacked line sequences can be used as a "cool down," puzzle, or other severe restriction on the relative speed of player progression through the world, since the high frequency of 180 degree turns give them a maze-like quality. These must be employed rarely and with great care; perhaps one of the most notable examples of this layout style is the Nova Prospekt sequence in Half-Life 2. A number of levels from that game end up in this category, given that space is more of a premium and the largely corridor-based environments lent themselves well to this style.

4. Broken Grid
A classic level design form is what I call a broken grid, which is simply an interrupted grid with a snaking path or paths through it.

An area is devised along a grid--a city block, a warehouse interior, a colonnade--and then is "broken" so that the grid is only traversible in a modified path, though the grid itself is intelligible. This could be a deathmatch arena, with the breaks simply to provide cover and unique features, or more typically just a form for a single player linear path. The path is still variations on s-curves, but the player appears to be traveling through a grid (though not at all in a gride-like fashion). A broken grid is one of the easiest methods for creating an interesting or potentially multi-path area to progress.

A superlative example of broken grid-style layout on a larger scale would be Silent Hill 2. While the town of Silent Hill itself is shown on the map as a normal grid of streets, the player comes into contact with walls, fences, or gorges that break the grid in challenging ways. While the structure of the town and the basic path seems clear (and visible on the map), the complicating elements provide challenge where there would be little to none otherwise, and are dynamically marked on the map by the player's character.

All these examples may seem simple, but the strength of s-curves applied all throughout the many stages of level design work will eliminate many common problems relating to player confusion or slack time. When the world itself, devoid of items and enemies, is rich and appealing to navigate on its own, you are far less likely to have problems elsewhere.

Tuesday, March 24, 2009

Considering Mirror's Edge

Tuesday, March 24, 2009 3
In our first entry we talked about the how the player character in FPS games could generally be likened to a refrigerator box. But is the box the problem, or an unfortunate but necessary convention?

After all, despite the inherent problems the box entails, the player generally isn't aware of the issue. They simply know that they have a frustratingly narrow bandwidth for interacting with what seems like a rich and interesting world. Perhaps it's the narrowness of agency. The inability to "do" anything other than (admittedly exquisite) variations on shooting people in the face.

A game that's addressed much of what was brought up last time is Mirror's Edge. DICE is a veteran FPS developer, and with Mirror's Edge they sought to redress a long-standing conventional flaw of the genre.
They set out a considerable design challenge for themselves: make the first person shooter a first person jumper. By focusing on this as the core experience, they solved much of the attendant issues as well as creating novel gameplay.

Reason would dictate a game about parkour fleetness would best be executed in third person, but DICE stuck by their assumption that first person could sustain such an experience with far greater immediacy, provided enough proprioceptive cues were given and the player was given tools for the tasks at hand.
And to that end I think the game quite successful. It mates a fresh visual style with a carefully nurtured sense of corporeal possession of Faith. For once, our point of view is not a shell-like avatar but a character, which aids the nearness of that corporeal possession to the core gameplay. Gone are the smashed or absent mirrors of Gordon Freeman's world.

The key is that the narrow, exceedingly specific set of verbs given to normal FPS avatars--aiming, shooting, grenade throwing, weapon switching, fire selecting, jumping, crouching--mutated into something tailored to the experience DICE had in mind. Faith is far more nimble than other FPS avatars--but at the expense of verb resolution when it comes to firearms. She's capable of handling firearms; she's just not as interested, and they won't get her where she wants to go.

A critical rejoinder to the above would be that Mirror's Edge approach to making a better first person shooter is to no longer make it about shooting at all.
Which is a fair point. The game makes a compelling experience out of subverting the basic structure of the FPS, not by forwarding it. This is a breath of fresh air in a stale genre, but it addresses standing issues by refocusing gameplay away from the "pure" strain--though the argument could be made that hybridization is the lifeblood of action games (notice GTA games absorbing current genre conventions like cover systems, amoeba-like).
Anyway, I'll be the first to admit that I am still very, very interested in the business of shooting people in the face, as much as I enjoy Mirror's Edge.

Yet even if we're looking to improve the "traditional" FPS game, Mirror's Edge is still a useful study. Modify, limit, reshape the agency of the player in the world and you radically change the world for the player. Control schemes and core "verbs", as some designers like to speak of them, are much of the heart of any given game experience.
So instead of reshaping and refining movement as Mirror's Edge did, think of ways a FPS might be reshaped and broadened in terms of the gunplay.
By clearing debris from the core of what is a very conservative genre and reconsidering basic assumptions of how these things work--you're a man with a gun always pointing out into the world, at friend and foe?--intriguing solutions begin to present themselves.

Next time we'll sketch out just such an approach--not a radical redesign of FPS mechanics, but one that would consider existing actions--drawing, pointing a gun--and give them significance where none existed before.

On Influences

A brief personal note about influences and creative synthesis: I take great inspiration from the work of television producer David Simon, creator of The Wire and producer for Generation Kill. Both of these shows are about the most tired subject matter imaginable--cops and marines respectively--yet they're better than almost anything on the same subject because of Simon's emphasis on journalistic verisimilitude.
Not surprisingly he was a journalist before moving to television, and it is that attention to detail, a feel for the real that informs the spirit of his work. The people in his shows, either fictional or based on real people, are human to us.
Without exactly turning this whole entry into a paean to David Simon, the point is this: marines, even their space-based brethren, are not boring. We have made them boring.
They are boring because they are tired copies of copies, faded nth generation reproductions of recycled popular culture. We might not have some of our classic videogame franchises without the all-pervasive influence of Cameron's Aliens, but we might have a lot more interesting games.

I believe the onus of expertise is on content creators, not on the audience, and it is therefore up to us to research and craft characters and gameplay and situation that hews as closely to the unimaginable variety and wonder of actual events as possible.
And so regardless of our aims as to "realism" or simulation in our games, a journalistic desire for truth, or the artistic "lie that tells the truth" (to paraphrase Picasso) should inform our work at all times.
This is fairly major current in my design philosophy these days, so it seems pertinent to mention early on.

Monday, March 23, 2009

The Refrigerator Box

Monday, March 23, 2009 11
In Oliver Sacks' The Man Who Mistook His Wife For A Hat, there is a chapter called "The Disembodied Woman" (excerpted here).
In it we read of Christina, a woman who has lost all sense of proprioception. She learns to puppeteer her own body; if she is not looking at a limb, she has no internal sense of what it was doing.

A nightmare scenario for anyone, but one that sounds oddly familiar to gamers.
Proprioception is what we aim to replicate, albeit distantly, when we talk about "body awareness" in games--to look down and see your body is the most basic feedback for a body we cannot sense.
I want to use this as a way to look more generally at the sense of immersion, of being embodied in the avatar, and how FPS games are limited in this respect. Before we talk about any design changes or solutions, we need to understand the problems.

We'll never be able to capture full proprioception (nor would we likely want to), but that same sense of "being there" is critical to immersion. Lack of proprioception is much of the difficulty for new players to grasp FPS controls, given the relative dearth of sensory feedback, and why even experienced players may become injured or killed in the world in a way that seems "unfair."

If FPS players ever feel as though they're a walking refrigerator box in the game instead of a person, it's because they are. Many games refine hit detection for the purpose of assigning damage, but collision-wise most player characters really are just ambulatory refrigerator boxes with a small view slit and a gun, and games are designed to suit.

This box-and-gun model has implications that have shaped and limited FPS games more than we might care to admit. First we'll talk about the player's field of view, then basic collision in the world and scaling issues, and finally a little bit of what this means for the game space and interactivity.

You may recall the furor over "true widescreen" shortly after Bioshock's release. Without getting into that fairly snarled topic of debate, it's worth noting that it was all over a few degrees of field of view. With the standing box-and-gun model for the player in FPS games, the player's field of view (FOV) is a critical window to the world outside the refrigerator box.
In reality we enjoy 140 degrees of binocular vision, where the overlap between the two eyes' vision gives us depth perception, as well as an additional 40 degrees of peripheral FOV.
Stepping inside the refrigerator box gives us monocular (i.e. non-depth perceptive) vision limited to about 90 degrees, and typically far lower, all with no periphery. (A move to third person would expand our practical FOV as well dramatically improve our body awareness, but with other far-ranging costs and implications to the game design, so we'll talk about that later.)
What makes this so troublesome is that maximizing player FOV in order to play the game effectively--situational awareness and target acquisition and so on--can run contrary to other design imperatives.

FOV 75 and FOV 90 on HL2: The Lost Coast. The man appears more distant at 90, even though we are standing face to face. Note that the crowbar remains the same, as it is rendered separately to prevent distortion.

A well known case is that of Half-Life 2. Evolving from the player's fondness for the non-player characters in HL1, Valve spent a great deal of time and effort modeling, animating, and voicing NPCs like Alyx and Barney, characters that would make up the emotional core of the experience.
They quickly found that their wide-angle FOV, ideal for fighting enemies in the world, made these friendly characters appear farther away then they would have liked, even when standing face to face (or face to box). HL2 shipped with a standard FOV set to 75 degrees instead of 90, with a special case that opened it up to 85 degrees during vehicle driving sequences.
Bethesda Softworks would take a different approach to the same problem for The Elder Scrolls IV:Oblivion and then later Fallout 3. They retained a higher, more "distancing" FOV, and chose to dynamically zoom in on any NPC in the world that the player talks to to simulate the desired visual intimacy.

In addition to the relative perceptual difficulties related to FOV and characters in the world, higher FOVs introduce distortion, given from projecting a spherical perspective onto a flat screen. While this can be cleverly incorporated into the game, as with playing the alien perspective Aliens Vs. Predator with a very high "fisheye" type FOV, it's a problem for weapons in first person.
And when you're a refrigerator box with a hole cut out, the gun you hold in your hands is a central visual hallmark, your primary (and often only) agency in the world.
At higher FOVs, the gun in hand begins to distort along with the world, its apparent distance from you potentially more disconcerting than the apparent distance to NPCs. That the gun is often rendered separately from the world may ameliorate this, but alienate the player in other ways, furthering his or her apparent separation from the world. They're already a firm proprioceptive barrier away from the game already; any additional layers between the player and the world become prohibitive.
But this is enough to sketch out the myriad of issues associated with the first person perspective and FOV; I'd like to talk about the box out in the gameworld.

People understand that their avatar is clumsier than themselves, and that with practice a player is able to overcome or compensate for most shortcomings. This means they're nominally past thinking about the refrigerator box, but the box is always there. Often we can feel it, more often if the gameworld has not been scrupulously designed to accomodate the problem.
What I mean is that with level design there's a tricky balance between visual scale and player scale. The immersed player forgets that he is a refrigerator box, yet the world still need be scaled to accomodate his generous girth.

A friend of mine and fellow level designer Drew Risch taught me the simple, fundamental rule for good playspace in an FPS: keep it wide.
It's relatively simple to establish scale for all buildings, objects, and characters in a game to correspond with reality, but real world scale is unbearable for a refrigerator box to negotiate, even if the box itself is the relative dimensions of a person. You're a box, a box with only a small hole out the front with which to engage the world, so allowances must be made. Despite being a box you must be made to feel the hero, and heroes don't have to carefully negotiate kitchen furniture like the morbidly obese.
To that end the gameworld must be carefully widened, ballooned to allow the passage of this refrigerator box player and his often as-clumsy-if-not-clumsier AI compatriots.
The trick is to make this work mechanically, while still visually keeping the world in the ballpark of reality. It won't match, not if the world is truly wide enough for the player to move around comfortably, but these discrepancies can be carefully masked. In HL2, the corners of the Gordon-box can get the player stuck neatly into right angles of tight spaces such as elevators--level designers place invisible wedges in corners to prevent exactly this.
(In third person these sorts of issues are even more pronounced, though in different form; replay the beginning of Max Payne 2 and observe a world necessarily warped to accomodate Max's bullet-dodging antics and follow camera.)

We begin to see clearly why information systems, usually delivered via some sort of heads-up display (HUD) become so critical to helping the player over such considerable handicaps. The player has a narrow FOV and no proprioception, so environmental cues of sight and sound (plus a little rumble, if on a console) are all he or she is going to get.
Detailed sound design with corresponding sensitization of the player that these sound cues mean something (like the dry snapping sound of a bullet passing close by) can help close to gap left by so many missing senses, but won't fix everything. Which is why damage indicators and the like are now considered standard, as there is simply too much critical feedback the player needs to survive.

But I feel as though we've opened many doors without much sense to how we might approach a solution or a change from the problems these issues present.
At this point, what I want to impress upon you is that the player character is a refrigerator box with a hole cut in it and a gun sticking out, and so long as he remains such--a mute, verb-poor box, murdering everything in his path only to pause occasionally to flail at an oversized green-lit button or watch a mandatory cutscene--FPS games will likely remain the dim spectacle that they've been for years. There certainly is hope, but there's also a lot of dead weight carried from sequel to sequel that ought to be reconsidered.
But I'm getting ahead of myself and betraying more ambition than I care to for a first entry.

Next time, we'll talk about methods to overcome these seemingly crippling limitations, and explore other design issues present with the status quo.

Summary of embedded links:

The Man Who Mistook His Wife For A Hat on
Excerpt from The Man Who Mistook His Wife For A Hat, "The Disembodied Lady."
Wikipedia entry for Proprioception
Wikipedia entry for field of view
Valve Developer Wiki on FOV in HL2
Excerpt of Max Payne 2 playthrough on youtube
gausswerks: design reboot. Design by Pocket