Fearsome Engines

Physics engines rule video games.

In the beginning was the bullet. Projectile motion is one of the first problems put to physics students: a ball launched at velocity v from height h and angle θ travels how far, and lands when? Projectile motion is also one of the master concepts of modern war, and military dollars drive innovation like nothing else. Before the advent of precision guidance, dense tables told artillerymen how to point their pieces at the right helmets. These were a nightmare to produce by hand, each accounting for wind, powder and weapon, so drawing them up was one of the first problems put, just after World War II, to a calculating machine owned by the United States Army. They called their device the Electronic Numerical Integrator and Computer, better known, for short, as ENIAC.

In its way, ENIAC had an imagination. Its vacuum tubes could tell tales about fantasy shells in flight, about hydrogen bombs, about laminar flow and the weather. W. Barkley Fritz, one of the computer’s programmers at the Ballistics Research Laboratory, detailed these and other applications, about one hundred total, in a 1994 essay called “ENIAC – A Problem Solver.” The problems were mathematic and mechanical, but they were stories all the same. They were scientific models and, in a sense, science fiction: descriptions of imagined worlds, bearing as much or as little resemblance to reality as might be convenient. At a 1996 conference on Army computing, one mathematician recalled a programmer asking ENIAC to optimize a plane’s flight path. Unhelpfully, the machine suggested an underground route would be ideal. The programmers, a colleague pointed out, hadn’t specified that “flights occur above ground and above water levels.”

It’s easy to undersell ENIAC’s kind of imagination: pedantic, invisible, fixed and mechanical. But “physics engines,” systems that define the laws of a virtual worlds, have more to offer than flight paths and bomb designs. Within modern video games, they do some of art’s most difficult and sophisticated world building. The engines work at the fuzzy margins of what we mean by science; they live on the edge of what we mean by fiction. And they aim, in their own fashion, to change the way we think about realism.

***
The phrase “physics engine” is largely an invention of the 1990s. Use took off in relative terms after 1998, the year that the software firm Electronic Arts released a game called Jurassic Park: Trespasser. Though the term wasn’t cooked up just to describe that game, it seems unlikely the idea would have taken root without it; it was the first title to stake its vision so dramatically on its physics. Earlier games had had their laws—Pong, of course, has a rigorous internal logic—but Trespasser aimed to take the idea many, many steps further. And as you’ve probably gathered, it was a game about dinosaurs.

Though now Trespasser enjoys a cult following, it was a flop in its day. On a budget of some $7 million, it sold just 50,000 copies; Gamespot labeled it “undoubtedly the worst game of 1998.” It left behind an iconic tale of reckless imagination and commercial disappointment – a game skewered by the challenge of using physics to invent a world.

To understand what made Trespasser radical, think about the way games create the experience of freedom. Granted, some don’t really bother. In Space Invaders, you have one axis of movement and one decision: when to shoot. But most modern games plant the player in a rendered environment and give them, to one degree or another, choices.

Jurassic Park: Trespasser
Jurassic Park: Trespasser

The most basic version of this would be a text-based, choose-your-own-adventure framework. A scene is described—“You wake in a dank dungeon,” maybe—and you respond by choosing from a predetermined set of actions: despair, sleep, try the door. Each choice calls up a new scene, each scene in turn offers new choices, and so it goes until the story reaches an ending. But don’t expect spontaneous wiggle room: If you want to turn left and the creator hasn’t prepared that option, you won’t be turning left. Before you ever make up your mind, the game knows the outcome of every possible decision.

Much more elaborate and dynamic would be something like The Elder Scrolls: Skyrim. An open-world fantasy role-playing game, Skyrim is designed to make the player feel as unrestrained as possible; Matt Mann, writing for What Culture, called its developer Bethesda “synonymous with freedom.” Part of that experience comes from non-linear storytelling, but much of it comes from physical modeling. Shoot an arrow at a hanging bucket and you’ll send it swinging; launch a fireball at a bookcase and you’ll scatter the contents. And while some Skyrim scenes are pre-programmed, those effects are produced on the fly. The physics engine helps the game world behave a little more like, well, physics: given a set of initial conditions, it applies general laws to find specific outcomes. Instead of knowing a pile of small and specialized things (what to do if you steal the ogre’s magic lyre), it knows one big thing – how objects in the fictional universe interact.

Most games mix both approaches: scripted and fluid, particular and universal. But the arcs of computing, gaming, and physics all seem to bend in the same direction, toward increasing generality. Today more than 400 games (and many of the most famous ones, Skyrim included) use some part or version of the engine created by the Irish software firm Havok. But for some fans, you can never fill a game with too much procedural realism. “We NEED better hair physics,” one gamer commented before Skyrim’s release in 2011.

Which brings us back to the unhappy ambitions of Trespasser. “[The game] was intended,” one of its designers, Richard Wyckoff, later wrote for Gamasutra, “to be a complete simulation of any arbitrarily-sized box interacting with a number of other boxes.” Players took control of heroine Anne, sole survivor of a plane that’s crashed on an island crawling with dinosaurs. Inhabiting Anne in the first person, players interacted with the world through her physically modeled arm; it could hold things, throw things, poke things, as arms do. Glance down and her health was visible as a heart tattoo, stamped on her left breast. Her mission was appropriately general: survive and escape.

The island was meant to be fully open, full of dinos with the latest artificial intelligence, stocked with its day’s finest physical puzzles. Its animals would act like animals, by the standards of 1990s AI. Its sounds, mixed in real time from the game’s collision physics, would sound like real sounds. And by excluding most anything that couldn’t be modeled as a set of interacting boxes, Trespasser hoped to offer gamers a radically consistent user experience. “Limited but rich,” Wyckoff wrote, was the team’s guiding principle.

It was a revolutionary failure. A key problem was Anne’s arm; due to technical difficulties, designers only gave their heroine one functional limb, and functional is a charitable way of putting it. The arm would get stuck in doors and corners, stretching over miles of terrain if the player wasn’t careful. Writing in retrospect for Geek, Jim Hatley called it “oddly tentacle-like.” Its queer physicality, he added, meant that “melee weapons were all but useless, and most of the guns were more effective when thrown.”

Compounding these problems, Trespasser’s system demands made it too much for most machines to handle. One reason the physics-first approach was so unusual at the time is the raw computational power required. A gamer’s home computer, Wyckoff recalled, could handle having about ten of the game’s “boxes” on screen before it would strain to process anything else. Unfortunately, each individual dinosaur was made up of five boxes: “head, body, tail and two feet.” You see the trouble. The game, IGN ultimately decided, was “too far ahead of its time.” Their reviewer’s judgment was awfully severe: “The designers should be praised for their efforts, but shot for their implementation.”

Trespasser2
Jurassic Park: Trespasser

There’s something very Promethean about the Trespasser school game design. Its makers thought they could steal the fire of the gods—in this case, physics expressed through math and code—for their own creative purposes. Like Dr. Frankenstein’s did, their ambition produced something monstrous, grotesque, little loved by the public. Its core idea remains seductive; the game still enjoys an active following at the fan site TresCom.org, and there are, for better or worse, multiple efforts underway to bring it up to technical date. But if the physical way of creating worlds is uniquely powerful—it is the way our only real one seems to work—it’s also hobbled in ways other artistry isn’t.

Even if you had an infinitely powerful computer to play with, your simulation would run up against the fact that physics, as a discipline, is unfinished. The two most successful theories we have, general relativity and quantum mechanics, are incompatible, separate as two levels split by a loading screen. They’re approximate, and the history of science is a fat nesting doll of approximations; F = ma is more a handy half-truth than it is the secret stuff of the universe, and no asteroid knows Newton’s law of gravitation. But for the objects ruled by a game engine, your favorite mechanics can be strictly true. In fact, they have to be. So at the margins of your universe, gaps between the engine and reality will inevitably accrete – sometimes, as they did in Trespasser, to disastrous gaming effect.

In practical terms, this kind of difficulty sets in long before you have to model black holes, objects at the Planck scale, or the origins of the cosmos. Most games settle for a good version of rigid-body dynamics—the movement of bodies that don’t melt or squish—and even this fast generates problems. Friction, as Wyckoff tells it, was one of Trespasser’s white whales, “the main reason we gave up on stacking puzzles – a box on top of another box would more often than not start to vibrate… and multiple-box stacks were nearly impossible to keep together.” It took getting things dramatically wrong to make clear, Wyckoff notes, that “the effects of static and dynamic friction are so important to realistic behavior that their absence will compromise the simulation.” Lesson learned, then – but because you can’t import the default settings of our reality, every constraint like this has to be deliberately modeled. It wasn’t until FIFA 14, for example, that the popular soccer series resolved its problems modeling air drag. They’d been mishandling their Magnus effect, Scientific American reported: the way that airflow bends the path of a spinning ball. Novelists rarely have to worry about this sort of thing.

Those troubles are compounded by the fact that it will—from a practical standpoint—rarely be worth the engine’s time to find an exact solution to its own problems. The more detailed the physics involved, the more likely it is that a final solution won’t be available at all. Instead your game offers an approximate answer to what’s already an approximate system of equations. Then it’s the job of the sound and graphics engines to represent the finding for you: a shadow of a shadow of a shadow of an original truth. In a fashion that fast starts to boggle the mind, game designers are a community of practical Platonists.

Physics design is an art of “good enough is.” On the one hand, you can’t go cramming every physical law you know into your code. While “more rigor” is often taken as a quality signal, no home console has the computing power to run the Standard Model of particle physics, and quantum chromodynamics would probably be wasted on Mortal Kombat. But a creator still has to keep up with innovation. Ragdoll physics, which lets bodies loll and flop, was in Trespasser’s day the cutting edge. Now “destructibility,” an engine’s ability to represent the splintering and deformation of game objects, is a key measure of its power and prestige. With growing computing power, it becomes possible to model more intricate physical systems; the simulable world grows with the growing speed of microchips. Today’s immersion will probably be tomorrow’s surrealism.

No Man's Sky
No Man’s Sky

One of the most anticipated games in recent memory, the open-world sci-fi title No Man’s Sky, is nominally due out by the end of this year. It’s a rare game that earns more than 6,000 words of copy in The New Yorker, but No Man’s Sky has earned buckets of ink on the credit of its ambition: a contiguous game-universe of 18 quintillion (not a typo) worlds. If it succeeds, it will set a dramatic new benchmark for the creative power of games. If it fails, it will be in a way the second coming of Jurassic Park: Trespasser.

No Man’s Sky will be powered by a controversial technique called “procedural generation.” Its planets and biomes are built from tailored algorithms rather than by hand, as if the cosmos were home to a somewhat lazy god. While a massively efficient method of creation, it’s also long been looked down on artistically. – No Man’s Sky’s art director Grant Duncan told Polygon, that most video game artists see the method as “a big pile of shit.” And yet hearing the game’s designers describe their approach, it’s hard not to be awestruck by the creative authority involved. Rather than make a planet’s sky red, programmer Sean Murray told Gamespot:

We create algorithms that do things like decide if a planet is the right distance from the sun, and if it is, then it would have water, and so we generate water on that planet, and that creates rivers, and it creates lakes, and oceans… but then it also creates moisture in the atmosphere. Then that will affect the color of the sky, because the wavelength of the light is being diffracted… just like in our world.

“Just like in our world:” not because it looks the same way, but because it was made the same way. No Man’s Sky, in other words, has something even stranger and more ambitious than a physics engine: a creation engine, parallel in power to our own universe. When Bethesda boasted that Skyrim would use more handcrafted terrain than its predecessor, Kotaku editor Kirk Hamilton defended procedural generation on just those grounds. “After all, the real world is procedurally generated,” he said. “The procedures are incredibly complicated—we call them ‘Science’—but the same principle applies.”

It’s hard not to hope No Man’s Sky succeeds. It’s even harder to predict whether it can, or if it’ll be dragged down by the kind of wayward surrealism that sunk Trespasser. The game’s universe is so unfathomably large, Polygon reported, that its designers had to create in-game space probes to check for mathematical artifacts on their behalf. But in success or failure, No Man’s Sky is likely—like Trespasser—to wrench game history even further in the physical direction: toward a more “scientific,” more “realistic” vision of what it means to create. Its debut will be the latest evidence that games, perhaps more than any other artistic medium, are deeply plugged into the progress of science and technology.

Grayson Clary lives and works in Washington, DC.