The More, the Merrier
John Carmack treats discipline as more than a state of mind. It's a way of life.
Discipline, along with a keen intellect and a ceaseless desire to experiment and build, had enabled him to construct digital platforms that caused seismic shifts across the landscape of technology. From before Commander Keen and id Software through Quake 2, discipline intermingled with curiosity had been his mana, a wellspring that fueled him to barrel over obstacles and bring his visions to life on computer screens.
In early 1998, Carmack took his seat at a table surrounded by high-rolling executives and drew from that well once again.
"Having a reasonable grounding in statistics and probability and no belief in luck, fate, karma, or god(s), the only casino game that interests me is blackjack," he wrote in a .plan blog dated February 9, 1998. "Playing blackjack properly is a test of personal discipline. It takes a small amount of skill to know the right plays and count the cards, but the hard part is making yourself consistently behave like a robot, rather than succumbing to your 'gut instincts.'"
Carmack's strategy was to play a basic high-low count and scale his bets far and wide. The prospect of losing did not faze him, nor did winning. Making games put food on his table and Ferraris in his garage. His robotic mindset paid off. By the end of the night, he'd racked up $20,000 in winnings. He did not pocket the money. Instead he donated to the Free Software Foundation, partly out of respect for the institution, partly because he felt he owed them. He and his team had written Doom and Quake on NeXTSTEP, an operating system that offered tools distributed through FSF at no charge.
Besides, Carmack was playing for fun. Activision had flown the id team to Las Vegas for a bacchanalia of food, drinks, and gambling on the publisher's dime in celebration of Quake 2's launch the previous November. Carmack had passed the time between the game's arrival in stores and Activision's fete working on id Tech 3, his next game engine.
The rest of id's team fell back into step more slowly. Shortly after Quake 2's completion, Tim Willits and Paul Steed had hopped a plane to Australia, one of many legs on a global tour to promote the game. Jennell Jaquays had been one of a handful of developers still at the office. Most of her peers had headed home for their well-deserved rest.
"When Tim left the office to go on the tour, he said, 'Whatever you do, don't open the maps and recompile them.' What were 75 percent of the things we had to do? Open the maps back up and recompile them," Jaquays remembered.
As the only level designers still on duty, Jaquays and Brandon James sifted through reports of bugs, many embedded in Quake 2's maps. To squelch the bugs, the maps needed to be opened. Cognizant of Willits' forewarning, James and Jaquays braced for impact and went in, clearing out errors and recompiling levels. They worked carefully. Fixing errors carried a high probability of introducing others. Next, John Cash went in to patch up the code involved in setting connecting points in each map.
Patches for Quake 2 rolled out without incident, and the skeleton crew had gone home. Jaquays and her spouse had sent their kids to stay with grandparents and traveled to France, where they rang in 1998 with friends. By the time developers began trickling back into the office, Carmack had long since slipped right back into the stream of his usual schedule, entering his programming cave in id's black cube around four in the afternoon, working for 12 hours, heading home for sleep, then returning the next evening to do it all over again.
Everyone else kept busy. Xatrix Entertainment, Inc., had been contracted by id to develop The Reckoning, the first of several planned map packs for Quake 2. Xatrix's team was building single-player and multiplayer stages as well as new weapons and enemies such as the Repair Bot, a foe that went around resurrecting dead monsters in an ode to Doom 2's Arch-Vile. Although Xatrix was at the wheel of The Reckoning, id's developers were its navigators, managing the project to completion. Once the team at Xatrix finalized content, id moved on to oversee Ground Zero, another expansion in the works at Rogue Entertainment.
External map packs did not consume all of id's time. While Carmack and programmer Brian Hook wrote id Tech 3, a small team of in-house artists and programmers built levels and monsters for a third Quake 2 add-on.
"What we started working on was, basically, Quake 2.2," Jaquays said. "We wanted to do our own map pack that was going to be a second Quake 2 story. We were working on that, kind of poking on it, not really inspired. I know I did a few map designs on paper, trying to make some new and interesting things in the editor. Then—this was mid-spring of '98—Carmack comes in and says, 'I want to do Quake 3 as graphics-accelerator-only.'"
Carmack gathered the team in a conference room. There, he outlined his plans for a third Quake game that would eschew software acceleration in favor of graphics that would mandate the presence of a video card in the user's PC. The team was cautiously optimistic. Graphics processing units had not yet become ubiquitous. Only users willing to pay top dollar for graphical bells and whistles in games such as Quake 2 and Half-Life installed them.
On the other hand, id Software had fostered a reputation for developing games that sang on the latest and greatest hardware. The need to run Doom and Quake at the highest possible settings had impelled consumers to trick out their systems to. Developing a game that refused to run on computers without a GPU was all but guaranteed to drive hardware sales.
"We knew it was radical, and we knew it would upset some fans, but we also knew that this is the thing we wanted to do," remembered Jaquays. "The idea of not having those damn polygon limits that software rendering required—that was a godsend. We were all behind it. We were 100 percent behind it. We took Quake 2.2 or whatever we were making and [abandoned it]. And that was it."
Carmack's second announcement held the potential to foment even more controversy. After years of writing cursory plots, id Software would abandon any pretense of a narrative in Quake 3.
"What Carmack envisioned was a world full of servers you could jump in and out of. You could play with your friends, or against bots," said Tim Willits.
"We all knew that this was going to make waves because we were going to alienate people," Jaquays agreed. "But, we all loved running around shooting other people in our maps. This was an opportunity to do what id really did best, which was a multiplayer shooter."
Like embracing GPUs, renouncing stories in favor of raw deathmatch made as much sense to id's community of players as it did to its developers. "We had tournaments, we had QuakeCon," Willits said. The annual gathering had begun in August 1996 when a group of Quake players from around the globe had decided to rent out a hotel room in Dallas and play computer games—namely Quake—for an entire weekend. Year by year, the conference had grown, spurred by appearances from id developers and highlighted by an annual keynote from John Carmack.
"When people talked about their love for Quake, or their first time playing Quake, it was usually about multiplayer," Willits continued. "'I played with my brother' or 'I carried my computer to college and we ran network cables down the hallway.' There was so much passion for multiplayer that it made sense to steer into what people love the most about the game."
Industry pundits concurred. "It’s where we were going, so not a surprise," said Rob Smith, then-editor at PC Accelerator magazine. "But the technology changed in those intervening years, so it was always going to be different. What it meant was we had to get better. There was the emergence of these people who could play way, way better than us."
Handling
Graeme Devine was new to id Software, but he was by no means unfamiliar with Quake and its growing legion of professional players.
"We were aware of it, definitely," Devine said in regard to the growing movement of pro gaming tournaments, or eSports. "Programmers would come in and show us how they played Quake 3, and of course we had QuakeCon. People like 'Thresh,' Dennis Fong, would come in and play us at Quake 3."
Like Mike Abrash, Devine was a programmer after John Carmack's heart. Growing up in the UK, Devine had learned how to program on the BBC Micro before starting his own game company at age 14. Two years later, he was writing code for Atari. In December 1990 he co-founded Trilobyte with Rob Landeros, whom Devine had met when they worked together at Virgin Games.
Trilobyte's most popular titles were The 7th Guest and follow-up The Eleventh Hour, full-motion-video (FMV) adventure games that saw the player's decisions unspool as pre-recorded video with special effects sprinkled in. Released in April 1993 months before Cyan Entertainment's Myst, The 7th Guest sold over two million copies and received credit for stimulating sales of CD-ROM drives.
A short time later, Devine became enamored with Apple co-founder Steve Jobs' NeXTSTEP operating system. Through Jobs, Devine met John Carmack. Giddy over the power of NeXTSTEP machines, Devine and Carmack traded messages back and forth through the early '90s, taking advantage of powerful features such as the ability to record and send audio files and images embedded within text emails.
In 1996, Carmack sent Devine in-progress shots of his Quake engine. Devine was impressed, and endured good-natured teasing from Carmack over his decision to create games like The 7th Guest using pre-rendered rather than real-time graphics. During the odd trip out to Texas, Devine swung by id to pay his friend a visit. After Trilobyte closed its doors in early 1999, Carmack extended a job offer to Devine to join id full-time as Quake 3's lead game designer.
Devine knew his limits. Though he was still knew at id, he recognized that he could code rocket launchers better than he could fire them. Nevertheless he threw his weight against Dennis "Thresh" Fong, one of the top Quake players in the world, when Fong visited id. Devine did not fight alone. Id's developers followed the franchise's competitive scene and looked to players like Fong to help them tighten screws on Quake 3. To put the game through its paces, they had challenged Fong to deathmatch: The entire development team against one pro.
"He was pissed that Christian [Antkow] took him out once by camping with the railgun," Devine remembered, laughing. "He was mad as hell. But he still beat us 31-1. It was just funny. He'd fire down a corridor, and we'd say, 'Why'd he fire down that corridor?', and then someone would run in at the very last minute at the end of the corridor, and we'd go, 'Oh. Well."
Player control had become a staple of Quake's multiplayer. Devine knew it, and looked to pros to help him dial in fine touches such as the speed of the player versus the speed of projectiles such as rockets. "A lot of it was [solving problems such as], 'I couldn't get back to the battle fast enough, and now the game's over' and 'I couldn't get away from the spawn point' and 'I heard the red armor [appear] and I couldn't get to it before it was gone,'" Devine explained.
Jumping, a crucial piece of Quake's DNA, got a literal boost by way of jump pads, circular pads on floors—and able to be positioned at angles thanks to id Tech 3's capability to render curved surfaces—that launched players into the air. Devine and the rest of the team took great pains to craft jumps that felt smooth and natural so as not to disorient players. Rocket jumps, normal jumps, pad-enhanced jumps—the developers iterated on them time and again, especially after playing Unreal Tournament, their chief competitor in the nascent arena-shooter genre.
A multiplayer-focused sequel to 1998's Unreal, Unreal Tournament boasted jump pads as well. Quake 3's team didn't care for them. "We felt their system was very linear; it didn't have the same graceful feel that our jump system had," Devine said, "because we worked a lot on making our jumps feel perfect and forgiving. The thing Nintendo spent the most time coding in Super Mario was jumping, and we spent a lot of time making our jump feel like you could just make [that leap]."
Fine-tuning Quake 3's movement and control for human players was only one step of the development process. A second, arguably greater challenge was emulating those same players.
Learning Machines
Just because Quake 3 would not contain a campaign did not mean id Software intended to abandon single-player modes.
Rather than scribble out a paragraph about human-alien hybrids or portals from hell tearing the fabric of reality, the Quake 3 team would develop artificially intelligent opponents to challenge players in deathmatch, team deathmatch, capture the flag—any and every mode included in online multiplayer. The idea was that players could hone their skills by playing against bots, then jump onto servers and challenge human players.
"You wouldn't need to have a great Internet connection or know a bunch of people. You could experience the game as if you were playing multiplayer," said Willits.
In keeping with tradition, Quake 3's premise was charmingly simple. A god-like creature scoured the universe for the greatest warriors, plucked them from their habitats, and forced them to fight in a deathmatch tournament for the enjoyment of spectators across time and space.
"Paul Steed had a gimmicky idea to have [the developers] be the first player-character models," recalled Jaquays. "He did one basic player model that became the character Visor, but the rest of us went around shooting each other in the maps for most of the rest of the year."
Quake 3 opened with a beautifully rendered intro video, created by Steed, depicting Sarge—a buff military man with gun-metal-gray hair and a cigar stub wedged between his lips—fighting off aliens before an unseen force snagged him out of the fray. That video was as much story as players were given. From the main menu, anyone who entered single-player competition progressed through ranked tiers of maps, called arenas, where bots fought for the same turf and went after the same weapons and power-ups as the player.
Although Carmack, Devine, and other programmers at id understood AI, it was not their forte. For that, they looked to Quake's community.
"Sometimes it was people working in concert, like the way we found Jan Paul van Waveren," Devine said of id's development process. Together, Devine and level designer Christian Antkow downloaded user-made bots for Quake and Quake 2 and played against them. Some were clearly pet projects. They moved, but without purpose, grinding into walls and ignoring players or, worse, firing with no rhyme or reason.
Loading a set of bots coded by a grad student, Antkow and Devine shared their verdict. The bots were so good, so advanced, that they had forgotten they weren't deathmatching against a human.
"That was all Jan Paul van Waveren, from the Netherlands," Devine continued. "He came up with the AI system and the neural network the AI used to determine how far could they see, how fast could they turn, how much are they attracted to each of [items and opponents], all of these things. That was all of his genius, and he really was. He was up there with John Carmack as being a genius coder. Absolutely fantastic."
Johannes Marinus Paulus van Waveren knew his way around id Software's catalog. In 1995 he put together a pack of custom maps for Doom before turning his attention to programming AI-controlled bots for Quake. Although van Waveren passed away on January 31, 2017, he cemented his legacy as a virtuoso of artificial intelligence through his work on id's games, as well as a graduate thesis written for University of Technology Delft in 2001 in which he extensively documented his bot-development process.
Van Waveren's first success in AI was Omicon, his Quake bot. He developed his construct in QuakeC, which came with disadvantages. Carmack's scripting language offered no way to implement data structures or manipulate strings of text. More problematic was the fact that Quake interpreted QuakeC code line by line, a much slower process than compilers, which crunched an entire program before running it.
Rather than stretch QuakeC to its breaking point, van Waveren wrote Omicon to play to the language's weaknesses as a slower language. "The bot has no prior knowledge about the environment when it enters the game and has to find its way around while playing," he wrote in his thesis. "The bot wanders around and drops bread crumbs or waypoints as it goes. These waypoints allow the bot to find back locations along the route it followed."
As Omicon learned a map, it remembered pathways and traveled them at will, like a human learning his or her way around a neighborhood. Despite its ability to learn, the bot suffered some handicaps. Traversing maps was one thing. Exploring environments was another; van Waveren likened Omicon to a blind man groping his way forward with a stick.
What Omicon lacked in exploration savvy, it made up for in diversity. Players who downloaded the bot could spawn dozens of Omicon instances, each wearing unique colors, just like human players who competed online. "Although these characters have not much more depth than their own outfit, name and personal chatter, human players often have the illusion that all bots have different personalities with different skills and abilities," van Waveren explained. "The bot uses fuzzy logic to decide on how much it wants to have or do certain things. Fuzzy logic is also used for weapon preferences and to decide which items the bot wants most."
Coined in the 1960s by Dr. Lotfi Zadeh of the University of California at Berkeley, fuzzy logic is a branch of computing that explores degrees of truth rather than binary yes-or-no, one-or-zero logic. Dr. Zadeh invented fuzzy logic over the course of trying to teach his computer a natural language, a concept impossible to break down in absolute terms. He based fuzzy logic on the way human brains work: collate data, sort it, and derive partial truths based on prior knowledge.
In other words, when faced with a new task, brains evaluate elements of the task and perform it based on a combination of what they perceive in their environment and what they already know about actions related to the task.
Van Waveren transplanted all he learned about fuzzy logic when he wrote Gladiator for Quake 2. Omicron's successor boasted numerous advantages. For one thing, it wasn't written in QuakeC. "These characters have a lot more depth than just a different name and looks," van Waveren wrote of Gladiator. "The characters have their own play style and preferences. These preferences are stored in personal fuzzy logic for each bot character."
Joining id, van Waveren centered Quake 3's bots on the advancements he had made writing Gladiator. Quake 3's AI-controlled combatants roam maps using an AAS, or area awareness system, written by van Waveren. Upon spawning on a map, a bot begins moving, analyzing level geometry as it goes and assimilating knowledge of navigable spaces: venture along solid ground and into water, but avoid pits and walls. From there, bots examine that data to find connections, such as between rooms. Connections are established by simulating movement along each possible pathway and then bunching areas together, forming an understanding of hierarchal path-finding: efficient trails from point A to B, where a particular power-up or weapon is located, and so on.
Quake 3's bots are formed from several layers. AAS is but the first of them. Learning areas as they go along, bots interpret their surroundings through sets of variables fed to it from the game. One layer down, AI logics ping away, guiding a bot toward its top-priority goal, interpreting chat from players and other computer-controlled opponents, devising replies based on pre-programmed personalities. The third layer consists of AI programming for different situations and if-else reactions for those situations.
"All the higher-level thinking and reasoning takes place in this layer," wrote van Waveren. "This layer also contains a command module which allows the bot to understand orders and commands from other players or a team leader. This includes AI for the fighting behaviour of the bot and AI to navigate around obstacles and solve puzzles."
While the third strata processes thinking and reasoning, the bot's fourth tier holds the brain for any constructs designated team leader in group-based modes such as team deathmatch and capture the flag. In deeper layers, characteristics are sent to processing levels. These characteristics include but are not limited to the bot's skill at attacking, how often it moves, whether it primarily moves forward or backward, when and how often it should perform strafing techniques to throw off opponents attempting to track it, and its accuracy as it aims while retreating.
Fuzzy logic informs most of the Quake 3 bot's interactions with the world. Each time the state of the world changes, the bot considers the world's present status, what the bot wants to do, and how much it wants to perform that action. If the bot falls below a certain health or armor threshold, for example, it will seek out appropriate restorative items. Likewise, each bot favors certain weapons. If it doesn't have its preferred weapon, and it determines that the current map offers it, the bot will—based on a host of inputs from the world—go to claim it. If its favorite weapon is in its possession, it will arm that weapon.
Drawing from a panoply of behavioral variables aided van Waveren in creating opponents that felt realistic. Above all, those opponents fell short of perfection to varying degrees. "A bot that is just a little bit better than the human player is often very suitable for training and practice," he explained. "A perfect bot would not be any fun to play with. Human players do not want to loose [sic] the game continuously. They at least need to win every once in a while or need to know they can eventually beat the game after a lot of practice."
The combination of fuzzy logic and so many moving parts resulted in diverse personalities for each Quake 3 character. Lucy, a chunky female dressed in biker attire, tends to crouch to make herself harder to hit. Crash, the first bot players face in the game's single-player tournament and a female variant of Doom's space marine, is the only AI opponent to walk instead of run. "Doom," the titular marine clad in green armor, exhibits aggressiveness to keep players moving and excels at wielding the railgun, rocket launcher, and—his favorite—the BFG.
Developing Quake 3's bots was an iterative process spearheaded by van Waveren with assistance from other programmers including Devine. "I would sit behind two testers from Activision for hours and hours, adjusting the AI's aggressiveness, how far they could see, how much they loved armor versus how much they loved health and so forth. I'd sit and try to make scalable AI that emulated how people played," Devine explained.
Devine and the others did their best to account for every type of behavior, from aggressive players like Dennis Fong to campers who tended to go after one of the map's most powerful weapons then hide out and pick off hapless passersby. Although multiplayer ended up the breakout star of Quake 3, its versatile array of bots made the game as enjoyable offline as it was on servers that sprouted around the globe, and set the stage for future projects.
"Getting those styles into the gameplay was fun," Devine said of programming the game's bot behaviors. "I think we got more technology out of it than we did gameplay, because out of that we got the pathing system, AI system—all the stuff that was used in Rage and Doom 3. The beginnings of [those projects] started there."
Enjoying Rocket Jump? Click here to share your thoughts with other Shackers in the Chatty.