december/january 1995

GAME DEVELOPER MAGAZINE GAME PLAN GGAMEAEM

The Dark of Editor Larry O’Brien [email protected] the Electric Pickle Senior Editor Nicole Freeman [email protected] Managing Editor Nicole Claro [email protected] n the end, I didn’t even have a what you want to be.” Sha-la-la, Editorial Assistant Deborah Sommers chance to light my pickle. In my indeed. [email protected] best shot yet at Andy Warhol’s The Bradys had station wagons Contributing Editors Alex Dunne promised 15 minutes of fame, I and convertibles, symbols of consump- [email protected] blew it, but it all might have been tion and status. In contrast, the Par- Barbara Hanscome different had they just given me the tridges had that most poignant of all [email protected] chance to demonstrate to the world symbols of freedom from the status Chris Hecker [email protected] the miracle of the electric pickle. quo—a schoolbus with birds painted on David Sieks II’m often the target of joke e-mails the side. [email protected] purporting to be from various people, Where the Bradys had an emo- Editor-at-Large Alexander Antoniades but I couldn’t dismiss the one purport- tionally stunted servant woman in Alice [email protected] edly from Danny!, the daytime talk (why did she need Sam the Oh-So- Cover Photography Charles Ingram Photography show. Danny! (exclamation point Blue-Collar Butcher to validate her mandatory), of course, is a vehicle for worth?), the Partridges portrayed a Danny Bonaduce, who, if you’re a cer- much more complicated world, in Publisher Veronica Costanza tain age, you’ll remember as the red- which one has to dance with the capi- Group Director Regina Starr Ridley haired and mysteriously edgy moppet talist devil even as one decries its from The Partridge Family. excesses. This complex enigma was Advertising Sales Staff embodied in the work of one actor— Western Regional Sales Manager Danny Who? the young Danny Bonaduce. Steve Nikkola (415) 905-2256 Yes, The Partridge Family, a show that So, of course, I returned the call. [email protected] has been strangely unwelcome in the Promotions Manager/Eastern Regional Sales Manager current “rediscovery” of the 70s. Unlike A Genius and Holly Meintzer (212) 615-2275 the Brady Bunch, there’s been no Par- A SCUBA Master? [email protected] tridge Family movie, no stage produc- There was to be a show on brains vs. Marketing Manager Susan McDonald tions, not even a regular slot on Nick at brawn, and my pro-nerd work over the Advertising Production Coordinator Denise Temple Night. Why? Because the Bradys years had not gone unnoticed. “What Director of Production Andrew A. Mickus played to the status quo, then and makes you think you’re so smart?” they Vice President/Circulation Jerry M. Okabe now—sprawling suburban house, ser- asked me. “I don’t think I’m smart,” I Group Circulation Director Gina Oh vants, an affluent and secure whitebread answered, “I just edit a magazine for Group Circulation Manager Kathy Henry home in which sons and daughters hap- smart people.” “It’ll have to do,” decid- Circulation Manager Mike Poplardo pily embrace the bourgeois. ed Producers Julie Knapp and Rita Newsstand Manager Debra Caris The Partridges, on the other hand, Whack. “What can you do for the tal- Reprints Stella Valdez (916) 729-3633 were darker. In the cluttered, claustro- ent competition?” phobic garage in which they practiced, My immediate answer: “Program a Chairman of the Board they gave birth to songs, not about computer faster than anyone who’s bet- Graham J.S. Wilson President/CEO “Sunshine-y Days,” but about doubts ter, and better than anyone who’s Marshall W. Freeman Executive Vice President/COO and fears. “Stop! I Think I Love You”? faster,” drew a stony silence. I tried Thomas L. Kemp Senior Vice President/CFO Why couldn’t he be sure? What was sports: “Throw a Frisbee-brand flying Warren “Andy” Ambrose Senior Vice Presidents David Cassidy saying? That corporate disc 120 yards fairly accurately?” Not in David Nussbaum, H. Verne America, by co-opting the language of a studio. “Hold my breath while wear- Packer, Donald A. Pazour, Wini D. Ragus Vice President/Production romance, had stolen the emotional ing diving gear?” Not exactly riveting Andrew A. Mickus Vice President/Circulation compass to the point where none of us, television. “Ride a mountain bike over a Jerry Okabe Vice President/Software Development Division in fact, could go forward with confi- moderately sized stick?” Stony silence. Regina dence. The Bradys on the other hand, “I can juggle a little. Just three balls, Starr Ridley told us that, “When it’s time to change, though.” There was a long sigh and I Miller Freeman you have to rearrange who you are and could hear the sound of a hand rubbing A United News & Media publication

2 GAME DEVELOPER • DECEMBER/JANUARY 1995 GAME PLAN

a forehead. “Bring your SCUBA gear. women in the audience here!” Then, to no idea what to do in it. I gave some We’ll figure it out.” put the audience in stitches, he acted thought to duct-taping my mouth and Breaking deadlines left and right effeminate and waggled his tongue sug- nose shut and doing push-ups to show (sorely testing the good humor of manag- gestively. Quentin had appeared on that one could be fit without being ing editor Nicole Claro and, over at Soft- several talk shows, which is apparently bulky, but I didn’t even know if the pro- ware Development, Barbara Hanscome), what young comics do nowadays rather duction staff could find duct tape in the my wife Tina and I flew out to Chicago than actually develop a witty routine. few remaining minutes before taping Thursday night, the night before the tap- time. It was then that I was saved by the ing. Impressive as it was to be picked up electric pickle. at the airport by a limousine, it was less One of the guys replaced by the impressive that the driver had lost the car The Partridges idiot comics was willing to lend me his in the parking structure, missed the exit pickle and a lamp cord. As I’m sure you from the airport, and got lost again on the know, when 110 volts of alternating cur- way to the hotel. I mean, I don’t know rent flows through a pickle, the result is a Chicago, but does it normally take two were darker than coronal discharge that dances like green hours to get from O’Hare to Evanston neon, what the Romans would have with no traffic? called an aurora cucumeralis if only they’d Three-and-a-half hours of sleep spent a little less time building aqueducts later, it was time to get up and get to the Bradys and and a little more time installing cheap, the studio. Finally, I would know if universal electrical service. green rooms were really green and if So I reported to the backstage area television sets had as much good food newly charged with confidence. There as movie sets. Tina and I debated sang songs about are few things that one can know with whether I should drink two or three metaphysical certainty, but one is that cappucinos to give me a little bounce or electrifying a pickle on national televi- whether the resulting quaver in my sion would be a “grabber.” It’s got all voice would come across bad on televi- the elements of great drama: surprise, sion. I didn’t have the choice. By the doubts and fear. danger (electrocution and explosion time I got to the (not) green room, I being distant, but real, possibilities), couldn’t even find real cream for the and visual appeal that can’t be beat. dregs of a pot of Maxwell House coffee. Then, sad to say, it all came apart. “Stop! I Think I Intimidated by the jeers of the crowd, Show Us Your Pickle tongue-tied by the insistence of the I was introduced to my fellow “brain” staff that I “know what you’re going to team members, and it was here that say before you go out,” tired and cranky things started falling apart fast. After Love You”? Why from lack of sleep, I went on and, in a meeting Alan, the systems analyst, and word, bombed. I was asked to step Charles, the biochemistry graduate stu- aside, to support my team, to be seen, dent, I was introduced to Quentin and perhaps, but not heard. And then it Gary, two stand-up comedians who wasn‘t he sure? was over. The judges decided that Jose, were planted in our panel apparently one of the “Macho Maniacs,” was the because the producers weren’t sure we’d most interesting of us all, a decision I be amusing enough. Quentin would couldn’t disagree with, based on what eventually “win” as the most interesting What was David made it onto television. of our team, despite the fact that his But I can’t help but think what “talent” was telling an offensive joke might have been. I can’t help but that was stupid when Eddie Murphy dream of the electric pickle. ■ first told it 10 years ago. With his Cassidy saying? Larry O’Brien chunk-gold jewelry and mock inner- Editor city speaking cadences, this guy was popped straight from the Play-Doh When Larry O’Brien is not singing Create-A-Comic kit. When he finally Still, the stand-up comics at least Brady Bunch and Partridge Family tunes, got on TV, the first words out of his knew the talk-show drill, which gave he can be found at Game Developer mag- mouth were, I swear to God, “Hey, them a distinct advantage over me. I’d azine or attempting to electrically charge how y’all doin’? Some fine-looking brought some skin diving gear but had various vegetables.

4 GAME DEVELOPER • DECEMBER/JANUARY 1995 SEZ U!

Gaming for The Fun of It??

SAY IT! The shady staff of Game Developer would love to hear your comments, questions, and suggestions! Please send them to: Game Developer magazine, Sez U!, 600 Harrison St., San Francisco, Calif., 94107. For those of you who do have access to the Inter- net, send e-mail to [email protected] or go to the Game Developer web site at http://www.mfi.com/gdmag. Thanks!

Dear Editor: some adults who have enjoyed gaming for the just have to say I really enjoy your maga- fun of it. zine. I’ve made a living doing defense and Randall G. Arnold Icommercial product design for many years Coppell, Texas and have only now gathered the resources to do what the majority of your readers are already doing—creating games! I’ve tested the waters by doing game-testing, consult- WAIT A MINUTE, MR. POSTMAN ing, manual design, editing and much play- Dear Editor: ing. Now I’m ready to see if my hare-brained lease stop calling the postal service’s uni- ideas will sell! versal access, low technology, information I enjoyed Barbara Hanscome’s “Gamin’ for Ptransfer media snailmail! Remember, only Grrrrls” (Chopping Block, Oct./Nov. 1995). 10% of the U.S. population is on the Internet at Despite the fact that boys and girls do have this time. The rest of them still need to move differing tastes, we are after all, both human physical objects around at the universal cost of and have that much in common. We like to be 32 cents per ounce. entertained, challenged, amused, thrilled, Jason Feinman and teased. Boys don’t necessarily need Via e-mail blood and violence, and girls can live without Dear Editor: cute, fuzzy animals. My sons not only like the ow come you don’t put articles online, background sound in games, they thrive on thereby saving trees and many post offi- it! In addition, my 8-year-old plays all four of Hcers’ backs? I know money is a concern, the characters in Street Fighter 2, including but can’t you just stick the advertisers’ ad in the girl (she has “neat powers”)! the articles? I promise to be subliminally I believe we can most easily find common affected by their ads. ground by examining games of the past, in Andrew Shebanow addition to perennial favorites. I have noticed Via e-mail that both sexes really get into games that let them insert their own personalities. Role- Editor Larry O’Brien responds: playing games let players of either sex use After receiving the preceding disturbingly their unique strengths. Hey, men like a good angry letter from a postal carrier in response to game of chess, yahtzee, cards, and so on–no our referring to ground mail as “snailmail,” real violence there. My point is that I honestly we’re not about to become even more of a tar- think these big game companies are trying get by throwing hundreds, maybe even thou- too hard and maybe they should consult with sands, of carriers out of work.

6 GAME DEVELOPER • DECEMBER/JANUARY 1995 GIMME MORE! but I just wanted to warn you that there’s a Our Readers Dear Editor: woman on your staff who doesn’t look where ’m a big fan of your magazine, and I’m glad she’s going on the busy sidewalks of San Fran- to see you’ve lowered the price. I thought the cisco. This month, our IOctober/November 1995 issue was your best Enrique Hombrelibre yet. Mike Michaels’s “Organizing User Input, Via e-mail Part I: The Input Queue Manager and Keyboard Events” was very well written and informative. Contributing editor Alex Dunne responds: readers have much I do have a suggestion, though: I’d really like Thanks for the note. We’ve taken care of Nicole to see more information about game industry Freeman, a.k.a. “little Nikita.” She travels under sales figures and other market data. Unlike a variety of assumed names, especially when other PC application categories, game sales involved in covert pedestrian-bumping opera- information is very hard to come by. I’d like to tions. Rest assured that everyone on our staff to say about gender know how well games sell, what the total mar- was alerted to her slip-up and that she will be ket size is, what typical budgets for games are, severely reprimanded! It’s slip-ups like this that and how game developers make their money. can devastate a little magazine like ours. After all, being a game developer isn’t simply a differences, the matter of hacking out code–you’ve got to sell ERRAT A those games too. Thanks. uality is job one here at Game Andy Shebanow Developer magazine. We strive to Via e-mail Qcorrect any mistakes we’ve made postal service, to provide you with best product we can. That said, we lower our heads and admit to the following two mis- LITTLE NIKKI takes. and suspicious Dear Editor: was walking down the street the other day •In Mike Michaels’s Oct./Nov. 1995 just minding my own business when this feature article “Organizing User Iwoman ran into me and knocked me into Input, Part I: The Input Queue encounters with moving traffic. Now, I was quite upset until Manager and Keyboard Events,” we she said she worked on this game maker mag- left out Listing 3, HEAPMGR.C. azine or something, and gee didn’t that sound •In “Getting Started with VESA” by interesting, and, well I guess I could forget the Matt Pritchard (June/July 1995) part whole incident if she would send me a copy of of the code in Listing 2, VESADE- the staff of what sounded like a great read, but I never MO.C, was omitted. heard from her again. I thought she said her name was Nakita Freeman or something, so I You can access each of these listings looked up game stuff on my groovy web brows- in its entirety (as well as all refer- Game Developer er and there’s someone on your staff named enced code from previous issues) on Nicole. I thought she might be working there the fabulous carousel that is the under an assumed name or something. I don’t Game Developer ftp site. care so much about the magazine anymore, magazine.

GAME DEVELOPER • DECEMBER/JANUARY 1995 7 CROSSFIRE

A Hardware Spec for Games

Alex Dunne ast issue, I examined the inter- and intracompany politics that GamePC Consortium’s can hold back rapid adoption of a stan- (GPCC) efforts to put dard. The three-dimensional graphics The standards specifi- together a benchmark for benchmark I described last issue is three-dimensional graphics merely one component of this proposed performance. The GPCC is a specification. young organization compris- cation under discus- ing hardware and software Standardizing Lvendors in the PC game industry. The Game Hardware consortium was formed to target the Like the MPC certification, which is vacuum in PC game standards through controlled by the Software Publishers the creation of the GamePC Association’s Interactive Multimedia sion at the Game PC specification—an all-encompassing section, the GamePC certification will GamePC standard similar to the Mul- provide a way for consumers to deter- timedia PC (MPC) specification. This mine the minimum hardware they standard is a tough nut to crack, not need to enjoy their software purchas- Consortium is a hot merely because of the technical hurdles es. It will also help the game develop- that have to be cleared, but because of ment community develop and market topic these days. So hot, in fact, that we‘ve got the results of the vote in this month‘s Bit Blasts (we are so on The GamePC Consortium’s specification for gaming hardware will be implemented as a seal of approval, indicating the type of hardware recommended for game play. These logos are still in the design stages. top of things).

GAME DEVELOPER • DECEMBER/JANUARY 1995 9 CROSSFIRE

games because a common level of game the GamePC Consortium roams. Cre- specification that generated the most performance will be expected from the ating another specification that dictates debate. In fact, it wound up being such hardware. similar—but not identical—require- a complicated topic that it didn’t make Why not simply use the MPC ments as the MPC specification will it into the standard for games? It doesn’t go far only confuse consumers. To avoid official enough. For instance, a graphically duplicity or conflicts between the certi- GamePC undemanding and processor-friendly fications, the GPCC has decided to ballot. The game of the variety would do fine base the GamePC specification on group is using the MPC3 specification. A game either the MPC2 or MPC3 specifica- still work- that required a bit more horsepower tion and build on those requirements in ing on it under the hood—perhaps Dark Forces areas specific to game play. (You can as we go or Wing Commander 3—would need a find a thorough description of the vari- to press, specification that provided for a faster ous MPC requirements on the World and it processor, graphics, and perhaps better Wide Web, at http://www.spa.org/- will be audio as well. Further down the road, as mpc/default.htm.) voted on inde- games demand more sophisticated As a result, the GamePC specifica- pendently from the rest of the hardware hardware, the specification can be tion will rely to a large degree upon one requirements. When completed, it will updated or higher levels of the specifi- of these two MPC levels as a baseline. likely take shape as a test suite that cation can be created. In theory it’s an excellent plan—con- computers will have to pass, similar to sumers won’t have to worry about con- the MPC test suite. The MPC Spec flicting requirements in the two specifi- Three-dimensional User Input. A To see how the GamePC specification cations. With a little collaboration, the requirement for three-dimensional will be used, look no further than the two standards organizations should be input (such as a joystick-generated MPC certification as a model. The able to effectively update their specifi- command) was recommended for game MPC specifications (there are three lev- cations on a regular basis without step- machines, as the MPC specification els—the higher the number the more ping on each others’ toes. However, calls only for a standard 101 keyboard current the specification) dictate the there are some parts of the GamePC and a mouse. The keyboard is fine for minimum processor, RAM, hard drive, ballot that risk conflict with the MPC Doom and the mouse is great for Myst, floppy drive, CD-ROM drive, audio, specification. but a Descent-type game or a flight graphics performance, video playback, simulator allowing six degrees of free- user input, I/O, and system software Turning Suggestions dom should require a flight stick to present on a PC. In addition, the MPC into a Ballot keep players from auguring in. Howev- Working Group provides a test suite on The following items present in the er, the ballot sent out by the GamePC CD-ROM, written by the National GamePC specification were bandied Consortium only queried for the pres- Software Testing Laboratories, for about among GPCC members. Some ence of a universal serial bus (USB) dig- establishing whether a computer is items made it onto the ballot for ital joystick interface and a front- delivering MPC3 compliance in the key members to vote for or against mounted joystick port—there was no areas of processing speed, video play- the specification, while others mention of the computer actually hav- back, graphics performance and audio. were shelved for future ver- ing a joystick hooked up. Specifying Hardware vendors are required to sions of the specification. that a person have a joystick port, but pass the test suite in order to Some of the suggested not requiring the joystick itself is some- display the MPC mark on items were pretty cutting what like requiring that the computer their products. In 1994, edge, but given that the have a port for a keyboard, but not the MPC1 MPC2 logo won’t take effect requiring the presence of a keyboard certification marks until sometime well (the big difference being that every were extended to indi- into 1996, the recom- computer comes with a keyboard, and vidual CD-ROM dri- mendations were ap- no computer that I know of automati- ves and sound cards, propriate. Here’s a quick cally comes with a joystick). and in 1995, the MPC3 rundown of items that A consumer without a joystick is mark was extended to were suggested for apt to look at a flight simulator box, see video playback boards and GamePC-compatibility: the GamePC logo, figure he or she- speakers. Three-Dimensional meets the specification (“Hey—I’ve got Because the MPC standard was Graphics. The three-dimensional graph- the joystick port”), bring the game developed years ago, it has already ics benchmark that I profiled in my last home, and find out that the darned staked out much of the territory that column was probably the part of the thing doesn’t work too well with a

10 GAME DEVELOPER • DECEMBER/JANUARY 1995 CROSSFIRE

mouse and keyboard. I may be nitpick- courage consumers from taking the 28.8KB modem might have been better ing, but I feel that if the specification is specification seriously. This is one of (oh well). I wonder if specifying access going to ask for something as nifty as a those cases where the special interests to one of the major commercial online front-mounted USB, you might want to of certain companies can cause political services shouldn’t be a requirement of a require the control that plugs into it. problems in specification creation. For- future GamePC specification. By all Three- tunately, neither of those items made it accounts, CompuServe, America dimensional onto the ballot. Online, Prodigy, and the Microsoft Sight and CD-ROM. This was an item that I Network are hot and heavy to promote Sound. Vari- saw in potential conflict with the MPC a new generation of graphical games ous GPCC specification. The GPCC proposed a using their online services as a back- members data transfer rate from a CD-ROM bone. Another idea for future GamePC proposed at 450KB per second—in other specifications is a network card— noth- that infor- words, a triple speed drive. This ing beats the speed of head-to-head mation per- raises two questions: why stan- play when you’re connected to your taining to three-di- dardize on this rare model of roommate’s computer with some coax! mensional sound be included in drive (why not just base it on System Software. No mention of the specification, and others favor sup- a 4X speed?), and won’t this system software is made because all port for stereoscopic devices in the conflict with the MPC3 specification if MPC specifications specify DOS and GamePC mark. My feeling when I first that gets ratified as the basis for the 16-bit Windows. However, the saw those suggestions was, yes, those GamePC specification? To attain the GamePC ballot queries support for high-end goodies should be in future MPC3 rating, a computer must have a AutoPlay (or similar functionality), versions of a specification, but coming quad-speed CD-ROM drive, so ap- which implies support for Windows 95. off the blocks with a specification that proval of a triple-speed drive will cause The question of which operating system calls for hardware that a miniscule por- the GamePC rating to dip below an to standardize on could confuse the tion of the gamers own (and not many already approved base standard. Some specification if it is not cleared up. games will support anyway) will dis- kind of amendment to the standard Additionally, GPCC members such as might have to be IBM have made it clear that they’d like made to correct this the GPCC to come up with a specifica- apparent conflict. tion that’s operating system neutral. Audio. The This means that either the AutoPlay GamePC specifica- requirement will have to be ditched, tion seems to be IBM will have to enable its own version fairly similar to the of AutoPlay in OS/2, or IBM is out of MPC specification. luck. Game PCs will The results of the balloting will be likely be required to available by the time you read this. support the current However, it’s still not clear when the standard sampling GamePC specification will begin to rates between 8 and appear on game boxes or hardware. 44.1KHZ and sup- Realistically, I wouldn’t expect it until port wavetable syn- the spring or summer of 1996. Yes, thesis for MIDI there are issues to be resolved regarding playback. the GamePC specification, but there’s Communica- no question that it’s a step forward for tion. With the everyone—developers and consumers head-to-head capa- alike. If you’d like to keep up to date bilities of many with what’s going on with the specifica- games on the mar- tion, or you’re interested in becoming a ket these days, the member of the GPCC, check out their GPCC suggested web site at http://www.mmwire.com/ requiring a 14.4KB gamepc/gpchome.html. ■ modem in a Game- PC-compatible machine. Excel- Alex Dunne is contributing editor to lent—although a Game Developer magazine.

12 GAME DEVELOPER • DECEMBER/JANUARY 1995 BIT BLASTS

Let’s Hear It for the Boy

Nicole Claro ■ For more information contact: .J.’s over, the World Series Nintendo of America actually happened this year 4820 150th Avenue N.E. (with the Cleveland Indians, Redmond, Wash. 98052 no less!), and my editor got to Tel: (206) 882-2040 Fax: (206) 882-3585 Christmas is here, rub shoulders with our favorite bottom-tattooed, for- mer child star. Judgment Day Diamond on the Edge happens in less than a week, Virtual Fighter, “Ready, Go!” Windows Obut after that, things could start to get 95-integrated video and audio has and there are new dull around here. Hey, Christmas, a big reached new heights. Diamond Multi- season for the game industry, is just media Systems Inc. has announced a around the corner! Many of our readers line of integrated three-dimensional tools, new books, have probably recently shipped projects multimedia accelerators that lets users they’d worked on diligently for months play a variety of high-powered games and are ready to spend some time under Windows 95. exploring each others work (not to The company believes its Dia- mention the tools they each used on mond Edge 3D is the only single-board new virtual headsets that work). Enter hardware for the accelerator that features a digital game- Christmas season—Virtual Boy from port for precise joystick control and two Nintendo. video gameports that let you play spe- Nintendo recently launched Virtual cialized, multiplayer titles. Several for everyone! We‘ve Boy to the tune of a $25-million mar- game companies are developing prod- keting campaign. The VR headset is a ucts specifically to take advantage of RISC-based, 32-bit system using two the capabilities offered by Diamond’s high-resolution, mirror-scanning LED new product. Papyrus’s Nascar Racing also got the scoop on displays, which immerses the player in a and Interplay’s Descent: Destination fantastic world. The player controls the Saturn are two games slotted to be action inside the lightweight headset bundled with the upcoming release of (fitted with stereo sound) using the dou- Diamond Edge 3D. Retail price for the results of the ble-grip controller with six buttons and Diamond Edge 3D will range from two plus-keys. Nintendo was responsible $249 to $299. for the three-dimensional image immer- ■ For more information contact: sion technology used in Virtual Boy, Diamond Multimedia GamePC while the company has licensed the pro- Systems Inc. 2880 Junction Ave. prietary display technology from Reflec- San Jose, Calif. 95134-1922 tion Technology Inc., based in Tel: (408) 325-7000 Waltham, Mass. Nintendo is currently Fax: (408) 325-7070 Consortium‘s vote on working with several companies on third-party games designed specifically for the Virtual Boy headset, which will Crash, Bang, Boom! retail for $179.95. Gameboy, Virtual Positron Publishing has released the specifications! Boy, where does the boy go from here? Dynamic Motion Module, the first

14 GAME DEVELOPER • DECEMBER/JANUARY 1995 HOT OFF THE PRESS!

t’s the moment we’ve all been waiting for...Just days ago (remember, it’s December in Magazineland, but October everywhere else) the GamePC Consortium (GPCC) announced the results of its vote on standards for game specifications. For back- physics-based collision detection pro- ground information on the debate, see Alex Dunne’s Crossfire column, on page 9 of gram for the PC. Designed as a plug-in this issue. Following are the standards the GPCC agreed on for the GamePC Level 1 for Autodesk 3D Studio, the Dynamic ICompatible System Specification. The specification covers five areas, systems, CD-ROMs, Motion Module uses physics to create graphics, sound, and video. The GPCC also agreed on a Recommended System Specifica- series of keyframes more precisely than tion, but due to its length, we couldn’t provide that data here. Go to our soon-to-be web you could by hand. It lets animators site (http://www.mfi.com/gdmag), though, and you can view it. combine objects that have been assigned dynamic motion with other SYSTEM • Must Meet MPC level 2 minimum specifications objects that rely upon key frame motion • Base system must contain at least 8MB RAM and detects the collision of objects • Must Support AutoPlay (or similar functionality) (with a collision detection resolution of • Must be able to read 10MB data file from hard disk in 17 seconds (more than up to 1/480th of a second), calculating 600Kb per second). the resulting motion response of the objects. The module uses quaternions CD-ROM (complex algebraic structures) to • Must be able to read 10MB data file from CD in 30 seconds (300K/sec). improve rotation and lets you apply fac- tors such as gravity, wind, acceleration, GRAPHICS: velocity, and drag to your objects. Fully • Must run “Fox and Bear” benchmark (640x480x8) at a rate of 30 fps compatible with 3D Studio’s internal • Must implement local bus (VLB or PCI) graphics with total video RAM greater than or equal to 2MB splines, the Dynamic Motion Module • Minimum total RAM (base system RAM+ video RAM) must be 9MB also provides smooth-shaded preview • Display and monitor must support the following display modes: images as frames are generated. 320 x 200 256 Colors (Mode 13 and Mode X) ■ For more information contact: 640 x 400 256 Colors (Mode 100h) Positron Publishing 640 x 480 256 Colors (Mode 101h) 1915 N. 121st St. 640 x 480 32K Colors (5:5:5) (Mode 110h) Ste. D Omaha, Neb. 68154 640 x 480 64K Colors (5:6:5) (Mode 111h) Tel: (402) 493-6280 640 x 480 16.8M Colors (8:8:8) (Mode 112h) Fax: (402) 493-6254 800 x 600 256 Colors (Mode 103h)

SOUND: VB Underground • Must be able to play 4, 22KHz 16-bit wave buffers mixed, concurrently • Must support all sample rates between 8KHz and 44.1KHz, mono and stereo The Waite Group Press has released • Must support General MIDI compatible wave table synthesis. another in its series of “Black Arts” books for programmers. Black Art of VIDEO Visual Basic Game Programming, by • Must be able to play a sample MPEG movie file from CD-ROM (accurate sound Mark Pruett, is a guide to every aspect synchronization with no audio breaks) of building Windows games from the • 352 x 240 window in display mode 640 x 480 x 8 must run at a rate of 15 fps ground up. Step-by-step tutorials clear- • Must be OM-1 MPEG compliant. ly explain essentials like drawing the boundaries of the game playing field, Systems that the GamePC Consortium tests and verifies to conform to the above specifi- using the Windows API to its fullest to cations can earn the GamePC Level 1 Compatible certification mark. create sprites and bitmap masks, and

GAME DEVELOPER • DECEMBER/JANUARY 1995 15 BIT BLASTS

Stick it to Them...Microsoft began monitoring object collisions. Every facet UPGRADE shipping the Game Software Develop- of game creation is covered here, ment Kit to developers at the beginning of October. Some of us got betas at the Com- including graphics, animation, sound- puter Game Developers’ Conference last tracks, and increasingly difficult game April. The Gossip Lady has looked in levels. vain in her mailbox but perhaps a lucky The 600-page book comes with a reader will tell us what video cards are sup- CD-ROM with sample games that ported. Since Microsoft’s standard answer YOURS! to anyone with problems running games demonstrate smooth-scrolling back- • RAD Software has released under Win95 is, “Talk to your [video, grounds, using bitmap tiles to create a version 2.0 of Smacker, sound, joystick, mouse] vendor” this is a maze, and adding ray-traced graphics to which has over 100 new fea- crucial question. Oddly enough, Win95 has your gamescape. The CD-ROM also tures. Smacker 2.0 has utili- problems with some Logitech mice. Does includes 16- and 32-bit reusable Visual ties up to 400% faster than Microsoft’s entry into the joystick market previous versions and is mean that other joystick manufacturers are Basic code to plug into your own games available on CD-ROM. The going to experience these unfortunate bugs and all the examples, graphics, and upgrade is $95 for current also? sound effects covered in the book. Black Smacker users. Art of Visual Basic Game Programming: A Learning Experience...Broderbund, • Autodesk is at it again (they always strong in edutainment, is going after The Newest and Easiest Way to Create put those upgrades out too that segment of the market in a big way. Games with Visual Basic retails for fast for us to keep track!) Not only did it purchase The Learning $34.95. !with the recent release of Company but Broderbund has also start- ■ For more information contact: Animator Studio 1.1. This ed a new line of curriculum-based games Waite Group Press Windows 95-compatible ver- under the Active Mind label. 200 Tamal Plaza sion of the two-dimensional Corte Madera, Calif. 94925 paint and animation software Sony-Sega Title Bout...Someone at Tel: (415) 924-2575 features many new plug-ins Sony needs to give those PR people a Fax: (415) 924-2576 and a digital clip library on raise! Sega, probably after seeing the CD-ROM. Current Animator tremendous amount of ink that the Sony Pro users can migrate to the Playstation is getting, lowered the price newest version for $149; the on its Saturn in an attempt to stay competi- migration will cost $199 for tive. Talk is that Sony’s only possible weak Intel for Everyone Animator and Multimedia spot in its attempt to wrest the set-top mar- Intel has introduced Indeo Video Explorer users. For new ket away from Nintendo and Sega is its Interactive, a new wavelet-based codec users, Animator Studio 1.1 lack of game design experience. With the that enables real-time interaction and will retail at around $295. hiring of Kelly Flock to head up the newly • Kai’s Power Tools 3 (KPT3) renamed Sony Computer Entertain- control of video and graphics imagery is the latest version of the ment, this last is no longer a problem. in multimedia and game application for imaging software available Flock has the guts and the smarts to say the PC. It ups the ante on image quali- from MetaTools (formerly what all of us developers have been mutter- ty, offereing far better quality at lower HSC Software). KPT3 is opti- ing ever since Hollywood mistook the rates than possible before with Indeo mized for Power Macintosh “play” in “game play” as something that and Windows NT and Win- you go watch—not something you do. Video. dows 95 and features sever- Flock says, “Anyone who talks about inter- Indeo Video Interactive includes al new tools and precise active movies doesn’t know the first thing features such as transparency support controls over imaging spe- about either.” Meanwhile, Sega announced for interactive digital effect, which lets cial effects. KPT3 will retail it will begin shipping titles for the PC. you overlay arbitrarily shaped video or for around $199, and regis- Publishers Repel Pirates...Wonder why graphics onto other video and graphics, tered users of KPT2.1 can your royalty checks are low? Maybe it has for run-time interactive control; local upgrade for $79. something to do with all the pirate CD- window decode, with which you can ROMs. The Software Publishers create an indepentent video playback Assoc. (SPA) just won injunctions against E.V. International, M&S window within a larger video playback come in early 1996 (just about the time Assoc., Mr. CD-ROM, Softshoppe and display or graphics scene; random this hits the stands). Stylin Multimedia, mostly for game pirat- keyframe access; and a scalable quality ■ For more information contact: ing. On another front, shareware authors feature that scales quality between sev- Intel Corp. have involved the FBI and the Royal eral different quality levels, depending 2200 Mission College Blvd. Canadian Mounted Police in shutting Santa Clara, Calif. 95954-1537 down pirate shareware CD publishers. on the PC’s CPU capability. Indeo Tel: (503) 264-6277 Rumor is that the shareware authors may Video Interactive for Windows 95 and join up with SPA. Windows 3.1 will initially be available Nicole Claro is managing editor of within an Intel SDK, with drivers for Game Developer magazine. Contact her Talk to The Gossip Lady at Apple’s QuickTime 2.01 and 2.1 to at [email protected]. Schmooze [email protected]. ... Schmooze news ...

16 GAME DEVELOPER • DECEMBER/JANUARY 1995 BEHIND THE SCREEN

Texture Mapping Part IV: Approximations

Chris Hecker nowing, understanding, and understand how the math works, we’re following through on your in a much better position to throw it all goals are key parts of soft- out and cut corners. So you thought we ware development. Often, I’ll go into a project with a per- In Our Last Episode... fectly valid set of goals, only Let’s quickly summarize and tie up loose to get distracted along the ends from my last column in this series, were done with per- way and produce something “Perspective Texture Mapping, Part III: Kthat meets an entirely different set of Endpoints and Mapping” (Behind the goals, but completely misses my origi- Screen, Aug./Sept. 1995). The summary nal ones. This phenomenon seems to is pretty short: we’ve developed a com- be pretty common in the game industry plete, high-quality sub-pixel-accurate spective texture map- as well, where companies go into a pro- perspective texture mapper. ject with the goal of creating a great The only loose end we’ve got left game, but end up creating a nice piece (besides performance, which is the of technology with no game play. main subject of this article) concerns ping. Didn‘t you feel Similarly, our goal during this the real-to-integer texture coordinate series is not to produce a perspective mapping. When we left off, we had a texture mapper. Surprise! Our goal is bug in this mapping and we needed to actually to draw perspective-texture- choose a rounding rule to get the cor- something was miss- mapped triangles on the screen quickly. rect mapping. I hinted that we already A subtle but important difference exists had the information available to make between these two goals. As with most the decision on which rounding rule to things in real-time PC graphics, the use, but I didn’t give the answer. As ing? The penultimate result on the screen is the only thing many of you probably guessed, the gra- that matters, not how you got it there. dients are the key to making this deci- We can exploit the difference between sion (which implies you must switch what looks right and what is right and between rounding rules at runtime— article in this series get big speedups in our code. and this is indeed the case). Unfortu- In other words, if a beautifully nately, limited space keeps me from written, mathematically perfect texture going into the derivation of the solu- mapper and a total hacked piece of junk tion. If you’re interested, you can pick produce the exact same results on the up the sample code I mention at the helps shed some light screen (including avoiding jitter and all end of this column on the Game Devel- the other things we’ve been learning), oper ftp site. You’ll find a big comment and the hack is 10 times faster, then the block explaining things there. choice is clear if you’re interested in on the ins and outs of speed. It’s important to note that this Divided We Fall does not mean we’ve been wasting our Finally I’m ready to make good on the time learning about “correct” perspec- second half of my two-part promise: tive texture mapping. In fact, it’s just the first part of which was to develop approximations. the opposite. Now that we intimately an easy-to-understand perspective cor-

GAME DEVELOPER • DECEMBER/JANUARY 1995 19 BEHIND THE SCREEN

rect texture mapper, and the second to Figure 1. The Perspective Curve polygon that’s close at low values of x speed it up to interactive performance. and distant at larger values. In our efforts to speed up the u This curve (it’s different for each mapper the obvious question is, polygon and scanline, in general) is “Where is the code currently spending what makes perspective mapping look its time?” I ran a profiler on it and correct, so the trick is to approximate ended up with what I like to call the the curve without using a divide and perfect profile—almost all our time without adversely affecting our visual (96%) is spent in one function, quality. DrawScanLine. The nice thing about a profile like this is that your optimiza- The Big Three tion work in that function, sometimes When I say we want to approximate the called the hotspot, is very highly lever- perspective curve, I mean we want to aged. In other words, every little bit use alternate equations that will pro- you speed up the hotspot increases the duce the same—or very close to the overall performance by a lot. It’s not same—output (the u value shown in surprising that DrawScanLine is the cul- Figure 1) for the same input (x, as prit because it contains the pixel loop, shown in Figure 1), but hopefully will but it’s always good to check our be more efficient than our algorithm assumptions and gather some real data. with its divides. Listing 1 gives us a closer look at Three approximations to the per- DrawScanLine inner loop. In it, we see x spective texture mapping equations are that the function is doing a divide and commonly used: subdividing affine, two multiplies per pixel to figure out quadratic, and lines-of-constant-z. the texture coordinates, a multiply to I’m going to talk about lines-of- calculate the texture offset, and a few The divide is the crux of the per- constant-z first because it’s very differ- adds. The divide is probably the major spective texture mapper. It takes the ent from the other two. First, “lines-of- sink here. Divides are much slower than linear interpolations of 1/z, u/z, and v/z constant-z” is an awkward name. Some multiplies on most processors, and mul- and turns them into the nonlinear curve people choose to call it “free-direction texture mapping,” which is a bit easier Listing 1. The Inner Loop to say but not quite as precise. Basically, a lines-of-constant-z rasterizer tries to while(Width— > 0) { take advantage of the neat fact that float Z = 1/OneOverZ; there are straight and parallel lines that int U = UOverZ * Z + 0.5; have a constant z through any planar int V = VOverZ * Z + 0.5; polygon. Imagine you’re sliding a plane *(pDestBits++) = *(pTextureBits + U + (V * TextureDeltaScan)); that’s perpendicular to the z-axis back through your polygon. The plane will OneOverZ += Gradients.dOneOverZdX; UOverZ += Gradients.dUOverZdX; slice the polygon in a series of parallel VOverZ += Gradients.dVOverZdX; lines as it moves through the depth } range occupied by the polygon. All the pixels along one of these lines will have the z value of the plane, so the line has tiplies are generally slower than adds. If that samples pixels close together when a “constant z.” we comment out the divide per pixel the polygon is near the eyepoint and Now, if you look at the math and do a linear interpolation between samples farther apart when the polygon behind our projection, when z is con- the left and right edge, the mapper per- is distant. If the polygon is slanted so stant, our equation turns into a linear forms seven times faster in my test (and that it’s close on one end and distant on interpolation (the perspective curve of course looks totally wrong because the other, the divide smoothly moves from one point on this line to the next there’s no perspective correction). from close to separated samples. Figure is a line itself), which is quick and easy Obviously, getting rid of the divide 1 shows a plot of screen x versus sam- to compute and has no divides in the helps a lot. However, to get rid of the pled u for a typical perspective mapped pixel loop. The down side is that in divide and keep the same visual quality scanline. As x increases, u starts general you’ll be interpolating along a we need to know exactly what the increasing slowly and then grows much diagonal line in the destination instead divide is doing there in the first place. quicker. Obviously, this data is from a of across a nice horizontal scanline

20 GAME DEVELOPER • DECEMBER/JANUARY 1995 (walls and floors are special cases where Quadratics 1). We need two quadratics—one to the lines-of-constant-z are vertical and Most people remember quadratic equa- produce the u texture coordinate from horizontal, respectively). tions as parabolas from algebra. A qua- x, and the other to produce the v coor- This diagonal (or free-direction) dratic in x is: dinate from x. interpolation causes three major prob- Because we have three degrees of 2 lems. First, if your diagonal lines don’t f() x=++ ax bx c ()1 freedom, we can choose to match exact- abut properly you’ll get dropouts and ly any three characteristics of the per- overwrites inside your polygon. This is This equation will graph a parabo- spective curve, and approximate the solvable if you’re careful. la or a line on the x and f(x) axes. The other characteristics. For example, we Second, unless you obey a strict fill coefficients a, b, and c determine the might choose to exactly interpolate the convention, you’ll get the same kind of two endpoints, and spend our last dropouts and overwrites between poly- degree of freedom on exactly matching gons. This is much harder to fix than the first derivative, or slope, of the per- the intra-polygon problems, but it’s still If you don‘t care spective curve as it enters or leaves one solvable. of the endpoints—we can’t match both Finally, and this one is the kiss of derivatives because that would cost us death as far as I’m concerned, it is total- two degrees of freedom, one more than ly impossible to achieve subpixel accu- about subpixel we have left if we’re going to hit the racy with a lines-of-constant-z texture endpoints exactly. We could even inter- mapper. To achieve subpixel accuracy polate one endpoint and exactly match we must always sample the texture from the first and second derivative exactly at the pixel centers of the destination but accuracy, the that point. Or we might spend all three our arbitrary line-of-constant-z doesn’t degrees of freedom interpolating three hit the pixel center in the destination. points on the curve exactly, like the two However, you can’t step off the line-of- endpoints and the middle point. We’ll constant-z to the pixel center or you’ll lines-of-con- do the derivation for the latter approxi- need to divide to take the nonconstant- mation to show how it’s done. z step into account. Damned if you do, To figure out the quadratic curve damned if you don’t. that interpolates the two endpoints and If you don’t care about subpixel stant-z tech- the midpoint and produces the u texture accuracy (insert flame about jittering coordinate given x, we start by writing and sloppy textures here), the lines-of- down the equations we know. We constant-z technique might be for you. assume x goes from 0 to 1 for simplicity. As an added bonus, you get depth cuing We need to solve for u at x = 0, 0.5, and effects like fog almost for free—you nique might be 1 using the perspective divide to give us already know the depth of the current three known values, u0, u1, and u2, line, and the depth, by definition, is respectively, so we can solve for a, b, and going to stay constant. So you can com- c, the three unknowns. We plug these pute your fog value at the start and use for you. values into Equation 1 to give us three it along the entire line instead of at equations in three unknowns: every pixel. fuabcc()000==2 ++= The next two techniques, subdivid- shape and position of the parabola on 0 ing affine and quadratic, are based on a the graph, and we use these three more straightforward approximation of “degrees of freedom” to attempt to fit a 2 the perspective curve. Both try to fit parabola to the perspective curve. We Ê 1ˆ Ê 1ˆ 1 fuabcÁ ˜ ==1 Á ˜ ++= easy-to-interpolate curves to the more use the normal perspective mapper to Ë 2¯ Ë 2¯ 2 complex perspective curve. Subdividing interpolate down the edges of the poly- ab affine does a piecewise linear approxima- gon so they’ll be precise, and use the ++c tion, fitting a number of line segments to quadratic to interpolate across the scan- 42 the curve, and quadratic fits a quadratic line (where we’re spending our time in curve to the perspective curve. DrawScanLine). At each pixel on the and: We’re going to use a subdividing scanline, we want to be able to feed in affine curve for our approximation, so our screen position, x, and the quadratic fuabc()111==2 ++ before going into detail on it I’ll go over equation should produce our texture 2 the quadratic technique. coordinate as its value (f(x) in Equation =++abc

GAME DEVELOPER • DECEMBER/JANUARY 1995 21 BEHIND THE SCREEN

We then solve the simultaneous Listing 2. The Subdividing Affine DrawScanLine (Continued on p. 24) equations for a, b, and c in terms of u0, u , and u , and after a bit of algebra we void DrawScanLine_suba( dib_info const &Dest, 1 2 gradients_fx_fl_a const &Gradients, get: edge_fx_fl_a *pLeft, edge_fx_fl_a *pRight, =-+ dib_info const &Texture ) au242012 u u { int XStart = pLeft->X; =- + - int Width = pRight->X - XStart; buuu34012 and: char unsigned *pDestBits = Dest.pBits; char unsigned * const pTextureBits = Texture.pBits; cu= pDestBits += pLeft->Y * Dest.DeltaScan + XStart; 0 long TextureDeltaScan = Texture.DeltaScan; Now, if we wanted to, we could use int const AffineLength = 8; these coefficients and solve the quadratic directly at each point on the scanline float OneOverZLeft = pLeft->OneOverZ; (we’d actually do the math using x = 0, at float UOverZLeft = pLeft->UOverZ; float VOverZLeft = pLeft->VOverZ; x = width/2, and x = width so we wouldn’t have to scale our x values float dOneOverZdXAff = Gradients.dOneOverZdX * AffineLength; between 0 and 1), but that means we’d float dUOverZdXAff = Gradients.dUOverZdX * AffineLength; float dVOverZdXAff = Gradients.dVOverZdX * AffineLength; be doing a bunch of multiplies per pixel—probably better than the divide float OneOverZRight = OneOverZLeft + dOneOverZdXAff; we’re currently doing, but not great. float UOverZRight = UOverZLeft + dUOverZdXAff; float VOverZRight = VOverZLeft + dVOverZdXAff; However, we can use forward differences to solve the quadratic using only addi- float ZLeft = 1/OneOverZLeft; tion and the solution for the previous float ULeft = ZLeft * UOverZLeft; float VLeft = ZLeft * VOverZLeft; pixel. Forward differences are covered in any good graphics or math textbook, float ZRight, URight, VRight; but, simply stated, you take f(x+1)-f(x) to fixed16_16 U, V, DeltaU, DeltaV; calculate the function’s step based on its if(Width > 0) { previous value. In the case of our qua- int Subdivisions = Width / AffineLength; int WidthModLength = Width % AffineLength;

Figure 2. The Quadratic Curve if(!WidthModLength) { Subdivisions—; WidthModLength = AffineLength; } u while(Subdivisions— > 0) { ZRight = 1/OneOverZRight; URight = ZRight * UOverZRight; VRight = ZRight * VOverZRight;

U = FloatToFixed16_16(ULeft) + Gradients.dUdXModifier; V = FloatToFixed16_16(VLeft) + Gradients.dVdXModifier; DeltaU = FloatToFixed16_16(URight - ULeft)/AffineLength; DeltaV = FloatToFixed16_16(VRight - VLeft)/AffineLength;

for(int Counter = 0;Counter < AffineLength;Counter++){ int UInt = U>>16; int VInt = V>>16;

*(pDestBits++) = *(pTextureBits + UInt + (VInt * TextureDeltaScan));

U += DeltaU; V += DeltaV; }

ZLeft = ZRight; ULeft = URight; x VLeft = VRight;

22 GAME DEVELOPER • DECEMBER/JANUARY 1995 BEHIND THE SCREEN

Listing 2. The Subdividing Affine DrawScanLine (Continued from p. 22) already guessed exactly how subdividing affine texture mappers work from what OneOverZRight += dOneOverZdXAff; I’ve been describing. UOverZRight += dUOverZdXAff; VOverZRight += dVOverZdXAff; Basically, you solve the real per- } spective equation at a bunch of points along the scanline, and do a linear if(WidthModLength) { ZRight = 1/(pRight->OneOverZ - Gradients.dOneOverZdX); interpolation between those correct URight = ZRight * points (affine and linear are virtually (pRight->UOverZ - Gradients.dUOverZdX); interchangeable in this context). Linear VRight = ZRight * (pRight->VOverZ - Gradients.dVOverZdX); interpolations are what we’ve been doing all along with 1/z, u/z, and v/z, U = FloatToFixed16_16(ULeft) + Gradients.dUdXModifier; so I won’t go into detail here. Linear V = FloatToFixed16_16(VLeft) + Gradients.dVdXModifier; interpolations are very fast, and the if(—WidthModLength) { setup isn’t too bad for each affine span. // guard against div-by-0 for 1 pixel lines The only trick is to determine how DeltaU = FloatToFixed16_16(URight - Uleft) often to subdivide; the more you subdi- / WidthModLength; vide, the closer your piecewise linear DeltaV = curve will match the real curve—but the FloatToFixed16_16(VRight - Vleft) / WidthModLength; more overhead you’ll have from divides } and per-span setup. One simple way to subdivide is to for(int Counter = 0; Counter <= WidthModLength;Counter++) { just break up the scanline into equisized int UInt = U>>16; spans. You can also adaptively subdivide int VInt = V>>16; based on the amount of perspective warp *(pDestBits++) = *(pTextureBits + UInt + on each span. This issue’s texture map- (VInt * TextureDeltaScan)); per will always subdivide to eight pixel spans, but we’ll look into adaptive subdi- U += DeltaU; V += DeltaV; vision next time. Figure 3 shows a subdi- } viding affine approximation to our } } } Figure 3. The Subdivided Affine Curve

u dratic, we need to do “second forward we’d read off our texture map and possi- differences,” where we calculate the for- bly crash. You can figure out when this ward difference of the function step. In will happen and prevent it by subdivid- other words, we calculate the forward ing, but that means even more setup in difference of the forward difference. addition to setting up the quadratic equa- How does it look? Well, in Figure tion for both u and v for each scanline. 2, the blue curve is again the perspective Overall, the quadratic approximation curve, and the red curve is the quadratic is very elegant conceptually, but the prob- interpolating the start, middle, and end. lems of under- and overshoot and the This is a pretty bad case for the quadratic setup overhead of calculating the coeffi- because the perspective warp is quite cients seem to make it not worth the high. On less distorted views the single trouble. You can also use higher order quadratic would match up better. You curves, like cubics, and the math we’ve can also subdivide into multiple quadrat- looked at extends easily. Perhaps we’ll ics to better match the curve if you want return to quadratics in a later column and to spend the extra setup time. However, I see what we can do with them, but for chose this view because it illustrates a now, we’ll move on to subdividing affine. very significant side effect of the quadrat- ic approximation—undershoot. If you It’s Affine Day x look very closely, you’ll see the red line It happens that the method we’ve cho- actually dips below u = 0, which means sen is also the simplest. You’ve probably

24 GAME DEVELOPER • DECEMBER/JANUARY 1995 favorite perspective curve, subdividing Sample Code portable, and you’ll be able to see every eight pixels in x. Listing 2 shows the DrawScanLine func- exactly how they’re called. The test bed There are a few nice things about tion modified to do subdividing affine is easy to modify—see the readme.txt subdividing affine texture mappers. texture mapping. We’ll max this out file in the archive. First, you can tune the performance next time, but even unoptimized it out- In parting, I want to mention a and quality by setting the subdivision performs the divide-per-pixel routine by few tidbits. First, you might think you level. This lets you adjust your perfor- two to four times. We must treat the should do an approximation down the mance on demand (which you might last span with care to ensure we interpo- edges as well, which is certainly possi- need to do at runtime, depending on late the rightmost pixel correctly. You’ll ble. However, your error can build up scene complexity). remember from previous articles that pretty quickly if you’re not careful. Second, you can pretty easily fit all our right edge is actually the left edge of Also, Digital Image Warping by George your interpolants in registers for the the next polygon over, so we need to Wolberg (IEEE Computer Society, affine spans (a subject I’ll cover in more subtract one pixel from the right edge to 1990) is a pretty good reference for this depth in my next column). figure out the last pixel in our polygon sort of thing (including forward differ- Finally, unlike quadratic approxi- and use it in the interpolation. ences). Finally, I’d like to thank Chris mation, you’ll never under- or over- I’ve also finally written a texture Green from Leaping Lizard Software shoot with subdividing affine because mapping test bed so you can simply for opening my eyes up to the fact that like the real perspective curve, the affine compile and run the listings. You can a, b, and c really are three totally arbi- spans are monotonically increasing or find it on ftp://ftp.mfi.com/gdmag. trary degrees of freedom. ■ decreasing with the curve. In other The test has all the texture mappers words, depending on your subdivision we’ve written so far, so you can see the granularity and the perspective warp, jitter from the integer mapper, the By the time you read this, Chris you’ll sometimes draw the wrong pixels, mapping bug from the one we dis- Hecker will have quit working for the man but you’ll never fetch outside the texture cussed in the last installment, and so and will be out on his own, finally paying map or even outside the extents of the on. It’s a Windows program, but the for his own beverages. You can recommend original correct span in texture space. code for the texture mappers is your favorite drink at [email protected].

GAME DEVELOPER • DECEMBER/JANUARY 1995 25 XSPLAT BREAKS OUT

XSplat Breaks Out

moment you sign off and pass along some- thing personal, when you freeze it in time and drop it into the hands of its con- sumers, you find yourself standing naked in front of the world, wishing you could take it all back and do it right. This is a roundabout way of saying that even as I introduced XSplat last month and used it to create a simple cross- platform paint program, I knew it con- tained major mistakes. Unfortunately, I haven’t mastered the Zen of letting go, and this is after all a series of articles. So we’re going to make four quick evolutionary swipes at XSplat before jumping into some real game code. An XSplat Breakout game in progress on Windows 95. The same source code works equally well on the Macintosh. You’ll find all the code included or referred to in this article on the Game Developer ftp site, ftp.mfi.com, in the /gdmag/src/ directory. n Writing Down the Bones, author Natalie Goldberg describes how, at a Darwinism 101 local fair, she set up a booth where she Previously, I briefly mentioned virtualizing wrote and gave away five-minute the CXSplatWindow member functions so we poems. Each poem represented a could use polymorphism in C++ to provide momentary thought, a unique idea multiple window types in a single applica- recorded on paper and passed along on tion using a single mechanism. The base the wind without a backwards glance. CXSplatWindow class can provide a generic IIn a similar vein, John Carmack and implementation from which we can derive John Romero wrote games for Softdisk any number of subclasses that can live Publishing, a service that sent new games together comfortably at run time. That’s to its subscribers every month, before start- change number one: virtualization of CXS- ing id Software. Every 30 days, the pro- platWindow. grammers had to come up with a complete Change number two involves sneak- and innovative concept, make it happen, ing around the much-touted event-based release it, and move on. nature of our target operating systems. As I envy the experiences of Goldberg it stands, XSplat also provides a strictly and the team at id, who learned to move event-based system, meaning that it reacts on, to avoid dwelling on mistakes. I’ve to user input. However, a game must be always found project ends to be painful, proactive—the game should continue even whether I’m finishing a chunk of code, a when the user does nothing. So let’s add a piece of writing, or a baked lasagna. The function CXSplatWindow::Idle, which the

26 GAME DEVELOPER • DECEMBER/JANUARY 1995 Jon Blossom system calls on every iteration of the main we have to negotiate with Windows message loop, that we can use to process through a sequence of calls involving game logic. Hence, change number two: GetKeyboardState and ToAscii. If we suc- Idle Events. ceed in getting a single ASCII code for the Before making XSplat Windows 95 came, and there was key, we can pass it on to the CXSplatWindow much rejoicing. The function provided by object. This precludes the use of special WinG under Windows 3.1 is now provid- keys such as Control or Shift in XSplat ed by the CreateDIBSection API. Chris games, but we’ll make do. Hecker went out of his way to make the The new WM_KEYDOWN handler, which WinG API identical to the CreateDIBSec- replaces the old WM_CHAR handler, is shown faster, the cross- tion API, so the two are nearly inter- in Listing 1. The WM_KEYUP handler is changeable. If you want to require Win- almost identical. dows 95 or NT 3.5 and do away with We also have to add some handling WinG installation, you can use CreateDIB- to the Macintosh message loop to process Section. That’s change number three: keyUp events. That’s very straightforward, platform graphics Enable CreateDIBSection. We may revisit except for a little trick that caught me. The this later to detect the appropriate imple- system engineers at Apple decided that mentation at run time. most Macintosh applications don’t listen Finally, XSplat as we have it now to keyUp events and that they could cut lacks a useful keyboard interface, which we some corners by not sending them, so you library needs a little need to create keyboard-based games. have to tell the Macintosh operating sys- Sending KeyDown messages alone doesn’t tem explicitly to send keyUp events before it quite cut it, so let’s refine CXSplatWin- will pass along a single one. Be a good citi- dow::KeyDown to notify us only when a key zen and turn off keyUp notification when goes down (and not when a key auto- your application exits, too. The following repeats) and add CXSplatWindow:: code will enable this: patching... KeyUp to inform us when a key is released. That’s change Number Four: Better Key- // Tell the OS to give us keyUp events board Events. short OldEventMask = LMGetSysEvtMask(); These quick tweaks prepare to move LMSetSysEvtMask(OldEventMask | the XSplat base beyond a novelty item and keyUpMask); Jon Blossom provides towards a fully featured foundation for // Play the game! games. This excludes the KeyDown and KeyUp XSplatMain(); events, which require some explanation. // Restore the old system event mask LMSetSysEvtMask(OldEventMask); Tuning the Keyboard With WM_KEYDOWN and WM_KEYUP messages, Palettes and Static Cling it in Part II of his Windows passes a virtual key code indicat- Another essential issue still remains ing the key that has been affected. We untouched by XSplat: palettes and color really want some more useful platform- management. In a multitasking, multiwin- independent key code, such as the ASCII dow environment, your application lives in value produced by the key in question, so harmony with many other applications five-part series.

GAME DEVELOPER • DECEMBER/JANUARY 1995 27 XSPLAT BREAKS OUT

Listing 1. Translating a WM_KEYDOWN Message came up with the “static colors” or the “cosmic colors,” as one friend of mine calls case WM_KEYDOWN: them. The static colors are split between // Only send KeyDown if the key is just going down // (no auto repeat) the first and last 10 entries in the palette so if (!(lParam & 0x40000000)) that a bitwise XOR of palette indices will also { provide an XOR of the colors. In Windows // We want the ASCII code of the key that’s going down // Begin with the key scan code, part of the virtual key 3.1, the values and number of static colors UINT ScanCode = (lParam & 0x00FF0000) >> 16; reserved depended on the video driver, but Windows 95 has standardized on 20 spe- // Wish we didn’t have to get all 256 entries, but... BYTE KeyState[256]; cific colors, listed in Table 1. GetKeyboardState(KeyState); After the system claims its static col- ors, you usually have 246 left with which to // Convert the scan code to 1 or 2 ASCII characters char unsigned Key[2]; work. You can tell the system to give up int KeyCount = the static colors, leaving it only color 0 as ToAscii(wParam, ScanCode, KeyState, (LPWORD)&Key, 0); black and color 255 as white, but I really // Only send the key if it translates to one ASCII char recommend that only for full-screen appli- if (KeyCount == 1) cations that use none of the standard Win- pXSplatWindow->KeyDown((char unsigned)Key[0]); dows user interface elements. In XSplat, } we’ll leave the static colors intact. In fact, we’ll go a step further. We’ll actually include the Windows static colors that require specific colors from the hard- VGA allowed for 16 colors, which the in our Macintosh palettes to ensure that ware, so both Macintosh and Windows Windows VGA driver programmed with the colors available to XSplat applications include resident Palette Managers to arbi- 16 specific colors. Then along came video won’t depend on platform. The first and trate color requests. Understanding the cards with a 256-color palette, but much of last 10 colors passed to the CXSplatWindow Palette Managers will allow your XSplat Windows had been coded assuming the 16 constructor will be always ignored, over- applications to share this color sandbox VGA colors of Windows 3.0. If Windows written by the static colors. with the other kids while still hoarding the allowed programmers to tromp all over all Color 0 on the Macintosh is always resources you need. the hardware colors, the colors used for white, while on Windows it’s always black, On the Macintosh, you are entitled window borders, captions, and other user no matter what we do. This “color zero to explicitly program 254 of the 256 colors interface elements could be replaced, and problem” often shows up when artists available in 8-bit video modes, the only modes with which XSplat deals. In the early days, all Macintosh systems had Table 1. The Windows Static Colors black-and-white monitors, so the original Macintosh operating system used only Index R-G-B Color Index R-G-B Color black and white for its user interface ele- 0 0x00 - 0x00 - 0x00 246 0XFF - 0xFB - 0xF0 ments, and now the operating system is 1 0X80 - 0x00 - 0x00 247 0xA0 - 0xA0 - 0xA4 2 0x00 - 0x80 - 0x00 248 0x80 - 0x80 - 0x80 hard coded to program color 0 to White 3 0x80 - 0x80 - 0x00 249 0xFF - 0x00 - 0x00 and color 255 to Black. 4 0x00 - 0x00 - 0x80 250 0x00 - 0xFF - 0x00 Giving two colors to the Macintosh 5 0x80 - 0x00 - 0x80 251 0xFF - 0xFF - 0x00 system doesn’t seem too painful, especially 6 0x00 - 0x80 - 0x80 252 0x00 - 0x00 - 0xFF when most applications include black and 7 0xC0 - 0xC0 - 0xC0 253 0xFF - 0X00 - 0xFF white in their palettes anyway, so we won’t 8 0xC0 - 0xDC - 0xC0 254 0x00 - 0xFF - 0xFF worry much about the Macintosh Palette 9 0xA6 - 0xCA - 0xF0 255 0xFF - 0xFF - 0xFF Manager. Windows, however, abides by much stricter rules. Read Ron Gery’s very thorough online article “The Palette Man- Windows’s colorful user interface could be hard-code an image to the palette on one ager: How and Why” (available on destroyed. system, expecting to be able to display the MSDN or through Microsoft Developer Windows programmers made a pro- same image with the same 256-color Relations group) for the full scoop. I’m vision that would (under normal condi- palette on another system. When they going to give you the abridged version. tions) guarantee the availability of certain bring the image from Macintosh to Win- Back when VGA cards came onto colors to draw the user interface. They dows, they find that all their whites have the scene, Windows made the switch to took the 16 standard VGA colors, threw in become black! Beware. An XSplat applica- color. At 640-by-480 pixels, the standard a few new ones to spice things up, and tion should never use color 0 or color 255.

28 GAME DEVELOPER • DECEMBER/JANUARY 1995 Identity Palettes Listing 2. Windows Palette Creation Our palette troubles aren’t over yet. We may have figured out what colors we // A dummy LOGPALETTE structure struct need in the palette, but there’s still no { guarantee that they’ll appear in the sys- WORD Version; tem palette in the order we request WORD NumberOfEntries; PALETTEENTRY aEntries[256]; them. Both operating systems go } LogPalette = { 0x300, 256 }; through complicated (read time-con- suming) mapping algorithms to ensure // Grab the current palette for the display and count the // number of static colors it’s using that appropriate colors appear when you HDC hdcScreen = GetDC(0); transfer an image from memory to the int StaticColorCount = 20; screen. If we manipulate the colors in the if (hdcScreen) { palette so that they exactly match the StaticColorCount = GetDeviceCaps(hdcScreen, NUMCOLORS); colors in the color tables of our offscreen GetSystemPaletteEntries(hdcScreen, 0, 256, LogPalette.aEntries); images, the system will skip that map- ReleaseDC(hdcScreen, 0); } ping step, and copying an image to the screen will become a direct transfer from // We’ll create our palette from the static colors, main memory to video memory, limited // filling in whatever gaps are left with colors from // the requested colors, or a gray wash as before if almost exclusively by the bandwidth of // there are none. the bus between the two. We need to int i; understand a few things before we can for (i=0; i

GAME DEVELOPER • DECEMBER/JANUARY 1995 29 XSPLAT BREAKS OUT

Listing 3. Macintosh Palette Creation request PC_RESERVED, Windows will not map subsequent color requests to that // Set up the palette from the given Colors entry. WinPalette = NewPalette(256, 0, pmExplicit | pmAnimated, 0); if (WinPalette) We want to trick the Palette Manag- { er into providing a one-to-one match // To maintain compatibility with our Windows cousin, we’ll include the Windows static colors between the colors we request and the col- // in the palette. Of course, color 0 must be white and color 255 black char unsigned const WindowsColorsLow[] = ors in the system palette. In other words, { 0xFF,0xFF,0xFF, we don’t want our colors to be collapsed 0x80,0x00,0x00, 0x00,0x80,0x00, 0x80,0x80,0x00, using the first technique, and we don’t 0x00,0x00,0x80, 0x80,0x00,0x80, 0x00,0x80,0x80, 0xC0,0xC0,0xC0, 0xC0,0xDC,0xC0, 0xA6,0xCA,0xF0 }; want any subsequent color requests to col- char unsigned const WindowsColorsHigh[] = lapse into ours. Because PC_RESERVED is a { 0xFF,0xFB,0xF0, 0xA0,0xA0,0xA4, 0x80,0x80,0x80, superset of PC_NOCOLLAPSE, marking every 0xFF,0x00,0x00, 0x00,0xFF,0x00, 0xFF,0xFF,0x00, 0x00,0x00,0xFF, 0xFF,0x00,0xFF, 0x00,0xFF,0xFF, one of our entries PC_RESERVED will do this 0x00,0x00,0x00 }; for us. So as long as we include the static // We’ll create our palette from these “static” colors, filling in whatever gaps are left // with colors from the requested colors, or a gray wash as before if there are none colors and mark the rest PC_RESERVED, we // Count tells us where to find the appropriate RGB triplet in the requested color array can guarantee a one-to-one match of col- int Count = 0; ors, but we may not yet match indices RGBColor rgb; int i; exactly. We’re forcing the Palette Manager for (i=0; i<10; ++i) to use the second mapping technique, { which means creating a new entry for every // Fill in the first ten entries rgb.red = (long)WindowsColorsLow[Count++] << 8; color we request, but it won’t necessarily rgb.green = (long)WindowsColorsLow[Count++] << 8; start creating new entries at color zero. If rgb.blue = (long)WindowsColorsLow[Count++] << 8; another application has requested palette SetEntryColor(WinPalette, i, &rgb); entries before ours, our palette will be real- } ized beginning where the last application left off, so M and N in the second tech- if (Colors) { nique may not be equal. // Fill in the middle entries with the requested colors To remedy this, the WinG SDK for (; i<246; ++i) included a sample function called ClearSys- { rgb.red = (long)Colors[Count++] << 8; temPalette that forces the Palette Manager rgb.green = (long)Colors[Count++] << 8; to realize a full palette of 256 PC_RESERVED rgb.blue = (long)Colors[Count++] << 8; colors, filling up the system palette so that SetEntryColor(WinPalette, i, &rgb); subsequent palette mapping begins again } at entry 0. Calling ClearSystemPalette in } our XSplat WinMain and marking our logical else { palette entries PC_RESERVED will get us the // Fill in the middle entries with a grey wash pure identity mapping we want. for (; i<246; ++i) The Macintosh Palette Manager { rgb.red = rgb.green = rgb.blue = (long)i << 8; works almost the same way, collapsing entries when it is able to serve color SetEntryColor(WinPalette, i, &rgb); requests as best it can. The Windows } } PC_NOCOLLAPSE corresponds loosely to the Macintosh pmExplicit flag, and the Win- Count = 0; dows PC_RESERVED corresponds to the Mac- for (; i<256; ++i) { intosh pmAnimated flag. To achieve an iden- // Fill in the remaining static entries tity palette on the Macintosh, then, we’ll rgb.red = (long)WindowsColorsHigh[Count++] << 8; put white at color 0 and black at color 255, rgb.green = (long)WindowsColorsHigh[Count++] << 8; rgb.blue = (long)WindowsColorsHigh[Count++] << 8; and mark all other entries as pmExplicit | pmAnimated. There’s no need for a ClearSys- SetEntryColor(WinPalette, i, &rgb); temPalette equivalent. } SetPalette(Window, WinPalette, FALSE); Listing 2 shows the code snippet that } builds an identity palette as part of the Windows CXSplatWindow constructor. List- ing 3 shows the equivalent code for the

30 GAME DEVELOPER • DECEMBER/JANUARY 1995 Macintosh. The 20 static colors are hard Listing 4. Breakout Declarations coded for the Macintosh, but they’re pulled out of the system palette under Windows. // Breakout Game Window // The Breakout window is a regular XSplat window with Also note the striking similarities between // most functions overridden. The game is played entirely the code for the two platforms... // within this window, so the Breakout window includes // all state information necessary for the game. Breaking Out class CBreakoutWindow : public CXSplatWindow Enough of that system stuff, let’s get to the { real point: building games. We’re going to public: // Game setup occurs during construction and on begin programming a cross-platform ver- // InitGame calls sion of an old classic, Breakout. You all CBreakoutWindow(unsigned char const *Colors=0); know the game. A wall of bricks fills the void InitGame(void); upper half of the screen, and the player // The destructor will clean up the game moves a paddle back and forth at the bot- virtual ~CBreakoutWindow(void); tom of the screen to keep a ball bouncing // All of the game logic takes place on Idle into the bricks. Whenever the ball hits a virtual void Idle(void); brick, that brick goes away. The game ends when all the bricks have been destroyed. // This game cares about key states virtual void KeyDown(char unsigned Key); XSplat now has everything we need virtual void KeyUp(char unsigned Key); to implement this game in full color: a place to create and display 256-color protected: CXSplatWindow // This function will completely redraw the game state graphics (palletized and void DrawCompleteGameState(void); COffscreenBuffer), time to process the flow of the game (Idle), and user input to con- // We’ll provide a ‘demo mode’ for the game to play itself int IsDemoMode; trol the paddle (KeyDown and KeyUp). We can derive our game window, CBreakoutWindow, // Game Data from the virtualized CXSplatWindow base and // Game element position and speed int BallX, BallY; override the pieces we need to make the int BallXSpeed, BallYSpeed; game work. int PaddleX; A CBreakoutWindow also keeps track of int PaddleXSpeed;

one complete game state. It stores the // Game field brick wall as an array of bytes, correspond- char unsigned GameField[kWallWidthBricks * kWallHeightBricks]; ing to the wall of bricks on the screen, and inline char unsigned GetBrickState(int X, int Y) any nonzero value in the array indicates a { return GameField[Y * kWallWidthBricks + X]; }; brick in that location. When the edge of the ball crosses a brick boundary, the cor- inline void SetBrickState(int X, int Y, char unsigned State) { GameField[Y * kWallWidthBricks + X] = State; }; responding array entry is decremented. For now, CBreakoutWindow::Initialize initial- inline char unsigned HitBrick(int X, int Y); izes all entries with the value 1, so one hit }; of the ball will destroy a brick. inline char unsigned CBreakoutWindow::HitBrick(int X, int Y) The ball and paddle both have posi- { tion and velocities, also stored in the char unsigned ReturnState = 0; CBreakoutWindow object. The paddle is lim- if (X >= 0 && Y >= 0 && ited to motion along the X-axis while the X < kWallWidthBricks && ball can move along X and Y. On KeyDown Y < kWallHeightBricks) KeyUp { and events, we’ll adjust the speed of int Index = Y * kWallWidthBricks + X; the paddle, moving it left as long as the ReturnState = GameField[Index]; player holds down the < key, and right as if (ReturnState) GameField[Index]—; long as the player holds down the > key. } On Idle messages, the game logic kicks in, return ReturnState; moving the ball and checking if it has hit } anything important. Then Idle redraws the game, using simple rectangle drawing code I’ve described previously (see “XSplat: A ment,” Oct./Nov. 1995), and copies it to Listing 4 shows the declaration of Foundation for Cross-Platform Develop- the screen. CBreakoutWindow, and Listing 5 shows the

GAME DEVELOPER • DECEMBER/JANUARY 1995 31 XSPLAT BREAKS OUT

Listing 5. Breakout Game Implementation (Continued on p. 33)

void CBreakoutWindow::KeyDown(char unsigned Key) { int BounceX = 0; if (!IsDemoMode) int BounceY = 0; { // Get the paddle moving BallX += BallXSpeed; switch (Key) BallY += BallYSpeed; { case ‘,’: if (BallX < kPlayAreaLeft) case ‘<’: { PaddleXSpeed -= 2; BallX = kPlayAreaLeft + (kPlayAreaLeft - BallX); break; BounceX = 1; } case ‘.’: else if (BallX >= kPlayAreaRight - kBallSize) case ‘>’: { PaddleXSpeed += 2; BallX = 2*kPlayAreaRight - 2*kBallSize - BallX; break; BounceX = 1; } case ‘d’: case ‘D’: if (BallY < kPlayAreaTop) // Switch to demo mode { IsDemoMode = 1; BallY = kPlayAreaTop + (kPlayAreaTop - BallY); break; BounceY = 1; } default: break; //——————————————— } // Follow the ball with the paddle center when in demo mode, } // allow the user to control the paddle in play mode else if (Key == ‘P’ || Key == ‘p’) { if (IsDemoMode) // Switch to player control { IsDemoMode = 0; if (PaddleX < BallX + kBallSize/2) ++PaddleX; } else if (PaddleX > BallX + kBallSize/2) —PaddleX; } } else void CBreakoutWindow::KeyUp(char unsigned Key) { { PaddleX += PaddleXSpeed; if (!IsDemoMode) } { // Reverse the motion of the paddle // Make sure the paddle doesn’t move out of the play area! switch (Key) if (PaddleX < kPlayAreaLeft + kPaddleWidth/2) { PaddleX = kPlayAreaLeft + kPaddleWidth/2; case ‘,’: else if (PaddleX > kPlayAreaRight - kPaddleWidth/2) case ‘<’: PaddleX = kPlayAreaRight - kPaddleWidth/2; PaddleXSpeed += 2; break; //——————————————— // Bounce the ball case ‘.’: case ‘>’: if (BallY + kBallSize >= kWallTop && BallY < kWallBottom) PaddleXSpeed -= 2; { break; // Ball is within the brick field. // Calculate ball bounces off bricks default: int BrickLeft = (BallX - kWallLeft) / kBrickWidth; break; int BrickTop = (BallY - kWallTop) / kBrickHeight; } int BrickRight = (BallX + kBallSize - kWallLeft) / kBrickWidth; } int BrickBottom = (BallY + kBallSize - kWallTop) / kBrickHeight; } // Look to the sides of the ball if (BallXSpeed > 0 && //——————————————— ((BallX + kBallSize - kWallLeft) % kBrickWidth) == 0) // Game logic is processed while the game is idle { if (HitBrick(BrickRight, BrickTop)) void CBreakoutWindow::Idle(void) BounceX = 1; { // Don’t do anything while backgrounded if (BrickTop != BrickBottom && if (!IsActiveFlag) HitBrick(BrickRight, BrickBottom)) return; BounceX = 1; } //——————————————— else if (BallXSpeed < 0 && // Move the ball and calculate a bounce off any walls ((BallX - kWallLeft) % kBrickWidth) == kBrickWidth-1)

32 GAME DEVELOPER • DECEMBER/JANUARY 1995 Listing 5. Breakout Game Implementation (Continued from p. 32)

{ BallXSpeed = -1; if (HitBrick(BrickLeft, BrickTop)) else BounceX = 1; BallXSpeed = 1; } if (BrickTop != BrickBottom && else if (PaddleSection == 0 && BallXSpeed > 0) HitBrick(BrickLeft, BrickBottom)) { BounceX = 1; // The ball is striking the leftmost section of } the paddle // from the left. Bounce it back. // Look to the top and bottom of the ball BounceX = 1; if (BallYSpeed > 0 && } ((BallY + kBallSize - kWallTop) % kBrickHeight) == 0) else if (PaddleSection == 4 && BallXSpeed < 0) { { if (HitBrick(BrickLeft, BrickBottom)) // The ball is striking the rightmost section of BounceY = 1; the paddle // from the right. Bounce it back. if (BrickLeft != BrickRight && BounceX = 1; HitBrick(BrickRight, BrickBottom)) } BounceY = 1; else if (PaddleSection == 2) } { else if (BallYSpeed < 0 && // When it hits in the very center section, the ((BallY - kWallTop) % kBrickHeight) == kBrickHeight-1) ball { // bounces straight up. if (HitBrick(BrickLeft, BrickTop)) BallXSpeed = 0; BounceY = 1; } } if (BrickLeft != BrickRight && } HitBrick(BrickRight, BrickTop)) else if (BallY == kPlayAreaBottom - kBallSize) BounceY = 1; { } // TODO: Lose ball! } BounceY = 1; else if (BallY == kPlayAreaBottom - kPaddleHeight - kBallSize) } { // The ball is at the correct height to bounce off the paddle //——————————————— if (BallX + kBallSize > PaddleX - kPaddleWidth/2 && // Perform any velocity changes due to bounces BallX <= PaddleX + kPaddleWidth/2) { if (BounceX) BallXSpeed = -BallXSpeed; // The ball hit the paddle, so it’s going to bounce back up if (BounceY) BallYSpeed = -BallYSpeed; BounceY = 1; //——————————————— // Divide the paddle into five sections and determine which // Display the new frame and return // contains the ball int BallXCenter = BallX + kBallSize/2; COffscreenBuffer* pBuffer = GetOffscreenBuffer(); int PaddleLeft = PaddleX - kPaddleWidth/2; if (pBuffer) int PaddleSection = (BallXCenter - PaddleLeft) { / (kPaddleWidth / 5); pBuffer->Lock(); DrawCompleteGameState(); if (BallXSpeed == 0 && PaddleSection != 2) pBuffer->SwapBuffer(); { pBuffer->Unlock(); // If the ball isn’t moving in X and it hits outside of } // the paddle center, it should bounce to the side } if (PaddleSection < 2)

implementation of relevant CBreakoutWindow Next Time we’ll take a look some platform-indepen- functions. Many of these functions use While the version of Breakout built in this dent timing functions that will allow us to constants (beginning with a “k”) that article works and is even fun to play for control the final speed of the game. And, should be self-explanatory. Notice that about a minute, it certainly has a long way of course, we’ll start spicing up game play there’s absolutely nothing platform-specific to go. For one thing, it’s running flat out with some extra colors, increasing speed, in the game code; it’s all built on XSplat all the time, and it hugs a root even on my and increasing difficulty levels. and compiles for Windows and Macintosh Pentium 90. Perhaps that has something Until then, have fun! ■ without change. to do with the fact that we’re redrawing Again, I encourage you to grab the the entire screen every frame? complete source code and compiled XSplat In my next article, we’ll streamline You can reach Jon Blossom via e-mail at Breakout applications from the Game the Breakout rendering by adding a [email protected] or through Game Developer ftp site. SwapRect function to COffscreenBuffer, and Developer magazine.

GAME DEVELOPER • DECEMBER/JANUARY 1995 33 COLOR QUANTIZATION

Under the Rainbow

So why are we revisiting this process? The answer’s simple: There is a newer and better algorithm available called variance minimization. More specifical- ly, I want to present to you an imple- mentation of this algorithm that is fast, practical, and produces visibly better results in circumstances common in game development. This article has two sections. First, we are going to discuss how to manage colors and graphics in the game devel- opment process and look at issues in getting artwork into your program. Once we have examined the situations where quantization is needed, we are going to get down to the nuts and bolts Two examples of color quantization in action. On the left, the cover of a magazine you might of variance minimization, and explain recognize, scanned at 16 million colors. On the right, the original scan reduced to 20 colors why it gets results that are superior to with full variance minimization. the commonly used Heckbert statistical and popularity methods.

Color Usage in Games ick a color, any color. When I First, I asked the question “Does color was younger, my brother, who quantization have a place in game devel- enjoyed magic and card tricks, opment?” I found that until about six or would frequently use me to seven years ago the answer was, “Not beta test his sleight of hand, really.” Since then, it’s quickly gone and he had a wisecracking way from “Not really” to “Oh, yes.” The of saying, “Pick a card, any advent of 256-color graphics modes on card.” Of course, all cards were PCs and Macintoshes spurred this notP created equal, and I always tried to change of tone. Prior to that, colors guess which card would throw a monkey were so limited that game developers got wrench into his trick, as brothers are their graphics from skilled artists who wont to do. Now after working on hand-drew each image. At the time, no image processing products for my start- popular display could show more than up company, I’m faced with similar 16 of 512 set colors, and PCs were lim- choices in color quantization algorithms. ited to 64 possible colors at best. With I can already hear some of you say- the shift from digital to analog color ing, “Wait a second, didn’t we do this a monitors came video cards that could year ago?” In a word, yes we did (“A display 256 simultaneous colors, which Few Good Colors,” December 1994). was a great improvement. More impor-

34 GAME DEVELOPER • DECEMBER/JANUARY 1995 Matt Pritchard and tantly, these video cards were capable of image and adjust and rescan until you Rich Geldreich Jr. drawing those colors from a range of a are satisfied. You now have the elec- quarter million to 16 million colors— tronic equivalent of a photograph nega- and for the first time the cards could tive. From this file you can produce the Game graphics are respectably display photographic or graphics that will actually go into your video images. program. If you make changes to the number of colors used or want to make Color and Palette derivative images (tinted, inverted, nothing without true, Management Issues brightened, and so on), going back to Let’s talk about artwork and graphics for the original scan file lets you maintain a minute. The graphics for a typical the highest quality. game can come from any combination Drawing images with a computer of the following (each of which raises paint program has some benefits, but vibrant color that issues that can affect the quality of the provides some new wrinkles. With a finished product): paint program, you can eliminate the • Traditional drawn images, which are need to resize an image. If a graphic scanned. needs to be a specific size, the artist just doesn‘t sap memory. • Images drawn with a computer paint sets the work area to that size and program. begins drawing. Because the artist draws • Computer-generated images such as with pixels instead of pen or brush, he raytraced images. or she has precise control of the final Try the high-speed • Images created with a video camera result. So the artist can draw lines per- and video capture board. fectly straight, make distances between Having an artist paint or draw objects precise, and make color gradi- images to be scanned is best suited for ents perfectly uniform. When it comes algorithm offered larger images, such as backgrounds, or to small images or objects, a paint pro- small images with a photographic look, gram is often the way to go. such as faces of characters. Getting the Artists often use video capture artwork into the program involves scan- equipment when they want multiple here and you‘ll ning, resampling (resizing), quantiza- angles or positions of the same scene or tion, and possibly dithering. Ideally, you object. Video data usually uses the YUV want to make this a one-step process. or HSV (Hue, Saturation and Bright- Whenever an intermediate image file ness) color model and is converted by exists, some visual information will be the hardware or driver software into optimize color lost. RGB colors. To get the best final results, follow two steps. Scan the image at the highest The Palette is a Resource physical (not interpolated) resolution Another issue in game development is quantization in your and store it in a lossless true color (24- allocating your colors for each screen or bit) format such as TIFF. Check the situation. Imagine that you are produc- scanned image at this point to see if the ing a fighting game for the PC, much color and contrast closely match the like the “Super Mortal Killer Turbo game design.

GAME DEVELOPER • DECEMBER/JANUARY 1995 35 COLOR QUANTIZATION

Dragon II” games you see in the all the ways and situations in which you ing Program by Lee Daniel Crocker, arcades. At any given time, you have need to quantize images to an arbitrary and quantizes it to an arbitrary number several independent images on the number (usually a small one) of colors of colors from 2 to 256. Unfortunately, screen—the background, the players, before they go into your final product. the 50K of Watcom C source code is and their weapons. As the game pro- too cumbersome to list completely here. gresses, these images are constantly Supporting However, the complete source, com- replaced with different images. Odds are Multiple Platforms piled program, and example files are that all those graphics started out as I want to mention one more situation: freely available on the Game Developer some sort of true color image and were porting your game and graphics to mul- ftp site, ftp.mfi.com, and in our Com- quantized to use a small number of dis- tiple platforms. On a PC, under DOS puServe library (GO SDFORUM), in crete colors. Think about what is going you have full control of all 256 entries in the archive file Dec95.zip, subfile on with the palette in such a game. the palette. But what if you are doing a VARMINCQ.zip. You can also access There are two basic ways to handle the Windows version? If you have never the shareware version of PowerView palette. programmed for Windows before, you here, in the archive file PVIEW100.zip First, the game might use a global, are in for a rude surprise. In 256-color fixed palette that multiple images draw modes, Windows reserves 20 colors for The Quantization Process from. This lets each image use a larger its own use. It is possible to get 18 of From here on, we are going to assume number of different colors, but because those back, but only at the cost of some familiarity with other quantization they must be shared with all other screwing up all the colors in the desk- methods that use cube splitting. Vari- graphics, the quantization error—the top. The new Microsoft Game SDK ance minimization is also a cube-split- degree to which the displayed color dif- provides support for taking over the ting process, but it differs from the more fers from the original color—will tend screen, but what if your program needs common Heckbert method in several to be much greater. be windowable on the desktop? You are important ways. The other approach is to use a seg- looking at a practical maximum of 236 So far, the only published informa- mented palette, where each object gets colors and you have two choices. tion on variance minimization is a paper an exclusive portion of the palette for its You can let Windows manage the by Xiaolin Wu, (“Efficient Statistical own use. This gives the object fewer col- colors for you, and it will translate some Computations for Optimal Color ors to use, but allows the quantization of your graphics colors into other colors Quantization,”Graphics Gems II, Acade- error to be kept to a minimum. This at the expense of speed and image quali- mic Press Inc., 1991). Upon examina- method allows for a much larger total ty. If you use 256-color images for your tion, we found the source code Wu pre- number of colors to be used. wallpaper, you’ve probably already seen sented with his paper was not practical It turns out that selecting colors this in action. When a program needs on a PC class system. So we threw out specifically for an image (quantizing for some additional colors, parts of the his source and developed our own highly that image alone) usually more than wallpaper flash for an instant before efficient implementation, which we pre- makes up for the reduction in available they are replaced with what Windows sent here. Wu’s paper is a very academic colors. It also turns out that the further considers the most similar colors that it read and will send average programmers you reduce the number of colors, the can spare. A better option is to redo scrambling for their college calculus more impact the quantization algorithm your 256-color program to work with books. So, we’ll focus on the actual has. (Dithering also has a place here, but 236 (or fewer) colors. implementation and how it differs from that is a topic for a separate article.) But why stop with Windows? other quantization methods. If you’re Two more palette management What about OS/2 or the Macintosh? interested in the theory and math, by all issues often show up in game develop- And if your product is a successful means check out Wu’s paper. ment—palette effects and shading. game, you could wind up porting it to For those not familiar with how Palette effects are just that: special dedicated game systems such as Sony, computers process color, here’s a quick effects, usually in the form of cycling, Nintendo, Atari, or Sega, each with dif- explanation. Every dot of color that pulsating or flashing colors. No big deal, ferent color systems. appears on your monitor is built from except that when you add palette effects, three separate component colors, red, you usually have to reserve specific por- The Example green, and blue. Each component has a tions of the palette for them. Shading, Program and Source brightness value that can range from on the other hand, often involves split- Now that I’ve built the case for quanti- none (black) to the maximum intensity ting the palette up into sections for each zation, it is time to deliver the goods. of the display device. Your computer’s brightness level. Taking code directly from our PC image video card uses a numerical value to rep- So where are we going with all this viewer, PowerView, we have created a resent the brightness of each color com- talk about color, artwork, and graphics program that takes the raw output of ponent. issues? This is simply an illustration of PicLab, a public domain image process- The computer industry has settled

36 GAME DEVELOPER • DECEMBER/JANUARY 1995 Listing 1. Structure Used for a Colorspace Box Listing 1. Then, we shrink the box to the smallest possible box that can con- typedef struct tain all of the used points within. In { uint variance; /* weighted variance */ fact, every time we create or split a box, uint total_weight; /* total weight */ we shrink it immediately. Shrinking the uint tt_sum; /* tt_sum += r*r+g*g+b*b*weight over entire box */ box is an important optimization used in uint t_ur; /* t_ur += r*weight over entire box */ most quantization processes. It can cre- uint t_ug; /* t_ug += g*weight over entire box */ ate empty regions in the histogram that uint t_ub; /* t_ub += b*weight over entire box */ are not contained in any box and must int ir, ig, ib; /* upper and lower bounds */ be accounted for when building the int jr, jg, jb; inverse color map. } box; Now we get to the question, “What exactly is variance?” Consider that all on 8-bit (one-byte) numbers, which allows for 256 possible settings between Listing 2. The Weighted Variance Calculation black and maximum intensity for each static uint variance(uint tw, uint tt_sum, color component. With three compo- uint t_ur, uint t_ug, uint t_ub) nents, the number of possible colors is { 256 by 256 by 256 or 16.8 million. double temp; That’s a lot of colors! It also gives us a temp = (double)t_ur * (double)t_ur; way to compare colors. We can create a temp += (double)t_ug * (double)t_ug; three-dimensional cube, and let each temp += (double)t_ub * (double)t_ub; temp /= (double)tw; axis (X,Y, and Z) represent one of the color components (R, G, and B). This return ((uint)((double)tt_sum - temp)); way, each color can be mapped to a } point inside the cube by using its RGB values as the X,Y, and Z coordinates of the color point. Now that we can repre- quantization routine I have ever seen the colors in a given box are going to be sent each color as a point in three- reduces a 24-bit color to 15 bits when represented by a color point, also known dimensional space, we can use simple building the histogram, due to memory as the “representative” color. Every used geometry to compute how close together considerations. color in that box is going to be replaced any two colors are. Using the Using short integers, a 15-bit his- by the representative color, and some Pythagorean theorem, we define the togram takes 64K of memory, while a degree of quantization error is going to distance between color 1 (r1,g1,b1) and 24-bit histogram would require 32 be introduced into the image when color 2 (r2,b2,g2) as the square root of megabytes. This reduction (typically those pixels are replaced with the quan- (r1-r2)2 + (g1-g2)2 + (b1-b2)2. Figure 1 truncation of the low bits) is in itself a tized color. Variance in this case means illustrates the RGB three-dimensional form of quantization that is actually the total quantization error of all the color space cube and how to locate a noticeable. If you have ever seen an used points in the box, weighted by the specific RGB color in it. image of a blue sky that has curved usage count of each point. Quantization is the process of bands as it approaches the horizon, The goal of variance minimization replacing one color with another color; you’ve seen the effects of this truncation. is just what the name implies; to pick a usually from a smaller selection of color With the advent of 32-bit compilers, I representative color that results in the points. The distance between the two have found it practical to use a 6-bit lowest possible total variance for that colors is called the quantization error. RGB histogram, which takes 512K of box. If you think about it, that’s the goal Our process starts with a color his- memory and produces superior results of quantization as well—to make the togram of the image to be quantized. compared to the 5-bit histogram. (We color change in each pixel, (that is, the For those not familiar with the term, a are using two bytes per entry, while quantization error), as small as possible. color histogram is a three-dimensional many implementations use four bytes The smaller the variance, the less array of the RGB colors used. The value per entry. With two bytes, remember change to the image. I’ve shown our of a specific element is the number of you need to take precautions to keep variance calculation in Listing 2. times the color with that element’s RGB from overflowing the histogram count.) In this algorithm, we define the coordinates appears in the image. Typi- Once we have this three-dimen- representative color as the “center of cally, most elements in the histogram sional color histogram, we put a box color gravity” for the box—that is, the will be unused or zero. Almost every around it. The box structure is shown in (Continued on p. 40)

GAME DEVELOPER • DECEMBER/JANUARY 1995 37 COLOR QUANTIZATION

Listing 3. Splitting a Colorspace Box (Continued on p. 39)

/*————————————————————*/ * away from the right box and given to the left box /* Splits box along the axis which will */ /* minimize the two new box’s overall /* variance. A brute force search is used sum(i, ig, ib, i, jg, jb, /* to locate the optimum split point. */ &total_weight3, &tt_sum3, &t_ur3, &t_ug3, &t_ub3); /*————————————————————*/ static void split_box(box *old_box) #ifdef DEBUGGING { if (total_weight3 > total_weight) int i, j; ASSERT(TRUE) box *new_box; #endif

uint total_weight; /* update left and right box’s statistics */ uint tt_sum, t_ur, t_ug, t_ub; int ir, ig, ib, jr, jg, jb; total_weight1 += total_weight3; tt_sum1 += tt_sum3; uint total_weight1; t_ur1 += t_ur3; uint tt_sum1, t_ur1, t_ug1, t_ub1; t_ug1 += t_ug3; int ir1, ig1, ib1, jr1, jg1, jb1; t_ub1 += t_ub3;

uint total_weight2; total_weight2 -= total_weight3; uint tt_sum2, t_ur2, t_ug2, t_ub2; tt_sum2 -= tt_sum3; int ir2, ig2, ib2, jr2, jg2, jb2; t_ur2 -= t_ur3; t_ug2 -= t_ug3; uint total_weight3; t_ub2 -= t_ub3; uint tt_sum3, t_ur3, t_ug3, t_ub3; #ifdef DEBUGGING uint lowest_variance, variance_r, variance_g, variance_b; if ((total_weight1 + total_weight2) != total_weight) int pick_r, pick_g, pick_b; ASSERT(TRUE) #endif new_box = boxes + num_boxes; num_boxes++; /* calculate left and right box’s overall variance */

total_weight = old_box->total_weight; total_variance = variance(total_weight1, tt_sum1, t_ur1, t_ug1, t_ub1) + tt_sum = old_box->tt_sum; variance(total_weight2, tt_sum2, t_ur2, t_ug2, t_ub2); t_ur = old_box->t_ur; t_ug = old_box->t_ug; /* found better split point? if so, remember it */ t_ub = old_box->t_ub; ir = old_box->ir; if (total_variance < variance_r) ig = old_box->ig; { ib = old_box->ib; variance_r = total_variance; jr = old_box->jr; pick_r = i; jg = old_box->jg; } jb = old_box->jb; }

/* left box’s initial statistics */ /* left box’s initial statistics */

total_weight1 = 0; total_weight1 = 0; tt_sum1 = 0; tt_sum1 = 0; t_ur1 = 0; t_ur1 = 0; t_ug1 = 0; t_ug1 = 0; t_ub1 = 0; t_ub1 = 0;

/* right box’s initial statistics */ /* right box’s initial statistics */

total_weight2 = total_weight; total_weight2 = total_weight; tt_sum2 = tt_sum; tt_sum2 = tt_sum; t_ur2 = t_ur; t_ur2 = t_ur; t_ug2 = t_ug; t_ug2 = t_ug; t_ub2 = t_ub; t_ub2 = t_ub;

/* locate optimum split point on red axis */ /* locate optimum split point on green axis */

variance_r = 0xFFFFFFFF; variance_g = 0xFFFFFFFF;

for (i = ir; i < jr; i++) for (i = ig; i < jg; i++) { { uint total_variance; uint total_variance;

/* calculate the statistics for the area being taken /* calculate the statistics for the area being taken

38 GAME DEVELOPER • DECEMBER/JANUARY 1995 Listing 3. Splitting a Colorspace Box (Continued on p. 40)

* away from the right box and given to the left box uint total_variance; */ /* calculate the statistics for the area being taken sum(ir, i, ib, jr, i, jb, * away from the right box and given to the left box &total_weight3, &tt_sum3, &t_ur3, &t_ug3, &t_ub3); */

#ifdef DEBUGGING sum(ir, ig, i, jr, jg, i, if (total_weight3 > total_weight) &total_weight3, &tt_sum3, &t_ur3, &t_ug3, &t_ub3); ASSERT(TRUE) #endif #ifdef DEBUGGING if (total_weight3 > total_weight) /* update left and right box’s statistics */ ASSERT(TRUE) #endif total_weight1 += total_weight3; tt_sum1 += tt_sum3; /* update left and right box’s statistics */ t_ur1 += t_ur3; t_ug1 += t_ug3; total_weight1 += total_weight3; t_ub1 += t_ub3; tt_sum1 += tt_sum3; t_ur1 += t_ur3; total_weight2 -= total_weight3; t_ug1 += t_ug3; tt_sum2 -= tt_sum3; t_ub1 += t_ub3; t_ur2 -= t_ur3; t_ug2 -= t_ug3; total_weight2 -= total_weight3; t_ub2 -= t_ub3; tt_sum2 -= tt_sum3; t_ur2 -= t_ur3; #ifdef DEBUGGING t_ug2 -= t_ug3; if ((total_weight1 + total_weight2) != total_weight) t_ub2 -= t_ub3; ASSERT(TRUE) #endif #ifdef DEBUGGING if ((total_weight1 + total_weight2) != total_weight) /* calculate left and right box’s overall variance */ ASSERT(TRUE) #endif total_variance = variance(total_weight1, tt_sum1, /* calculate left and right box’s overall variance */ t_ur1, t_ug1, t_ub1) + variance(total_weight2, tt_sum2, total_variance = t_ur2, t_ug2, t_ub2); variance(total_weight1, tt_sum1, t_ur1, t_ug1, t_ub1) + /* found better split point? if so, remember it */ variance(total_weight2, tt_sum2, t_ur2, t_ug2, t_ub2); if (total_variance < variance_g) { /* found better split point? if so, remember it */ variance_g = total_variance; pick_g = i; if (total_variance < variance_b) } { } variance_b = total_variance; pick_b = i; /* left box’s initial statistics */ } } total_weight1 = 0; tt_sum1 = 0; /* now find out which axis should be split */ t_ur1 = 0; t_ug1 = 0; lowest_variance = variance_r; t_ub1 = 0; i = 0;

/* right box’s initial statistics */ if (variance_g < lowest_variance) { total_weight2 = total_weight; lowest_variance = variance_g; tt_sum2 = tt_sum; i = 1; t_ur2 = t_ur; } t_ug2 = t_ug; t_ub2 = t_ub; if (variance_b < lowest_variance) { variance_b = 0xFFFFFFFF; lowest_variance = variance_b; i = 2; /* locate optimum split point on blue axis */ }

for (i = ib; i < jb; i++) /* split the selected axis into two new boxes */ {

GAME DEVELOPER • DECEMBER/JANUARY 1995 39 COLOR QUANTIZATION

Listing 3. Splitting a Colorspace Box (Continued from p. 39)

ir1 = ir; ig1 = ig; ib1 = ib; jr2 = jr; jg2 = jg; jb2 = jb; new_box->variance = variance(total_weight2, tt_sum2, t_ur2, t_ug2, t_ub2); switch (i) new_box->total_weight = total_weight2; { new_box->tt_sum = tt_sum2; case 0: new_box->t_ur = t_ur2; { new_box->t_ug = t_ug2; jr1 = pick_r + 0; jg1 = jg; jb1 = jb; new_box->t_ub = t_ub2; ir2 = pick_r + 1; ig2 = ig; ib2 = ib; new_box->ir = ir2; break; new_box->ig = ig2; } new_box->ib = ib2; case 1: new_box->jr = jr2; { new_box->jg = jg2; jr1 = jr; jg1 = pick_g + 0; jb1 = jb; new_box->jb = jb2; ir2 = ir; ig2 = pick_g + 1; ib2 = ib; break; /* enter all splittable boxes into the priory queue */ } case 2: i = 0; { if ((jr1 - ir1) + (jg1 - ig1) + (jb1 - ib1)) i = 2; jr1 = jr; jg1 = jg; jb1 = pick_b + 0; if ((jr2 - ir2) + (jg2 - ig2) + (jb2 - ib2)) i++; ir2 = ir; ig2 = ig; ib2 = pick_b + 1; break; switch (i) } { } case 0: { /* shrink the new boxes to their minimum possible sizes */ heap[1] = heap[heap_size];

shrink_box(ir1, ig1, ib1, jr1, jg1, jb1, heap_size—; &ir1, &ig1, &ib1, &jr1, &jg1, &jb1); if (heap_size) shrink_box(ir2, ig2, ib2, jr2, jg2, jb2, down_heap(); &ir2, &ig2, &ib2, &jr2, &jg2, &jb2); break; /* update statistics */ } case 1: sum(ir1, ig1, ib1, jr1, jg1, jb1, { &total_weight1, &tt_sum1, &t_ur1, &t_ug1, &t_ub1); heap[1] = new_box;

total_weight2 = total_weight - total_weight1; down_heap(); tt_sum2 = tt_sum - tt_sum1; t_ur2 = t_ur - t_ur1; break; t_ug2 = t_ug - t_ug1; } t_ub2 = t_ub - t_ub1; case 2: { /* create the new boxes */ down_heap();

old_box->variance = variance(total_weight1, tt_sum1, t_ur1, break; t_ug1, t_ub1); } old_box->total_weight = total_weight1; case 3: old_box->tt_sum = tt_sum1; { old_box->t_ur = t_ur1; down_heap(); old_box->t_ug = t_ug1; old_box->t_ub = t_ub1; insert_heap(new_box); old_box->ir = ir1; old_box->ig = ig1; break; old_box->ib = ib1; } old_box->jr = jr1; } old_box->jg = jg1; } old_box->jb = jb1;

(Continued from p. 37) they split a box into two smaller boxes, as possible) or distribute the number of statistical center of all the points in the their criteria doesn’t directly result in used color points evenly, without regard box, taking their usage into account. reduced color error in the new boxes; to how close they are to the representa- sometimes it does a good job, some- tive color. Other variations on the split- A Better Split times it does a not so good job. The ting criteria exist, but they do not I think of Heckbert’s statistical and Heckbert methods either split along the improve the overall result. median cut methods as naive. When largest axis (making the boxes as square In variance minimization, the goal

40 GAME DEVELOPER • DECEMBER/JANUARY 1995 Figure 1. The RGB Colorspace Cube zation error, is chosen next, and in our implementation it just happens to be the box at the top of the priority list. The Cyan White process is repeated until the number of boxes created equals the number of col- ors desired. Green An interesting side effect of this algorithm is that you can easily compute how well the image has been quantized at any time by summing up the variance Color at Yellow of each box created so far. An interest- point ing variation would be to keep splitting (R,G,B) boxes until the total variance falls below a set threshold. This would let you com- pute how many colors are needed to Black G quantize an image and get a certain R quality level. X-Axis Magenta (Red) B The Inverse Color Map Once we have finished splitting cubes Y-Axis Red Z-Axis and determining representative colors, (Green) (Blue) the new palette is built by putting each box’s representative color into a list. To is to split the boxes in such a way that if Now, we must choose another box get from the original 24-bit color to the you added up the variance of both to split. This is where another important proper palette entry, a structure com- boxes, it would be the smallest number difference occurs with variance mini- monly known as an inverse color map is possible. Wu used summed area tables, mization. Heckbert’s method will select created. This is a three-dimensional cube but we simply used brute force, which the next box based on which box is the size of the histogram where each turned out to be quite fast and efficient. This function, split_box, is shown in Listing 3. Figure 2. Filling in the Histogram Boxes Starting with the box to the split, a plane is passed through the box along one axis and used to divide the box in two. The variance of each box is calcu- Representative color lated and the plane’s position is to points for each box remember if the total variance of both boxes is the smallest yet encountered. As the plane makes its way through the box, individual points are moved from one box to the other by subtracting and adding their values which simplifies and optimizes the process of keeping the variance calculations up to date. The function we used to get statistics for This point each box is shown in Listing 4. is closer to the repre- Once done, another plane is passed sentative color of a different box through the box along the two remain- ing axes, resulting in the evaluation of every possible way to split the box. The box is then split along the plane that largest, which box has the most pixels in point in the cube contains the palette resulted in the smallest total variances, it, or some combination of the two. In entry number for the color at those coor- and both new boxes are placed in a pri- variance minimization, the box with the dinates to be transformed into. In many ority list according to their individual highest variance, that is, the one that implementations, the inverse color map variances. needs the most work to reduce quanti- is built by filling in each box’s area with

GAME DEVELOPER • DECEMBER/JANUARY 1995 41 COLOR QUANTIZATION

that box’s representative color number. Listing 4. Gathering Statistics for a Colorspace Box That is not the way to do it. (I pull my hair out every time I see that.) /*——————————————————————————————————————*/ /* Calculate statistics over the specified box. */ Consider the situation shown in /*——————————————————————————————————————*/ Figure 2. You have a large box and a static void sum(int ir, int ig, int ib, small box, which are touching each other. int jr, int jg, int jb, uint *total_weight, Both have representative colors located uint *tt_sum, uint *t_ur, uint *t_ug, uint *t_ub) approximately in the center of the boxes. { In the large box, a point exists right next int i, j, r, g, b; uint rs, ts; to the edge where the small box is. Even uint w, tr, tg, tb; though it is in the large box, it is much uint *rp, *gp, *bp; closer in the color space to the small box’s j = 0; representative color. By just filling in the boxes, the pixels of that color will not be tr = tg = tb = i = 0; translated into the best available color. rp = hist + ((ir * R_STRIDE) + (ig * G_STRIDE) + ib); There are ways to build the inverse color map so that each coordinate is for (r = ir; r <= jr; r++) mapped to the nearest representative { rs = r * r; color, regardless of what box it is in. We gp = rp; have chosen the method published by Spencer W. Thomas (“Efficient Inverse for (g = ig; g <= jg; g++) { Color Map Computation,” Graphics ts = rs + (g * g); Gems II, Academic Press Inc., 1991). His bp = gp; code is included in the example program for (b = ib; b <= jb; b++) available on the Game Developer ftp site. if (*bp++) /* was this cell used at all? */ { Performance w = *(bp - 1); j += w; In terms of color quality, what is seen by tr += r * w; the human eye matters the most. What tg += g * w; appears to be a strength of this algo- tb += b * w; i += (ts + b * b) * w; rithm is the results it produces when } quantizing to small number of colors. For statistical results, Xiaolin Wu gp += G_STRIDE; } reported that the mean quantization error of variance minimization was one- rp += R_STRIDE; third to one-ninth that of the older } algorithms. Our own experiments yield *total_weight = j; similar results. The difference in results *tt_sum = i; gets greater as the number of colors gets *t_ur = tr; *t_ug = tg; smaller. For a game where only a por- *t_ub = tb; tion of the palette can be spared for a } graphic, this is good news indeed. What about speed? In his paper, Xiaolin Wu was able to quantize a 256- by-256 image in 10 seconds on a Sun avoid turning this into a book. It’s pretty even help some of next year’s games workstation, using five bits of color. In clear that a large and growing amount of look a little more vivid and stunning. our PowerView program, we can quantize game graphics are coming from video, Until next time, happy hacking. ■ an 800-by-600 Targa file in about one scans and other true color sources. With second on a 486/66 in real mode. The that, there is no reason not to use the results get even better in protected mode, very best methods available to get them Matt Pritchard and Rich Geldreich Jr. where it is practical to use six bits of color. into games and other programs, as long work together at Innovatix, a small soft- as they are practical methods. We hope ware company in Garland, Texas. You can The Final Curtain that by presenting a programmers-eye contact them via e-mail at matthewp@net- Image processing is a complex subject, view, and some practical working code com.com, [email protected], or through and we had to leave out some issues to we’ll speed that process up and maybe Game Developer magazine.

42 GAME DEVELOPER • DECEMBER/JANUARY 1995 TOP 10 DESIGN SINS

The Top 10 Design Sins

1. Boring Levels Z Z A dumbfoundingly oft- Z An expert is someone who knows Z forgotten ingredient of Z Z game design is the very not only the right way to solve a world a player steps into. Its particulars are problem but lots of wrong ways. frequently assigned to the most junior designers. “Interactive scripting” boils —Marvin Minsky down to “level layout.” For that matter, both are direct descendants of the “mis- sion and scenario design” that has been done for boardgames since the 70s, when Avalon Hill and Simulations Publica- o learn how not to make a game, tions Inc. (SPI) popularized historically play at least part of a new one accurate—yet playable—war games. every day. Every week, play one • The same enemies occur over and all the way through. I did that over. There are no surprises. for more than 15 months for • Games are too linear and provide only Sega of America’s third-party one way through. licensing department, part of • Progress through the game does not whose charter is to play, evalu- teach or require a growing repertoire Tate, beat, and, if possible, crash every of skills. game from every publisher for every sin- Designer Paul O’Connor, of gle Sega platform. And when a game Alexandria Inc., advances a push and was technically sound, but experientially pull theory of level design, where players deficient (that is, not fun), we had to are simultaneously pushed by enemies have at least 10 suggestions for improve- and pulled by the allure of power-ups ment. As they say, someone had to do it. throughout a level. We saw the same mistakes being An action game without good levels made across game categories and plat- is just a bad action game. However, good forms (yes, we looked at titles for Super levels without action still make for a NES, 3DO, Jaguar, Duo, PlayStation, good puzzle game. PC, and Macintosh, too) by publishers and developers. Each title could have 2. The Sin of been a better game, often without Repetition requiring any more memory; usually it In theater they say would have cost only another week or there is only one two of design time. Following are the unpardonable sin, top 10 design sins—ones my colleagues “Thou shalt not bore.” and I saw over and over again—that Level design is only one way to commit made us shake our heads and ask, “What this offense. were they thinking?” For action games:

44 GAME DEVELOPER • DECEMBER/JANUARY 1995 Jim Cooper • Background graphics and obstacles er?” The designer did if the game is are recycled from level to level with tricky in a cheap way. The computer little or no change. does if too much happens offscreen. • The same attacks work over and over. • The game does nothing new or unseen You dreamed last No new weapons, or abilities, or sto- in other games already or fails other- ryline advances occur as player wise to stand out in its genre. Known advance through levels. Players do not as the shovelware syndrome, this situa- get (or are not required) to mix up tion finds players asking, “Is this really night you got on the their behavior patterns. any better than the 16-bit version?” • Mid-level “continue” markers are • The range of player actions is too lim- scarce or missing altogether, imposing ited. Action games must deliver too much time catching up to the dif- action. If you can do only one thing, ficult parts after every “death.” it’s called a “reaction game,” and that boat to heaven, and For strategy and role-playing games: genre’s time is long past. • Menu structures are too deep. Players • “When you win, you still don’t win.” find themselves playing with the cur- These games have cheese screens (vic- sor more than the game. This most tory screens that appear when you’ve by some chance often strikes ports of won) that are disappointing or miss- computer games, when insufficient ing. Often, there is insufficient story- thought (or none at all) has gone into line reinforcement of success. reworking the user interface for a joy- had your PC by pad instead of a mouse. 4. Production • The same maintenance tasks must be Value (Or repeated incessantly. In 1978, a board Flat Bells game designer named Jim “Bear” And Whistles) your side... Peters coined the term “grocery A pet peeve among game.” It applies all too well today to professional game ana- any game that forces players into lysts is CD-game music that could as repeated back-and-forth tasks. easily have come from a cartridge. To achieve the Designers should let the computer Another gripe is presentational do the drudgery; the player’s input sequences that clearly outweigh the rest should be the spark that drives the of the game in budget and production enterprise. effort (which only conjures images of The Emporer’s New Clothes). You do sanctity of a perfect 3. Not not want people to say, “Great explosion Entertaining graphics, how come there’s no sound?” (Enough) or “Where’s the music?” Players don’t Not boring is not care if your budget ran out before you game, avoid these enough. Sid Meier of could address these problems. MicroProse put it this • Sound effects are sampled at too low a way, “Who has the most fun in a game: rate. the player, the computer, or the design- • Sound is repetitive and annoying. sinful situations.

GAME DEVELOPER • DECEMBER/JANUARY 1995 45 TOP 10 DESIGN SINS

Music loops are too short or the same any licensed game, and one that every uniquely appropriate. The joypad or voice bites are cued over and over. licenser should answer for itself before mouse button combination to unleash it • Video sequences are offensive, usually authorizing any licensee’s release. ought to be demanding, yet intuitive. because nonprofessional actors are The effect in game terms should be dev- used, for example, members of the 7. Counter- astating, but balanced by design ele- 12345 development team. Intuitive ments to preserve it from trivialization, Weapons and such as scarcity of vital ingredients or 5. Conflicting Special Moves limited circumstances during which it is Aspects of These errors exemplify possible. Production the difference between Surprisingly, uniformi- showing and telling, between a gloss on 8. Difficulty ty is more important design and the kind of gut gameplay Properly setting a than level of quality. players dream about. game’s challenge is a No game is expected to depict reality thorny challenge itself. (yet); all a player asks is not to be jarred If a game is too easy out of a willing suspension of disbelief by overall, it’s boring. But incongruities. Making a sports so is infinite incrementing of difficulty; • Music is inappropriate to the mood, nobody plays a computerized game as a action, or audience. duel to beat a machine. That’s nineteenth- • Artwork does not match the target century (and early 1980s) thinking. audience. game may seem • Optimal strategies exist and are obvi- • Sound effects do not match the ous. The AI is weak or does not graphic quality or standard level of respond to player actions at all. quality in the game’s genre. • Ramping is uneven or flat. The flow like a fairly intu- of difficulty is uneven—it is too easy 6. Licenses Left and then too hard, too hard and then Unfulfilled disappointingly easy, or never changes Hits-driven or not, our at all. industry increasingly itive proposition. • Bosses—arch-villains to provide relies on licenses— final challenges at the ends of lev- leveraging proven or els—are missing, too easy, or too expected consumer entertainment utility hard. Only one or two tactics are such as sports, popular books and movies, Turning movies needed against bosses. Enemies or cartoons and comic books, even packaged bosses don’t take damage like the goods like brand-name soft drinks. Mak- player does. ing a sports game may seem like a fairly Beware of creating pseudodifficulty, intuitive proposition; turning movies into however, such as “mandatory hits,” or games takes far greater care. It is not into games takes damage that cannot be escaped at any skill enough to punctuate action sequences level, even if nonfatal. Trying to lull the with outtakes from the licensed product. player into a false sense of insecurity is a On the other hand, don’t assume that no-no. because comics and cartoons lend them- far greater care. selves so easily to video game translation 9. Execution the work is already largely done. It can be A major game design an advantage to have to face the chal- • Powerful attacks are too similar in sin is allowing the lenge of making a simple inanimate effect or gameplay. challenge to arise more object interactive. • Such powerful attacks are too rare or from navigating a • Signature voices and phrases are not common or too hard or easy to execute. game’s interface than included. • Special moves or weapons are illogical negotiating its story elements. Program- • The design does not explore elements in their comparative effectiveness. mers and designers are most prone to of its license’s appeal. Calling a magic spell a “Mega- this mistake; they cannot help but think • The game could just as easily have Bloodcurdling-Turbo-Lightning-Suck- learning and doing things the hard way had a totally different title or main ing-Farfak-Zapster” only goes so far. is fun. It is not. It’s work, the kind they character. The spectacle onscreen and aurally when are paid to perform for the players. This final point is the acid test of it’s loosed must be impressive and • Collision detection is too loose or

46 GAME DEVELOPER • DECEMBER/JANUARY 1995 tight. For example, when collision GO, AND SIN NO MORE detection is too loose, players experi- ence fighting game “hits” that should veryone participating in the design process can help avoid the 10 sins of game design. or shouldn’t have landed. When it is EThe burden should not fall on the developer alone. too tight, players must position a Designer climbing or jumping character’s sprite • You are not just designing a game, you’re crafting game elements to survive the mael- at precisely the correct pixel. strom of producer, marketer, and licenser reviews. Stick to your guns and learn to cre- • Animations of actions are poorly atively outfox upper management. It may seem like a game unto itself, but you must timed or have insufficient frames. play for you and your game to succeed. Games simply lack state-of-the-art graphics and sound. Producer • Basic character movement physics are • Do your job. It’s not just spreadsheeting, or phone-mongering, or lunching. It’s oversee- lax. These physics include jumping ing and delivering the game from the designer to the distribution channel. range (which might be too far or too short), hang time (anything outside a Marketer range between apparent earth stan- • A high-variance strategy is actually your best career bet when dealing with games. At early concept meetings, champion the designer. If it pans out, you can say you pushed dard and moon gravity needs justifica- for it. If it doesn’t, you tried to talk market sense into them. When the game is almost tion), speed of motion, and acceler-o- ready to launch, you must look beyond feature lists at tactical marketing meetings. It’s meter functionality (after a half-sec- your job to figure out how to bring the game alive. Have the producer explain what’s ond moving in the same direction, a unique about the game. It will take more than a few screen shots to communicate that character or onscreen mouse arrow to potential players. should speed up.). If you aren’t able to create the next CFO new technology, you should at least be • Quality sells. Much has been made of the unique marketing behind Doom and Descent. able to execute the current standard well. Don’t forget—there was unprecedented quality in each game. So why not put that incremental product development money your producer is begging for into next quar- 10. Low ter’s marketing budget, under word-of-mouth advertising expense? Replay Value President Games differ from • To get the best out of your people, give them the best of yourself. Are you duty-bound books and movies in to maximizing return on investment or increasing shareholder value? Your franchise as the number of times a publisher depends only on a reputation for quality product. Believe it or not, Spectrum they are consumed. HoloByte’s stock rose the last time it announced another delay in getting out its first Games with linear levels give players no Star Trek: The Next Generation CD-ROM game. Perhaps this unexpected reaction from reason (or opportunity) to revisit scenes the “smart money” had something to do with the lesson the entire industry learned from new angles. The investment in the when another publisher’s bug-riddled graphical adventure CD, The Lion King, experi- average game’s technical development enced retail return rates rumored to have exceeded 50% of sales. could stand to be exploited even more. And no matter what your graphics and sound budget was, after players see and Always, always remember the experi- 2. Repetitiveness hear those jewels a few times, the only ence you offer will be consumed itera- • Don’t stint on the preparation of a thing they want to wrestle with is what tively, that is, over and over again. great storyline. Treat the game more you worked on for just two months out Make maximum user configurability as a novel than a short story repeated of the development cycle—the game. your friend. over and over—or as a movie, not a • Variable difficulty settings are missing. music video. If everyone thinks he or • High scores or low times are not Dos for each Don’t she can make a video game, show recorded, robbing players of the chal- Fortunately, where I come from, you why they are wrong. lenge to try and beat them. don’t complain about problems with- • Players don’t have a selection of out offering solutions. Here are a 3. Entertainment playable characters to choose from. number of ways to avoid the 10 sins • Give good value. • Insufficient “player-override” func- I’ve outlined: • Dare. tionality. Players cannot skip cinemat- • Lead, as opposed to manage. ic scenes and special effects. 1. Boring Levels This last is a cardinal sin all its • Make demands on players. You must 4. Production Value own; by unnecessarily fatiguing players, know their capabilities, which is • Have a production concept that it mortally wounds replay value. admittedly not always easy. somehow fits on the back of your

GAME DEVELOPER • DECEMBER/JANUARY 1995 47 TOP 10 DESIGN SINS

business card and still serves as a yard- ACKNOWLEDGEMENTS Walton says, “Everything in this business stick against which every development conspires against good games.” decision can be measured. rateful acknowledgment is made to The platform wars among 32-bit GSteve Ackrich, group director, Sega of consoles have already spread to the PC. 5. Production Coherence America Third Party Licensing and It happened when Windows 95 began Acquisitions, for permission to print this • Manage the development process, promising true plug-and-play ease of use. article based on materials I prepared that is, its participants. All are neces- and delivered with him at the Sega Race your products to market, but avoid sary, none is sufficient alone. When Developers Conference, March 1995. I’d these simple errors. It’s worth it to take appropriate, tell them so. also like to thank him for admission to an extra three weeks design time up front gameplay bootcamp. And to Gary Barth, and tack another two to three weeks onto 6. Licensing my drill instructor, now at Sony Comput- the end of the cycle for polishing. • Build a game from the license up; er Entertainment of America and the Marketing myopia is the technical don’t just plug and ship your game (or producer of Battle Arena Toshinden. term for the flip side of the “not invented let your licensees do it for you). here” coin. So you have the technology. • Know, define, and insist on making Your game can do what has never been central to gameplay the specific appeal appealed to children, teens, and adults done before or something wildly better of your licensed property. If the through spectacle, action, and ethical than has ever been done. That’s not why license has any value at all, playing to components. Three types of people people buy it. They will buy it—and con- its strengths is a recipe for success. could enjoy them, and anyone can still tinue buying it—because it’s fun. ■ enjoy them on three or more levels. 7. Special Moves Jim Cooper, a gamer with an MBA, • Extend the metaphors in your game. The Eleventh Sin has founded software and game companies, You cannot tell players they are having The 11th sin is failing to realize these are consulted to money managers, and taught fun. They have fun by being fully not design sins, but management sins. No marketing. He is the founding editor of The engaged. They will only be fully competent game designers willingly com- CGDA Report, and can be reached at engaged if they acknowledge and mit them—their masters do. As Gordon [email protected]. accommodate differences you define. Make the player’s input and the result- ing game outputs consequential while internally consistent or the whole house of cards comes tumbling down. • The soul of video gaming is the epiphany of acts of desperation that become intention. In a fighting game, it’s that joystick-slap or button-slam combination—born of a split second’s agonized frustration—that miracu- lously looses the perfect mid-air counter-throw. Like math, it makes “of course” sense after you’ve done it.

8. Difficulty • Defy passivity at every turn. • Surprise, but play fair.

9. Execution • Optimize the inevitable compromises feature for feature by weighing benefit against benefit in play value. Use mar- keting for focus groups and user test- ing throughout the project.

10. Replay Value • Roll at least three games (if not five, or 17) into one. Star Trek and Star Wars

GAME DEVELOPER • DECEMBER/JANUARY 1995 49 INTERACTIVE STORYTELLING

The Play’s The Thing

‘interactive story’ is an oxymoron,” says Jonathan Knight, a producer with Via- com. “It seems like you can’t have one and the other. It’s one or the other.” Still, the possibility is too cool to ignore, and so game developers contin-

Kris Kilayko ue to search for ways to marry the two art forms. They’ve come up with many approaches, some more successful than others. “We don’t have the polish of the thousands of years of work that has gone into regular stories,” says Lawrence Schick, managing director of the interactive story and strategy group at Magnet Interactive. “In comparison to what a playwright or screenwriter does, the stuff we do is awkward and unpolished, and it isn’t as satisfying.” People working with interactive storytelling in any form it may take—be it within the confines of a shoot-em-up Hounds and Jacyls: Integrating puzzles into a story adventure without disrupting the player’s action game or a puzzle-oriented mys- suspension of disbelief is one of the biggest challenges of interactive stories. In tery game—face many challenges as Hyperquest’s new title, Archeologica, the game puzzles not only move the story forward , they search for the key to a successful they give the player a deeper connection to a central character in the game. interactive experience. Here are a few things they’re wrestling with.

ow do you keep a game inter- The Illusion active and also weave in a of Player’s Choice good story? This question is Many interactive story games have the becoming more important in ultimate goal of giving the player the the gaming world. It’s possi- feeling that his or her decisions are ble now to make stories actually affecting the story. “That’s the somewhat variable and inter- holy grail,” says Schick. “Obviously, active and to make great within very strict limitations, you want Hgame experiences more dramatic and the player to write the story by the deci- character oriented. But the possibility of sions they make.” This has been a tough truly merging the interactivity of games goal to reach, so far. Branching plot and the suspension of disbelief of drama stories, in which a story unfolds as the is the carrot dangling before many mul- players make various decisions, are one timedia professionals today. Yet, is this approach to interactive stories, but the merger possible? “It seems like the term story must be limited or the decision

50 GAME DEVELOPER • DECEMBER/JANUARY 1995 Barbara Hanscome tree becomes astronomical. Graphic Player as Hero adventures, where a story is revealed to Viacom’s Jonathan Knight looks at the the players as they succeed in solving “holy grail” a little differently. To him, puzzles or winning battles, are another the key to a successful interactive story All the rock ‘em- approach. This genre, which includes game is aligning the player with the the Kings Quest Series and Wing hero’s objective. It’s all about making Commander III, offers gameplay and sure the player and the hero want the story together, but you have story seg- same thing. “That’s the way modern sock ‘em graphics in ments followed by gameplay segments. drama has always worked,” explains The two aren’t integrated. Knight. “Stanislavsky felt that every Computer role-playing games story ever written hinges on the objec- based on building up skill levels and tive of the hero. Whatever the hero possessions, such as Sword of the wants out of the story will drive that the world won‘t Samurai, let you model a limited set of story to its conclusion.” a character’s personality traits— It’s this element that Knight feels abstracts such as a character’s aggres- makes highly interactive games like siveness, hostility toward the player, Asteroids and Doom, and even more make up for a bland and honor—and manipulate the num- puzzle-oriented games like Myst, so bers with algorithms and routines that successful. “Every game back to Aster- give the impression the characters are oids is really an interactive story,” says reacting to events in the game. Knight. “In Asteroids you have a hero story. Today‘s You can also incorporate a dramati- (the little ship), you have antagonists cally correct story into the process by (the rocks), there’s setting (space), you submitting plot elements to the same have rising action (more rocks coming quantification. You can set up algorithms at you), and there’s climax—it always designers are rising that weight a character’s options to mir- ends tragically with the ship getting ror another character’s (so it appears that blown up.” The objective is clear to the one character is following another), hold player immediately, and there’s no con- back options for dramatic effect (only flict between what the player wants and to the challenge and after your player’s character marries the what the hero wants. villain’s love can the villain have the But Knight says this element is option to send assassins after you). This lost in many interactive stories. Sure, presents the illusion of an unfolding story it’s easy to align yourself with a ship in based on the actions the player takes— danger—that’s based on “sweaty palm” creating meaningful the characters appear to react to what the emotions, fear and survival instinct. But player does. But you usually have a limit- what about objectives that are more ed number of generic and repetitive dra- complex: something like Hamlet’s matic pieces to work with. “The problem dilemma, for example, in which our plot lines as well as is creating something that apparently hero’s objective is to avenge his father’s stitches itself into a movie, without death. We might be drawn to this repeating, and without having to be 10 objective deeply enough to observe pas- CD-ROMS.” says Schick. sively at a Shakespeare festival, but are beautiful visuals.

GAME DEVELOPER • DECEMBER/JANUARY 1995 51 INTERACTIVE STORYTELLING

we involved enough to play “Hamlet tioning fit into a complex story with Mnemonic as an example of a game Interactive?” Plus, the story is already characters, dialogue, and plot? “If you’re that successfully melds action and story, written, how can we really affect the really going to condition someone, you however the feedback is missing. The outcome? can’t be too obvious about it. You don’t game is a linear movie in full-screen Games that are structured so that want to kill them if they walk though MPEG until the player has the option the core objective is achieved through a the wrong door, for example. That’s not to interact, then the screen moves to variety of sub-objectives work well to conditioning, that’s just irritating,” says letterbox. “In Johnny Mnemonic you keep the player moving along on the Knight. The goal is to reach the player get to make several kinds of decisions. right path. at a deeper level. “You don’t want to The hard part is knowing what kind of For example, if you were creating reward and punish actions as much as decision you get to make at any given the “The Fugitive Interactive,” the hero, want to reward and punish emotional moment. They don’t give you a cue as Richard Kimball’s, main objective is to responses. Emotion is what is deep to what kind of choice you’re making: Is prove his innocence in the murder of down and subtle, and that’s what the it a movement choice, should I go left his wife. But in Act 1, his mini-objec- player is not going to be conscious of.” or right? Should I pick something up or tive is to escape incarceration. In the put it down? Is it a fighting option film, he achieves this objective by jump- Making Feedback where I should kick and punch or ing out of a bus, disguising himself as a Work for You block?” explains Schick. The players doctor, stealing an ambulance, hiding in Knight admits he’s still working on have a limited time before the movie a sewer system, and jumping off the top exactly how to create this subtle emo- goes back to full screen. “When you of a dam. “We can offer five more, or tional conditioning. He thinks feedback make your decision matters as much as 10 more, to the player, so that they’re from supporting characters might be what you decide to do.” says Schick. “If not forced down the path the film fol- one solution. “Other characters can you don’t do anything, it often goes lows,” explains Knight. “These different work to goad the hero in certain ways. into a bad end, you didn’t act fast actions could suit a whole range of per- In the Interactive Fugitive, for example, enough and the bad guys blow you sonalities, and yet, sort of unknowingly where the goal of the hero is to prove away.” to the player, the character is still his innocence in the murder of his wife, Feedback is also necessary to avoid achieving the objective that we have set if a guy came up to Richard Kimball one of the most basic trouble spots of for him. and said, ‘You’re a murderer. You killed interactive stories: bottlenecks, in which But that doesn’t completely solve your wife,’ and then the player decides a player cannot move forward until he the problem of merging the hero’s Richard Kimball can beat the crap out or she solves a puzzle. Bottlenecks objective with the player’s objective. of the guy, that behavior—even though destroy suspension of disbelief and are There will always be options the player it’s violent—is conducive to the objec- just plain frustrating for the player. In will want to take that aren’t options tive. And we want to reward the player his games Castle of Dr. Brain and presented in the game. What Knight for that.” Quest for Glory IV, David Cole pro- suspects might be the key is simple, Feedback is also crucial to tell the vides a help mechanism to avoid this Pavlovian condition/response. “Because player that his or her decision made a problem. “I tell the player up front that stories are so psychologically complex, difference to the story. “Feedback is if you click on this button five times, and the distance between what the hero almost the hardest thing to do,” says the first four clicks will give you a hint, and the players want is so great, I think Schick. “Letting the player know what and the fifth click will solve the puzzle we need to use animal conditioning on difference he or she made in a story for you.” To keep it challenging for the our players, and basically reward and implies a couple of things. First it player, the fifth click doesn’t reveal the punish them psychologically, right in implies tipping your hand as to what solution to the puzzle, but it moves the line with the objectives of the story for would happen if the player didn’t make player forward. certain behaviors.” He admits it sounds a decision, and second, it implies that “They did the same thing in the kind of diabolical, but it happens all the you have to somehow, in some brutal 7th Guest,” explains Cole. “In each time in games. “If you think back to way, tell the player what difference this game puzzle you can go down to the Asteroids, if you didn’t destroy the made to the other characters, which is library and there’s a hint book that tells rocks like you were supposed to, if you what matters in the story. It can feel you a little bit about each game puzzle. just sat there and cruised around and contrived, but you’ve got to have it. In And if you consult the book several didn’t go after the objective, then they an interactive story the players are mak- times in a row, eventually it says, ‘oh, started playing this music. It makes you ing the decisions and you have to set okay, you solved the thing.’” really nervous and you get really scared. things up carefully so that they see the But providing help isn’t good And if you go after the rocks, it stops. implications and results of their own enough, you have to let the player know They’re conditioning you.” decisions.” help is available. “In 7th Guest, I didn’t But, how does Pavlovian condi- Schick points to the game Johnny know that you could get past the puz-

52 GAME DEVELOPER • DECEMBER/JANUARY 1995 INTERACTIVE STORYTELLING

zles by using a hint book until I did it pens, and when you’re not fighting ronment, similar to Myst, and must by accident,” says Cole. “It’s a tricky you’re stuck watching a very set script help Sara reset each exhibit in the task, because on one level you want the that you cannot control. Integrating observatory to get the computer system player to be totally immersed in the puzzles and story is even more challeng- up and running. Each exhibit involves fantasy of the game and not thinking ing for edutainment designers, who rely an educational game or puzzle to solve. about the computer. On the other on puzzles to teach subject matter and Mair felt the game was successful for hand, if you’ve got these helpful things test knowledge. How do you make many reasons, but the puzzle and story built in, it’s nice to make that obvious these a seamless part of the experience? mix didn’t hit the mark. “We felt that to the player that those things are Game producer Julia Mair and her what was happening was that we were there.” team from HyperQuest wrestled with forcing the player to stop the action. this problem in their two educational We wanted the player to move through Integration of titles, Astronomica and Archeologica, the dramatic structure and never, or Puzzles and Story which not only mix gameplay and story, very infrequently suspend their disbelief Games such as Wing Commander III but education as well. In Astronomica, to play the games. Many of the games and Daedelus Encounter come close to the player learns about astronomy by are challenging and fun and interesting, merging the excitement of game play helping a teenage heroine named Sara but you still have to stop, you have to with strong characters and storylines. save her dad from captivity in an obser- play the game, you have to get it, and However, it’s not really a mix. The vatory. The player navigates through a then you move on.” story happens, then the fighting hap- photorealistic three-dimensional envi- In Archeologica, the learning aspect is still dependent on puzzles and games, but Mair and her team think TOOL BOX they integrated them more successfully. They set up a main objective for the ombining an interactive story with a challenging objective requires vision—liter- player similar to the one that exists in ally. Here are a couple of tools that can help you visualize the twists and turns of Astronomica: the player must help two your game’s structure from plot line to character development. Use these tools to characters, Sara and Elija, find and res- diagram, outline, and brainstorm projects, and you will begin to understand the cue a character trapped within an envi- art of telling an interactive story. C ronment. In this case, the character is StoryVision, by the company of the same name, is an organizational tool for interactive Elija’s mother, an archeologist trapped gaming used to visually diagram plot structure and characterization. Analogous to a somewhere within an archeological dig detailed blueprint of an interactive script, this tool allows you to map out the “game plan” site. The games and puzzles are layered through the use of bubbles and lines, similar to a flow chart format. Once the scene bub- within the experience. For example, the bles are created, you can attach text to the bubbles in any word format. CD Noir’s Dave players don’t just passively hear about Dengler, who has used StoryVision says, “It’s also great for brainstorming.” Used by writ- the Egyptian Book of the Dead after ers, producers, and developers, this program links with any word processing program and pressing a button, they also travel can organize the text in a screenplay style. Although the program does not include its own through spaces in the dig that represent text editor, user Chris Taylor of Interplay Productions says, “I like the program’s simplici- passages of the book itself. They don’t ty. It is quick, easy to use, and makes changes rapidly.” For more information contact Sto- just learn the significance of the Solar ryVision at (310) 392-5090. Boat to the Egyptians, they maneuver Inspiration, a diagramming and outlining tool by Inspiration Software Inc., can be used as one through a secret passageway. Some a brainstorming tool and a diagramming tool. With a choice of over 500 symbols including of the games are the same games the full ANSI flow charting symbol set, and color, shape, and size capabilities, this tool Egyptian children played, and certain makes it easy for you to differentiate between visually linked ideas. If you still haven’t plot twists are revealed to the player found the perfect symbol for your idea, Inspiration lets you import your own graphics. The only by using knowledge they’ve accu- diagram view also lets you create smaller diagrams that connect to parent diagrams. Lynn mulated in the game, such as decipher- Pierson, product specialist, says, “There are hundreds of levels of diagrams. Each diagram ing hieroglyphs or using tools archeolo- has the capability of connecting to a child diagram.” Each symbol in the diagram has a gists use. linked Notes Window allowing unlimited pages of text, and the multiple zoom feature Then they took it one step further. offers a variety of perspectives to help map out your game’s intricate structure. Toggling “We didn’t want the player to feel that from the diagram to the outline allows you to view your plot structure or characterization in a text format. Complete with its own text editor, Inspiration can revise, edit, and format he or she was pitted against how clever in the outline view. For more information contact call Inspiration Software Inc. at (503) the developer can be or grounded in a 245-9011. twitch arcade element only,” says Mair. —Deborah Sommers To avoid this, they created another character, an archeologist named Bur- ton who once inhabited the dig site

54 GAME DEVELOPER • DECEMBER/JANUARY 1995 where the game is set. He has set up the online). This is the main objective that the player and a character in a story,” puzzles and traps to protect the trea- drives the game, so the player needs to says Lori Cole, who wrote the Quest sures he’s discovered throughout his trust that her decision is right. The for Glory series with husband Corey life. The player discovers various aspects HyperQuest team worked hard on the Cole. “The player will put the imagina- of Burton’s personality through the finer details of the character, choreo- tion into the character if the game has a intricate, Rube Goldberg-like games graphing her movements, her tone of base for them to build upon.” Her and puzzles he has created, and falls voice, and her physical posture so that favorite anecdote to support this theory into a sort of love-hate relationship her personality and situation would has to do with the game Wing Com- with him. Instead of interrupting the come across loud and clear. mander I. When players got to the story with a puzzle, and frustrating the When it came to supporting char- scene in the game where one of the player with a game created by someone acters, such as Sara’s father, an eccentric supporting characters died, BBSes were else, the puzzles take the player deeper scientist with less time on screen, they filled with posts from people lamenting into another layer of the story. let stereotypes work to their advantage. the character’s death. “People posted Of course, veterans of role-playing “We wanted to telegraph his passion, things like ‘She was my love! We had a games, mystery games, and adventure that he’s committed to what he does, relationship!’ They really didn’t have a games are old hands at this. This is and that he’s more than capable of lot of interaction with this character, what their games are all about. “There’s but that didn’t matter.” a misconception in the adventure game Chris Thompson, an interactive field that the puzzles are arbitrarily Astronomica and script writer agrees. In his article “Inter- pasted in. A lot of our puzzles are about active Drama, the Rules of Storytelling” relationships,” explains Corey Cole. (Morph’s Outpost, May 1995), he writes, “Figuring out how to interact with dif- “Developers shouldn’t be afraid to with- ferent people, how to interact with the Archeologica, two hold information. If a user is interested bartender, how to meet someone, how in a character or situation, there’s to get them to join your party, basically almost no limit to the amount of how to help them so they will help you. ‘unknowns’ that he or she will tolerate. That makes the game world feel a lot titles from Hyper- In fact, unknowns generate intrigue, more real. Look at movies, they’re all suspense and mystery.” about character relationships, and that hasn’t been done very much in games What’s Next? thus far. We’re trying to bring much Where is the industry going with inter- more of that in.” Quest, not active storytelling? Some say multime- dia is waiting for someone like Stephen Living, Breathing Spielberg (or Einstein) to come solve all Characters the problems. Some are waiting for the But how do you make those characters only mix gameplay “film/game genre” to die so they can get interesting enough for your player to back to true game experiences. Some want to interact with them? How do say it’s going to depend on motion cap- you telegraph a character’s personality ture technology and artificial intelli- and motives and communicate these and story, but gence before we’ll be able to realize the traits clearly and quickly to the player? true integration of interactivity and HyperQuest’s Mair says it comes down story. “We’re really wrestling with stuff to trading off when stereotypes will no one has wrestled with before, and for work for you and when they will not. education as well. fairly high stakes,” says Schick. “So In Astronomica, Mair and her team people get either desperate about it, or really wanted to create a strong female they basically want to fall back on what heroine, but one that was also a regular putting his shoes in the refrigerator. they know will work. The only reason kid. “In the first scene, we wanted it to We tried to choose where stereotyping why any of it works at all is because the be clear to the player that Sara was a worked for us, because we wanted to concept of actually experiencing a story leader, we wanted to show a young girl cue into a whole set of basic cultural rather than watching it is so compelling with a problem who is strong enough to IDs.” that people are engaged, despite the tackle it.” In the first scene, Sara makes a In games and film you can still embryonic form of the art.” ■ decision that will guide the entire game leave out a lot of information because (she must reset each exhibit in the labo- the player will fill it in. “It doesn’t take Barbara Hanscome is managing edi- ratory to bring the computer system back much to create a relationship between tor of Software Development magazine.

GAME DEVELOPER • DECEMBER/JANUARY 1995 55 ARTIST‘S VIEW

Creation of a Fantastic World

David Sieks rtist’s View remains pretty ceptual considerations with the overall much confined to graphics fabric of the game, inseparable from any issues. However, as digital discussion of the title’s creation or its Nothing brings a game entertainment has matured— effectiveness. Such is the case with has begun to mature—it Buried in Time, sequel to the Journey- sometimes happens that the man Project, labored on for two years by borders separating visual con- Presto Studios and released this summer to life so much as siderations from other game by Sanctuary Woods. elementsA become blurred. When, you Many companies pay lip service to might reasonably ask, are game graphics an integrated approach to design, yet, anything more than just that? The while ever-greater importance is certain- answer: when they are an integral part of ly being placed on quality graphical con- realistically rendered the design process of the game as a tent, in most instances game visuals still whole, interwoven from the earliest con- occupy a largely decorative role. With detail, no matter how minute. This month, David Sieks turns an artist‘s eye to Buried in Time, the new time travel game from Though a picturesque ruin is all that remains today of Richard the Lionheart's 13th century castle, Presto artists turned to contemporary sources to recreate it in stunning detail for Sanctuary Woods. Buried In Time.

GAME DEVELOPER • DECEMBER/JANUARY 1995 59 ARTIST‘S VIEW

Buried in Time, graphics do not serve as mere adornment, however. Nor for that matter is another important creative ele- ment—story—just a weak scarecrow frame on which to hang gameplay. While Presto’s ultimate objective was a fun, playable computer game, there was also a desire to create a deeper and richer experience than the typical adventure Presto designers did their homework to ensure the several historical settings were accurate and title. Presto’s president and Buried in convincing in their detail, even for places that never existed, like this cloistered garden path for Time producer Michel Kripilani, writer a palatial workshop Leonardo DaVinci might have had in Milan— but didn't. Dave Flanagan, and creative director Phil Saunders spent more than five months assembling the skeleton of a that cut), and of course each destination continued to flesh out the story, and game to realize that ambition, all before had to offer gameplay potential. Kripilani began to assemble the produc- even going into preproduction. From the The Presto game design team fur- tion team. Much back and forth was ther complicated their task by opting for involved, and many changes were made historical accuracy, despite the fantastical along the way, but the basic framework plot. This meant exhaustive research, not that had resulted from those first months only for visual and descriptive references of brainstorming remained in place to on which to base designs, but also for hold the project together through its convenient gaps in known history that growth. Though time-consuming, such provided opportunity for embellishment. an integrated approach helped to create a Eventually, along with several futuristic cohesive and balanced game, with a story environments, three historical settings that carries you along while the detailed were chosen: the medieval castle of environments draw you in. All the painstaking research and careful Richard the Lionheart, a Renaissance era design is brought to life by artistic use of workshop of Leonardo da Vinci, and a Designing for Immersion textures and lighting. Mayan ziggurat. The game’s graphics feature rendered, The first two proved especially fer- point-of-view interaction spots linked by very start, visuals, gameplay, and story tile subjects for Saunders and supporting full motion sequences. The level of visual went hand-in-hand, and that integrated conceptual designer Victor Navone to detail in Buried in Time is astonishing approach is apparent in the way the build upon. Little remains today of and, combined with excellent sound game works so successfully to draw the Richard’s Normandy castle, Chatteau effects and an atmospheric score, con- player into its world—or rather, worlds. Gaillard, which fell in the early 13th tributes to an environment that century, but Saunders used contempo- envelopes the player like a warm bath. Setting the Scene rary sketches and descriptions to fill in Drawing the player deep into the game In Buried in Time, the player assumes many of the gaps, and was able to world was the goal, and no effort was the role of a time-travel agent wrongly extrapolate the rest to recreate a wholly spared to accomplish this end. At times, accused of tampering with the past. To convincing environment. On the other this was a grueling commitment to stand vindicate yourself, you must escape hand, despite its impressive architectural behind, as so much of the detail is extra- house arrest and journey through time detail, the da Vinci workshop is pure neous to actual gameplay. But the Presto and space to the several zones in ques- invention, hypothesizing the great man’s philosophy is that detail is what con- tion in search of clues to the identity of whereabouts and activities during a vinces the player to suspend disbelief and the true culprit (solid adventure game shadowy period in his history. Again, enter the illusion, and when it comes to stuff, but still a welcome change from due to meticulous attention to known illusion there’s no such thing as being the onus of saving the universe yet details—and equally meticulous fudging too convincing. Its 40 minutely detailed again). During the early design process, of the rest—the setting attains an eerie environments contain roughly 10,000 the team at Presto considered many degree of authenticity. three-dimensional objects. By the end of time-travel destinations. One chief crite- Throughout the two years it took to the project, Presto artists had more than rion was visual appeal; Saunders wanted complete Buried in Time, environment 40GB of visual data online. periods and places that would lend design, story, and gameplay elements One reason all these details achieve themselves to the lush three-dimensional advanced apace. From the early plot and such a convincing effect is likely Saun- graphics he had in mind. Freshness was environment decisions, Saunders moved ders’ background as an industrial design- also a factor (Egyptian pyramids failed on to conceptual sketches, Flanagan er (he’s still one of the lead car designers

60 GAME DEVELOPER • DECEMBER/JANUARY 1995 ARTIST‘S VIEW

at Nissan). Even fantastic science-fic- Vitale for texture mapping. Rather than was project manager and vice president tional settings are grounded by his prac- simple nontiling textures, materials and Farshid Almassizadeh (yes, they’re tical form-follows-function approach. relief maps were created in Photoshop brothers), whose job it was to see that He also has an obvious flair for the dra- (Adobe) that exactly fit each object. both schedule and high standards were matic (before automobiles, he designed Finally, the completed three- maintained. theme park rides) and these strengths dimensional environments were lit, ani- All the graphics for Buried in Time provided the guiding vision for the mated and rendered with Electric Image were generated on Macintosh comput- Presto art team, a vision Saunders com- (Electric Image Inc.), which Kripilani ers, mostly PowerMacs, with PowerMac municated by multitudinous sketches, unreservedly describes as “hands-down 8100/100 systems sporting 140 MB marker comps, and lots of arm waving. the best 3D animation package available RAM and 2GB hard drive space as ren- Though their creative director knew for the Macintosh. Nothing else even der servers. As Kripilani explains, the what he wanted to see and provided a comes close.” An optimized Phong ren- best graphic creation tools are available strong conceptual starting point, the derer obviated the need for time-con- first for the Macintosh platform. “When team delegated completion of the art- suming ray tracing, allowing animators you are on the bleeding edge, like we are, work to various departments, where the Shadi Almassizadeh, Eric Hook, and you need the best tools as soon as they visual guidelines were fleshed out and Eric Fernandes to complete renders in a are available.”

The decision to incorporate live action video rather than graphically rendered computer 'actors' drove the design of the time-travelling biosuit, which was transformed into an actual costume by a Hollywood special effects company. further details added. Conceptual fraction of the time while maintaining a The Well- sketches were turned into three-dimen- high level of quality. Dressed Time Traveler sional models using Form-Z, from Though a different department With such photorealistic detail going into Autodessys Inc. Three-dimensional handled each stage of the production, the environments, the team decided to artists Jose Albanil and Leif Einarsson there was much communication use live action for the occasional human found Form-Z an excellent and very between the various artists involved. presence. Even the best attempt at a vir- robust program, and as one of the first to Often, pieces had to be sent back up the tual actor would not be realistic enough, offer Boolean operations on the Macin- chain when a texture didn’t work quite they felt, and would fracture the illusion tosh, this tool allowed rapid creation of right or an animation required an object Saunders and the Presto artists had the many complex objects in the game. to be articulated differently. The guid- worked so hard to create. But incorporat- The three-dimensional models were ing dictum was that it wasn’t done until ing live action presented its own problems then passed to E.J. Dixon III and Frank it was right. Shepherding it all along and proved a complicated process.

62 GAME DEVELOPER • DECEMBER/JANUARY 1995 had to be changed to a very matted metal to avoid picking up reflections of the blue screen in front of which the video was to be shot. In its final state, the design for the biosuit looked like a cross between an old-fashioned deep-sea suit and the robot from Lost In Space. The actual suit was constructed by All Effects Company in Hollywood, Calif., using a complicated process in which each section of the suit was carved from foam, following Saunders’s design specifications. A mold was then pulled from the foam carving, a plaster cast pulled from the mold, and finally a vacu- form plastic piece pulled from the plaster cast. The pieces were sewn onto a foam bodyform to give the suit bulk without undue weight (though the final product The wealth of detail in Buried In Time called for designs running the gamut from a sprawling still weighed in excess of 40 pounds). space station all the way down to this surprisingly useful handheld cheese food dispenser. Special removable identification markings were used, so that during the game several

The first step was finding an actual video camera lens that would match the perspective of the rendered environ- ments. This done, Saunders was able to design ahead of time the environments in which the digitized actors would appear. On the set, marks were placed to guide the actors through the virtual ter- rain, and lights were situated to replicate the lighting effects that would appear in the rendered environment. For example, a yellow light connected to a flicker box created the effect of torchlight for the castle scenes. Composited into the ren- dered scene (with Aldus/Adobe After Effects), the digitized actor looks more convincingly a part of the picture than previous experience of composited video and computer graphics might have led you to expect. The decision to use live action gen- erated another issue: creation of the “bio- suit,” a bulky, armored personal time- machine worn by the hero and his fellow temporal agents. Further, the fact that this item would have to be a real object, worn by a live actor, forced certain design considerations. The original plan had been for a suit composed of large, highly Death scenes, painted in loving detail by Gary Glover, accompany a description of the agent's reflective metal plates. First, the large ignominious demise (in this case, lactose intolerance). plates had to be segmented to allow movement. Then the reflective surfaces

GAME DEVELOPER • DECEMBER/JANUARY 1995 63 ARTIST‘S VIEW

agents could be shown suited-up, though world excuse for the interface. Because only one costume had been built. Before you, the time-traveling player, are con- you rush to order yours for next Hal- stantly sealed within this futuristic loween, you should know that the gang at Michelin Man getup, your view onto the Presto considered this suit a deal at world is through the suit’s video display $25,000. (For that price, you could buy camera, which is fed to a smallish screen yourself a nice Nissan.) in the center of the interface, surrounded Besides being a neat costume, the by inventory and other controls. These biosuit also provided a logical game- controls are simple, straightforward, and Table 1. Buried in Time Statistics (Figures are Approximate)

Item Number Design documentation and script 300 pages Environments, rooms 40 Preproduction sketches 1,000 Individual three-dimensional objects 10,000 Total number of polygons 10,000,000 Textures 6,000 Animation, frames 30,000 Visual data in final game 25GB All-nighters 100 The settings in Buried in Time are so rich and compelling that you are prone to for- get your objective and simply explore in gape-jawed wonder.

work so well that they quickly become all but invisible to the player, who is by then engrossed in the beautifully ren- dered scenes in the view window. To the user, this interface is so deceptively sim- ple that if you’ve never attempted to design one yourself, you might never credit that it was the result of three months of teamwork. In almost no other regard, however, does Buried in Time appear to be a game that was easy to make. If you can step back from the illusion long enough to admire the depth of detail evident at all levels of this game, you realize that it has gut-busting effort written all over it: “It’s amazing how draining these projects can be,” says Kripilani. “We are still trying to bring our brains back from jello-land.” ■

David Sieks is a contributing editor to Game Developer. You can contact him via e-mail at [email protected] or through Game Developer magazine.

64 GAME DEVELOPER • DECEMBER/JANUARY 1995