Sitting in an office chair and frowning slightly, Randy Pagulayan peers through a one-way mirror. The scene on the other side looks like the game room in a typical suburban house: There's a large flat-panel TV hooked up to an Xbox 360, and a 34-year-old woman is sprawled in a comfy chair, blasting away at huge Sasquatchian aliens. It's June, and the woman is among the luckier geeks on the planet. She's playing Halo 3, the latest sequel to one of the most innovative and beloved videogames of all time, months before its September 25 release.

The designers at Bungie Studios, creators of the Halo series, have been tweaking this installment for the past three years. Now it's crunch time, and they need to know: Does Halo 3 rock?

"Is the game fun?" whispers Pagulayan, a compact Filipino man with a long goatee and architect-chic glasses, as we watch the player in the adjacent room. "Do people enjoy it, do they get a sense of speed and purpose?" To answer these questions, Pagulayan runs a testing lab for Bungie that looks more like a psychological research institute than a game studio. The room we're monitoring is wired with video cameras that Pagulayan can swivel around to record the player's expressions or see which buttons they're pressing on the controller. Every moment of onscreen action is being digitally recorded.

Midway through the first level, his test subject stumbles into an area cluttered with boxes, where aliens — chattering little Grunts and howling, towering Brutes — quickly surround her. She's butchered in about 15 seconds. She keeps plowing back into the same battle but gets killed over and over again.

The Game

What's New in Halo 3

More weapons And meaner ones, too. Our favorite: the Spartan Laser. Modeled on a powerful real-life laser, it can destroy an enemy in one shot.

More vehicles

The number of vehicles has been doubled, from eight to 16. These include the Brute Chopper, a monowheel-meets-hovercraft that can turn on a dime and mow right over Warthog ATVs.

Instant replay In Saved Films mode, a virtual-camera application lets you record any fight, view it from any angle, and then send it to friends on Xbox Live to show off your moments of triumph.

Enhanced audio The new sound engine can deliver up to 100 separate tracks at a time. You'll hear bullets whiz past your ears, enemies creep up on you, and AI characters scream and curse during firefights — all in full 5.1 surround sound.

Vast levels You'll battle through lush jungles and enormous hangars and maneuver atop alien ships. Bonus: a multiplayer level inspired by medieval cathedrals.

DIY game design Using the new Forge tool, players can customize multiplayer maps by dropping weapons, vehicles, and flags anywhere they choose. Always wanted to play a free-for-all round using only grenades? Now you can.

— C.T.

"Here's the problem," Pagulayan mutters, motioning to a computer monitor that shows us the game from the player's perspective. He points to a bunch of grenades lying on the ground. She ought to be picking those up and using them, he says, but the grenades aren't visible enough. "There's a million of them, but she just missed them, dammit. She charged right in." He shakes his head. "That's not acceptable."

Pagulayan makes a note of the problem. It is his job to find flaws in Halo 3 that its creators, who know what players should do, might not be able to see. He assesses whether the aliens have gotten too lethal, whether the revamped Needler guns are powerful enough, and — most important — if and when players are getting bored or (as is more often the case) frustrated. Clicking away on his keyboard, Pagulayan brings up video of one of the first fights in the game, in which a Brute wields a ferocious gun. Neophyte players are getting massacred.

"That enemy can kill the player in three shots," he says. "Imagine your mother playing, where she's barely learning how to move around in the game — bam, bam, bam — dead. That's not going to be a fun experience."

All game companies test their products, but generally they just pay people to report any bugs they find — monsters that disappear or places where graphics don't render properly. But because it is owned by Microsoft, which launches dozens of Xbox and PC games every year, Bungie has access to one of the most advanced game-testing facilities ever built. Pagulayan and his team have now analyzed more than 3,000 hours of Halo 3 played by some 600 everyday gamers, tracking everything from favored weapons to how and where — down to the square foot — players most frequently get killed.

Bungie doesn't just test its own games this way. It also buys copies of rival titles and studies those, too, to see how Halo matches up. "I've never seen anything like it," says Ian Bogost, a professor of digital media at Georgia Tech, who toured the testing lab in the fall. "The system they've got is insane."

It might seem like an awfully clinical approach to creating an epic space-war adventure. But Bungie's designers aren't just making a game: They're trying to divine the golden mean of fun. They need to create an experience that is challenging enough to thrill the 15 million existing hardcore fans of Halo — yet appealing enough to lure in millions of new players.

If anyone can pull off this delicate balance, it's Bungie. Released in 2001, the original Halo seamlessly blended riveting gameplay with a cinematic narrative — the fight between humans and a murderous alien race was told through plenty of twitchy, white- knuckled combat. When Halo 2 debuted three years later, it again broke new ground by letting gamers square off against their friends on the fledgling Xbox Live online service. Fans went berserk. They debated the intricate plotlines, bought T-shirts and figurines, read Halo novels that Bungie produced, and crawled into work bleary-eyed after all-night death matches. Halo became a cultural touchstone, a Star Wars for the thumbstick generation.

Get Ready for Next-Gen With Our Halo 3 Video Primer: Never played a Halo game? Discover what the buzz is all about as Wired editor Daniel Dumas discusses the Halo ethos and provides an action-packed glimpse of the future: Halo 3. For more, visit wired.com/video. Now the company has to do it again, only better. This will be the first Halo for the Xbox 360, and it comes at a critical point in the console wars, with Microsoft fighting both Sony's graphically superior PlayStation 3 and Nintendo's unexpected hit, the wrist-twisting Wii. Microsoft needs Halo 3 to be a system seller — a game so good that people buy an Xbox 360 just to play it (the original Xbox's only profitable quarter came during the launch of Halo 2). "I don't see any other game that's going to have as big a blast radius for the Xbox as Halo 3," says Dean Takahashi, author of The Xbox 360 Uncloaked. "They need to sell a lot of consoles for Microsoft."

So Bungie's designers sift through Pagulayan's reports, peer through the one-way mirror, and scrutinize every second of the game. Videogame development involves artistry, obviously. But at Bungie Studios, it's become something of a science as well.

The Science

Blood, Guns, and Research

While Bungie is using science to make better games, researchers are learning more and more about gameplay itself. Among the findings so far:

· It's just as fun to die. A group of Finnish scientists wired gamers with skin meters, cardiac monitors, and facial electromyographs and found that getting killed in a game produces the same positive emotions as beating an opponent or completing a level.

· Fellowship matters. Researcher Jonas Heide Smith ran a study with 19 gamers and discovered that even hyper competitive players tend to help others. Desire for fairness in play, it seems, is as strong as the desire to win.

· It's OK to cheat — a little. In 24 interviews with gamers, researcher Mia Consalvo discovered that "a majority of game players cheat" — though they also have strict social codes governing what's acceptable. Consulting a game guide: cool. Using auto-aim software to target opponents: uncool.

· Games are good practice. A study in the February 2007 issue of Archives of Surgery found that laparoscopic surgeons who excel at videogames make 47 percent fewer errors and work 39 percent faster than their peers.

— C.T.

Bungie's office in Kirkland, Washington, houses more than 100 workers in a massive open room covered by a domed roof. It's early June, and the place has an air of quiet, frantic energy. In a far corner, a group of artists work on crafting the swoopy attack movements of the aliens. Along a wall, environment programmers stare intently at screens, fine-tuning scenery in the latest levels. Marty O'Donnell, the company's audio engineer, is holed up in a soundproof studio room, tweaking Halo 3's 34,000-plus lines of combat dialog, to ensure that aliens and marines curse and yell appropriately during battles (Wired's editor in chief, Chris Anderson, voiced a few blood-curdling screams for the game). Near the kitchen area, a programmer naps in a small pile of beanbag chairs.

Now one of the largest game design studios in the industry, Bungie began as a two-person operation. In 1991, college pals Alex Seropian and Jason Jones gathered in Jones' Chicago basement to create games for the Macintosh. Their first hit, in 1994, was a first- person shooter called Marathon. Most shoot-'em-ups of that time, like Doom and Wolfenstein 3D, had little or no plot; finishing a mission was as simple as fighting your way to the end. But Seropian and Jones imbued their games with intricate story lines and vibrant characters. Marathon and its sequels also pioneered technical advances astonishing for the era. Two gamers could team up and play the game in cooperative mode, while up to eight players could spar against one another in virtual arenas, taunting opponents over AppleTalk.

With the Marathon franchise and another game called Myth, Bungie built a loyal cult following. In the late-'90s, the designers started planning a new strategy-based title in which players would control an entire army of space marines fighting a rival band of hyperactive, gibbering aliens. The action would involve moving entire military battalions around the battlefield at once, and players would engage in a sort of futuristic version of Risk. But as work on the project began, the team found itself drawn back to the first-person, kill-frenzy action of Marathon. Eventually they decided their new game would focus not on the whole army but on a single soldier — Master Chief — as he fought the Covenant, a race of aliens driven by a mysterious religious prophesy. Halo was born.

Early on, the Bungie crew came up with a mantra that would eventually guide all aspects of Halo gameplay: "30 seconds of fun." The idea was to have Halo repeatedly immerse players in hectic battles that would last for half a minute — just long enough to create heart-thumping chaos and the risk of death — before offering a respite. Meanwhile, each level would also include scripted cinematic scenes to push the story forward. It was a subtle but deeply pleasing balancing act: Halo neither bored people with overly long storytelling animations nor numbed them with pointless fighting.

Leveling the Playing Field

In April, Bungie found a nagging problem with Valhalla, one of Halo 3's multiplayer levels: Player deaths (represented in dark red on this "heat map" of the level) were skewing toward the base on the left, indicating that forces invading from the right had a slight advantage. After reviewing this image, designers tweaked the terrain to give both armies an even chance.When Bungie demo'd the game at Macworld Expo in 1999, fans were awestruck. So were Microsoft game executives. They were looking for a system seller for their forthcoming Xbox and for the Xbox Live online service they hoped to launch shortly thereafter. Microsoft bought Bungie in 2000 for a reported $50 million; a year later, Halo, recoded for Microsoft's console, became the must-have game of the year. It instantly transformed the Xbox from a dubious proposition to a credible alternative to the then-dominant PlayStation 2. Bill Gates and CEO Steve Ballmer began pushing hard for a sequel.

The pressure to deliver nearly destroyed Bungie. When it began making the original Halo, the design team consisted of 10 people. They could all sit in a single room and communicate by yelling over their shoulders or peering at each other's cool creations onscreen. To make Halo 2, the company ballooned to more than 60. Separate teams formed to design each level of the game, but they didn't coordinate their efforts: When project leaders assembled the pieces for the first time, they discovered that the story was incomprehensible and the game whipsawed from too easy to nearly impossible.

"It was a disaster in the game-story campaign," admits Harold Ryan, the studio manager. "We looked around the room going, 'I don't want to play this. I don't want to make this.'" They threw out 80 percent of the work they'd done and started over. But they now had barely a year and a half to reconstruct the entire game.

The movie

No Big Screen for Halo

The movie version of Halo was supposed to be the next Star Wars. Instead, it's more like The Empire Strikes Out. In the summer of 2005, Microsoft teamed up with Universal and Fox for a $130 million adaptation of the videogame franchise. Peter Jackson signed on to produce, tapping f/x whiz Neill Blomkamp to direct. Weta Workshop began churning out models, and Oscar-nominated scribe Josh Olson reworked a version of Alex Garland's (28 Days Later) original script.

In October 2006, both studios pulled out, citing financial issues. But sources close to the project say the problem wasn't just Jackson's rumored $200 million budget; the studios were also irked by the software giant's demands for creative control and a hefty 10 percent of the box office. (Microsoft denies these claims. Studio reps declined to comment.) "I had faith the film would find another home," Olson says. "It's Peter Jackson. It's Halo, for God's sake. Who's not going to pick this up?"

A year later, Halo is still in limbo, but fans can at least check out Halo: Arms Race, a short film the director created for last summer's E3 conference. (More shorts will be released before the launch.) If Blomkamp's seamless visuals are any indication of what could be, Hollywood needs to level up.

— Hugh Hart

Luckily, Bungie had a secret weapon. Because games were becoming a new focus for Microsoft, the company had built a dedicated usability lab for stress-testing its titles. Bungie tapped Pagulayan, a recent PhD graduate in experimental psychology from the University of Cincinnati, to refine Halo 2 in the facility. Pagulayan's team quickly went to work building tools for extracting gameplay data, including the location of each player and when and where they fired weapons, rode vehicles, killed aliens, and died. They ran weekly tests, analyzing 2,300 hours of play by 400 gamers in under two months. Over and over again, they found snags — a mutant alien that was far too powerful, a lava pit that too many players fell into.

But the time constraints were daunting, and the lab wasn't able to catch everything. In the end, Halo 2 was a less complex, less satisfying game than the first Halo. In the original, players had three equally powerful ways to attack: gun, grenade, or punch attack — the "golden tripod," as Jamie Griesemer, Bungie's head of gameplay design, dubbed it. Like a game of rock-paper-scissors, part of the fun was frantically deciding which method would work best. But in Halo 2, the designers decided to let players wield two guns, an option so overpowering that players rarely used any other form of attack. Perhaps worst of all, Bungie's team didn't have time to finish their story. Halo 2 ended with Master Chief announcing that he's returning to Earth and "finishing this fight" against the alien force. Then... nothing. The credits roll. It was as if the coders had simply turned off their computers and walked away. In public, Bungie employees put on a brave face, but privately they were chagrined. "Just as the game was going out the door, everybody was kind of like, Holy shit — this is not what we like here," recalls Brian Jarrard, Bungie's head of community relations.

One aspect of Halo 2 did blow everyone away: multiplayer matches over the Internet. No console game had yet mastered online play. And Bungie worked closely with the engineers at Microsoft's Xbox Live service to make signing on point-and-click simple. In minutes, Halo 2 players could join a quick game of "death match" — kill others before they kill you — or assemble teams for rollicking bouts of capture the flag. Better yet, players were automatically paired with others at the same skill level, ensuring that they wouldn't be instantly slaughtered by crazily adept 12-year-olds in Texas.

Fans swarmed online. Halo 2 became a system seller again: Of the 6 million people who have signed up for Xbox Live, fully two-thirds of them joined to play Halo. Redmond was ecstatic. Online gaming had long been considered a vital next step for console makers and, thanks to Bungie, Microsoft got there first.

As I peer over his shoulder at the computer screen, Tom Doyle prepares to show off his new gun. Holding an Xbox controller, he walks Master Chief over to a menacing, garbage-can-sized weapon and cradles it in both arms. Doyle spins the in-game camera around, so that we're staring right down the barrel, and fires. A stream of white-blue plasma pours out. This is the Plasma Turret — a powerful alien weapon debuting in Halo 3 that can blast through your shield in about two seconds. Doyle designed it.

"A lot of the energy weapons in Halo 2 felt frail, like pyoo-pyoo-pyoo Buck Rogers lasers" he says. It made people not want to pick them up and use them. "This feels more deadly. You can almost feel the heat of the weapon, the ignited plasma beams." He chuckles. "You know this thing is gonna kill."

Bungie is determined not to repeat the mistakes of Halo 2. This time it wants to make the single-player game perfect. To this end, it has committed to a two-step process: First dream up the new weapons, levels, and situations. Then monitor hundreds of people as they play the hell out of them in Pagulayan's lab.

There are a few things to fix right away. One of Bungie's central goals is to restore the "golden tripod" of play. Working with Doyle and the other weapons artists, gameplay chief Griesemer tweaked the guns — for example, reducing the amount of ammo many carried — so that wielding two at a time won't always be the most effective way to dispatch an enemy. He then boosted the power of grenades and the "melee" punching attacks. Battles, he hopes, will once again become the sort of lightning-fast chess matches they were in the original Halo, requiring constant, on-the-fly decisions about which method of attack to use.

To make combat even more unpredictable — and to give longtime Halo players new treats — Griesemer and the team devised new objects for the game, doubling the number of weapons. Inspired by a real-life, high-powered beam called a Galilean laser, Doyle invented the Spartan Laser. It produces a bolt that can destroy an enemy in one shot — but because it takes a few seconds to charge, it gives astute opponents the chance to notice they're being targeted. Other designers came up with the Bubble Shield, a temporary force field, and the Gravity Lift, which players can use to propel themselves into the air. Among the new vehicles is the Mongoose, a small four-wheeled motorcycle, and the Brute Chopper, a sort of high tech Big Wheel with a ferocious cannon mounted in front. Each new addition, Griesemer points out, brings new facets to the gameplay. But each also inevitably causes unexpected problems: A particular gun becomes too powerful, a vehicle ends up making battles lopsided — and suddenly the game is less fun.

This is where Pagulayan and two assistant Bungie researchers step in. Every other week, beginning in the fall of 2006 — when the first builds of Halo 3 were available for testing — Pagulayan and his team have recruited about 20 people to come into the lab and play the game. Some tests include a pop-up box that interrupts the player every few minutes, asking them to rate how engaged, interested, or frustrated they are. Pagulayan also has gamers talk out loud about what they're experiencing, providing a stream-of-consciousness record of their thought process as they play. Over time, he's gathered voluminous stats on player locations, weapons, and vehicles.

After each session Pagulayan analyzes the data for patterns that he can report to Bungie. For example, he produces snapshots of where players are located in the game at various points in time — five minutes in, one hour in, eight hours in — to show how they are advancing. If they're going too fast, the game might be too easy; too slow, and it might be too hard. He can also generate a map showing where people are dying, to identify any topographical features that might be making a battle onerous. And he can produce charts that detail how players died, which might indicate that a particular alien or gun is proving unexpectedly lethal or wankishly impotent.

The lab also records video footage of every testing session and hyperlinks these clips to the individual progress reports. If the design team wonders why players are having trouble in a particular area, they can just pull up a few test games to see what's going wrong. Take what happened last March: A report noted an unusual number of "suicides" among players piloting the alien Wraith tank in an upper level. After watching dozens of archived test games, Griesemer spotted the problem. The players were firing the tank's gun when its turret was pointed toward the ground, attempting to wipe out nearby attackers. But the explosion ended up also killing (and frustrating) the player. To prevent this, Griesemer reprogrammed the tank so that the turret couldn't be lowered beyond a certain point. The Wraith suicides stopped.

Welcome to the Jungle

In early tests, players wandered lost around the Jungle level: Colored dots showing player location at five-second intervals (each color is a new time stamp) were scattered randomly. So Bungie fixed the terrain to keep players from backtracking. Sure enough, the dots clustered by color, showing that players were moving smoothly through the map.A similar report showed that in the game's first level, called Jungle, players often ran out of rounds for their rifles. This was a mystery, because the designers had been careful to leave more than enough ammunition lying around. The team checked Pagulayan's video records and found that people were firing at the aliens when they were too far away, misjudging the range of the weapon and wasting bullets.

At first the designers couldn't figure out how to fix this problem. But then Griesemer stumbled on an elegant hack: He made the targeting reticule turn red when enemies were in range, subtly communicating to players when their shots were likely to hit home. It worked.

The ideal in gameplay, the goal every developer aims for, is an experience that keeps players in a "flow" state — constantly surfing the edges of their abilities without bogging down. Modern videogames are often compared to Hollywood movies, but the comparison, many Bungie designers will tell you, is inaccurate. A movie is static. "You sit there and absorb it all in a single two-hour shot, and it's perfectly linear," says Frank O'Connor, one of the writers tasked with scripting the story line in Halo 3.

Creating a game, in contrast, is like a combination of architecture — constructing environments that influence the behavior of people inside them — and designing a new sport. Gamemakers have to devise a system of rules and equipment that gives players a few basic goals and then allows them to find their own ways of achieving those goals. The flow comes from constantly discovering innovative ways to solve these open-ended problems.

Of course, this means that players will sometimes surprise game designers by doing things even they never thought of. This spring, executive producer Jonty Barnes watched a tester run around in a multiplayer level of Halo 3 that's constructed like a deep canyon. A bunch of Gravity Lifts were scattered around the bottom, and the player was bouncing from one to another. Then the tester got a clever idea: He grabbed one lift and, holding it, jumped into another one, launching himself up onto a high ledge. He then placed the second lift on the ledge and used it to bounce up even higher, landing on the top rim of the canyon. That area wasn't even supposed to be accessible to players.

"So he's up running on the canyon ledge, and the engineers are going, ‘Christ, how the hell did that happen? Do you know what kind of bugs this is going to cause?'" Barnes laughs, a hint of pride in his voice. "But that's what you get when you set people free in your world."

Halo 3 is a vibrant, beautiful game, but it's also a bit cartoony. It doesn't have the eye-popping verisimilitude of, say, Gears of War, a rival Xbox 360 hit from Epic Games that dazzled fans last winter. Many critics have made this same comparison, and it's a sore point among some Bungie designers. They like to note that Gears of War — like most of today's shooters — takes place mostly in narrow corridors with only a few enemies at a time, so its makers can lavish attention on every square foot of space. Halo 3 is set in sprawling outdoor levels, with dozens of alien enemies swarming onscreen at once. The vastness of the game's geography means that gamers can replay each battle several times, trying several radically different ways to fight through it. It also means that Bungie's designers have to spread the Xbox 360's processing power around more thinly.

But though expansive levels may be one of the keys to Halo's appeal, the problems they cause go well beyond graphics. Enormous battlefields also create lots of places where things can go wrong — areas where players can get bored, stuck, or killed. This has been one of the main challenges facing Halo 3's designers; it first showed up in testing of the beginning Jungle level. Players were simply baffled about where to go.

In the lab, Pagulayan pulls up an early map of Jungle; on it are superimposed the locations of about 30 testers after half an hour of play. The dots are scattered throughout the terrain. This, he says, is bad: It means that people were wandering aimlessly instead of progressing through the level. "People were lost," Pagulayan says. "There wasn't much deep analysis to do here."

To solve such problems, the designers must subtly direct player movement by altering the world in small ways. In this case, they decided to change the geography of the Jungle level so that in certain places players had to jump down a steep ledge to reach the next area. This way people can't go backward, because they can't climb back up the ledges. Pagulayan shows me a map from the next testing round, after the fix was implemented — and sure enough, all the dots are clustered in tight bunches, right where they are supposed to be.

Another case of terrain-sprawl trouble popped up a few months later in one of the upper levels. The level is intended to introduce vehicle combat, with players following a bunch of their fellow marines as they clamber aboard Warthog ATVs and ride out over a wide-open plain. But Pagulayan's data showed that a significant number of players were trudging across the plain on foot. It turns out the designers hadn't put enough vehicles in the scene, and the artificial-intelligence marines were taking them all before players realized they were supposed to hop aboard. The solution: More Warthogs.

On a sunny Thursday afternoon, I'm finally allowed my own taste of Halo 3. I'm escorted into the faux game room, seated in the comfy chair, and handed a controller. I'll be playing the Jungle mission. Pagulayan settles behind the one-way mirror to observe.

As I wander through the lush forest, I'm struck by details: Steam rising off felled logs, clusters of insects flying in clouds, plants that sway realistically as I brush past them. Halo 3 may not have the most advanced graphics available, but it's noticeably more gorgeous than the previous Halo games. Soon, though, I get confused; I try to follow one of my comrades up a short cliff, but I can't scale it. It takes me five minutes to figure out that I'm supposed to go around instead.

Then, bang — the action starts. A phalanx of Grunts comes squealing to attack, and soon I'm wearing out my trigger finger as I blast away with my machine gun. Sure enough, the "golden tripod" balance has been restored. The guns seem to run out of ammunition more quickly than usual, so I'm constantly opting for punching attacks and, later, grenades to take down large groups of enemies. It takes me a while to figure out which button controls my melee attack — where my avatar runs up and smashes an opponent in the head — but once I get it right, I discover that it's enormously satisfying: Each blow delivers a moist, brutal impact that sends foes flying.

After half an hour, Pagulayan pulls me out of the room for a debriefing. I'd been temporarily flummoxed at the cliff, he observes. "We've had participants spend 30 minutes trying to climb up there." He thinks the designers will need to make it easier, maybe adding a little arrow to show the correct route. He also picked up my confusion over the melee attack button. Other testers are having the same problem, and Bungie is not yet sure how to fix it.

Pagulayan makes notes on my experience — more data to feed into the Bungie machine. They'll crack these problems, he is sure. They'll solve the mystery of why some Brutes are going AWOL in a later Jungle battle. They'll train their AI marines so they don't keep mindlessly hollering the same curses over and over while fighting. And they'll figure out how to get players to monitor their ammo — before they run out and get gunned down.

Last week 52 percent of players gave the Jungle level a 5 out of 5 rating for "fun," and another 40 percent rated it a 4.

Pagulayan wants to do better.

Contributing editor Clive Thompson (clive@clivethompson.net) wrote about collective intelligence in issue 15.07.

Feature The Creators of Halo 3 at Bungie Studios