NOVEMBER 1997

GAME DEVELOPER MAGAZINE GAME PLAN

A Pox Upon Patents EDITOR IN CHIEF Alex Dunne [email protected] MANAGING EDITOR Tor Berg ike authors, composers, and using the idea, system, or process itself, [email protected] other creators of intellectual and this is where the confusion begins. EDITOR-AT-LARGE Chris Hecker [email protected] property, software develop- Many people compare code to words, CONTRIBUTING EDITORS Brian Hook L ers derive their living directly and wonder where the government gets [email protected] as a result of what they put down on off awarding patents for a sequence of Josh White “paper.” The registration of ideas. And instructions when it would never do so [email protected] as such, it is the responsibility of soft- for the sequence of words that make up ART DIRECTOR Azriel Hayes ahayes@mfi.com ware developers to understand the a book, article, or poem. The difference ADVISORY BOARD Hal Barwood legal basis which protects their work — comes from the way the instructions Noah Falstein and which can potentially rob them of affect hardware and related devices. Susan Lee-Merrow their work. Because software is used to control Mark Miller Recently, Dave Perry, president of hardware, it is a method or process, and

Shiny Entertainment (creators of therefore subject to patent laws. COVER IMAGE Real 3D EARTHWORM JIM and MDK) found himself Back in the ‘50s, the PTO routinely 2 the target of possibly unwanted atten- rejected patent applications that were tion. He caused a minor firestorm after a based on algorithms, based on the fact PUBLISHER KoAnn Vikören recent interview with Robin Ward was that they are immutable — they are ASSOCIATE PUBLISHER Cynthia A. Blair (415) 905-2210 posted on the Video Game Design web “laws of nature.” Now however, soft- cblair@mfi.com site (http://www.videogamedesign.com/ ware patents are issued for techniques REGIONAL SALES Tony Andrade design/davep2.htm). In the interview, based on algorithms when the software MANAGER (415) 905-2156 Dave stated that he intended to patent uses the algorithm to control hardware tandrade@mfi.com the engine technology behind Shiny’s in specific, limited ways. In other upcoming MESSIAH title. In his words, words, the algorithm may not be MARKETING MANAGER Susan McDonald “It is actually the first demonstration of patentable, but the application that MARKETING GRAPHIC DESIGNER Azriel Hayes perfect real-time 3D tessellation/defor- uses it may be. It’s a fine line the PTO AD. PRODUCTION COORDINATOR Denise Temple mation/skin/interpolation/volumetric walks, but that’s the system we have in DIRECTOR OF PRODUCTION Andrew A. Mickus lighting running at full speed all at the place today. VICE PRESIDENT/CIRCULATION Jerry M. Okabe same time in just software.” I say the Whether Perry has a patentable tech- GROUP CIRCULATION MANAGER Mike Poplardo attention is “possibly” unwanted, nology is certainly not clear from his SUBS. MARKETING MANAGER Claudia Curcio because it’s conceivable that his prima- statement above, and it’s unwise for NEWSSTAND MANAGER Eric Alekman ry goal was to stir up some publicity for anyone to dismiss the technology out REPRINTS Stella Valdez himself, his company, and MESSIAH. In of hand without understanding it thor- (916) 983-6971 any case, I’ll bite. The situation oughly. If Shiny’s engine is that differ- reminds us that our code is subject to ent and eligible for a patent, and the intellectual property laws that many company is awarded one, so be it. C’est Miller Freeman feel work improperly. As such, it’s a la vie, that’s their right. A United News & Media publication good time to review the conditions However, I for one am no proponent under which software may be patented. of software patents. I’ve heard my First and foremost, if you have ques- share of software patent nightmare CEO - MILLER FREEMAN GLOBAL Tony Tillin tions about this subject, run down to stories, and I don’t think it helps the CHAIRMAN - MILLER FREEMAN INC. Marshall W. Freeman the nearest bookstore and pick up growth of the industry to spend more PRESIDENT Donald A. Pazour Stephen Fishman’s Software time and money on legal fees. The SENIOR VICE PRESIDENT/CFO Warren “Andy” Ambrose Development: A Legal Guide (Nolo Press, more patents are issued, the more SENIOR VICE PRESIDENTS H. Ted Bahr, 1993). (There’s a second edition that’s everyone will tiptoe into development, Darrell Denny, about to come out that I’m definitely making sure that their software doesn’t David Nussbaum, going to buy.) This subject is complicat- inadvertently tread on someone’s Galen A. Poss, ed and open to much interpretation, patent. Wini D. Ragus, and the more you educate yourself, the Let’s hope that Perry is not serious Regina Starr Ridley better position you’ll be in to spar with about the patent, and simply desires VICE PRESIDENT/PRODUCTION Andrew A. Mickus other developers about the merits (and more prerelease attention for MESSIAH. VICE PRESIDENT/CIRCULATION Jerry M. Okabe otherwise) of the system. You know the old saying, “there’s no SENIOR VICE PRESIDENT/ Regina Starr Ridley In contrast to software copyrights, such thing as bad publicity….” ■ SYSTEMS AND SOFTWARE DIVISION which protect the expression of an idea, system, or process (but not the idea, system or process itself), patents go much further. Patents keep others from

GAME DEVELOPER NOVEMBER 1997 www.gdmag.com SAYS YOU

Wal-Mart: Right or Wrong? ell, I actually hope that the what? It still wasn't good enough for W integrity of video games is some people. never sacrificed for shelf space. I don't For Wal-Mart, I actually had to hard hat was a great editorial in the know what percentage of the video code the parental lock option to be T September issue. Wal-Mart has game sales market permanently stuck on and compiled already changed several game titles, is controlled into the final executable in order for both in terms of packaging and in by Wal- the game to be acceptable to them. terms of content. Monolith's latest Salut, mes amis! Drop us a line at Mart There isn't even a parental lock menu game, BLOOD, had its packaging — as [email protected]. Or write to Game now, option in the Wal-Mart version since well as the game itself — altered for Developer, 600 Harrison, San but I that is the only version of the game Wal-Mart (to be less bloody), although think you can purchase there. If you want the customer could Francisco, CA 94107. that it’s a the uncensored version of the game download a different that you buy at Wal-Mart, you’ll have patch from market than music. It to download a special patch from the Monolith's would certainly play a strong role 3D Realms web site. site to in the development of a game title O.K. fine, now we have the Wal-Mart bring if a major game retailer such as Toy's version. Now comes the international back the 'R' Us were to start carrying only titles market. We came to find out that there full gore. that it morally approved of. This is a ban on owning, using, or otherwise CARMAGEDDEN industry isn't only about making a depicting shurikens in any media in 5 was treatedB in the quality game, but also about making the UK. I guess people back in the ‘70s same manner. The "gay- money. Once you sacrifice design and got a little carried away after watching pride" Easter Egg in SIM quality, the buyer suffers. the latest Bruce Lee flick, and this is COPTER was also followed by a replace- We as consumers need to support their answer to the problem. So now, ment offer from Maxis. the little man and deviate from saving on top of Wal-Mart, we also have the I recommend subscribing to both a buck at retail giants such as Wal- UK version where we actually had to VGA: Video Game Advisor and Computer Mart. One person isn't going to make a add special code to the game which Retail Week, as both are written by and difference, of course, but if enough replaces any and all shurikens in the for retailers and distributors. Both give people say, "To hell with them!" then game with throwing darts at run time. a very different outlook on the indus- they might get the hint that consumers This also required new code and a lot try from their side. They’ve been hav- want more. of new art — as if a dart isn't going to ing similar Wal-Mart/censorship arti- David Krueger hurt just as much as a shuriken. So cles in their coverage, but with the now, instead of shurikens you'll just retail perspective. Frankly, I‘m very read your article on the "Wal-Mart have incidents of people nailing each worried for the industry. IEffect" and it was right on. Let me other with darts at every local pub in Part of this backlash is caused by the tell you about our personal experience the UK. industry's own success. We’re finally with this during the development of While the executives at Wal-Mart getting computers and games into the SHADOW WARRIOR. It's amazing how claim that they are not twisting our hands of more than 15% of the popula- many different content restrictions arms, they actually are, just in a passive tion, and as a result, into the hands of exist now, and not just with Wal-Mart way. Everyone knows that in order for people who are not all college-educated either. It seems that there is always your game to be a successful seller, you white males between the ages of 25-35 someone new that has to be pleased if have to reach the largest market distri- who make $30-60k a year. While this is you expect to see your product on their bution possible. Wal-Mart knows that a good thing, the current distribution shelves, and more are popping up model means that instead of a greater every day. Correction The article, “Implementing Mixed diversity of products, the more we try Before releasing SHADOW WARRIOR, I to get a larger piece of the pie, the had to maintain three separate versions Rendering”in the September 1997 issue more homogeneous our products of the game. The regular "uncensored" of Game Developer contained a number become, until we all look like Mario — version, the Wal-Mart version, and the of errors. On pages 36 and 38, Figures 2A or worse, Hollywood — and the only UK version — this includes those ver- and 2B have been transposed. Thus, the creative ideas come out of underfunded sions for the shareware release as well! figure labeled 2A is actually 2B and vice versa. Furthermore, the title for figure 2b "art house" game studios. And "internet SHADOW WARRIOR has a parental lock distribution" is not a magic pill to solve option that allows parents to simply (that is, the true figure 2B) is incorrect, as all our problems hitting those niche toggle a button to remove all the it should have been "Texture mapping markets. blood, bad language, and any nudity composite and double buffer in SW I was most pleased to see that for the or partial nudity that is in the game. thread." first time ever in this debate, you didn’t The parents can also password protect Not only that, but we omitted co-author call what Wal-Mart does "censorship." it so that the kids can't turn the option Herb Marselas's byline and bio from the Most people in the entertainment off without the password. This we did article. We deeply regret this omission industry wave that word like a flag. pre-preemptively and voluntarily as a and any confusion caused by the misla- John Williamson standard game feature, and guess beling of the aforementioned figures. http://www.gdmag.com NOVEMBER 1997 GAME DEVELOPER SAYS YOU

they are 10% of our market and that them. Not everyone will do anything ing competition. With the spread of our publishers are going to want that for the "almighty dollar." Developers online and catalog sales, the buying part of the market as much as the other have the same chance to show their public will simply go elsewhere. 90% in order to reach as many cus- integrity and values; they can change On the other hand, the marketer also tomers as possible. Well, what's easier? their product to make more sales (and doesn't want to go against the mores of Coercing each game developer and those sales are to stores, not con- the community surrounding it, either. musician separately to produce the sumers) or they can stick with their The marketer is out to maximize content that they want, or simply vision. When Wal-Mart chooses not to income, and to do nothing that can telling the publishers that they won't sell a popular CD, that’s money they’re jeopardize that goal. And I think we carry a product in their 10% of the forfeiting for their corporate values. should admire marketers who limit market unless they develop a product When John Mellencamp changes his their income because of personal or that fits their family values plan? Sure, lyrics, he is forfeiting his artistic vision corporate moral or ethical considera- it's our option to blow off 10%+ of our for his value$. tions, even if we disagree strongly with potential audience. What an option; John R. Nyquist their beliefs. These people are willing and surely the Wal-Mart executives to lose sales to local, online, or mail- know all this. have several thoughts on your edito- order competitors. It may be unfair, but it's not much Irial in the September 1997 issue of What does that mean for those of us more than an annoyance if you simply Game Developer on the problems of who design and produce products for plan far enough ahead. I do expect that censorship. the benefit or enjoyment of others? 6 this will get worse for each game and First some facts: Censorship is every- Simple. Know your market. If you are music over time though. We where. It’s usually pragmatic. Budgets designing a risque game, know that the simply viewed this as just another constrain libraries and librarians get a sales will have to be targeted different- phase of the project before the final feel for the needs and wants of their ly than one clearly targeted at children release of the game, but it does take up community. Retailers stop carrying or people with more "traditional" fami- some of your precious development items that don't sell and add items that ly values. And vice versa. time in both implementation and thor- they hear are selling well across the Remember that only the government ough testing of that version to make street or in the next town. You will is banned from censorship (except sure that there aren't any forgotten choose which replies are worthy or not pragmatically, when it is the actual booby prizes waiting to spring up and of being reprinted in the magazine. purchaser of information, such as with cause you trouble with the Wal-Mart Each of us restrict our own choices in libraries.) Everyone else is free to do as Gestapo. many ways. they please. I don't think any of us As Wal-Mart and other chain stores Here is an amusing and true story. would want it any other way. gain a larger percentage of the retail When I was young, I fell in love with As Alan Toffler first stated, the future market, I expect the requirements to the Tarzan books — not the movies, has more choices and options, never become progressively worse as their which bore no relationship to the fewer. Wal-Mart already has lost mar- power increases. Who will regulate books. I couldn't get them anywhere. ket share to catalog sales. I think the them on our behalf? And when can we They weren't in print. I had discovered Internet will eventually be their great- expect retail marketing geeks to arrive the books in my grandmother's home est competitor and not the store down on our door steps telling us how we in a back room that had belonged to the street. While I don't believe the must design our games or write our my uncle when he was a kid. Internet, or any technology for that songs? Then the head librarian at the matter, will replace the smell and feel Jim Norwood Kansas City library removed the few of a good book, I suspect there will Tarzan books the library had from the come a time when purchasing or rent- ith regards to your editorial shelves because "Tarzan is living in sin ing visual or multimedia entertain- W "The Wal-Mart Effect," I believe with Jane in the jungle." (A person who ment (which includes computer that you’re worrying over nothing. No obviously got her literature from the games) in a store will be a (fond?) game developer has a right to be on a movies and not from books!) Two memory. store's shelves; remember, the store has months later, my mother presented me Al Baker to buy the game to sell it. If a developer with all 24 Tarzan books freshly pub- would prefer to change their product to lished by Doubleday! Nothing like a lit- sell more units, that is their prerogative tle censorship and notoriety to make Public Apology and it illustrates their priorities. You something popular. I wonder how Speaking of the September editorial, Alex ask, "Who knows what consumers will many people bought the books for a Dunne misidentified the musician who do if a major retailer stops stocking a little titillation, only to discover how changed the cover of his Christmas album certain popular game?" Would the prim and proper Edgar Rice Burroughs in order to gain Wal-Mart shelf space. In world come to an end if a consumer really was! fact, it was Kenny G, not Yanni, who was couldn’t buy a copy of DOOM, MYST,or Yes, there is a big danger of foolish pictured with a naked infant. We offer our BARBIE FASHION DESIGNER at their local censorship. A marketer may decide to humble apologies to Yanni, whom we retail store? A chain showing integrity avoid a product because of sensibilities have long considered kinda cool, in a and sticking to its values is a good that are at odds with its customers. strange, mustachioed way. thing, even if you don’t agree with That is a foolish marketer. He is invit-

GAME DEVELOPER NOVEMBER 1997 http://www.gdmag.com BIT BB LL NEWS FROM THE WORLD

grammable buttons for direct fingertip INDUSTRYINDUSTRY MAGELLAN Studio 1.0 access to more than 20 edit and dis- play functions in 3D StudioMAX LOGITECH has unveiled MAGELLAN (default and user-specific button set- WATCHWATCHStudio 1.0, a smart software/hardware ting are available). by Alex Dunne solution for the professional multime- MAGELLAN Studio 1.0 supports FROM THE ULTIMA O NLINE news front, dia authoring market. MAGELLAN Windows NT 3.51, Windows NT 4.0 Electronic Arts announced that during the Studio 1.0 allows interactive motion and Windows 95 and has a suggested beta test, the game established the world retail price of $495. record for "the largest number of people ■ Logitech 8 concurrently playing in the same virtual Fremont, CA world" — 2,850 players. What is interesting, (510) 795-8500 is that the size of the game space (189 mil- http://www.logitech.com lion square feet, or about 6.7 square miles according to my calculations) would require 38,000 17" monitors to view it all — almost enough to blanket a football field. Acoustics Modeler IN (OTHER) NEWS FROM THE SONIC FOUNDRY has just released its WORLD OF PATENTS, Aureal Acoustics Modeler Plug-In, a digital sig- Semiconductor received a patent for its nal processing tool that adds the head-related transfer function (HRTF) filter In 1993, Magellan was chosen to con- acoustical coloration of real environ- technology, which is used in the company's trol a robot in space during a space ments and sound altering devices to A3D 3D audio technology. The patented shuttle mission for NASA. existing recordings. technology, developed by the company's Acoustics Modeler was developed for Crystal River Engineering subsidiary, cov- control of three-dimensional objects in use with any editor that supports ers the compression techniques used to Kinetix’s 3D Studio MAX. The product DirectX plug-ins, including Sonic process 3D positioning data. Aureal consid- includes a MAGELLAN 3D Controller Foundry’s Sound Forge 4.0. Rather ers the patent to be a big obstacle to any as well as dedicated software for inter- than simply adding reverb to a sound competitors trying to achieve the same 3D facing with 3D Studio MAX 1.2. At file to simulate an audio environment, audio at similar price points. present, support for 3D Studio MAX Acoustics Modeler actually incorpo- ACTIVISION ANNOUNCED that it will 2.0 is in the beta stage and will be rates the acoustical responses of a given publish the first three titles from Redline available upon the release of MAX 2.0. environment into a sound file. The Games, a new company started up by The MAGELLAN 3D Controller James Anhalt and Ronal Millar. Millar was (known as the “Space Mouse” in the senior game designer at Blizzard Europe) is an input device that allows (worked on DIABLO, WARCRAFT II, and the users to intuitively and precisely upcoming STARCRAFT), while Anhalt was a manipulate 3D objects with six degrees consultant to Activision (programmed on of freedom in CAD/CAM and visual projects MECHWARRIOR II and PITFALL: THE simulation applications. MAYAN ADVENTURE). Redline's first title out Key features of MAGELLAN Studio of the gate will be an RPG/strategy game. 1.0 include dynamic control of 3D LET'S DO THE TIME WARP. Activision objects, cameras, or lights simultane- announced that it acquired the rights from ously in up to six axes; “roll-up” Atari/JTS Corporation to develop titles menus for axes constraints, recording The Acoustics Modeler Plug-In. based on the classic games ASTEROIDS and control, Move/Scale function, and BATTLEZONE. These two games will join node position; automatic animation PITFALL and ZORK as spruced up and recording, providing real-time motion program features a library of dozens of relaunched old favorites under the capture, along with features such as these features, including recording stu- Activision moniker. It's just a jump to the slow motion, clipping, and pause dios, concert halls, warehouses, tun- left… recording; four static buttons for sen- nels, bridges, and woods. In addition, TOM RYAN, THE CEO OF SCITECH sitivity control and reset of transfor- recorded material can be filtered SOFTWARE, testified before the House mation matrix; four dynamic pro- through numerous sound-altering

GAME DEVELOPER NOVEMBER 1997 http://www.gdmag.com AA SS TT SS OF GAME DEVELOPMENT

devices such as classic microphones costs $249, and an upgrade from previ- Judiciary Subcommittee on Courts and and instrument amplifiers. Users can ous versions costs $69. You can down- Intellectual Property, speaking on behalf of also record and access their own load the demo from the company’s the WIPO Copyright Treaty Implementation acoustical environments with the web site. Act. Ryan testified that SciTech, maker of Impulse Recovery Function. ■ PowerProduction Software the MGL graphics library, had been threat- The Acoustic Modeler Plug-In has a Los Gatos, CA ened by an extortionist who warned that suggested retail price of $249. (800) 457-0383 unless the company paid him $20,000, he ■ Sonic Foundry (408) 358-2358 would post instructions on the Internet Madison, WI [email protected] explaining how to disable the countdown (608) 256-3133 http://www.powerproduction.com timer on the trial version of SciTech's http://www.sonicfoundry.com Display Doctor. The CTIA would provide 9 copyright owners with more legal means with which to fight unauthorized circum- New DVD Standard vention of technological protection of copy- StoryBoard Quick 3.0 THE DVD FORUM has proposed the righted software, such as the ability to act POWERPRODUCTION SOFTWARE format of a DVD-RAM disc (rewritable against web sites that post serial numbers has released the new version of its DVD), which has a storage capacity of so that pirated software can be installed. storyboarding software, StoryBoard 2.6GB on a single side, to the European SEGA AND MICROSOFT are working Quick 3.0. Computer Manufacturers’ Association towards an agreement whereby the next (ECMA). The DVD Forum will also pro- generation Sega console system would be pose the DVD-RAM format to other based upon Windows CE. Sega's machine international standardization organiza- will reportedly be based on a 128-bit micro- tions. The DVD-RAM format version processor from Hitachi. By basing the con- 1.0 was agreed to by the Forum at the sole on Windows CE, the companies hope end of July, and the Forum started issu- to make it easier for game developers to ing the Format Book in early August. build titles for Windows-based PCs and the Following the announcement of the next generation console using a similar format version 0.9 in April, the DVD- code base. RAM working group evaluated the com- "OVER 1,000,000 SERVED." No, that's patibility of the DVD-RAM disc with not a McDonald's slogan from the '60s; it's other DVD disc formats. the number of unique users Blizzard claims Storyboard Quick 3.0 gives you one, The standard states that: to have logged into Battle.net. The service two, four, six, nine, twelve, sixteen • Playback of DVD-RAM discs on exist- hit that number just eight months after its frames per page, vertical or horizon- ing DVD-ROM drives is possible sim- launch, and is a testament to the success of tal, with or without captions, in four ply by modifying the LSIs. DIABLO. According to PC Data's numbers, aspect ratios. • Data reliability is ensured due to the DIABLO has sold around a million copies to use of a dedicated cartridge and, for date. Hey, wait, that means every person StoryBoard Quick features dragable compatibility with DVD-ROM drives, who bought it… characters, props, and locations, allow- it is also possible to take the disc out IT'S AN ODD WORLD OVER AT GT ing you to previsualize your project. of the cartridge. INTERACTIVE, which announced a $10 This new version has a number of The DVD Forum consists of Hitachi million global marketing campaign for additional locations, props, and char- Ltd., Matsushita Electric Industrial Co. ODDWORLD: ABE’S ODDYSEE. The announce- acters. New libraries, new printing for- Ltd., Mitsubishi Electric Corp., Victor ment is notable in that GTI has already mats, and new aspect ratios comple- Company of Japan, Pioneer sketched out four sequels to ABE'S ODDYSEE ment a revised and updated user Electronics Corp., Sony Corp., Toshiba before the first has made it out the door. interface. StoryBoard Quick imports Corp., Philips Electronics N.V., These games, GTI explains, form a new scripts from Final Draft, as well as .GIF, THOMSON Multimedia, and Time genre called "Aware Life forms in Virtual Mac PICT, Windows Metafiles, and Warner Inc. Entertainment (ALIVE)". Earth to GTI market- bitmap files allowing you to scout ■ The DVD Digital Domain ing department: Put down the rubber locations on the Web. http://www.dvddigital.com cement and come out with your hands up. Storyboard Quick 3.0 is available for Let's see if the first title is a hit before we Mac or Windows 95. The latest version get carried away with the sequels.

http://www.gdmag.com NOVEMBER 1997 GAME DEVELOPER by Brian Hook GRAPHIC CONTENT

Texture Transparency and Texture Compression

his month marks the first time that I’ve had a chance to sit down and write about T some various odds and ends that I’ve been meaning to discuss. Transparent Textures and not rendered. Again, Figures 1 and Alpha testing and alpha blending are 2 are examples of this, where the green often more appropriate than using major topic in game development color represents the key color value, chromakey when implementing tex- A these days is support for transpar- and thus won’t be rendered. tures with transparency. ent textures. Transparent textures have Things became more complicated ALPHA BLENDING AND ALPHA TESTING. I’ve been inconsistently supported by both with RGB texture maps and hardware already discussed the theory of alpha 11 hardware accelerators and even graph- acceleration, since MIP-mapping and blending in previous columns ics APIs – Direct3D has a very strong bilinear filtering can screw up your “Multipass Rendering and the Magic of bias for one type of texture transparen- chromakey color test. For example, you Alpha Blending,” pp. 12-19, Game cy (chromakey), and OpenGL supports could designate the key color as Developer, August 1997), so this month texture transparency only through alpha testing. Ever since RAM costs plummeted lower than Transparent textures have countless uses, including bitmapped sprites, win- Ray Liotta’s career, texture compression dows, grates, and any other complex object that is easier to represent with a hasn’t been as high a priority for most 3D sprite than actual geometry. Figures 1 and 2 are examples of these, a fan and accelerator manufacturers. grate from DESCENT by Parallax 0x808080, but with bilinear filtering I’m going to show you how to use blend- Software. The green portions of the enabled, the odds of a texel coming ing and alpha testing for antialiased bitmaps represent transparency, allow- through the filtering stage unmodified transparent textures. Instead of designat- ing the background image to show is very unlikely. And the simple box fil- ing a single color as transparent, alpha through. ter that most MIP-map generators use testing allows you to specify certain bits Transparency in textures can be will mangle a unique color when found to represent transparency. A texture map implemented as varying levels of in smaller MIP-map levels. with more bits dedicated to alpha will translucency or simply as full For these reasons, bilinear filtering have the ability to represent increasing opaque/full-transparency “punch and MIP-mapping are typically mutually levels of translucency. The two most outs.” The former can only properly be exclusive with chromakey. Some hard- common formats for alpha textures are implemented through alpha blending ware architectures have added support 4444 ARGB, and 1555 ARGB. The former and alpha testing; however, punch for a key color range instead of just a sin- sacrifices color depth in order to allow outs can be implemented through gle key color, but this isn’t a particularly sixteen levels of transparency. The latter either chromakey or alpha testing. elegant solution CHROMAKEY. Chromakeying is a tech- since it’s prone nique commonly used in the video to accidentally production world for merging two removing other images. A key color in the first image is texels as the replaced by the contents of the second result of blend- image. This concept is the foundation ing and MIP upon which “blue screening” is based. mapping. In Transparent texture maps implement some extreme chromakey by allowing the game to cases, it won’t designate the key color. With 8-bit even correctly paletted textures, this is trivial since it handle a trans- only requires a single palette entry to be parent texel that FIGURE 1. Chromakey tex- FIGURE 2. Chromakey tex- designated as transparent. When ren- ends up being tured fan from Parallax’s tured grate from Parallax’s dering the texture map, any texel that filtered to an out DESCENT. DESCENT. is equivalent to the key color is ignored of range value. http://www.gdmag.com NOVEMBER 1997 GAME DEVELOPER GRAPHIC CONTENT

maintains higher color resolution, but something that you need to be aware available tools. Aside from palettized only has the ability to indicate absolute of when working with textures con- textures, a standard for precompressed transparency and opacity. taining alpha. texture data doesn’t exist. In all like- ALPHA TESTS AND OPENGL. With OpenGL, SOURCE OF THE ALPHA. This is a quick note lihood, any compressed texture solu- you enable and configure alpha testing – be aware of your texture environ- tions will be proprietary (such as the with ment and incoming iterated alpha 3Dfx Voodoo’s proprietary 8-bit com- glEnable( GL_ALPHA_TEST ); value when working with textures con- pressed texture format). glAlphaFunc( GL_GREATER, 0.0F ); taining alpha. The source of your frag- QUAKE2 needs to dynamically com- The alpha function defines what type ment alpha may not be particularly pute texture data through surface of relationship must exist between intuitive and will depend on your tex- caching (in the software-rendering sub- incoming alpha and the alpha reference ture blend/environment, your texture system) and dynamic light map genera- value to render an incoming fragment. map format, and the value of iterated tion (in the OpenGL-rendering subsys- For the preceding bit of OpenGL code, alpha. With OpenGL, this is clearly tem), so the usefulness of precomputed all fragments with an alpha greater defined. But with Direct3D, however, compressed texture data will be limited than zero will be rendered. Such a func- you’ll probably have to experiment to games that don’t modify their tex- tion would be used with 1555 ARGB with different drivers, because no clear tures on the fly. Also, QUAKE2 is designed textures, where a texel alpha bit of 1 specification exists on this topic. to be portable across many platforms, indicates opacity and 0 indicates trans- ANTIALIASING WITH ALPHA. A cool side effect and supporting many different propri- parency. If bilinear blending is enabled, of using alpha bits to represent trans- etary compressed texture formats isn’t then you can achieve a reasonable form parency is that you can get antialiasing particularly desirable or even feasible. 13 of antialiasing, however, bilinear blend- effectively for free. Even with a 1555 Run-time texture compression, on the ing can have odd effects with alpha ARGB texture, you can get antialiasing; other hand, allows the incoming texture testing, so you need to be very diligent bilinear filtering will blend the binary to be a lot more dynamic in nature, when rendering textures with alpha alpha values into intermediates values, since the compression doesn’t occur blending, bilinear blending, and alpha depending on texel coverage. This until the texture is uploaded to the hard- testing enabled. means that textures with “punch outs” ware. The downside to this approach is ALPHA TESTING AND THE Z-BUFFER. Another won’t necessarily have harsh edge alias- that there will likely be a significant and caveat is that alpha testing and alpha ing artifacts along the borders between noticeable hit on performance every blending don’t necessarily coexist very opaque and transparent regions. time a texture is compressed and down- well with Z-buffering. Take, for exam- loaded, discouraging the use of lots of ple, a case where you have a 4444 dynamically changing textures. Once ARGB texture. Assume the texture has Compressed Textures again, QUAKE2 relies heavily on texture gradually increasing amounts of trans- downloads for effects such as dynamical- parency as you get closer to the center exture compression was a really ly updated light maps. of the texture, with full transparency at T hot topic a couple years ago when Neither of these solutions is perfect, the center (as in, a cutout) and full RAM prices were phenomenally high. and both have significant pros and opacity at the edges. Ever since RAM costs plummeted lower cons. Until hardware accelerators that The intuitive way to render this than Ray Liotta’s career, texture com- support texture compression hit the would be with standard alpha blending. pression hasn’t been as high a priority market, we won’t really know which glEnable( GL_BLEND ); for most 3D accelerator manufacturers. direction things are heading. So until glBlendFunc( GL_SRC_ALPHA, Some work is still going on in this area; then, we won’t know how to compen- GL_ONE_MINUS_SRC_ALPHA ); however, I fear that some hardware sate for the various idiosyncratic tex- The problem occurs when you try to manufacturers might be going in the ture compression implementations write values to the Z-buffer condition- wrong direction on this one. that will be heaped upon us. ally based on alpha. The fully opaque Textures are expected to be com- This month’s column has covered a parts of the texture need to have depth pressed either by the game developer as lot of the odds and ends that I’ve been values written. However, any transpar- part of a preprocessing step or by the meaning to address over the past few ent portions must not have depth val- hardware and/or its driver during run months. I’d like to thank Matt ues written to the Z-buffer. Alpha test- time. Both of these methods have some Toschlog and Parallax Software for ing doesn’t solve this problem pretty significant drawbacks. allowing me to use their bitmaps. For adequately, since a pixel that fails Precomputed texture compression my January 1998 column, I plan on alpha test won’t be rendered at all, has some obvious benefits — slow but talking about my experiences with when in fact you still may want a par- high-quality compression algorithms QUAKE2 and the development method- tially translucent fragment to be ren- can be used, and there’s very little run- ology that id uses. ■ dered but with depth buffer updates time overhead for using compressed Brian Hook recently had a nightmare in inhibited. Unfortunately a mechanism textures. But this assumes that you which real-time 3D graphics programming that describes this doesn’t exist in know what your texture data will look was totally irrelevant to life in general. Direct3D, nor in OpenGL. like before your program is even start- Fortunately, when he woke up he was still For this reason, textures with varying ed, and it also assumes that you’re coding QUAKE2 at id Software. Send hot levels of translucency may be prone to using some type of industry standard milk and soothing reassurances to visual anomalies, and this is definitely texture compression algorithm with [email protected]. http://www.gdmag.com NOVEMBER 1997 GAME DEVELOPER by Josh White ARTIST’S VIEW

Birthing Low-Polygon Characters

eah, I know. My own patience for metaphors in computing is quite short, too; but you have to admit that “birthing” for character creation makes sense. Character design is a control-freak parents’ ultimate dream; there are no vagaries of chance here. We artists build a human character exactlyY how it’s supposed to be. WHERE TO START? The blank-page block can Height, weight, sex, clothing style — be very strong when an artist is facing a they’re all at our fingertips. Scary, huh? character design job. Not only are the Let’s walk through the birthing starting options overwhelming, but char- process of a human character. We’ll do acter design is more than visual, so we’ll this in two parts: design and construc- have to do some nongraphic creation. 15 tion. This month, we’ll start with real- For example, look at Lara Croft from time 3D character design, working TOMB RAIDER. For a full character toward a solid pencil sketch and a basic design, we’d want to know much more construction plan, including face and about her than her appearance: Her texture budgets. In January, we’ll walking style, her interests, her natural explore how to actually build a 500- abilities, what kind of people she likes, face character based on this design. her accent, her choice of words… all Creating compelling, interesting characters is a well-documented topic, so go scam some knowledge from experts.

kinds of nonvisual detail should be FIGURE 1. Pencil sketch character. Character Design (and probably was) defined. We design characters in two steps. bviously, character design is a • First, we collect all kinds of detail, indecisive about girls, and seems to O really broad topic, and there are even if it’s not directly relevant to have serious issues with school (Mrs. endless approaches to this topic. In drawing the character. Grundy). These imperfections make fact, for someone starting out, therein • Second, we develop graphic represen- him “real,” and even normal. lies the problem: too many options. tations: pencil sketches, 3D models But Archie is nothing compared to With that in mind, I’m laying out with textures, and animations. the twisted psyche of his best friend. some specific techniques from the A DAB OF THEORY. There’s a whole lot of Jughead’s strange, ugly appearance, sea of possibilities — but if you do it theory that can be invoked for charac- suppressed or retarded sexuality, freak- differently, don’t feel neglected. ter design. Here’s a tiny taste (see the ish obsession with eating, and all- sidebar, “Homework: Character Design around spaciness are exaggerated flaws Definition Research,” for more sources). that real people possess — and they The first lesson for artists-turned- make for all kinds of rich storytelling. For those of you who have avoided the designers is, perfection is boring. Think FINDING CHARACTERS. So where do you find term so far, an “avatar” is a represen- about any cool character you know. a library of character traits? Every- tation of a player in any computer-sim- Most of their interest comes from flaws where. People-watching, with a critical ulated environment. They’re often low- and weird quirks. These flaws can be in eye toward unique personalities, is a polygon 3D models of people in many forms: physical, mental, emo- great way to get a whole pile of inter- multi-user 3D worlds, but the term tional, societal, and so on. esting, fresh elements for character also applies to 2D-only “sprite” For example, take a look at the comic design. Spend an hour at an outdoor images of the player. The term isn’t book character Archie, the blandest, café with a notebook and see what you usually applied to games, but if it most basic good character we can imag- can find. Here are some suggestions to were, the player’s character is an ine. On one hand, he seems plain and keep the experiences fresh: avatar. For example, Mario is an basic; but actually, he’s far from perfect. • Write, don’t draw. Instead of desper- avatar. He has a crappy old car, is ridiculously ately trying to sketch out characters http://www.gdmag.com NOVEMBER 1997 GAME DEVELOPER ARTIST’S VIEW

as they whiz by, try jotting down someone interesting walks by, record Obviously, the head (especially the one unique detail about each inter- a little snippet. You can then peek in face) is important for character person- esting person: “fringe leather the viewfinder and sketch right there ality. For example, in the comic strip bracelet,” “dyed-black hair, crispy- or review it later. Peanuts, compare Lucy to Sally. The looking,” “stumpy militant gait,” Of course, first-person observation visual differences are all in the face “greasy icky overalls,” “thrashed isn’t the only source for character and hair; the bodies are practically novel, bent-back cover.” Later, you design. identical. can use these reminders to sketch COMMUNICATING YOUR DESIGN. So you know Facial detail is really noticeable when composite characters. what character you want to build; now it’s missing — witness the spooky lack • Pick a theme. Maybe have a “shoe you have to show other people. Once of facial detail on the Power Rangers’ day”; only look at the shoes and try you have an idea for a character design, suits. Is it just me, or are those charac- to identify what shoes reveal about a it’s helpful to get it out where people ters really bland because of the missing character. Other themes could can see it. But when you’re designing face? Another proof by negation can be include hair, accessories (books, glass- someone else’s character, you have to seen in mannequins. They’re designed es, purses), clothes, and motions know exactly what they want or to have no character, and most don’t (walking gaits or unique movements). they’re going to be disappointed. have any facial detail at all. Coinci- • If possible, save images. Obviously, At a minimum, a character design dence? I don’t think so. 16 it’s handy to have a still reference needs to cover the basics. Human or That’s all well and fine, but what if from which to work, but pointing non-human (such as an alien)? He or we’re building a character that some- cameras at random strangers is she? What size? What culture? What one else has designed? In that case, our mighty awkward (and not always style within that culture? Of course, we next task is to communicate — to learn appreciated). One quick and easy way also need lots of physical appearance what design we’re supposed to build. to do this is get a camcorder (only details. What skin color? What clothes? VERBAL SKETCH. Most people can express a $350 these days!) and rest it on the (What style of pants? Faded denim or basic character design in a “verbal table, aimed at a public space. When new? Flared leg? And so on.) sketch.” This is often the point at which ARTIST’S VIEW

we artists first encounter the character. TABLE 1. Artist/character designer interaction. For example, I asked my flaky char- acter designer, Jake, to tell me about Artist asks: Designer responds: any old character he could imagine: How old is Jim? “He’s, uh, 72.” “OK, um, there’s this old guy, Jim, see, What is Jim’s culture? “He’s a Jewish guy who came to the U.S. from and he hates dogs ‘cause his wife was Poland when he was seven.” killed by a big black Doberman back in What’s his style? “Uhhmm… he’s, uh, normal old guy… not crazy… ‘82, and um, his pants are always hell, I don’t know!” creased, and he wears this old golfing What color is his skin? “White, Polish features; his bushy hair is grey hat all the time and ummm… sus- and he’s all wrinkly.” penders. Yeah, and his shirts are What’s his build like? “Thin, but healthy, 5’6” and 120 lbs. He used to always… they’re really clean, like he’s be good in track.” super-careful about being clean. He’s How high is the waist of his pants? “Pretty high, in that old man way.” worried people will think he’s a bum How long is his hair? “About 3 inches, curly.” because he spends a lot of time at the Does he have any props? “He has a cane, but no glasses.” park, looking for people to talk to ‘cause his family all moved to Detroit five years ago, but he didn’t want to answer that we didn’t really get was the SKETCH. Next, we sketch the character leave New York.” style — not surprising since poor Jake on paper. The sketch forces us to define 18 Verbal sketches are interesting and is being put on the spot. Still, we’ve the character’s race, culture, age, style, help give a sense of the character, but revealed that his design hasn’t been size, and a lot of other details that the do we know enough to build Jim? Not fully developed yet. That’s O.K.; with verbal sketch doesn’t cover. It’s a very really; we need to know more, so we his specific breakdown of clothes in the important point of reference for team- ask some questions (Table 1). verbal sketch, we have enough to work work — it’s used as a goal for the 3D These questions help a lot. The only from here. modeling tasks. Figure 1 shows a sketch of our char- acter Jim. Now we have all kinds of detail, and the issue quickly changes Homework: Character Design Research from the vague, murky, “What does Jim look like?” to the daunting, but K, let’s say we admit that buff and they’ll point you to an endless attackable, “How do we get all the we need help with this char- stream of relevant video evenings. detail of this sketch into a low-polygon acter design stuff. Well, hit Novels: Fiction contains arguably the 3D model?” The answer: Understand O the books! Creating com- most deep character design practiced our limitations, then revise the design pelling, interesting characters is a well- today, so I’d recommend reading about to work with what we have. documented topic, so go scam some how novelists do it as well. Again, you can GATHER INFO (AND MAKE DECISIONS). We’re knowledge from experts. You can find just read some excellent books that focus now at the rubber-meets-road spot, so books about character design in any on character development (as most do) and we need to find out what the road is. major bookstore or library. pay attention to what makes the character This is usually done through an awk- Historical: Character design is one unique, or you can seek out resources ward, difficult series of communica- of the oldest and most prevalent themes in designed for authors. For example, brows- tions that I outlined in the August art. Storytelling, painting, sculpture, and ing at Borders Bookstore turns up entire 1997 Game Developer article, “The Artist theater all depend on rich characters. books devoted to crime details for authors. Synapse.” These traditional media have a lot to offer These books are shelved in “writing”; At the end of that communication an interactive entertainment character they’re written to help authors craft realis- process, we’ll know what our game designer. One good way to get a nicely tic behavior for desperate criminals. engine can and can’t do (or at least packaged summary of this information is Game designers: And, of course, we’ll know what decisions need to be by taking a class from a local school — you game designers know this stuff. Check out made). Here’s an example scenario: might find a class that is devoted to the conference notes from lectures on game Our communications efforts pay off, idea of characters throughout art history. design, articles for designers, and the and we now know that the graphics Film: For game characters, start with like. Better yet, if you know any first-rate engine is basically a QUAKE clone — it character design techniques used in com- game designers in the industry, play new- renders a first-person view of a texture- mercial film industry. Just watch some bie and ask them how to do it in person. mapped 3D environment with no “character study” movies and try to iden- Again, character design is a huge area; dynamic lighting (lights are built into tify what, exactly, makes the characters don’t be disappointed if your first design the textures), and it can do per-vertex cool and unique. Of course, you can also attempts aren’t pro quality. Don’t forget “skinned” animation for character ani- find books, articles, and lectures that are that there are lots of resources to help mation as well as normal hierarchy- aimed at developing characters for films. you, including professional game design- based animation. For example, the director Frederico Fellini ers; they often have a really good grasp We also encountered our budgets: specializes in bizarre faces; ask any film of character design. We have 500 faces and 100k of texture memory to spend on Jim. That doesn’t

GAME DEVELOPER NOVEMBER 1997 http://www.gdmag.com ARTIST’S VIEW

sketch to 3D. That’s covered in Whose Job Is This, Anyway? January’s column.

ome will argue that character publishers tend to assume that any Modeling: Basics design isn’t really the artist’s professional artist could whip out a job — that’s what game really cool character from blank screen, here to start? Let’s start with an S designers are for, they say — especially for demos, “B” games, and W overall approach. In practice, but it’s frequently assigned to artists other non-mainstream projects. we’ll usually start with an existing real- anyway. And, yes, you have to admit it’s In smaller projects, the job roles time 3D human model and edit it to just plain fun, so we fun-loving artists aren’t usually so strict, so artists do match our sketch. Depending on how naturally want to be involved in it. some design, designers can create similar our characters are (and how How do artists end up designing? In some art, and together they cover all carefully we can edit the geometry large projects, ignorant producers and the bases. without disturbing mapping), we don’t have to remap or rebuild large parts of the model. But don’t worry, I’m not sound like much texture memory, but find out that it’s really a performance going to pull that kind of shortcut here we also learned that Jim isn’t the lead tradeoff: Animating all 500 vertices — we have to start from ground zero. character, so 100k is enough texture can easily mean a frame rate penalty So we’re going to build our character 20 memory for such a secondary charac- once the math gets to be a heavy from scratch, aiming for our face-count ter. Also, we found out that we can use load. For the lead characters, it’s budget for each part: head, torso, arm, 8-bit textures, each with its own worth the performance hit, but not and leg. For texturing and mapping, palette; that means a 256×128 texture for a minor character like Jim. we’re using only Adobe Photoshop and only uses 32k of memory.Here’s some FINAL DESIGN SKETCH. Based on the infor- 3D Studio MAX, so we can’t do any 3D more important decisions that were mation we’ve just gathered, we can painting. We’ll just use standard pro- made for Jim: now sketch a more do-able version of jection mapping techniques. • Range of motion: A talk with the Jim. We’ll strip out some of the detail We’re going to use cylindrical tex- game designer tells us that Jim that isn’t very achievable — for exam- ture mapping for the head, because we doesn’t need any complex animation. ple, the frizzy hair on the sides of the really want the ears and sides of the He’s going to limp around and wave head would have been difficult repre- face to have full detail, but we’ll do pla- his arms a bit, but won’t do anything sent satisfactorily, and it’s not critical nar projection mapping for the other that requires too much detail in the to conveying Jim’s personality, so we parts. This is a trade-off, because planar hands or head. This means that we could just change the design rather projection will lose detail on parts of don’t have to design the character to than fight the limit. For other prob- the body. Still, we’ve decided that the be capable of cartwheels; this detail lems, we may choose to fight for a cer- loss of detail on the sides of the arms simplifies the joint design, but it also tain important detail, but in this case, and legs is tolerable. (Besides, painting affects texture mapping. Why textur- it’s probably not worth it. planar-projected textures is a lot faster ing? For example, if Jim were to bend FINAL APPROVAL. Next, we show our final and less error-prone than cylindrical deeply at the knee, we would have to sketch to the art director for approval. texture mapping). design textures on the knee that As usual, the director is wildly excited looked good at full bend and at nor- by its innate beauty and our rare mal straight-leg positions. Knowing genius implied, so the sketch is Let’s Divide Our Budgets! that he’s only going to bend 90 approved instantly, and we get our degrees (for sitting), we will create usual huge bonus, utter worship, and h boy! Now we get to divide up textures that look good from those tearful hugs aplenty. O our allotted budgets: 500 faces angles. O.K., perhaps that’s a tad unrealistic. and 100k of texture memory. Let’s start • Speech: The difficult decision about More likely, the art director expresses with face count. facial animation was made early on some appreciation, but also wants In general, the head and torso are — we’re using cartoon bubbles for some changes. After these revisions, more able to “flex” their face counts, dialog, so we won’t animate speech. eventually, you’ll get a stamp of and since people are generally looking This will save lots of hard work doing approval. at the upper body and head most, we’ll lip-synch (obviously at the expense of Once the approval festivities are use a disproportionately large number realism). over, our final step is organization. We of faces in this area. By contrast, the • Skinned joints: Even though we gather the sketch and the face and tex- arms and legs will be modeled as sim- could do “skinned” vertex animation, ture budgets into one spot — a folder ply as possible, while still implying we’ll be using intersecting joints. in the appropriate directory, or a single plenty of detail. Another obvious rea- “This character is a minor role, and sheet of paper — so we can quickly and son we want to keep arms and legs sim- its movement is relatively small, so easily find them. This folder is the sym- ple is that there are two of each of intersecting joints probably won’t bolic end of the design phase — we’ve these. Any face we add to the design of look too bad,” our art director reas- completed Step One. From here, we get one arm means double faces in the sures us. After some questioning, we into production and take this pencil final model. Let’s divide the body into

GAME DEVELOPER NOVEMBER 1997 http://www.gdmag.com ARTIST’S VIEW

a few parts and assign face counts: TABLE 2. Budget numbers for Jim, the character from Poland. • Head - 148 (includes neck stump) • Torso - 102 (chest, pelvis, stumps for Number Size RAM Where used joints) 1 256x128 32k Head (cylinder map) • Arm - 66 (includes hand, elbow joint, 2 64x128 16k Arm (front and back) shoulder stump) 2 64x128 16k Leg (front and back) • Leg - 68 (includes foot, knee joint, 2 128x128 32k Torso (front and back) hip stump) So we’re using 250 faces for the head tures for the front and back of the In January’s column, our task is and torso, plus two arms (132) and two arm, and another pair for the leg, and clear: Build a textured 3D model from legs (136) equals 518 faces. That’s close a pair of 128×128 textures for the our sketch and within our budgets. enough to our budget for a first pass. front and back of the torso. Table 2 Here’s vaguely how we’ll do it: What kind of arm can we model shows the numbers. We’re using • We’ll create the textures and geome- with 66 faces? Nothing fancy — it’ll seven textures that add to 96k of try for each part. have a closed-fist or mitten-style hand, memory. • We’ll assemble the parts into a hierar- and no real wrist joint modeled. Same chy, adjust joints, test a few anima- for the other geometry — basic model- tions, and test in the 3D environment. ing will have to do. The End.... Not. • Finally, do revisions until the model For texture memory, let’s start by is approved. ■ 22 deciding what we’d like. If our charac- e’ve covered a lot of ground this Josh White runs Vector Graphics, a ter is only 100-pixels tall, we don’t W month. Out of thin air, we real-time 3D art production company. He really need very large textures. With extracted a do-able real-time 3D charac- wrote Designing 3D Graphics (Wiley 100k, we can have an ample 256×128 ter design. We defined our basic Computer Publishing, 1996), he has spo- cylindrical map texture for the face, approach — decided on our mapping ken at the CGDC and cofounded the leaving 64k for the body. Let’s assume methods, broke the model down on a CGA, an open association of computer left and right arms and legs are identi- per-part basis, picked important areas, game artists. You can reach him at cal, so we’ll use a pair of 64×128 tex- and divided up our budgets accordingly. [email protected]. FORCE FEEDBACK

24

CopCop aa FeelFeel....ih GAME DEVELOPER NOVEMBER 1997 http://www.gdmag.com 25

hap.tic (adj.)(1890) { to touch} 1: relating to or based on the sense of touch 2: characterized by a predilection for the sense of touch 3: to be out of haptic with reality Article by Chuck Walters Hapic Peipheal!!!

http://www.gdmag.com NOVEMBER 1997 GAME DEVELOPER FORCE FEEDBACK

even peripheral manufacturers are prototyping and/or

shipping more than nine force-feedback game devices

for home use, at or under $200. Three companies are sup-

plying the force-feedback technology: CyberNet,

Immersion, and Microsoft. With force feedback

ramping up and three implementations available,

26

Direct X has stepped in to standardize Some of the companies listed in Table thousand dollars, compared to a few the SAPIS used to control these devices. 1 also distribute force-feedback devices hundred for the home versions. A hefty This article will give you a general for game consoles and arcade machines. portion of the cost difference is spent overview of the tools and techniques Companies such as Happ Controls (the reducing the compliance (play) used to implement force feedback in largest manufacturer of arcade force-feed- between the actuators (motors) and the your games. It will focus on generic back devices) use technologies similar to stick. The following sections discuss design issues and DirectX 5 implemen- those being discussed, but they won’t be the interface between the actuators and tation. Before diving into the nitty-grit- the focus of this article. For a more com- the stick. ty code work, however, we will review plete view of the market, take some time COMPONENTS. The play and durability of a the hardware. to browse the research sites listed at the force-feedback device depends, in part, Two force-feedback joysticks and end of this article. The Intel site has the on the material and tolerance of the three force-feedback wheels are expect- specifications for the Open Arcade machining. Cheaper materials, such as ed to be in retail outlets by Christmas Architecture Coin-op Reference Platform plastic, are pliable, do not hold up to 1997. At least six more force-feedback also known as the Arcade PC standard high-tolerance machining, and wear devices are planned for next year. (which includes force feedback). faster. Here, the material limits the per- CyberNet, Immersion, and Exos formance. More expensive alternatives, (acquired by Microsoft) have been offer- such as composites, aluminum, and ing products for high-end simulations Mechanics alloys, can hold higher-tolerance and research for years, but CH Products machining. Still, just because quality was the first consumer product to make ot all force feedback devices are material is present doesn’t mean that it it to the retail market. The companies N created equal. The more expen- has undergone the costly high-toler- in Table 1 have at least a working pro- sive devices are able to produce high- ance machining. Quality material has totype slated for home PC use. frequency sensations at a cost of a few the added benefit of holding up better

TABLE 1. Availability of force feedback devices.

MFG FFB Engine Product Name Interface SRP ETA Act Labs Immersion Racing System GP $99 9/97 CH Products Immersion Force FX SP & GP $150 Retail Racing Wheel FX SP & GP $150 11/97 Interactive I/O Immersion Virtual Vehicle Tdi SP or USB $995 Direct Logitech Inc. Immersion WingMan Force SP or USB ? ?/98 SC&T International Immersion Ultimate PER4MER SP & GP $170 11/97 Thrust Master Immersion MotorSports GT ? $200 11/97 Cybernet Cybernet Real Feel Wheel SP & GP $200 Direct Real Feel Yolk SP & GP $200 Direct Microsoft Microsoft SideWinder FFB Pro GP $150 9/97 Interface Legend: SP = Serial Port GP = Game Port USB = Universal Serial Bus

GAME DEVELOPER NOVEMBER 1997 http://www.gdmag.com 27

to general wear and tear. Let’s open a quite noisy). The counter rotational turers’ immediate goals — what they force-feedback input device and exam- requirements of force-feedback trans- have works well. When the competi- ine the inner workings. missions are demanding, so either the tion heats up, however, circuitry will GIMBAL. The gimbal connects the stick to cable/belt will need to be extremely be upgraded in the following areas. the transmission. Force-feedback joy- strong or devices will need easily acces- PROCESSOR. Most force-feedback devices sticks generally have more play than sible adjustment screws for keeping the have a microcontroller to control the steering wheels because of their dual- cable/belt tight. motors and handle effect computa- axis motion. The biggest contributor to ACTUATORS. Force-feedback joysticks use tions. Motor control is cut and dry, gimbal play are the slots of a slotted two motors, which are similar to those whereas effect-handling can be bale. Double-slotted bales (Figure 1) are found in fax machines and printers. improved in many ways. Future proces- the loosest. Immersion has patented a They exert about 1 lb. of sustainable sors will handle new types of effects slotless gimbal, shown in Figure 2. Keep force per motor, peaking at around 1.5 and be able to play more of them simul- an eye out for this design in retail sticks lbs. Force-feedback wheels have one taneously. There will also be improve- over the next year. Currently, it’s only motor that can sustain 3-4 lbs., peaking ments in dynamic effect transitions. available in research-quality devices. at around 5 lbs. Cheaper motors nor- MEMORY. The amount of RAM deter- TRANSMISSION. Actuators are connected mally exhibit higher friction, so they mines the number of effects that can to the gimbal by the transmission. dampen out subtle forces, causing poor reside on the device. Different effects Geared transmissions must have play or unperceivable response. require varying amounts of RAM, so or the gears will bind. Tight gears tying the number of one to the other require precise machining. Therefore, isn’t well-defined. To illustrate this cost becomes reliant on the material Circuitry point, current devices have on-board and machining commodities. A memory ranging from a few hundred cable/belt drive is a higher-quality evice manufacturers are scram- bytes to a few thousand bytes. A single method of transmission. Since there D bling to produce high-quality feel effect takes anywhere from several are no gears that can bind, this method at a low cost. Currently, circuitry bytes to several hundred bytes. has the potential for a very tight force improvements are on the back burner Therefore, there is RAM for potentially response and much less noise (gears are because they don’t satisfy the manufac- hundreds of effects, but many devices http://www.gdmag.com NOVEMBER 1997 GAME DEVELOPER FORCE FEEDBACK

partition this space to simplify the Universal Serial Bus (USB) available on device is faster with DirectX 5 (if the microcode, thus artificially reducing the next-generation PC motherboards device is powered), because the device the total count. There are at least two and supported in Windows 98. (USB is must exist in the game controller’s benefits of increasing the on-board similar to SCSI in that devices can be property sheet. Proprietary APIs that RAM: chained off of one port. USB is also don’t use this information will search • More RAM allows more effects to be faster than the serial port.) The change for a force-feedback device on each stored locally, reducing playback to USB should reduce feedback latency port and wait for either a confirmation latency. and the problem with port availability. or a timeout before moving on to the • More resident effects means that next. This can take up to five seconds, effects can be played simultaneously which makes automatic detection of a (added together), creating new Designing Force Effects force-feedback device at game start-up effects. less appealing. SENSORS. These are the stick position he force-feedback element of a Once the force-feedback device is ini- tracking mechanisms. Many devices T game requires aspects of physics tialized, the user should be able to cus- use potentiometers to track the stick or and collision detection that should tomize the force settings for the device. wheel’s position, which is the main already be implemented and used by At a minimum, users should be able to reason devices need calibration. the audio engine. When you get down set the gain, since force-feedback Potentiometers are variable resistors to the code level, force response is devices tend to vary in the amount of that lose resistance as they age, which very similar to 3D audio. In my expe- foot-pounds they can exert. (There is a 28 causes a positional drift in the joystick. rience, piggybacking the audio code proposal to have this gain setting Microsoft’s Sidewinder uses an innova- helps determine what effects to add, incorporated into the device’s property tive digital optical tracking system that where to add them, and saves both sheet in Windows, but you’ll need to is self-calibrating. Digital optical track- CPU and developers’ time by reusing implement this yourself in your game, ing is also faster at position acquisition computations. Exceptions to this are at least until DirectX 6.) Various types then potentiometers, which means less effects such as “wheel stiffness,” that of devices exert different amounts of time is spent polling the joystick, do not have an associated sound force (for example, wheels typically thereby freeing CPU cycles for other effect, but remain active throughout exert more force than sticks), but even game needs. In addition, fast acquisi- the simulation. the forces applied by different brands tion time is important for condition While Microsoft’s DirectX 5 docu- of joysticks can vary. Gain adjustment effects (explained later), which are mentation doesn’t go into the artistic may seem like a simple task at first, and dependant upon positional data. part of force feedback, the three force- it can be depending on how far you Effects such as those that simulate iner- feedback engine manufacturers have a take this setting. Gain can easily be tia will perform more smoothly and lot to say in their development docu- applied to Springs and Jolts for exam- feel more realistic with a faster digital mentation. I won’t cover the design ple, but Vibrations and custom forces optical tracking type of system. elements in the same manner, so I rec- are commonly very temperamental, INTERFACE. Most of the initial force-feed- ommend examining the commercial and adjusting their gain can ruin the back devices attach to either the serial web sites listed at the end of this article desired effect. So, if some effects can be port or the game port, and some and the books in the “Books On Force- ruined by differences in gain, and devices require both (Table 1). Next Feedback Technology” sidebar. force-feedback devices have different year’s devices will likely migrate to the The initialization of a force-feedback force ratings, there’s a problem.

FIGURE 1. Double-slotted bale. FIGURE 2. Five-bar linkage.

GAME DEVELOPER NOVEMBER 1997 http://www.gdmag.com Reflection

Incidence

Response

FIGURE 3. The forces involved in a FIGURE 4. Microsoft’s Visual Force FIGURE 5. Immersion’s I-FORCE car crash. Factory Studio

Basically, each force-feedback device reference in your game is risky. A frame effort on the gamers part. requires some special tuning considera- of reference (FOR) is the “who” or tion to get the desired effects just right. “what” to which the force response Carefully consider how you allow attaches. You generally only need to Types of Feedback Effects players to map (or customize) their consider two FORs, the player’s body 29 input controls. When input mappings and their machine (one inside the he terms “texture” and “effect” are are altered by the game player, the new other, but not rigidly attached). T often used interchangeably to mapping should also change the imple- Switching between FORs may confuse define the force-response data sent to mentation of force-feedback effects. If the player, making forces appear the device. In haptics, “textures” are you don’t give adequate thought to buggy. For example, forces on a car literally textures (such as sandpaper, how your input device will behave don’t have the same vectors as those wood grain, and so on), so I will refrain once the player modifies the standard on the driver, and switching between from confusing the distinction. Effects configuration, the player could be in the two hurts the realism of the game. can be two-dimensional on joysticks for an unpleasant experience. For Choosing the object that directly and are one-dimensional on instance, imagine that a player is using interacts with the simulated wheels. Many effects are a joystick in a car racing game. The environment usually pro- additive, meaning they default mappings have the y axis act as vides the best experi- can be played with a combination gas/brake pedal, increas- ence. Switching FORs other effects simulta- ing the vehicle’s speed when the stick or choosing a bad neously. Effect addi- is moved forward and braking the car FOR also complicates tion is nice to a when the stick is moved back toward development by point, but too much the player. If the player remaps the y making it difficult can take away from axis so that pushing forward on the for the engineer to the experience (and stick up-shifts the car’s gears and identify and correct wear out the user). pulling back down-shifts the car, then undesired feedback The following sections a y-axis jolt can cause a problem. A col- loops. discuss ways of thinking lision to the car from behind would Be careful of feedback about effects. cause a forward jolt effect on the stick, loops in your force effects. STATIC AND DYNAMIC EFFECTS. After and inadvertently cause the car to shift Feedback loops occur when a force is creating an effect, it can remain up a gear. attractive. A simple example of this is unchanged or undergo continuous Allowing the player to turn on or off when a car hits a barrier and the frame modification. Static effects (also known certain force effects is a nice feature of reference is attached to the driver of as “canned” effects) don’t require run- (for example, engine vibration trans- the car, but the collision detection/cor- time modification, which makes them mitted to the joystick may be annoying rection is attached to the car itself simple and well-suited for trigger in a long race). You could even go so (Figure 3). effects. A gun shot is a good example far as to let players customize certain The force response is in the general of a static effect because it always pro- effects. While this may be going over- direction of the barrier, which makes duces the same kick in the same direc- board, remember that game extensibili- the player hit the barrier again — tion. Static effects can be downloaded ty is valued by most players. If effects hence the feedback loop. A feedback and remain on the device (as long as are created with a sensation editor and loop was not appropriate for the exam- there is enough device RAM), which saved to a file loaded by the game, ple barrier collision (caused by the poor gives them very low response latency. players may be able to customize these FOR choice), but in some cases it works Static effects are also easier to design effects with the same editor, and share out great. Gravity wells, rubber-band- because testing doesn’t need to be their customized effects with other ing, and tractor beams could all benefit done on numerous variations of the players on the Internet. from a feedback loop, which, by the effect, as is the case with dynamic Switching between various frames of way, can be pulled out of with a little effects. They can also be easily created http://www.gdmag.com NOVEMBER 1997 GAME DEVELOPER FORCE FEEDBACK

with the sensation editors (which I will can be divided into interactive and microsecond notation, which a wrap- discuss later). Some devices have ROM time-based events. Time-based effects per could convert to the conceptually effects that don’t use any RAM (beyond are played regardless of where the easier frequency notation. Finally, get the space allocated for parameter modi- force-feedback device is positioned. this: direction can be expressed in fication); such effects can be used as Jolts and vibrations are time-based polar, spherical, or Cartesian coordi- either static or dynamic effects at a effects. Interactive effects are nates. Decent error handling and very reduced space cost. based on the state of the recovery can get out of control unless Most effects can be stick (position, velocity, this measurement system is simplified modified during play- and/or acceleration). by a wrapper. back, producing a Springs and friction Although I recommend using dynamic effect. A joy- are some examples of DirectInput as your force-feedback API, stick vibration that interactive effects. it’s not your only option. Here’s a short varies with engine DirectInput catego- description of proprietary APIs and RPM is an example of rizes interactive DirectInput wrapper APIs: a dynamic effect. effects as “condi- I-FORCE 1. This is Immersion’s propri- Dynamic effects are tions.” All other etary stand-alone API. I used this sim- where force-feedback effects are time-based ple, easily implemented API in THE technology really shines, and fall under the cate- NEED FOR SPEED – SPECIAL EDITION. I- as they let the player experi- gories of “periodic,” FORCE 1 only works with the 30 ence the best motion within the “ramp,” or “constant” (Table 2). Immersion engines, but it works in game world. Unfortunately, good both Windows and DOS. Future effort dynamic effects can also be time con- will likely lean on DirectInput device suming to create. One pitfall is that Force-Feedback APIs driver support, rather than improving some devices don’t work well at the I-FORCE 1. extent of their range; sometimes sim- he DirectInput API in DirectX 5 is CYBERNET 2. The latest Cybernet API sup- ply incrementing a variable can drasti- T definitely the force-feedback API of ports DirectInput and I-FORCE com- cally change a force effect. For exam- choice in the long run. All three force- patible drivers. It’s a stand-alone API ple, some force-feedback devices have feedback engine manufacturers that falls between I-FORCE 1 and too much play and/or motor friction to (Immersion, Microsoft, and Cybernet) DirectInput in terms of complexity and adequately represent the full spectrum currently or will soon support features. of frequencies for which the engine DirectInput. That is reason enough to WRAPPERS. Using a wrapper will make vibration effect may have been coded. use it, but there are other redeeming initial implementation easier because it To address this problem, you should qualities. The API is designed to be very will hide many of the gotchas. But critique individual devices to find a flexible and is easily extensible. The before you simply jump into using one general minimum and maximum problem with DirectInput is that it can of these premade wrappers, realize that across the range of force feedback hard- be a bit convoluted at first glance. they are focused around their creators’ ware. DirectInput wrappers (whether you devices and will exhibit some problems OPEN-ENDED AND ONE-SHOT EFFECTS. There make your own or use someone else’s) running on their competitors’ devices. are two ways to manage effect play- are necessary to restrict the generality Immersion and Microsoft both provide back, and both will probably show up and redundancy of the API, which is a source code of their wrappers, and it’s in any given game. One-shot effects are result of DirectInput’s basis on an excellent way to determine the dif- those with a finite duration. They are Microsoft’s Component Object Model ferences between the two companies’ simple to manage because you play the (COM). Effect management should also interpretations of the DirectInput effect and forget about it. A single jolt be addressed by a wrapper because to a joystick as a result of pulling the DirectInput doesn’t do this for you. TABLE 2. Types of force-feedback joystick trigger to shoot a gun is an DirectInput didn’t hide the RAM limi- effects. example of a one-shot effect. The effect tations of the devices by providing is executed and stops on its own. software mixing, which creates a On the other hand, open-ended download/offload dilemma that you, Group Category Type effects require the game to monitor the developer, have to address. Interactive Condition Spring state information in order to stop the Other issues that DirectInput wrap- Damper effect at the proper time. Consider, for pers can simplify are the notation and Inertia example, a car (a fast, exotic, red one) numeric ranges of the DIEFFECT structure Friction driving over a wood-plank bridge. variables. For example, the dwGain ele- Time-Based Periodic Square There is no finite duration for the car’s ment in the DIEFFECT structure has a Sine time on the bridge, so the effect will range of 0-10,000. Gain is analogous to Sawtooth Up need to be monitored by the game to a volume setting for the device, which Sawtooth Down regulate the vibration in accordance is easier to manage as a percentage (0- Constant Constant with speed, and stopped whenever the 100) of effect strength. A wrapper Raw car stops or leaves the bridge. could also simplify DirectInput’s han- Ramp Ramp INTERACTIVE AND TIME-BASED EFFECTS. Effects dling of periods. DirectInput uses

GAME DEVELOPER NOVEMBER 1997 http://www.gdmag.com FORCE FEEDBACK

force-feedback specification. It’s also a They will both support playback within given device, get a pointer to the good starting point if you want to cre- the editor on all DirectInput-compati- LPDIRECTINPUTDEVICE interface for that ate your own universal wrapper. If I ble force-feedback devices, but the first device. decide to use a prefabricated wrapper, I revisions may not work flawlessly with 5. Using the LPDIRECTINPUTDEVICE, set the expect it will be for effect file loading competing devices due to the infancy data format (the sample code uses only. of DirectInput force-feedback device the default format explained in the I-FORCE 2. This is a misleading name drivers. I recommend playing with the DirectX 5 documentation). because I-FORCE 2 is not a stand-alone editors even if you don’t plan on using 6. Again using the LPDIRECTINPUTDEVICE API upgrade to I-FORCE 1. I-FORCE 2 them extensively. This will help you (DID), call QueryInterface() to upgrade only loads effect files created by understand the parameters for various to an LPDIRECTINPUTDEVICE2 (DID2). The Immersion’s sensation editor (I-FORCE effects. DID2 inherits all the functionality of a Studio), and wraps the DirectInput FORCE-FEEDBACK EMULATOR. Immersion has DID, so you can even use DID2 for game effect create and release interfaces. The a serial-based emulator that runs in a controls without force-feedback sup- I-FORCE 2 documentation has sample DOS window on a second machine. port. The standard DID doesn’t sup- code for a more complete wrapper, but This expedites trouble shooting if you port force feedback. this code isn’t present in I-FORCE 2. don’t have a force-feedback device 7. Using the DID2, set the co-op level. It SIDEWINDER FORCE. This is Microsoft’s handy. In some instances, the emulator must be DISCL_EXCLUSIVE and either fully functional DirectInput wrapper. is better than a device because you can DISCL_FOREGROUND or DISCL_BACKGROUND. SideWinder Force has functions to watch the state of a virtual device on 8. Release the DID because you now 32 work with Microsoft’s sensation editor your monitor; however, it only works have a DID2 that takes its place. This is (Visual Force Factory) and wraps effect with I-FORCE 1 drivers. This emulator the last thing I do in my callback modification and playback. was created when prototype devices function because I have the DID2 that SideWinder Force also wraps device were scarce. However, since force-feed- is used to acquire the device and setup tasks. The source code to the back devices are now readily available, query its capabilities. SideWinder Force library is provided both Microsoft and Immersion believe 9. Repeat steps 4-8 for each device you with Microsoft’s SDK. that emulators are non-essential for want to use. DirectInput. 10. Using the DID2, acquire access to the device. This call is made initially Tools and again whenever you lose and ensation editors pro- Sample regain window focus. S vide a means to DirectInput Code 11. Using the DID2, get the device’s visually edit forces. capabilities. This will tell you if the The visual environ- he sample code device supports force feedback, as ment helps clarify T on the Game well as how many axes, buttons, the purpose of all the Developer web site is and so on, are on the device. variables in a given straight DirectInput EFFECT SETUP. Ideally, you want the effect and modify code. I refrained from effects that you create and the effects those variables on a using wrapper APIs in played back in your game to have a picture or graph. After order to remain flexi- one-to-one correspondence. Even creating an effect, it can ble. The mouse and key- though DirectInput makes no attempt be played back, allowing for board are referenced in the to hide the RAM limitations of the a fast edit/play development sample code because they were force-feedback device, and even cycle. Once the effect(s) are finalized, closely tied to the device setup in my though some devices can only have they can be saved to a file for the game test suite. I removed most of this code one type of resident effect, it’s still pos- to load at run time. A force-feedback to minimize the distraction from the sible to get accurate effect playback. emulator, on the other hand, creates a joystick and force-feedback code rele- You just need to prioritize the playback virtual device that visually represents vant to this discussion. of effects of the same type. force-feedback effects on a monitor. DEVICE SETUP. The following is an The basic steps of effect creation are: SENSATION EDITORS. Currently, two sensa- ordered list of essentials to get up and 1. Determine if the effect is supported tion editors are available: Microsoft’s running: by the device. Visual Force Factory (Figure 4) and 1. Retrieve a pointer to the DirectInput 2. Create the effect using the DID2 of the Immersion’s I-FORCE Studio (Figure 5). interface (LPDIRECTINPUT). device for which you want the effect Both of these editors output 2. Using the LPDIRECTINPUT, enumerate created (the same effect must be cre- DirectInput-compatible files that can the joysticks. ated on each device separately) and be statically linked to the game or 3. Your enumeration callback function passing in a filled in DIEFFECT struc- loaded at run time. The benefit of load- can either save the LPDIDEVICEINSTANCE ture. ing the effects at run time is that con- passed to it for each joystick for later 3. Unload the effect to make room for sumers can modify the effect in the device creation, or create the device the next effect. sensation editor themselves. Both edi- within the callback function (as the Effects are automatically down- tors are capable of single and com- sample code does). loaded to the device when created. If pound (concatenated) effect creation. 4. Using the LPDIDEVICEINSTANCE for a the device is full, however, the

GAME DEVELOPER NOVEMBER 1997 http://www.gdmag.com CreateEffect() interface will produce an both trigger and non-trigger effects, Another method is to modify an effect error. To prevent this error from occur- but in order to unlink the effect from and then play or update the effect in ring, you can set a flag to prevent the the trigger, the effect must be modified the same call to SetParameters(), which automatic download of effects during (requiring download) to detach it from reduces the amount of communication the effect creation stage, and then turn the trigger. required with the device, since the play it back on so that the effects automati- PROCESS LISTS. A process list allows you command piggybacks on the modify cally download when you play them. to concatenate effects so that one plays command. PLAYBACK. To play a trigger effect, you after the previous is completed. Process MIXING EFFECTS. An effect must be on the must download the effect (make sure lists are being proposed for inclusion in device in order to play it. Yet most the trigger button variable is set appro- DirectX 6. This feature is currently force-feedback devices limit the num- priately in the DIEFFECT structure). available through use of the DICUSTOM- ber of effects that reside in the device’s Unloading the effect will stop the FORCE effect, which can be created man- RAM at any given time, and software effect. When the effect is unloaded, ually (with a fair amount of effort) or mixing isn’t supported in DirectInput. pressing the trigger no longer plays the with the sensation editors. There is no The result is that you may be limited to effect. Unfortunately, Immersion and standard way to concatenate effects, playing only two DICONSTANTFORCE effects Microsoft have interpreted the DirectX however, so these emulated process at once. Until effect management is 5 specification for this process slightly lists don’t port well between the differ- improved, you’ll probably experience differently, and as of this writing they ent force-feedback engines. some difficulties with mixing configu- haven’t arrived at a common solution. MODIFYING EFFECTS. Many effects can be rations on low-RAM devices. In Immersion’s implementation, modified during playback, depending GAIN ADJUSTMENT. The gain can be adjust- 33 starting a trigger effect won’t play it on which device you are targeting. ed in one of three ways. Most effects immediately. Rather, it will acti- While tuning dynamic effects, have a magnitude parameter for each vate the effect to be played be aware of their impact axis — some go as far as one parameter when you press the on latency and proces- for each direction of each axis. The sec- assigned trigger. The sor load — you’ll run ond method is to set the gain on the benefit of this approach into trouble if you’re entire effect, which will be applied to is that multiple effects not making a con- all sub-elements, including envelops. can be mapped to a scious effort to The third method works on a device trigger and remain res- avoid both. There level. All effects are attenuated by the ident on the device. are several ways to setting passed to SetProperty() (not to be This means switching modify effects. You confused with SetParameters(), which trigger effects is a low- could release the old works at an effect level). latency process. effect, create a new In Microsoft’s implemen- one, and play it — prob- tation, the trigger effect is ably the worst method. The Shake It Up ready to use once it is downloaded. best way is to modify an existing If you start the effect, it will play back effect with the SetParameters() interface. orce-feedback devices are now immediately, even if it’s mapped to a With this function, you can specify F readily available to consumers trigger and the trigger hasn’t been changes in single parameters, and only looking for good force response in their pressed. The benefit to this implemen- those parameters will be games. DirectInput force feedback is a tation is that the effect can be used for downloaded,thereby reducing latency. little detailed, but programming with it will increase the chances that all devices will work with your game. Remember that DirectInput force feed- Books on Force-Feedback Technology back is a “version 1” API, as are the accompanying device drivers. Effect here are two books on force- A Force Feedback management/emulation is bound to feedback technology and pro- Programming Primer, improve in the next revision. Inserting gramming that you should (Immersion Corp., 1997) force feedback into the game near the T investigate if you want further is targeted more specifi- accompanying sound effects will make information on the subject. The first cally at the game devel- implementation easier. Competition book, Grigore Burdea's oper. Rosenberg is the between the contenders in the force- Force and Touch president of Immersion feedback market is bound to bring out Feedback for Virtual Corp., and his book improved force-feedback technologies Reality (John Wiley & focuses on the I-FORCE 2 and DirectX 5 in the coming years. If all this stops Sons, 1996) is a good methods of implementing force effects. The being fun, take a vacation. ■ book about the design 177-page book is free and is available an Chuck Walters is a software engineer at and theory of force-feed- Adobe Acrobat file from the Immersion web Electronic Arts in Seattle, Wash., and back hardware. site (http://www.force-feedback.com/ received his BSCS degree from the The second book, Louis Rosenberg's pages/ book_request.html). University of Washington, Seattle. He can be reached at [email protected]. http://www.gdmag.com NOVEMBER 1997 GAME DEVELOPER PROGRAMMING TUTORIAL

or the past few years, game program-

mers have been steadily adding

terms to their 3D vocabulary — terms

such as binary space partition, rasteriza-

tion, perspective-correct textures, MIP-

mapping, and so on. One of these terms 34 FFhas become a catch-all describing a gener- al means to an end rather than the

specific structure that it was originally conceived to describe. That word is “voxel,” and the context is voxel engines. Real-Time Voxel engines have come to mean anything that renders ter- rain-like imagery; whether or not the engine is based on real voxels is immaterial as long as it looks good. Figure 1 is a screen shot of the voxel engine created in this Voel Teai article compared to a screen shot from the quintessential voxel-based game COMANCHE 3 from NovaLogic. I don’t know exactly what technique they’re using, but as long as ours looks the same, why ask why? Anyway, in this article, Geeaio we’re going to hold fast with the tradition of using the term voxel loosely to describe a technique used to render data that has volumetric information in it rather than polygonal data. However, before we take off into mathematical hell, let’s take a look at real voxel graphics and their data repre- sentations.

Real Voxels

oxel graphics originated in medical imaging. Voxel V means “volumetric pixel” and is essentially a cube in 3D space. Each cube has a volume dependent on the length of one of its sides. However, most representations use voxels that are 1 × 1 × 1, so each voxel has a volume of 1 × 1 × 1 = 1.0 voxels. At this point, you may be wonder- ing, “How do I represent voxel data in a com- puter?” There is no correct answer, but most of the time, voxels are represented by either a 3D array or a more abstract data structure such as a tree. Figure 2 illustrates a voxel geo- metrically, along with the two most common representations. Voxel data is usually obtained from medical imaging systems such as MRI and CT scanners. Voxel rendering can be accomplished in a FIGURE 1. The author’s voxel engine is on the left; COMANCHE 3 is on the right. number of ways, such as ray tracing or even

GAME DEVELOPER NOVEMBER 1997 http://www.gdmag.com with polygon graphics. In the case of ray tracing, imagine almost photorealistic quality. One such algorithm is the that each voxel is a tiny little cube, and a ray tracer traces “Marching Cubes” technique, which is based on rendering out the voxel data by computing ray intersections from the slices of voxel data. Fortunately, we’re not going to learn the viewpoint through the view plane into the voxel data. Of marching cubes algorithm, because we don’t need to render course, this approach would be extremely slow because there full voxel data. Rather, we’re concerned with data that is are zillions of voxels in even the simplest voxel data set. For partially volumetric, such as height data.

SOME OF THE MOST REALISTIC TERRAINS IN TODAY’S GAMES USE VOXEL TECHNOLOGY. THIS TUTORIAL EXPLAINS VOXELS IN THE CONTEXT OF BUILDING A RUDIMENTARY FLIGHT SIMULATOR by André LaMothe example, say that you’re scanning your head and you have a 35 scan resolution of 100 dots per inch; that means that there Unreal Voxels are 100 × 100 × 100 voxels in each cubic inch or 1,000,000 voxels! Now image that your head is about 6 × 6 × 10 (I don’t ince we’re interested in simply drawing 3D terrain (in have a ruler) inches for a total of 360 cubic inches — 360 * S real time of course), we don’t need full 3D voxel data. A 1,000,000 = 360,000,000 voxels! At eight bits per voxel, mountain range is basically a 2D grid with a height (and you’ve got 360 megabytes. Call it half a gigabyte for people color) at each position, or in another words, a height map with large foreheads, and you’ve got a real problem. There (Figure 3). The trick is to figure out a way to render height must be a better way to store and display voxel data. And, of map data in such a way that it looks 3D and has some course, there is. resemblance to the data set being rendered. Because we Voxel data can be compressed, take advantage of spatial don’t want to write a polygon engine that renders little partitioning techniques, and so on. However, the real prob- cubes, or more precisely, vertical parallelepipeds, we’re stuck lem isn’t in the storage, but in the rendering. Processing with using some form of ray tracing to create our display. hundreds of megabytes of data per frame would be a bit This isn’t as bad as it seems. Just as ray casting (the tech- slow, to say the least. Therefore, algorithms have been nique used for WOLFENSTEIN and RISE OF THE TRIAD) works for devised that take advantage of the cubic and regular struc- worlds made of rectangular solids, we can use ray casting to ture of a voxel data set to render the data quickly and in render worlds that are composed of rectangular solids that

FIGURE 2. Three representations of a voxel.

Geometric representation Abstract matrix representation Abstract graph or tree representation

+y Single voxel

(x,y,z) dz= 1.0 r

dy = 1.0 n +x dx = 1.0 m +z Voxel with volume 1.0 Voxel _Data [m] [n] [r] Voxel _Data_node at position (x,y,z) { Data *Links } http://www.gdmag.com NOVEMBER 1997 GAME DEVELOPER PROGRAMMING TUTORIAL

FIGURE 3. Height map data. nique; the minimum altitude of all heights is the same (that is, sea level), and m x n Height Field Data 3D Representation of Data set each column must have the same color along its vertical extent. Of course, we n could add another 2D array that contains 2522197653 the starting altitude, allowing us to ren- 9 12 8 100 56 64 31 26 der caves, but we’ll keep it simple this time around. The real bummer is that each voxel column in the height map m must be the same color. However, if you think about it, this doesn’t matter, because when you’re looking at a moun- tain range, you only see the top of each

3 9 47 54 36 22 15 9 Each cell contains height vertical column. The color of the material data for voxel column. at various depths is irrelevant unless you have x-ray vision and can see through the mountain material. So the bottom line is just happen to be about a pixel or two in thickness. All we that all we need is one 2D map to represent the height data, need to do is change the scale of our thinking and use the and maybe another 2D map, similar to a texture map, that 36 same idea. In addition, because we’re going to use height represents the color for each voxel column. So if the world is map data, we don’t need a ton of 3D voxels to describe our 1,000 × 1,000, then we need a total of 1MB × 2 or 2MB of stor- data set. We simply need a 2D array that contains a height age, assuming a byte for each height and color. That’s a pretty in each cell. Therefore, we’ve already killed at least one full good savings from our original 500 Mb of full 3D voxel data! dimension of storage — and that is a good thing. There is once catch to our representation/compression tech-

FIGURE 4. The 3D viewing system.

Top view x-z

+z

View plane Clipping planes

Viewing 3D view α = Field of view Frustum

-x +x View point Yon clipping Hither clipping plane θ,φ β plane View direction ( , )

+y +z

View plane +x Viewing distance

View point (xc,yc,zc)

GAME DEVELOPER NOVEMBER 1997 http://www.gdmag.com FIGURE 5. Ray tracing voxel data.

Voxel Data Top view x-z (each cell represents height) +x

View plane View point (screen) (xc,yc,zc )

View distance

+z

Side view y-z 37 Each screen row +y View plane (screen)

View distance View point (xc,yc,zc)

+z One "slice" of the data

A Ray Casting Terrain Algorithm of magnitude if they are to look at all real. For example, DOOM and QUAKE use a 90-degree FOV. A game with a 60- efore we write the terrain generator, we’re going to degree FOV would show less, and a 180-degree FOV would be B look at how to do it the slow way and then we’ll make like looking out of a wide-angle lens — that is, lots of distor- a number of optimizations to make it about 100 to 1,000 tion. times faster. The key here is to understand the geometry and Imagine that the camera is flying above the terrain at what is happening in the terrain generator. Don’t worry, some height, and we want to see what the resulting image we’re not going to plunge into gradients and vector calculus. would be on the computer screen. This can be accomplished We’ll use nothing more than basic geometry with a little bit by brute force ray tracing. For every pixel on the screen, of trigonometry. we’ll construct a ray that originates from the camera, pierces Let’s begin with some terminology — refer to Figure 4 as the screen (at the pixel), and continues on until it hits the we go. The position that we’re going to view the scene from terrain. Figure 5 illustrates this using multiple views. Listing is called the “view point,” or “camera.” It has a position 1 shows the pseudo-code. (xc,yc,zc) and orientation (θ, φ, β). The position is in “world That’s all there is to it. Because of the algorithm’s design coordinates,” and the orientation coordinates are angles and its close analogy to the physics of photons and real analogous to the pitch, yaw, and roll of the camera. The direction that the camera is pointing is called the “view LISTING 1. Pseudo-code for brute force ray tracing. direction.” The object we’re looking at is called the “view plane,” which is a surface representing the window onto For (each pixel on the screen) which we’re mapping the 2D information to generate the { illusion of 3D. The view plane is usually the screen, but 1. Compute ray originating from camera thru pixel. doesn’t necessarily have to be. Also, the perpendicular dis- 2. Project the ray. tance from the view plane to the camera is called the “view 3. If (Projected ray intersects terrain) distance.” Finally, the camera has a “viewing volume,” or { “frustum.” This is the area that is visible to the camera. For Color screen pixel color of intersected terrain data. example, most people have about a 140-degree horizontal } // end if field of view (FOV) and a 90- to 120-degree vertical FOV. So we should make our computer models within the same order } // end loop http://www.gdmag.com NOVEMBER 1997 GAME DEVELOPER PROGRAMMING TUTORIAL

FIGURE 6. Screen projections.

Perspective projection Orthographic projection

x x' = D * x' = x z y y' = D * y' = y z 38 z coordinates are used to complete (x',y'). z coordinates are thrown away. Projection is totally parallel.

light, the scene will be rendered almost perfectly (of course, look at Figure 7a. Here we see a line segment at some posi- there won’t be shadows or reflections). The only problem is tion on the left side of the view plane. To generate the per- that Steps 1, 2, and 3 take a lot of computer cycles. For spective projection of the line on the view plane, all we need example, if you want to render a screen image that is 320 × to do is draw rays from the view point through the view 200, you’ll have 64,000 pixels. Hence, we must compute plane to each end of the line segment. The point where each 64,000 rays or parametric lines, project these until they of these lines intersects the view plane is the perspective-cor- intersect with the terrain data, compute the points of inter- rect line that we would see if we were viewing the scene at section, and then plot the pixels on the screen in the correct the given viewing distance through a window. color. That’s a lot of computing. We need a way of doing the Figure 7b shows the derivation of the perspective trans- same thing with less math and fewer computations. This can form. The figure shown is a side view of the z-y plane, so be accomplished by taking advantage of the regularity of the there isn’t any x information; a similar derivation can be data and the behavior of perspective transforms. done for the z-x plane. Anyway, the view point lies on the z

axis at a distance Vd from the view plane, and the point P = (Px,Py,Pz) is at some distance Pz and at some height Py from Optimizing the Algorithm the view point. Finally, P’ = (Px’,Py’,Pz’) is the point of inter- section on the view plane. Using similar triangles, we extract e’re now going to derive an algorithm and associated the relationship W optimizations so that voxel terrain data can be ren- Py Pz = dered at faster rates. However, the algorithm is so simple, ′ Py Vd you really need pay attention to all the subtle details. Let’s begin by taking a look at the derivation of the perspective or, transform and what it does for us. Py When drawing 3D computer graphics on a 2D computer Py′ =∗ V d Pz screen, we only have two dimensions. Therefore, to convey . the data that is lost in the translation of 3D to 2D, various Thus, it looks like the perspective transform of a point

projection techniques have been created. One such tech- (x,y,z) at a viewing distance of Vd is nique, perspective projection, is based on the premise that as =∗ an object moves away from the view plane and camera, it x_perspective() Vd Px Pz should get smaller. Similarly, as the same object gets closer =∗ y_perspective() Vd Py Pz to the view plane and camera, it should get larger. Therefore, . we can deduce the projection from the z coordinate of each This tells us a couple things: First, the height or size of a vertex making up a 3D object. line decreases as it gets farther away from the view plane. Figure 6 represents a perspective transformation as well as We therefore know that the scale of an object is also propor- a nonperspective, or orthographic, projection. As you can tional to the z distance that it is from the view plane. We’re see, the perspective projection looks a lot better — it looks going to base our entire algorithm on this important fact. 3D. The key to generating a perspective projection is using Now it’s time to get down to the details. We have all the the z component of each vertex to scale the position of each tools that we need to really analyze the situation and come (x,y) to arrive at a new (x,y). It might be easier to understand up with a better algorithm than the brute force method of this relationship by looking at how real light works. Take a computing a ray for each pixel on the screen. What we’re

GAME DEVELOPER NOVEMBER 1997 http://www.gdmag.com going to do is trace out, or contour FIGURE 7. The derivation of the perspective transform. map, each vertical scanline of the screen by first casting out a single ray for each column on the screen. Based +y 3D vertex on the first voxel column that the ray a. hits, we’ll then follow the contour of P = (x,y,z) the terrain from that point on without any further rays being cast out in that particular column (Figure 8). P' = (x',y') projected point in But before you do that, let me offer screen coordinates you a warning. The following figures are a bit cavalier in their labeling of the axes. This is due to the fact that we’re +z View plane (screen) View point trying to mix world coordinates, polar (xc,yc,zc) coordinates, and screen coordinates. The bottom line is that when we finally get to writing the engine, the x-y axis will be the ground plane, and the z axis View plane (screen) will vertical. However, for a number of the figures, I used z to go into the b . (Px,Py,Pz) 39 screen and y for vertical just to make P things easier to understand. +y It’s possible to find the first intersec- Py' tion of a ray cast from the view point Py through the bottom of the view plane into the terrain, and then follow the +x rest of the terrain’s contour and render it based on the math and consistency +z (z-Vd) (Vd) (0,0,0) of the perspective transform. How? Use similar triangles View distance Well, we need to make a few observa- Place view point at origin (0,0,0) to simplify tions before we can construct the algo- Py' V = d rithm. Figure 9 shows the view point Py Pz Px Px' = V * with a number of rays being cast • d Pz Vd Vd through each pixel in the same screen Py' = Py * , similarly Px' = Px * , • • Py Pz Pz Py' = V * column. This figure contains a lot of d Pz information, so let’s review it slowly.

FIGURE 8. Contour ray casting.

View plane (screen) Single column

Row 0

Row 1 • Side view • Dashed rays represent • rays synthesized by algorithm. •

V d View point (xc,yc,zc)

Height/ altitude

Seed ray +y Row 239 (Mode X) +z Voxel Data

http://www.gdmag.com NOVEMBER 1997 GAME DEVELOPER PROGRAMMING TUTORIAL

The first thing I want to bring to your attention is the slope ya=∗ 1 ds ∗() V + z of the lines. The first line has a slope m . Remember that 1da 1 =∗ ∗ + ya2da 2 ds() V z = Rise Slope ya=∗ 3 ds ∗() V + z Run 3da . M And remember, slopes don’t always have to be in terms of dy=∗ ds() vd + z=∗ ds constant x and y — they can be in terms of anything. A slope is the aa a, rate of change of one variable in relation to another. In our and case, we’re interested in the rate of change of z with respect =∗ ∗ + yb1 1 ds() Vdb z to x or dz/dx. In Figure 9, the first line with slope m1 has dz yb=∗ 2 ds ∗() V + z = 1 and dx = Vd. Therefore, the slope must be 2 db =∗ ∗() + dz 1 yb3 3 ds Vdb z m == 1 V V M dd. dy=∗ ds() V + z=∗ ds constant That’s interesting. The slope of a line that originates at a bdb b.

distance Vd from the view plane and pierces the first pixel So the points of intersection of a ray along any vertical below (or above) has a slope of 1/Vd (the reciprocal). If line at a given distance from the view point are also at con- you’re with me, then hold onto your hat, because here’s the stant intervals. Moreover, this constant increases at a rate of

clincher; in addition to m1 having slope 1/dz, m2 has a slope (ds*z), where z is just the distance between the line and the 40 of 2/Vd. Hence, view point along the z axis. That’s all there is to the algorithm. We can now create an m1V= 1d incremental ray caster that casts a single ray for each column m2V= 2d of the screen and then generates a vertical column of pixels = m3V3d that represent what the display would have looked like if we M . had cast a ray for each pixel in the column. Let me repeat,

Or, in terms of m1, the algorithm we’re going to come up with only casts a sin- gle ray from the view point through the bottom of the view m1m=∗ 11 plane (the screen) for each column. The ray’s intersection is m2m=∗ 21 then computed, and from that point on, the rest of the con- =∗ m3m31 tour for that column is generated incrementally using the M . math that we’ve derived. What this means is that the change in slope per vertical That sounds great, but how? Our plan of attack is as fol-

screen pixel, or per dy, is constant and equal to 1/Vd, which lows: First, we’ll need to generate a ray that has a dx,dy, and we’ll call ds. Referring again to Figure 9, we see that the lines dz for each column of the screen. We’ve talked about the dz

with slope m1,m2,…m5 each intersect lines parallel to the part, but what about dx and dy? The dx and dy components view plane at constant intervals. In other words, are computed by finding the endpoints of a unit vector that lies in the ground plane and is perpen- dicular. For each column of the screen, FIGURE 9. The geometry of height mapping. we want to cast a ray. So for a screen that is 320 pixels wide, such as Mode X, we +y need to cast 320 rays, each at a slightly Row 0 different angle. To do this, we first need to decide on our horizontal FOV. Row 1 Assuming that we want a 60-degree FOV and that our screen is 320-pixels wide, ∆ ds m1 m = ds ∆ A 1 B m2 we’ll need to break 360 degrees up into y1a m2 = 2 * ds ds m smaller subangles so that from any view- y b ∆ 3 m = 3 * ds 1 A 3 ing direction (that is, heading), we can ∆ y2a ds m4 B . cast out 320 rays: 160 to the left and 160 ∆ . . y b A ds to the right. So we create virtual degrees, 2 y3a . . ∆ ∆ . based on the FOV and the screen width. B A y4a The formula is y b 3 V ∆ d Number of Virtual Degrees = B ∗ 360 y4b Screen Width z Field of View . z a b Row 239 In our case, this is equal to +z Voxel Line "B" Voxel Line "A" 320*(360/60) = 1,920 virtual degrees. These represent voxel columns of data. With that computation out of the way, let’s generate the dx,dy part of the ray

GAME DEVELOPER NOVEMBER 1997 http://www.gdmag.com FIGURE 10. Computing dz. +z Row 0 View point θ Downward pitch

Row i ∴ dz = ds * i = downward slope of ray along trajectory of current column (dx,dv)

41

Row 239 (x,y) View plane (screen) trajectory. From basic trigonometry, we know that any point same and is called ds in our derivation. This means that if on a circle with radius r is equal to you’re some distance d from the view plane and you’re try- x = r∗ cos()θ ing to draw a voxel column, then you need to scale the col- umn by this amount to take into consideration the perspec- ∗ ()θ y = r sin tive scaling that exists at the given distance from the view where θ is the angle made with the positive x axis. plane. And the amount of scaling or difference between Since our camera is always flying above the terrain at an adjacent intersections in a vertical column gets larger as we altitude of z, we can use this equation to generate our dx,dy move farther away from the view plane. deltas. However, instead of using the standard sine and Now that we know that we need to track this “scaling” vari- cosine, we must use versions of them that can take angles able, how do we use it? When the main rendering loop is from 0 to (1920 - 1). That’s why we’ll need to make look up entered, the position of the ray is updated with the deltas tables. The pseudo-code for our outer loop is in Listing 2. dx,dy,dz, and then the current z position of the ray is com- Now back to the computation of dz. You’ll recall that dz is pared to the height data located in the height map at the cur- the slope of the downward ray that we are casting to com- rent ray’s downward projected (x,y). If the height in the pute the very first intersection (Figure 10). Referring to the height map is higher than the ray, we enter a second inner figure, the downward pitch of the camera relates to the start- loop. In this inner loop, the goal is to draw pixels in the col- ing position of the ray cast. This means that if the camera is umn until we have drawn enough pixels so that the perspec- pointing down to row 100 of the screen, then the slope of the ray is 100*ds. Therefore, LISTING 2. The outer projector loop. dz=∗ screen row ds . // start ray off at far left column Of course, since the screen’s y coordinate gets more positive curr_angle = curr_heading + 160 on the way down, we’ll need to alter this equation a bit; in fact, we’ll need to do a lot of little tweaks to make things work. for (int column = 0; column < 320 column++) Now that we know how to compute dx,dy, and dz, we’re { finally ready to complete the algorithm. Once we compute dx = COS_LOOK[curr_angle]; these values, we enter a loop to render the current column. dy = SIN_LOOK[curr_angle]; The loop will project the ray from the camera’s view point dz = ? (xc,yc,zc) at a rate of dx,dy,dz. However, we must track one other variable — the “current projected scale.” Recall that // draw the column we derived that the deltas between ray intersections piercing adjacent pixels in a single column will intersect any vertical // adjust the trajectory angle, rotate ray to right column beyond the view plane at constant intervals. These curr_angle—; intervals are equal to the current distance from the view point multiplied by the change in slope between adjacent } // end for pixels on the screen in a single column, which is always the http://www.gdmag.com NOVEMBER 1997 GAME DEVELOPER PROGRAMMING TUTORIAL

all the data for two worlds is less than 400k after compression. Now that we know the how and what of the data, let’s talk about the program. I’ve written two versions of the voxel terrain generator program; one with DirectX for Windows 95 (VOXELWIN.*) and the other in DOS 32 protected mode (VOXELD32.*). They’re both way too long to list in their entirety here, so we’ll only cover the main voxel rendering module and the main control module. Let’s begin with the terrain-rendering function Render_Terrain(...). The function implements our algorithm almost verbatim. The only difference is that everything is in fixed-point math FIGURE 11. Using VistraPro 4.0 to render terrain. 11a (left) with a 20.12 format — this, of course, is for speed. While the is the terrain height data exported as a 256-color gradient floating-point processor may be faster than the integer contour map. 11b (right) is the rendered terrain based on processor for multiplication, when you convert floating- that contour map. point values back to integers you’re looking at 40-60 cycles per float. That’s horrible. The key to rasterization algorithms is to convert the input into integers or fixed-point and, for tive projection of the voxel column looks correct on the dis- the entire algorithm, perform all pixel rasterization with play. This is accomplished by having an exit strategy based on integers — don’t mix integers and floats. You can use both, 42 the current projected scale. At each iteration, we add the cur- but keep them separate, or the implicit conversions and rent projected scale to the z of the ray, which has the effect of casts will kill your performance. Anyway, let’s briefly cover “climbing” up the voxel column. At the same time, we adjust the function and see what it does. the slope of the ray, because each pixel we draw means that First, you must send the function the (x,y,z) world coordi- the new ray would have a slope change of ds. Therefore, dz is nates of the view point along with the pitch, yaw, and roll of incremented by ds. Finally, when z is above the voxel column the camera. Actually, the roll isn’t used at all, and the pitch is (or when we’ve hit the top edge of the screen), we bail out of really more the horizon than an angle. The last parameter is the loop and continue tracing the contour. The tracing the destination buffer into which the scene frame is rendered. process must be done for a number of steps from “hither” to The scene frame is defined in the main program’s define sec- “yon” in Figure 4 to cast far enough to see reasonable detail. tion to be 320 × 240. Once the function is entered, the first

Putting It All Together LISTING 3.0. The Terrain Rendering Algorithm.

ow to write a program that uses our algorithm and gen- void Render_Terrain(int vp_x, N erates the 3D voxel display. Here is where all the details int vp_y, come into play. Before we dive into the voxel display gener- int vp_z, int vp_ang_x, ator and the main control module, let’s cover a quick check int vp_ang_y, list of what our code needs to do. First, we need to generate int vp_ang_z, height data and a color map, and we need to encode them in UCHAR *dest_buffer) some common format such as .BMP or .PCX. The height { data can be generated algorithmically, or you can download // this function renders the terrain at the given position and satellite height data — or if you have an extra $100.00, you // orientation can get a copy of VistaPro 4.0 (http://www.callamer.com/ vrli/vp.html), which is what I did. VistaPro is a fractal terrain int xr, // used to compute the point the ray generator that creates height data and 3D views with full yr, // intersects the height data texturing of the height data. Thus, you can create any fractal curr_column, // current screen column being processed landscape you wish. The program allows you to export the curr_step, // current step ray is at terrain height data as a 256-color gradient contour map raycast_ang, // current angle of ray being cast dx,dy,dz, // general deltas for ray to move from (Figure 11a). We can read in this file and use the color index // pt to pt as the height of each voxel column. curr_voxel_scale, // current scaling factor to draw each Getting the texture information is a little tricky, but basical- // voxel line ly what you do is place the camera at a (x,y) position in the column_height, // height of the column intersected and center of your world with a z altitude of 10,000 units or so. // being rendered From this altitude, the 3D terrain looks like a 2D texture map. curr_row, // number of rows processed in current You can export it from VistaPro and then you can use this tex- // column ture data as the texture color information for your rendering x_ray,y_ray,z_ray, // the position of the tip of the ray (Figure 11b). So what size should we make the height and map_addr; // temp var used to hold the addr of data color maps? I started off with 1,000 × 1,000-pixel height maps // bytes and then realized these files would be too big to download — about 2MB for everything. So I decided to go with 512 × 512 UCHAR color, // color of pixel being rendered height and texture maps. This works out fine, looks good, and *dest_column_ptr; // address screen pixel being rendered

GAME DEVELOPER NOVEMBER 1997 http://www.gdmag.com thing we do is to convert everything to fixed point and com- LISTING 3.0 (CONT.). The Terrain Rendering Algorithm. pute the starting video address and ray casting angle. Now that the starting position of the ray is computed, // convert needed vars to fixed point along with the deltas, the main stepping loop is entered, vp_x = (vp_x << FIXP_SHIFT); which will step out on each ray trajectory about 200 times. vp_y = (vp_y << FIXP_SHIFT); This procedure is also controlled by a #define in the main pro- vp_z = (vp_z << FIXP_SHIFT); gram. Now, for each iteration of the main stepping loop, the height of the voxel under the ray being cast is tested to see if // push down destination buffer to bottom of screen it is higher than the current ray’s z value or height. If so, the dest_buffer += (SCREEN_WIDTH * (SCREEN_HEIGHT-1)); voxel column segment while(...) loop is entered, and the voxel column is drawn until its projection is as large as its // compute starting angle raycast_ang = vp_ang_y + ANGLE_30; height. Then the while(...) is exited, and the ray’s position, along with the current voxel scale, is updated with the appro- // cast a ray for each column of the screen priate deltas. The function can literally be ripped out and for (curr_column=0; curr_column < SCREEN_WIDTH-1; curr_column++) used in any program as long as you include the #defines and { the main global data access pointers height_map_ptr and // seed starting point for cast color_map_ptr, which point to the data for the height field and x_ray = vp_x; texture map respectively. Let’s see the function in action y_ray = vp_y; with a complete application (a really simple flight simulator). z_ray = vp_z; 43 // compute deltas to project ray at, note the spherical cancelation The Killer App: A 1,000-Line Flight Sim // factor dx = COS_LOOK(raycast_ang) << 1; dy = SIN_LOOK(raycast_ang) << 1; y original goal was to create a demo that allowed you to fly around the terrain data and change the viewing M // dz is a bit complex, remember dz is the slope of the ray we are parameters. However, I got tired of controlling the flight, so I // casting, therefore, we need to take into consideration the decided to write a little bit of AI to control an autopilot that // down angle, or x axis angle, the more we are looking down the would fly over the terrain when we left the controls alone for // larger the intial dz must be a couple of minutes. I originally wrote the demo in DirectX dz = dslope * (vp_ang_x - SCREEN_HEIGHT); and Windows 95 (using Visual C++ 4.0), then I decided to port it to protected mode DOS (using Watcom 10.6), because // reset current voxel scale half of the programmers that I know still don’t have DirectX curr_voxel_scale = 0; on their computers, let alone the SDK. (I never thought I would be porting Windows programs back to DOS.) All of // reset row this software is on the Game Developer web site. curr_row = 0; To run to the DirectX version, you’ll need the DirectX 3 or // get starting address of bottom of current video column better run-time DLLs, and to run the DOS version, you’ll dest_column_ptr = dest_buffer; only need the DOS extender, which is included in the files. Both demos will load the height and color data by default, // enter into casting loop so all you need to do is execute either application. If you for (curr_step = 0; curr_step < MAX_STEPS; curr_step++) want to supply your own height and color data, then the { command line parameters are // compute pixel in height map to process • VOXEL(WN1|WN2|D32).EXE height_data_file.bmp color_data_file.bmp // note that the ray is converted back to an int • Both files must be on the command line. // and it is clipped to to stay positive and in range • Both file names must be in 8.3 format. xr = (x_ray >> FIXP_SHIFT); • Files must be in 512 × 512 in 256 colors. yr = (y_ray >> FIXP_SHIFT); • Files must be .BMP format with no compression. The main control module of the voxel engine is called xr = (xr & (HFIELD_WIDTH-1)); Game_Main(...). Game_Main(...) isn’t too complex, but I want to yr = (yr & (HFIELD_HEIGHT-1)); peruse briefly its operation. The function is called once per map_addr = (xr + (yr << HFIELD_BIT_SHIFT)); frame and is responsible for taking the input, altering the flight model (or lack thereof), and rendering the terrain. You // get current height in height map, note the conversion to have control of the view point, its orientation, and the speed // fixed point and the added multiplication factor used to of motion. Also, the autopilot that I mentioned earlier will // scale the mountains engage in about one minute if you don’t touch any keys; to column_height = (height_map_ptr[map_addr] regain control, turn left or right. The autopilot selects random <<(FIXP_SHIFT+TERRAIN_SCALE_X2)); speeds, turns, and follows the height of the terrain, so it’s a cool screen saver. The DirectX version of the code (also on the // test if column height is greater than current voxel height Game Developer web site), has a couple of Windows calls, such // for current step from intial projection point as the frame synchronization and the keyboard access. if (column_height > z_ray) Otherwise, its no different from the DOS version. { http://www.gdmag.com NOVEMBER 1997 GAME DEVELOPER PROGRAMMING TUTORIAL

What Now? LISTING 3 (CONT.). The Terrain Rendering Algorithm.

ell you have a fast terrain generator with which // we know that we have intersected a voxel column, therefore W you can alter terrain and texture data at will. I // we must render it until we have drawn enough pixels on the suggest that you try animating the height data, and/or // display such that their projection would be correct for the the texture data. For example, you could create a tiled // height of this voxel column or until we have reached the top texture and height map and play animations on the data. // of the screen You could animate real waves on the water, or little peo- ple running around the terrain. In addition, we’ve said // get the color for the voxel nothing of lighting. You could create a light lookup table color = color_map_ptr[map_addr]; with 256 shades of each color by using a least-squares // draw vertical column voxel method. Then you could have another 2D light map that while(1) would describe the light intensity for each pixel in the { texture map data. Then, as you’re rendering, you could // draw a pixel simply do one more look up per pixel to do lighting in *dest_column_ptr = color; real time. This would allow you to do lighting effects such as local spot lights just by painting into the light map // now we need to push the ray upward on z axis each frame. Finally, there’s no reason why you couldn’t // so increment the slope use a 3D polygon engine to place objects above the ter- dz+=dslope; 44 rain. This way, you could make a poor man’s FURY III. Have fun. ■ // now translate the current z position of the ray by André LaMothe has written three best-selling game pro- // the current voxel scale per unit gramming books and is currently CEO of Xtreme Games. He z_ray+=curr_voxel_scale; completed his latest project, REX BLADE, a DOOM-style game, // move up one video line in less than six months.There’s not much left of him after dest_column_ptr-=SCREEN_WIDTH; that! You can reach him at [email protected] or http://www.rexblade.com. // test if we are done with column if (++curr_row >= SCREEN_HEIGHT) { // force exit of outer stepping loop // cheezy, but better than GOTO! curr_step = MAX_STEPS; break; } // end if

// test if we can break out of the loop if (z_ray > column_height) break;

} // end while

} // end if

// update the position of the ray x_ray+=dx; y_ray+=dy; z_ray+=dz;

// update the current voxel scale, remember each step out // means the scale increases by the delta scale curr_voxel_scale+=dslope;

} // end for curr_step

// advance video pointer to bottom of next column dest_buffer++;

// advance to next angle raycast_ang—;

} // end for curr_col

} // end Render_Terrain CHARACTER ANIMATION LINEAR VELOCITY EXTRACTION

46 FOR CHARACTER ANIMATION recently moved from the Lincoln Park neighborhood in Chicago, to

Bucktown, another neighborhood within the city. Actually, the

Salvation Army moved most of my furniture for me, so moving the bal-

ance of my possessions seemed, at first, like an easy task. I didn’t bother

calling a full roster of friends/movers for this move; I only called my

friend Paul and his fiancée Sarah. The three of us moved all of my stuff,

plus some of my own fiancée’s stuff, in just under four hours. Even if it

hadn’t been one of the hottest days of the summer, there was just no

way to make this process fun.

The moving process got me thinking. If I ever get a shot at a job in a

video game publisher’s marketing department, I’m sure I’ll suggest game

ideas constantly. I imagine myself sitting behind a big desk with brand

BY SCOTT CORLEY IGAMEI DEVELOPER NOVEMBER 1997 http://www.gdmag.com new business cards and plenty of time will fall into the categories of standing, Fortunately, the translation involved in on my hands. I’ll have a big develop- walking, jogging, lifting, carrying, a 3D animation is already stored as pure ment staff somewhere close by, and I’ll dropping, throwing, and setting down numbers, so determining the velocity be sure to dismiss all of their ideas as nicely. Within these categories, we of an animation is easy. It’s certainly unmarketable. Then, one day, when I may have a wide variety of inter- easy compared with determining the have a particularly open schedule, I’ll changeable animations to mix things velocity of a sprite animation. drop the big one. I’ll insist we develop up a bit. For lifting, carrying, throwing, Allow me to insert some standards a “moving day” game in 3D. I’ll call it and setting down, we’ll choose an ani- here. I follow the same concepts used in MOVING DAY 2000 X-3D. mation based on the weight of the box my August article, so if you read that, Using my MOVING DAY 2000 X-3D involved. The final motion capture list you might want to skip this paragraph. game as an example, I’ll explain a con- will have around 150 moves on it. Our floor (the plane that Sucker walks cept called linear velocity extraction We would like to maintain appropri- on) is the plane z=0. The world is a (LVE), a technique for managing the ate velocities for each animation. Back right-handed coordinate system where animation of walking creatures. The in the days of sprite animation, it was the positive z axis is “up.” Sucker has a techniques that I describe could be important to use an appropriate veloci- root node that is at the top of his skele- used to create a homespun develop- ty for a moving animation so that the ton hierarchy; move the root and ment tool for modifying and managing sprite’s feet would not “slip” on the Sucker moves in the world. This root is these animations. The August 1997 ground. In 3D, using an appropriate positioned at Sucker’s center of gravity issue of Game Developer contained an velocity is still important, and in some (the joint between the torso and the 47 article called “Using a Base-Root cases close-up camera views make foot hips). This root node is the only part of System for Animated Characters,” slippage even easier to detect. the animation that will have changing which is heavily related to this topic. I’ll re-address some of the concepts introduced in that article to provide some context, but if anything seems Crafting a Tool to Process Character brushed over or confusing here, refer back to that article and read it. Animation Data uring the course of this arti- Most 3D tool vendors supply linkable How to Play MOVING DAY 2000 X-3D cle, I mention this mysteri- libraries to extract the data from their ous “tool” that you’ll need files. This is convenient because if the file he object of MOVING DAY 2000 X- D to write. Most of you have format changes, all you need to do is link T 3D is to move all of the furniture, tools to deal with 3D characters and ani- new libraries, and you’re ready to go. I’d boxes, and junk from one dwelling to mation data already, and can modify be wary of this approach for a few rea- another in four hours or less. If you them to implement new features. If you sons. First, the libraries may not give you succeed in moving everything in the don’t have any tools to work with the files some bits of information that you need, allotted time without excessive break- spit out by your animation package, you and since you can’t modify the libraries, age, your buddy buys you lunch. If you need to write some, so read on. you might be out of luck from the start. exceed the time limit, U-Haul charges The tools that you write should accom- Second, the libraries may be provided in you double for the moving van and plish a number of important things for you. a form that isn’t compatible with your hassles you about refunding your $120 First, most commercial 3D packages have linker or your CPU. Third, that bit about deposit. If you damage too many of his fairly complex file formats that store a ton linking with updated libraries when new belongings during the move, your of information that you don’t need during file versions come out is a bit flawed. buddy smacks you. your game. Your tool should extract only Many 3D tool vendors are slow to get new When the game starts, you get to the information of interest to you. Second, developer tools released, so if a small choose one of four characters with there may be a native format that you need change in the file format makes the which to move your friend’s boxes. All your data in; for example, a fixed-point for- libraries useless, you have no recourse of the selectable characters have two mat. Your tool should handle that as well. except to wait for new libraries. If you arms and two legs, and they all use their Getting information about converting write your own tools to parse through the legs to get around. Once you select a 3D file formats varies from easy (look in files yourself, you can at least attempt to character, your buddy tells you which the back of the instruction manual) to handle new file formats before all the boxes need to be moved, which boxes almost impossible and expensive. Before information becomes available to you are particularly fragile, and how much considering a 3D animation tool, you may (and usually this is very easy to do). time is left. For easy reference, we’ll call want to investigate how easy it is to So go write a behemoth tool that can your in-game character “Sucker.” extract data from the file formats. I won’t read in 3D hierarchical animated charac- Sucker is a bipedal creature in a real- say specifically which vendor I’ve had the ters, process them to the point that they world environment with gravity, so most problems with, as that would be are useful to you, and spit them out in a most of his movement will be confined très gauche, monsieur. I will remain soft, format that is convenient for your purpos- to a 2D plane. Aside from jumps and so as not to spoil anyone’s image. es. You’ll be glad you did. special moves, the motions we capture http://www.gdmag.com NOVEMBER 1997 GAME DEVELOPER CHARACTER ANIMATION

FIGURE 1. As animation progresses, the root moves away from the origin. tain distance d over a certain time t. We can calculate d simply by taking the final position of the root and sub- tracting the initial position of the root, as shown in Figure 2. Determining t is simply a matter of reading the total number of frames or the total anima- tion time from our animation file. Note Z that I gratuitously use the word “sim- Y ply” here. If you don’t have the tools to X read and process your model and ani- mation data directly, you’ll have to write those tools before you can do any Frame 1 Frame 2 Frame 3 Frame 4 of these calculations. That may or may not be a simple job. Once you have translations in x, y, and z, in addition system, you should now be interested in those tools running, though, you can to rotations. Other segments will have the details of what to do when Sucker reread this paragraph and truly enjoy translations from their parent, but the translates away from the origin. We the word “simply.” translations will stay constant for all know that the base coordinate system is Now that you have d and t, you can 48 animation frames. You may be wonder- always located at the origin of the space calculate v, the linear velocity, as d/t. ing why I use z=0 as the floor instead of that Sucker was modeled in, but we also Actually, d has three potential values:

the popular y=0 floor. Some profession- know that Sucker can walk away from dx, dy, and dz. For now, we’ll leave al 3D tools use z=0 (notably, the origin in that space, as in Figure 1. everything in z untouched, so forget

MultiGen’s tools), while others use y=0. If Sucker’s root isn’t moving a signifi- about dz. Calculate dx (final x position

I prefer z=0 because it puts all move- cant distance from the origin, we don’t minus initial x position) and dy (final y ments on the floor in terms of x and y. need to do anything. If Sucker is just position minus initial y position). Then

If all graphics tools agreed on one stan- standing around, or juggling while calculate vx and vy, the x and y linear

dard, I’d use it. As long as the tools you standing, or even doing jumping jacks velocity components, by dividing dx

write provide a means of rotating the to warm up, no adjustments need to be and dy by t. The final units you end up axes to a common orientation, the made. During any of these animations, with might be feet per second, feet per standard you use doesn’t matter. the root may move around quite a bit, frame, meters per second, or undefined Sucker’s root will always be animated but at the last frame of the animation, distance units per unknown time unit. so that his feet align properly with the the root won’t be very far from the base. The units don’t matter, just make sure z=0 floor. We’d like to control Sucker by The “rule of base” says that the base can you know what they are. You and the using a base coordinate system project- always be considered an approximate animators giving you this data need to ed onto the floor. On the programming projection of the root onto the floor. As know what 1 equals. You can get pretty end of things, it’s easy to create this base long as this remains true, we’re fine. far without ever knowing this, but coordinate system, because everything When Sucker walks or runs, the root eventually you’ll need to know. in our animation is relative to the ori- can be a few feet from the origin at the Once we have the linear velocity, we gin. As long as the base coordinate sys- end of the animation. This violates the can put the rule of base back into tem is located at the origin, everything rule of base, so an adjustment needs to effect. Before we do that, however, I’d Sucker does will be relative to that base, be made. That adjustment can be deter- like to explain the overuse of the word and we can move Sucker relative to the mined using LVE. “linear” in this article. The word is world by changing the base’s transla- The idea behind LVE is very simple. used to emphasize the fact that we’re tion. The only rotation we’ll apply to Our animated character moves a cer- interested in linear distance change the base will be around the base’s z axis, so you can envision the base as being an Calculate velocity of animation using distance traveled and the over- imaginary disc that is always parallel to FIGURE 2. all time of the animation. the floor. In addition, the base’s z trans- lation will always be zero, so that imagi- nary disc will actually be incident with the floor plane.

The Rule of Base Root Travels Distance d Z o far, we’ve covered the basics from Y S the original base-root system article X — we can now get into a discussion of Time t=4 frames LVE. If you followed the preceding quick overview of the base coordinate Frame 1 Frame 2 Frame 3 Frame 4

GAME DEVELOPER NOVEMBER 1997 http://www.gdmag.com movements along the y axis. In fact, it can handle any movement in the x-y The Rule of Base plane. Recall that at the beginning of this he Rule of Base states that the base coordinate system may always be con- article, we decided to leave the z move- sidered an approximate projection of the root coordinate system onto the ment intact in the animation. This floor. Whenever this rule is violated, you must take special action. In almost turns out to be a good decision in light all cases, LVE is the best way to restore the Rule of Base. of the “linear” emphasis. Sucker lives T in a world with the acceleration of gravity, so motion in the z direction over time, not angular velocity or any- Books Are Heavy certainly isn’t going to be linear. For thing else. It’s also used to emphasize this reason, we don’t do any extracting that the actual movement of the root e can now play back an anima- in the z axis. of an animated character is very erratic. W tion of Sucker carrying a large If you refer back to the juggling and The root is translating through all sorts box full of books. If you just play back jumping jacks paragraph, you’ll recall of arcs, shaking around, and at times, the LVE-processed animation, you that there will be animations in may even be moving backwards rela- know that the animation won’t move which the rule of base is followed tive to the ground when the animation away from the base (the rule of base is without any processing. For these ani- as a whole has a forward velocity. The still in effect). To get this animation mations, we don’t want to extract a velocity that we’re extracting is a sim- moving without violating the rule of velocity at all because it will make 49 ple distance over time. The rest of the base, you have to move the base. You Sucker drift when he’s supposed to be wacky movement is left in the anima- stored the extracted linear velocity standing still. There will almost tion. When we add the two back with the motion, so you know exactly always be a difference in translation together, we reconstruct the original how fast to move the base. between the first and last frames of an motion. We’re almost there. The animation system that you write animation, but if that distance is To put the rule of base back into for MOVING DAY 2000 X-3D should small, we would like to leave the ani- effect, we have to adjust each frame of automatically read the velocity for mation alone and store a velocity of the animation by subtracting a certain each animation and apply it for you, so zero. The question then becomes, distance from the x and y translation you never have to adjust any of the “What’s a small distance?” from each frame. Use Equation 1 to cal- velocities by hand. In addition, any What you consider a small distance culate that distance for a particular funky root movement from the origi- is up to you and can be handled many frame. In Equation 1, we’ll use the two nal animation has been retained. The different ways. A perfectly reasonable linear velocity components vx and vy, extracted linear velocity can handle method of determining “small” is pass- the time stamp f of the frame, the orig- any forward or backward movements ing in a distance on the command line inal components of the frame’s root along the x axis (we assume Sucker is of your tool. Another method to con- translation x and y, and the frame’s animated facing down the positive x sider is examining the animated model new root translation components x′ axis) as well as any sideways strafing and using some measurement from and y′. ′ x =x-f*vx ′ LISTING 1. y =y-f*vy (Eq. 1) The time and distance units in Equation 1 are up to you. Again, // Note: This code snippet doesn’t cover the definition of the classes whether you’re using feet per frame or // it uses, such as Animation and Model. I will explicitly use the “this” meters per millisecond, you need to // to reference class attributes, for clarity. Also, you define your units and remain consis- // can assume that no global variables are being referenced in this code. tent. Check out Listing 1 for an exam- ple of how this is done in code. void Animation::TakeLinearVelocity(Model *theModel, double &xvOut, double &yvOut, double So what have we done? Equation 1 &zvOut, bool ForceVelocity) is simple, but it was difficult to { explain, so it must have some signifi- double modelSize[3]; double velocity[3]; cance. For each frame in the anima- double start[3],end[3]; tion, Equation 1 subtracts the distance double curPos[3], dist[3]; that the root has traveled up to that int i,j; frame. If you play back a run anima- tion after doing this LVE processing, theModel->GetMaximumDimensions(modelSize[0],modelSize[1],modelSize[2]); the animation will appear to run in // determine what “small” is place. We have put the rule of base back in effect. When saving out the modelSize[0]/=4; // If animation moves the root a distance greater than processed animation, store v and v x y modelSize[1]/=4; // 1/4 of the largest dimension of the model, with it, as we’ll be using that extracted modelSize[2]/=4; // we will extract a velocity. velocity very shortly. Conitnued on page 51. http://www.gdmag.com NOVEMBER 1997 GAME DEVELOPER CHARACTER ANIMATION

FIGURE 3. Animation assumes last frame is identical, in time and position, to the frame and the first frame, as in Figure first frame 4. In other words, the last frame should be the frame that comes just before the first frame, so when you loop the ani- mation, everything looks smooth. There’s no need for your tools to leave off a frame, because there’s no redun- dant frame at the end of the anima- tion. The problem with this method is that again your animation tools may not work this way. Either of the loop methods that I just presented is accept- able, and if you reread those sections you’ll see that the methods are essen- tially identical. Frame 1 Frame 2 Frame 3 Frame 1

that to determine “small.” For exam- animation identical, in which case the Speed Shifts ple, if you have a segmented model, first and last frames may be considered 50 you might find the largest dimension identical in time (at the loop point, the ow that Sucker has his automati- of the largest segment and declare that last frame is the first frame and occurs N cally ripped-out linear velocities to be “small.” This would mean that no at time zero). In other words, there to propel him, you may want to adjust velocity would be extracted unless the would be no time between the last the velocities at game time. When the root moved a distance that was large frame and the first frame, as in Figure end of the day nears and Sucker gets relative to the model itself. 3. When you play the animation back tired, you may want him to move more Once you have a value for “small,” in MOVING DAY 2000 X-3D, you’ll play slowly than usual.

compare your dx and dy values to it. If a through the animation and loop back When you adjust a velocity, start out distance in a particular direction is to the first frame, skipping the last with the original velocity vector for the greater than “small,” extract a velocity frame, because it’s identical to the first animation that you’re adjusting. (Up in that direction. If not, set the velocity frame in appearance and in time. until this point, I’ve referred to the

for that direction to zero and leave the There are a few problems with the velocity by its components vx and vy. translation in that direction alone. above situation. If your tools aren’t The velocity vector that I refer to here is By this time, you should understand written carefully, they may include the made up of these components.) Multiply the importance of deciding what your first and last frame in your data. Since the x and y components of that velocity units are and keeping them consistent. these frames are identical, and we’re vector by a scale value. For example, you There’s another sticky consistency prob- really skipping the last frame, includ- could multiply by 0.8 to slow Sucker lem that you might not notice, which ing both frames would be wasteful. The down 20%. The only other thing you can make your animation loops look second problem is that your animation need to do is multiply the playback horrible. You and your animators need tools may not work this way. frame rate of that animation by 0.8 as to define where the first and last frames The straightforward way of dealing well so that Sucker’s feet won’t slide. of your animation are, and how they with the last frame of a looping anima- While this is easy, when creating anima- will be handled. Also, verify that this tion is to assume that there is one tion system tools you may not initially definition of the first and last frames implied frame of time between the last think to provide a way to override an works with the animator’s software.

FIGURE 4. Animation assumes that there is time between the last frame and the Handling Looped Animations first frame.

he first frame of a looped anima- T tion is obviously where the anima- tion starts. It’s time zero. While frame one is obviously time zero, it very well may be considered frame one by the animation software (only programmers count from zero). This shouldn’t cause a problem, but is something to keep in mind. The last frame of a looped animation Implied Time is, of course, where the animation ends. You can insist that the animator make the first and last frames of the Frame 1 Frame 2 Frame 3

GAME DEVELOPER NOVEMBER 1997 http://www.gdmag.com LISTING 1 (CONT.). animation’s velocity and frame rate. If Sucker seems too responsive to the // If ForceVelocity==true, we will extract a velocity how joystick for some reason, you may have // small the overall root translation is. A good way to force this is to give Sucker a slight acceleration, // by setting our “small distance” value to 0. from zero velocity up to the velocity of if (ForceVelocity) a walk or run animation. This is modelSize[0]=modelSize[1]=modelSize[2]=0; achieved in the same way as adjusting an animation’s velocity, except in this // When an Animation is constructed, its velocity is initialized to zero. case the velocity is changing every // If we detect that the velocity is not zero, it means we have already frame, so the playback frame rate must // extracted a velocity. Repeating this step again would be disastrous, be adjusted every frame as well, until // so here we do a safety check. Sucker accelerates up to his target velocity. if ((this->xVelocity!=0.0)||(this->yVelocity!=0.0)||(this->zVelocity!=0.0)) { xvOut=this->xVelocity; yvOut=this->yVelocity; zvOut=this->zVelocity; Tips for Tuning Animations return; // Velocity was already extracted. Don’t repeat! } ere are some tips to polish up your H animation tool. Add command velocity[0]=velocity[1]=velocity[2]=0.0; // Get ready to find the velocity line options to your tool that will sup- 51 if (ForceVelocity) press LVE completely (in both the x { and y axes), or partially (either x or y // In the case of a forced velocity, the velocity being forced is passed in only). When deciding your value for // via xvOut, yvOut, zvOut “small,” you’ll probably find that no velocity[0]=xvOut; velocity[1]=yvOut; velocity[2]=zvOut; value is perfect. You may get an anima- } tion that has just enough root move- ment to get a velocity extracted, and it may cause your character to drift when this->GetFirstRootTranslationFrame()->GetPosition(start[0],start[1],start[2]); you want it to stay still. In addition, this->GetLastRootTranslationFrame()->GetPosition(end[0],end[1],end[2]); you may find that some animations get a y velocity extracted when they should // Determine linear velocity and subtract it from each keyframe really only have a x velocity. for (i=0; i<2; i++) Strive to adjust your “small” value so { that the vast majority of animations if (abs(end[i]-start[i])>=modelSize[i]) convert automatically with no special { intervention. This will reduce your dist[i]=end[i]-start[i]; workload and data maintenance prob- if (!ForceVelocity) lems. When certain animations give velocity[i]=dist[i]/(this->LastFrameNumber - this->FirstFrameNumber); you trouble, just make sure that they’re // This divisor represents the number of >spaces< (of time) between keyframes converted with the appropriate LVE suppression flags. for (j=0; j<=(this->LastFrameNumber - this->FirstFrameNumber); j++) A particularly good candidate for LVE { suppression is any animation in which this->GetFrame(this->FirstFrameNumber + j)->GetTranslation(curPos[0], curPos[1], a character pivots on one foot. In these curPos[2]); cases, your root is going to swing 180 curPos[i]-=velocity[i]*j; degrees and, in the process, travel a sig- // Subtract the distance that the velocity has taken us on frame j nificant distance. However, this special this->GetFrame(this->FirstFrameNumber + j)->SetTranslation(curPos[0], curPos[1], case requires a solution using some curPos[2]); method other than LVE. You definitely } don’t want a velocity extracted from an } animation such as this, so use those } LVE suppression flags. Provide a way within your anima- xVelocity=velocity[0]; tion tool to force the extraction of a yVelocity=velocity[1]; specified velocity from an animation. zVelocity=velocity[2]; Normally, your tool will determine xvOut=xVelocity; the velocity of each individual anima- yvOut=yVelocity; tion and extract that velocity. There zvOut=zVelocity; will be cases where you want to over- ride the velocity that your tool calcu- } lates with a specific velocity from else- http://www.gdmag.com NOVEMBER 1997 GAME DEVELOPER CHARACTER ANIMATION

where. Sucker provides a perfect fectly, the box and Sucker will eventu- Go Forth and LVE example of when we might want to do ally drift apart. We must therefore this. There are objects in Sucker’s come up with a way to match their hat wraps up our discussion on environment that he interacts with, velocities. T LVE. Depending on your experi- and we will have animations associat- For all animations involving Sucker ence creating and managing anima- ed with those objects that match up and a box, we’ll convert the two ani- tions, this may seem like a lot of work. with Sucker’s animations. For exam- mations as a pair and use Sucker’s If it seems like a lot of work to create a ple, Sucker will at times pick up boxes, velocity for both. First, we convert home-grown tool to manage LVE, be carry boxes, throw boxes, and set Sucker and make a note of the veloci- aware that for many games on the mar- down boxes. The motion of the boxes ty vector that we extracted. Then, we ket today, approximately half of the in these cases has to be animated and use our tool’s velocity override fea- coding effort was spent on creating synchronized, since we don’t want to ture and force the box animation to tools alone. From that perspective, simulate the box as a rigid body rest- have the same velocity as Sucker. implementing LVE should be a fairly ing on Sucker’s arms. Now, we can play the two animations insignificant blip on your workload. During the animation of Sucker and in sync and not worry about them If this doesn’t seem like a lot of work, the boxes, you’ll have to make sure drifting apart. try it out. It’s fun to have tools that do that all of the animations are of the The last point I’ll make about syn- everything automatically for you. By same length and that they look correct chronized animations is that if they are the way, after this investigation of when played together (that much is animated together and then separated MOVING DAY 2000 X-3D, I have decided 52 obvious). What isn’t clear right away is later, their base coordinate systems will to scrap the project and reallocate the that when you process the animations match exactly. When playing the ani- resources elsewhere. See ya, Sucker. ■ separately, you’ll get slightly different mations back in the game, the bases Scott Corley is vice president of software velocities for Sucker and the box due to should start out in the same place with development at High Voltage Software. slight differences in the starting and the same facing. If the paired anima- His new wife actually thinks game pro- ending positions of the roots. If you tions’ velocities match correctly, the gramming is cool. For tips on where to find then play back the animation with bases will stay matched up, which is such enlightened women, e-mail Sucker and the box synchronized per- handy. [email protected]. POSTMORTEM Pademoim 2

hen our team at

Crystal Dynamics

54 began the develop-

ment of PANDEMONIUM 2

for the PlayStation and PC

CD-ROM, our goals were WWprobably similar to those of other teams creating sequels. We wanted to build a

game based on the original game’s 3D

engine and characters, yet add dramati-

cally new game play mechanics and

graphical enhancements. For financial

reasons, we wanted to reuse code and

elements from the first game, but we

wanted the look, feel, and play to be

dramatically different.

GAME DEVELOPER NOVEMBER 1997 http://www.gdmag.com The PANDEMONIUM experience was built to mimic a fast-moving roller coast- er. The engine in the original game, which shipped in October of 1996 for the PlayStation, supported a very active camera that delivered cinematic angles and a wild sense of motion. We wanted to build on that foundation and design an even bolder camera scheme. We also wanted to communicate the sense that the game was “hand-crafted,” because our development team feared that origi- nality was being lost in the character- action genre, and that publishers were continuing to reuse a significant amount of tile sets and backgrounds to the detri- Nikki, Fargus, and Sid in the original …and Nikki’s updated look for ment of creativity. Fooling the consumer PANDEMONIUM… PANDEMONIUM 2. with empty claims of large numbers of

PANDEMONIUM DOESN’T JUST DESCRIBE 55 THE FRENETIC PACE OF DEVELOPMENT AT CRYSTAL DYNAMICS, IT ALSO REPRESENTS THE COMPANY’S BREAD AND BUTTER THIS CHRISTMAS by Scott Steinberg levels, when the number of unique levels remained some- card and Kinetix’s 3D Studio 4.0 — essentially all worksta- what modest, grated on our gaming sensibilities. Our inter- tions purchased off the shelf without much further tweak- ests were immediately focused on building originality and ing. Our commitment to individual creativity and flexibility creativity throughout the entire product. during the development of the original product allowed the With regards to graphics, we wanted to push into a new team to quickly transition to the sequel without our having art frontier with a thematic look that was radically different to retrain them or invest heavily in new development from one level to the next. We also wanted to aggressively resources. In addition, by strange coincidence, several mem- augment the dynamic roller-coaster camera and kinetic hori- bers of the design team were high-school friends who were zontal game play, while at the same time build the same spa- unknowingly hired together, which helped fuse the group. tial drama with vertical game play. Another one of our goals was to surpass the graphical stan- Before we could start development, however, our team dards set by previous games. From the outset, there was little had to be relocated from our studio in Novato, California, to interest in repeating the original PANDEMONIUM’s fantasy our main office in Menlo Park, where the majority of Crystal environments. Instead, our team decided to push in a direc- Dynamics’ staff is located. While only two hours away by tion reminiscent of Salvador Dali and Timothy Leary, which car, the new location was a significant change in the team’s sets PANDEMONIUM 2 apart as a visual wonderland. This aes- working environment and caused some friction between thetic goal was balanced by a core game play directive: to team members, as I will explain shortly. build a layered and integrated entertainment experience based on technical — as well as exploratory — game play. The sound design of PANDEMONIUM 2 was a subtle but The Genetic Core extremely important feature to the development effort. From the beginning, the music designers adopted a direction radi- ne of the core strengths of the PANDEMONIUM develop- cally different from the rest of the industry. Character action O ment team stemmed from the empowerment of indi- games from the U.S. and Japan historically have used fantasy- vidual designers to dream up and execute graphics or game oriented music. With the capabilities of the CD at their fin- play ideas without hindrance from the other development gertips, the designers chose a new genre for inspiration: the disciplines. Our development environments were custom- San Francisco club scene. Their influences came from a host built with powerful tools to allow designers, artists, and pro- of esoteric musical sources such as Freaky Chakra, Tipsy, grammers to experiment, innovate, test, and build new fea- Steroid Maximus, Sukiya, and . Exploring various tures before they were hard-coded into the game. These tools clubs in the city, the sound team crafted a sophisticated and took about three to six months for a person to learn. Every incredibly energetic musical skeleton. This musical direction team member had a Pentium 166MHz with a 3D accelerator excited our international distribution partners, as it was http://www.gdmag.com NOVEMBER 1997 GAME DEVELOPER POSTMORTEM

funny look, it wasn’t quite the treatment we had all envi- sioned. Eventually, his appear- ance evolved to meet the tastes of the team. Fargus’ partner Sid, a puppet on a stick, was designed to be his alter-ego throughout the sequel. Sid’s role in the game was greatly expanded as a range weapon, as well as game play mechanic.

The Quest for Beta

chieving a feature-com- A plete beta proved to be a challenge. Our release date was moved up by almost a month 56 for marketing reasons — we viewed November and December as a crowded time Nikki, the heroine, was completely for game releases. As a result, our development schedule was redesigned for PANDEMONIUM 2. extremely relevant to their con- compressed The team had a sumers and offered multiple market- hard target date in August 1997 ing opportunities and partnerships. contributions to the creative process that forced everyone to work concur- and to the final result. rent days without sleep. CDs were Once the rough designs were final- burned and distributed for game play Character Design ized, the characters went into their 3D feedback and testing. Compressing the modeling phase. Lead artist Leon schedule meant that certain key ele- he most significant change planned Cannon and lead designer Zak Krefting ments of the game weren’t completed T for the sequel involved retooling bore much of the pressure to complete until the last phase of development. the two main characters to give them a this task in time to preview the game at Shortening a product development more mature look and attitude. Nikki, 1997’s E3 in Atlanta, and to meet mar- schedule by nearly a month is unprece- the heroine, was completely keting deadlines for advertising and dented in our industry. It requires a redesigned. Fargus, the goofball jester, packaging. While Nikki’s character was massive amount of work, planning, was given enhanced mechanics and a somewhat challenging to complete, more demented look and behavior. Fargus was extremely time-consuming Multiple looks for the characters were to finish. His costume went through presented to focus groups to gauge con- many iterations, many of which made sumer appeal. In turn, we ran these him look like a psychotic harlequin models by our distribution partners in jester. While it was an interesting and Europe for review and buy-in. This level of involvement from our UK, French, and German distributors was key to maintaining European consumer appeal with this sequel. The process was iterative; it took multiple meetings and character sketches before a satisfactory look and feel was achieved. While some people might have built a sexy charac- ter à la TOMB RAIDER’s Lara Croft, thank- fully nobody in the company was inter- ested in cloning Croft. Instead, we went after a more elegant look, somewhat reminiscent of Elle MacPherson. Agreeing on this artistic target helped galvanize the relationship between the Fargus and his sidekick Sid were development team and the marketing given a more demented look team. Both groups made constructive

GAME DEVELOPER NOVEMBER 1997 http://www.gdmag.com The talented yet ethereal PANDEMONIUM 2 development team, hard at work fostering a creative work environment. 57 and coordination. In order to achieve nificant, and many felt that the game stemmed from PANDEMONIUM 2’s new our new ship date, some of the original was much too difficult to play. The character features. These fears proved PANDEMONIUM team members, who had marketing department sent reports to to be well founded, as early on in the been working on another project, had our team noting where consumers were testing process the testing team dis- to be brought in to help complete the encountering difficulties, and we fre- covered a disproportionate number sequel. These four “volunteers” signed quently turned around new versions of of glitches associated with the new on for a five-week tour that made a the game that reflected this real-time character features. huge difference in our ability to make feedback. Communication between testers the early ship date. Once their tour of Compounding our technical chal- and the development team was espe- duty was over, our team was left to fin- lenges, we had to overcome some cially challenging. In order to pro- ish up the schedule and ship in internal misconceptions about the vide useful and constructive feedback October. Although we will meet our project. Since PANDEMONIUM 2 had to the development team, the October ship date for the PlayStation been positioned internally as a sequel, PANDEMONIUM 2 testers required spe- game, the PC version will be delayed many people assumed that the game cial training from the test depart- until later in the year. represented nothing more than a mod- ment. For instance, the PANDEMONIUM Four weeks before our golden master est technical challenge. On the con- 2 camera movements have their own date, the team struggled to update glue trary, the project was quite challeng- lexicon, which required the design screens, complete the introduction’s ing. The functionality of the new and testing staffs to identify, itemize, sound mix, and stabilize numerous characters’ features and behaviors, and diagnose camera and design bugs crash bugs. Two weeks before the gold- along with enhanced enemy intelli- using a very technical and specialized en master date, the bug list was still sig- gence, made the product quite a tech- vocabulary. Thankfully, many of the nical undertaking. original PANDEMONIUM testers were available to test the sequel, which The Gauntlet

he approval cycle for a T PlayStation product is very stressful. With in-store commitments and market- ing activities timed to coin- cide with the retail avail- ability of a product, all eyes focus on the testing cycle. Costly delays can arise if the tenacious staff within Sony’s quality assurance department reject a product due to bugs in the software. Our team felt that our Lead designer Zak Krefting. Lead artist Leon Cannon. biggest potential bug risks http://www.gdmag.com NOVEMBER 1997 GAME DEVELOPER POSTMORTEM

PANDEMONIUM 2 features a dynamic, roller-coaster camera and kinetic horizontal game play.

helped minimize the department’s connectivity, integration, and keting needed to create stunning learning curve. involvement in the creative process artwork that would impress the was felt by all to be the key to suc- magazine’s editorial decision mak- cess. The more new technology ers. With this challenge in hand, 58 What Went Right tricks and the more brains con- the marketing and art teams tributing to the game design, the worked together over the course of 1. From the outset, the team was dri- better the product stood to be. several days to create and polish a ven to design and create a large 4. A by-product of the design team’s suitable scene. The result was that number of very diverse levels. This remote location during develop- the magazine’s editor was ecstatic goal was partially met on the ment of the original PANDEMONIUM about the treatment, and we land- design side and truly met on the was the team’s general distrust of ed the cover. graphics side. When the decision upper management and the mar- The other instance that tested was made to shorten the develop- keting group. Without personal our teamwork occurred when pack- ment schedule and ship the prod- contact on a daily basis with these aging artwork arrived from an out- uct in October, design features that groups, the design team had demo- of-house design team. The charac- we had planned to include beyond nized marketing and management. ter models in the artwork were the core mechanics were aban- The situation improved significant- deemed unacceptable, so with time doned. However, the product was ly during development of the in short supply, the marketing graphically rich and diverse from sequel, when everyone worked in team again solicited the artists to the outset, so the shortened sched- our Menlo Park offices. There was a enhance the artwork. Again we met ule didn’t have the same impact on collective sense of involvement marketing’s schedule and quality art that it did on the game design. shared by the executive staff, mar- expectations. 2. From the beginning, our develop- keting, and the development 5. We created “micro teams,” built ment group established an uncon- groups, and much of the tension around designers and artists with a ventional management, art, and (particularly between the develop- similar vision. This reengineering design philosophy. Given so much ment team and the marketing of the traditional team brought individual autonomy, our group team) quickly evaporated. Some of along with it a renaissance of cre- had a magical feeling to it, a sense the techniques used to facilitate ative freedom and efficiency. The that both art and design could fuse this spirit were fairly straightfor- micro teams were built to guide the together and integrate like never ward and occurred organically. creation of each “game zone,” or before. This integration allowed us They centered on getting people to chapter of the game. Decisions on to blur the traditional lines of team work together at consumer focus game play, specific mechanics, and hierarchy and development special- groups, reviewing character sketch- the graphical style were made with- ties. On a more subtle level, our es and designs, encouraging in these micro teams. Of course, structure also allowed individual involvement, and valuing each overall continuity was still personality traits to shine through others’ opinions based on our vari- extremely important, and was man- in the game play and level layout. ous areas of expertise. aged by the lead designer and the Core team members exhibited a There were two specific situations lead artist. To reinforce the overall wide spectrum of game play styles where both the marketing and leadership of the project, collective and wove their personalities into development teams came together team meetings were frequently the fabric of the game. for a common goal. The first was held to communicate each micro 3. There was an almost religious fer- when the marketing team orches- team’s zone specifications. This vor within our team, riding the trated a media tour that yielded a helped minimize areas of redun- power of the development environ- potential magazine cover in a lead- dant game play and let us share ment, the game’s engine, and the ing video game magazine. To innovative ideas with the rest of group’s creative cadence. Team secure our spot on the cover, mar- the product team.

GAME DEVELOPER NOVEMBER 1997 http://www.gdmag.com POSTMORTEM

PANDEMONIUM 2’s whimsical graphics were designed to be reminiscent of Salvador Dali and Timothy Leary

on the critical path to shipping the What Went Wrong game it was pushed back in the The Legacy 1. One of our initial goals was to schedule. When our schedule aking into account all that’s been address a major criticism of the orig- adjustment was made, those ani- T said thus far, everyone associated inal product: that the game play was mated sequences didn’t have the with PANDEMONIUM 2 was quite proud too linear. Achieving this lofty goal programming or art support to be of how it turned out. In this age of remained elusive. Programming implemented. beefy product development schedules resources proved scarce during the 4. In general, working on a sequel can and budgets, the game did what few start-up phase of the project, and be somewhat stifling and difficult to have ever done: It shipped early. The during early diagnostic meetings, we get excited about. As I explained single most important lesson we 60 realized the complexity of this goal earlier, one of the goals was to aug- learned was how important the human and decided that our technical team ment the linear game play of the component is in development. was not big enough to reach this original PANDEMONIUM, which Whether the term is “intellectual capi- goal in time. Instead, we settled brought with it many interesting tal” or “talent,” products succeed or upon a more achievable target: to creative challenges. In the early part fail depending on the quality of the develop a system of multiple paths of 1997, it became clear that the team members. Managing and inspir- in various levels that branched off team would realize only a partial ing these people has evolved away and let the player explore more of victory. This design augmentation from some of the harsher, old-school the game’s environments. was the primary motivation for techniques. Instead, companies will 2. Looking back at the team’s dynam- many members of the team, so continue to grow based on how well ics, one of the loftier goals that we when we retreated from this target, they treat and support their key cre- narrowly missed was our attempt to the creative energy and morale of ative talent. Those companies that maintain the organizational free- the team dropped. Managing expec- show a real understanding of this shift dom that the team enjoyed during tations and creative energies turned and effectively connect with their development of the original out to be critical in keeping up teams will wind up developing the best PANDEMONIUM. That atmosphere fos- enthusiasm and passion. products. ■ tered a spirit that bound the group 5. There was some controversy over Scott Steinberg, vice president of market- together. Once the team consolidat- whether to do a computer-rendered ing at Crystal Dynamics, has been respon- ed in Menlo Park with the rest of the 3D introduction to the game. The sible for managing and marketing GEX, the company, some of the designers felt marketing department was interest- company’s fast talking, top-selling, gecko that their frontier spirit would ed in developing a high-quality, lizard that has been the company’s top rev- inevitably be lost. Little actions were multiscene introduction to help enue-generating product. Prior to joining spontaneously taken to revitalize relaunch the characters and enhance Crystal Dynamics, Scott was in marketing that attitude, such when some team the product’s publicity efforts. The management at Sega of America, where he members set up a bright purple tent team was suspect of the value of the was responsible for marketing and promot- around a central work area. Yet sequence when measured against the ing Sega Genesis, Game Gear, and Sega some corporate organizational ele- cost and time requirements to com- CD software products. ments crept into their work lives, plete it. The art group didn’t have including endless demonstrations to the time, nor the inclination, to PANDEMONIUM 2 distributor candidates and countless work on it, and it was farmed out to marketing meetings. a freelance contractor. There were Game platforms: PlayStation and PC 3. The team had planned to use in- problems from the outset, causing CD-ROM game character models in animated major budget overruns and delays. sequences, rather than large, fully- Specifically, character motions and Development time (from conception thru animated sequences. Using charac- aesthetic integrity were continually shipping): Approx. 1 year ter models would have been more problematic, to the degree that the Size of development team (excluding QA): affordable, easier to implement, and project barely made it into the game 22 people less time consuming than the fully by the beta testing stage. This late animated sequences. Unfortunately, completion precluded taking advan- Ship date: October 1997 implementing character models tage of prelaunch marketing and Publisher: Crystal Dynamics wasn’t as easy or as fast as we had sales opportunities that arose after originally thought. Since it wasn’t our alpha version was completed. Distributor: Midway

GAME DEVELOPER NOVEMBER 1997 http://www.gdmag.com SOAPBOX by Jack Heistand

Nature vs. Nurture: Growing up Online

he entertainment software industry is poised put down roots. We’re all learning a lot. It’s time for for great expansion thanks to the potential us as an industry to get together and determine a business model that makes that online multiplayer gaming represents. sense for the consumer, the developer, the publisher, and everyone else The question on many people’s minds is not involved. It’s time for us as an industry T to share learning; for distribution of whetherTthere is a business here, but for online play, the chances of your that learning. The time for smoke and 64 when this business will take off? game being a hit plummet.” The reac- mirrors and the circulation of misinfor- Gamers have voted with their purchas- tion among publishers right now is mation is over. In that spirit, the fol- es and given clear, direct feedback to quite pragmatic: enable games for lowing is offered. publishers of packaged goods titles: “If online play and make online play as you don’t have a network component widely available as possible to drive retail sales. Some publishers are Priority One: Creating a Market putting up their own servers for matchmaking, such as e don’t have a true market yet, Blizzard’s Battle.net, while oth- W either in terms of the consumer ers are making their games audience or in terms of a broadly rec- available everywhere, as with ognized business model. The business GT Interactive’s BLOOD. model must be in place before the The risk with these audience really begins to arrive, or the strategies in the long current confusion in this market will term is that free online persist. Ultimately, the two broad mod- play will become a els up for consideration are advertising- commodity feature based and the “consumer-pay” model. that all games In the latter, any and all types of include by default. But hourly, daily, weekly, monthly, or where’s the real value yearly “pay-to-play” formats are coming back to developers included. There will be many different and publishers? With every- types of these pay-to-play formats for one providing online play some time, and that’s okay. With freely, I’m hard-pressed to understand regard to the ad-based business model, how we as an industry are growing it’s not here yet. the business and making the market Ad revenue will not create any mean- more vital. Delivering the best ingful value to developers and publish- online game experience for the ers for at least three years. If there is growing communities around games one publisher who has gotten a royalty isn’t an easy or inexpensive exercise. check from advertising of even Unfortunately, the free online gam- $10,000, please stand up and show us ing networks are providing subpar the money. Meanwhile, many of TEN’s experiences. Consumers obtaining content partners have already seen six- their first experience in suboptimal figure royalty payments, thanks to our settings such as these will be unlike- subscription revenue stream. ly to come back to online gaming The lowest barrier to entry for suc- anytime soon, and will likely balk cess today is to be a developer and/or at paying for the privilege. In publisher of online-only content. The addition, the more broadly a big guys aren’t focussing in on it. They title is distributed to various can’t afford to take their best talent off online gaming solutions, the of predictable retail franchises and harder it is for a community to Continued on page 63.

GAME DEVELOPER NOVEMBER 1997 http://www.gdmag.com Continued from page 64. ness. The former needs to win as a cant revenue source for online gaming send them on fishing expeditions. The publisher first; they’ve struggled for companies and their content partners, best and breakthrough content will over five years to build only a 5% mar- some official, independent auditing come from smaller companies like ICE ket share in gaming. Their first goal mechanism is necessary. While TV has Online, VR1, Multitude, and others. will be to try to topple EA. I’d rather be the Nielsen ratings, radio has Arbitron, locked in a jail cell with a hungry Mike and magazines have the BPA, the Tyson than take on EA. The business is Internet, and online gaming in particu- Priority Two: Games and Gamers just too unpredictable and Microsoft lar, has no such means of validation. lacks the leverage that it typically For the free sites out there, the num- o truly grow the online gaming enjoys. At the same time, AOL needs bers cited seem to reflect unique visi- T market segment, developers must applications that drive usage for as tors who have come to the sites at least do a better job of addressing the needs many of their 8-10 million subscribers once. A better approximation of a site’s of the audience through the games as possible. INN’s hearts and cribbage “active member base” is a must if themselves. are the focus for now. We as an indus- advertisers are ever to begin taking this • Communities are loyal to games first, try cannot, and should not, rely on market seriously. Currently, the best genre second, and nothing else. these mainstream industry leaders to approximation of a site or service’s • Consumers want to compete. They dictate the evolution of the online active member base can be obtained by want tournaments, they want nation- gaming business. tracking peak simultaneous usage — al game play, and they want to The consoles are coming. The PC has the number of users a service attracts at understand their personal rankings had the opportunity to distinguish its busiest times of day. As a rule of 63 relative to the other competitors. itself as the sole Internet access thumb, peak usage runs about 4% of • The best games are organic. They provider and make serious inroads on the total active member base. This evolve and grow over time to reflect the console dominance in electronic equation yields that most of the free the needs of the community. This entertainment. That window will soon services are overstating their active isn’t limited to role-playing games; begin to close. With the console com- base by a factor of four or five. In total, witness QUAKE and DUKE NUKEM 3D. panies, it seems highly unlikely that there are about 150,000 PC games Wherever possible, this organic the publishers will have much say in enthusiasts who have signed up to metaphor should be extended to the online business model. While con- TEN, Mpath, and the Internet Gaming include and involve the user: provid- soles suffer from the finite lifespans of Zone combined; the rest are either ing a game’s community with the their audiences, which are not portable duplicate accounts or one-time, “tire- tools to extend the game is far easier from one platform to another, the big kicking” curiosity-seekers. These esti- than doing it “in house” and adds a winners — Nintendo and Sony — have mates are reinforced by a recent IDSA sense of involvement that sophisti- enough critical mass if they build the study that found that 4% of the 3.5 cated gamers appreciate. communities at initial ship. What hurt million PC game enthusiasts have sub- • The technical hurdle of latency must the Sega Channel was its launch at the scribed to an online gaming service. be further overcome in order to truly peak of the 16-bit market. By the time So what does all this mean? It means grow the online gaming business. they had amassed 200,000 online that online gaming has a lot of grow- Only then will online games rise to users, there was little new content ing up to do. Where do we begin? We mass market proportions with the coming. Not to mention that in Sega’s must come to some agreement on the advent of new genres such as sports business model, publishers received direction this market segment will take simulations and fighting games. only a few cents on the dollar. Ouch. and work with some level of coopera- Game design should address latency Instituting some standards will help tion to move in that direction. Let’s where possible — either in the opti- ensure that when the console compa- face it: Online gaming can be as signifi- mization of data transmission or by nies enter the online gaming market in cant to the entertainment software creating “cheats” and workarounds a significant way, there will already be industry as the video rental business is that make latency less of an issue. But in place established and accepted para- to Hollywood. Or we can continue to equally important and often over- meters and guidelines. muddy our own waters and watch a looked is the need to reach true con- Database and billing administration potentially lucrative market remain a sumerization of online gaming is a nightmare. It took TEN three niche play. ■ through better ease of use and instal- months after commercial launch to Jack Heistand is the president and CEO lation. There is huge room for iron out most of the kinks. As of this of Total Entertainment Network, a com- improvement in this area. writing, we’ve sent 16 consecutive bills mercial online gaming service with three out. I don’t think there’s an off-the- distinct revenue streams: subscriptions, shelf application that will work here. advertising, and technology/brand licens- Priority Three: The Need for We probably would be better served as ing. Heistand previously served as senior Standards an industry to agree on one application vice president of corporate business devel- and embrace that. opment at Electronic Arts, and also held or most industries, to grow far There are wild figures being bandied senior management positions with Hearst F beyond the “start-up” phase, some about regarding the numbers of users Magazines, where he was the founding standards are a must. Microsoft and on systems. To the extent that advertis- publisher of SmartMoney and The Wall AOL are not serious about the busi- ing is, or eventually can be, a signifi- Street Journal Magazine. http://www.gdmag.com NOVEMBER 1997 GAME DEVELOPER