NOVEMBER 1998

GAME DEVELOPER MAGAZINE

V GAME PLAN

600 Harrison Street, San Francisco, CA 94107 t: 415.905.2200 f: 415.905.4962 w: www.gdmag.com The Second-Title Trap Publisher Cynthia A. Blair cblair@mfi.com EDITORIAL Editor-in-Chief ame development is no And here we go down the spiral. Wheee! Alex Dunne [email protected] walk in the park, especially If you find yourself in this situation, Managing Editor when it comes to managing my condolences. Your management Tor D. Berg [email protected] Departments Editor G the business aspects. And skills will be put to the test, and hard Wesley Hall [email protected] possibly the most stressful period for a decisions regarding layoffs, budgets, and Art Director studio is when it finds itself falling vacation plans will be forced upon you. Laura Pool lpool@mfi.com behind schedule. One tidbit of advice: if your publisher is Editor-At-Large Chris Hecker [email protected] Missing a milestone has several rami- ranting at you over a blown deadline, Contributing Editors fications. The two most notable side maintain your cool. It’s an emotional Jeff Lander [email protected] effects are a souring of the developer- time, and taking the high road rather Mel Guymon [email protected] publisher relationship and the post- than getting into a war of words will Omid Rahmat [email protected] Advisory Board ponement of milestone payments. The help preserve your relationship. Hal Barwood LucasArts latter is especially serious for developers, Of course, there are ways to avoid Noah Falstein The Inspiracy and can propel a studio into crisis falling into this morass at all. Account Brian Hook id Software Susan Lee-Merrow Lucas Learning 2 mode. Creditors go unpaid, medium- for downtime in your budget. When fig- Mark Miller Harmonix and long-term planning go out the win- uring out how much money you need Paul Steed id Software to complete a title, factor in a couple of Dan Teven Teven Consulting dow, and the team pulls together to sat- Rob Wyatt DreamWorks Interactive isfy immediate goals. months’ worth of operational capital to If these consequences weren’t bad get by after the product is completed. ADVERTISING SALES enough, often it gets worse. Pressures Don’t tap into that money if you run Western Regional Sales Manager Alicia Langer alanger@mfi.com t: 415.905.2156 can lure developers into the "second- short. Instead, immediately go back to Eastern Regional Sales Manager title trap.” Faced with a high burn rate your publisher, confess that you’ve gone Kim Love klove@mfi.com t: 415.905.2175 and limited funds to complete a title, over budget, and face the music. Sales Associate/Recruitment it’s common for a development studio Running out of money before you deliv- Ayrien Houchin ahouchin@mfi.com t: 415.905.2788 to pull some people off of the current er the title puts you in a better position ADVERTISING PRODUCTION project to put together a design docu- than if you run out after you’ve deliv- Vice President Production Andrew A. Mickus ment for a second title, in the hope that ered the completed product to your Advertising Production Coordinator Dave Perrotti after a couple of months and more con- publisher. The undelivered product is Reprints Stella Valdez t: 916.983.6971 tract negotiations, a publisher will your only leverage during development. MILLER FREEMAN GAME GROUP MARKETING green-light it. The second revenue Never factor royalty payments into Group Marketing Manager Gabe Zichermann stream would offset the lagging mile- your business plan. Think of royalties as MarComm Manager Susan McDonald stone money from the first project, bonuses or stock dividends (windfall). If Marketing Coordinator Izora Garcia de Lillard buoying the company for a while. your budget depends on royalty pay- CIRCULATION Watch out. Don’t forget that many ments from your games, rest assured Vice President Cirulation Jerry M. Okabe publishers insist on the first right of that you’ll run out of money. Assistant Circulation Director Mike Poplardo refusal for a developer’s second title, so Don’t wait until the last second to put Circulation Manager Stephanie Blake the developer has to approach his cur- together a design document for the sec- Circulation Assistant Kausha Jackson-Crain rent publisher first. If the first project is ond title. Presenting a publisher with a Newsstand Analyst Joyce Gorsuch going poorly, this publisher probably second proposal earlier forces the pub- INTERNATIONAL LICENSING INFORMATION knows it, and is therefore bargaining lisher to either fund it or fan it more Robert J. Abramson and Associates Inc. from a position of strength. If the pub- quickly. If it decides to pass, you can President Libby Abramson 720 Post Road, Scarsdale, New York 10583 lisher gives the second project the pursue other publishers before the cash t: 914.723.4700 f: 914.723.4722 thumbs-up, this contract will probably from the first project dries up. If possi- e: [email protected] be much less favorable for the developer ble, plan two titles from the start, using Miller Freeman than the previous one. two different publishers. Of course A United News & Media publication If the publisher punts on the second you’ll want to stagger the delivery dates. Chairman-Miller Freeman Inc. | Marshall W. Freeman project, the developer may decide to Finally, brush up on your business President/COO | Donald A. Pazour look for funding elsewhere. So now the management skills. I highly recommend Senior Vice President/CFO | Warren “Andy” Ambrose Senior Vice Presidents | H. Ted Bahr, Darrell Denny developer, who hasn’t been talking up Gordon Bell’s High-Tech Ventures: The Galen A. Poss, Wini D. Ragus, Regina Starr other publishers in a while, must shop Guide for Entrepreneurial Success (Addison Ridley, Andrew A. Mickus, Jerry M. Okabe the second project around the industry. Wesley, 1991). Bell’s been around the Vice President/SD Show Group | KoAnn Vikören Senior Vice President/Systems and Software Back in the office, the original game block many times, and the case studies Division | Regina Ridley may fall further behind because key in his book offer priceless lessons. ■ staffers are absent. Bills for plane trips BPA International Membership and hotel rooms from the far-flung Applied for March 1998 schmoozing trips pile up in the office.

GAME DEVELOPER NOVEMBER 1998 www.gdmag.com SAYS YOU

Indie Game Festival? Take Two. even a completed independent game companies developing a product for, may be found there (in a relaxed say, a popular console, must do so in venue). the usual entanglement of legal secre- here's our Sundance? (from Tony Van cies and NDAs, as well as laboring under W September 1998 GamePlan) Producer, Electronic Arts the financial responsibilities of licenses, What a strange question. By your own development kit purchases, and other admission, Sundance is used to I agree complications. screen completed films. How Got an idea? E-mail us at with your Maybe the landscape for indepen- many games do you know of [email protected]. Or write to Game editorial dent development would be different if that are actually completed Developer, 600 Harrison Street, San in Game things like the black PlayStation without a publisher paying the Developer (Yaroze) were more widespread. The bill? An indie market doesn't exist. Francisco, CA 94107. 100 percent. problem is, once you're involved in Instead, you would be more likely to see As a developer for technology, you're involved in licens- a "technology Sierra, I see how large companies are ing. Software products don't stand demo" of a incapable of exhibiting the faith and alone as autonomous entities the way game vision required to break out of the "How films do (meaning: platform and hard- which do we copy id this time?" mentality. ware, not marketing and distributing). may Marketing drives the industry more There are so many other problems — “wow” than the talent. "How do we sell this to the time to develop a game vs. the time 4 — but Wal-Mart?" becomes the make or break to shoot a film (16 weeks for a film this isv moment for a game concept. compared to over a year for a game), like watching a Continuing with your Hollywood the presence of independent sources of trailer instead of a completed film. analogy, too many games are put into money for filmmaking, and so on. The Indie films are financed out of pocket, production on pitches such as, "It's a notion that a team of developers can in the hope that the producers will gain cross between QUAKE and DIABLO with a bring a product to bear, showcase it, big when a distributor picks it up. There little MYST thrown in." OpenGL, only to then have it picked up and dis- are over 80 years of procedure and DirectX, and the Internet have provided tributed is, frankly, almost absurd. analysis for how a film producer will indie developers with all of the resources There are currently a number of festi- make his money back, including the needed to make a great game but little vals which highlight the underground fact that technology for showing the chance to get that game to market. of digital filmmaking (D.FILM, media already exists in mass formats. An added benefit, if this could grow ResFest), and perhaps something that Every time a movie shows, the producer to other cities, would be the contact provides a showcase for all indepen- gets a check. between gameplayers and developers. At dent digital creativity (games, films, Currently, the best an "Independent screenings, indie filmmakers get instant animation, graphic design, and the Game Producer" could see is his money feedback on what worked and what like) would be more likely to succeed. back (ooh) and perhaps a small royalty didn't allowing them to improve on the As a video maker and game animator (the bulk of it goes to the game develop- next one. Game players also get insight myself, I would be more interested in a ers) if the game's sale recoups its cost. If into why decisions are made in the project that is more encompassing. the game fails, that's it, it's gone forever games they like or don't like. E3 does Let's not forget that Sundance has (no market for residuals, as old games not provide that kind of contact. become an inflated feeding frenzy, crit- are low tech.). Being an independent Jim Edwards icized profusely and abandoned by game producer would be great for tax via e-mail many members of the independent write-offs, but not much for income. film community. Indie films are also quickie films. The Your idea promoting the organization Sean Capone production is complete in under a of an independent game developer festi- via e-mail month. Games can take 6 to 12 produc- val is intriguing, but given the nature of tion months (especially if low budget). the software development industry, I'd That's a lot of time to have one's money be surprised to see anything like it take tied up with no guarantees. Bottom line, shape. E3, obviously, is not a festival so this business needs to mature and much as it is a conference — a place Due Credit for the October Cover Image. become more profitable. Then, and not where established companies showcase The Skaar from GT Interactive/Epic before, we can have comparisons with their products before other industry MegaGame’s UNREAL, was modeled by Sundance (or the Oscars or Variety, or executives, and where even smaller Dave "Motornerve" Carter. Dave built many other Hollywood examples we do development houses typically have the this image with Kinetix’s 3D Studio R4, not currently fit). support of a larger parent company. To BonesPro from Digimation, and propri- Now the obvious. E3, as you noted, is bring a game concept to playable demo etary texture-mapping tools. It should not the Sundance equivalent. But the level, much less completion, requires a be noted that the image shows actual Computer Game Developers lot of resources (money, talent, equip- in-game models, skins, and environ- Conference [now the GDC] is as close ment, salaries, and so on) that don't ments. Dave can be reached at as you are going to get today. exist in the same way that they do in [email protected]. Networking, seminars, demos and yes, the film industry. To top it off, smaller

GAME DEVELOPER NOVEMBER 1998 http://www.gdmag.com New Products: RTIME Interactive Networking Engine V3.0, 3Dfx’s Glide 3.0, and Okino’s new version of PolyTrans p. 6

Industry Watch: Many mergers, ups and downs at 3Dfx, and Broderbund’s layoffs p. 8

Product Reviews: Intel’s VTune 3.0 News from the World of Game Development and Sonic Foundry’s Acid p. 10

Distributed Timebase Manager (to keep color brightness control), vertex layout New Products global time synchronization), the support for complete control over indi- Realtime Filter Manager (uses affinity- vidual vertices, and an extension mech- by Wesley Hall based data distribution to determine anism to allow developers to add addi- the appropriate information to send tional functionality and optimizations. each player in realtime), the Intelligent The Glide software developer’s kit New Network Engine Update Manager, and Server-to-Server (SDK) is available free of charge via the RTIME recently released the latest ver- Communications. These features are 3Dfx web site. The kit also includes 6 sion (V3.0) of the RTIME Interactive beneficial for many game genres, Glide programming libraries, tools, and Networking Engine, a scalable, high- including action, strategy, sims, sports sample code. Glide 3.0 and its SDK are performance client/server networking titles, and persistent worlds. RTIME available for download immediately. engine that supports real-time, multi- V3.0 is currently being integrated into ■ Inc. player gaming over both the Internet several fall titles, including Acclaim’s San Jose, Calif. and Local Area Networks (LANs). TUROK 2: SEEDS OF EVIL, and Ripcord’s (408) 935-4366 The engine enables game developers SPECOPS: RANGERS LEAD THE WAY. http://www.3dfx.com and publishers to build or port multi- The RTIME Client runs on Windows player games to the Internet. This new 95, Windows NT, SGI, and Solaris. The release is built on top of a completely RTIME Server runs on SGI, Solaris, and Updated PolyTrans rebuilt core engine, extends the Windows NT. A development-only ver- OKINO recently updated its stand-alone engine’s performance and capabilities, sion is available for Windows 95. PolyTrans Model Translator (for and includes new features in response ■ RTIME Inc. Windows and SGI) to version 2.2. to the requests of RTIME’s customers. Seattle, Wash. PolyTrans is a model translation pro- One such feature is the new RTIME (206) 281-7990 gram that allows 3D models and scene Integrated Server. Now RTIME-enabled http://www.rtimeinc.com files to be converted between various games no longer require a dedicated industry standard file formats in their server to act as a host. A client applica- entirety. Rather than convert just sim- tion can now link directly with a local Glide 3.0 ple geometry and some material attrib- server library that services all other 3DFX just announced Glide 3.0, the new utes, the PolyTrans program converts connected gamers. V3.0 also helps version of its low-level software inter- every aspect of a file so that the trans- reduce bandwidth consumption face that enables control of the compa- lated file is "render ready.” New fea- through the use of server-side dynamic ny’s Voodoo family of graphics chips. tures include: animation conversion, filter management. The Parallel Glide can serve as the primary appli- auto-bitmap conversion for RIB WorldMasters feature extends the previ- cation program interface (API) or may exporter; animation conversion ous WorldMaster (a server-side, super- work in conjunction with another API between 3D Studio MAX, Lightwave, client used to drive inanimate objects, to enable optimal acceleration on 3Dfx RIB, and DirectX; Direct plug-in sup- provide server-based authority and hardware. The API is designed specifi- port for 3D Studio MAX v1.2, v2.0, security, maintain scores, and so on) to cally and only for 3Dfx hardware. Glide and v2.5; support for several new file enable multiple copies to run in paral- 3.0 is more streamlined than previous formats; and fully integrated trimmed lel. Each one can be used to control dif- versions in an effort to make it easier to NURBS support. ferent simulations in the virtual world. write complex games or applications PolyTrans is available for Windows Other new features include the ability that can fully take advantage of present 95/NT and SGI. Pricing starts at $395 to specify restriction information on and next-generation 3Dfx chips. Glide (PC, Windows) and $495 (UNIX). public and private objects, enhanced 3.0 utilizes triangle strips and fans, and ■ Okino Computer Graphics Inc. transport directives, and streamlined has new features including gamma table Mississauga, Ontario object-level API. These build on already support for complete control over light- (905) 672-9328 existing functions such as the ing brightness (including individual http://www.okino.com

http://www.gdmag.com NOVEMBER 1998 GAME DEVELOPER BIT BLASTS

Sperry and Louis Castle have agreed to 3Dfx section within their 450 nation- Industry Watch five-year employment contracts, and wide stores. This 3Dfx-only area will sell will remain with Westwood. 3Dfx-related hardware and software by Alex Dunne DISCREET MAX! The 3D tools industry products, such as the Diamond Monster has seen quite a bit of activity lately, Fusion and Creative Labs' 3D Blaster EIDOS announced record results for the and plots continue to unfold. Following Voodoo2, plus 3Dfx-optimized titles three months ending June 30. It saw closely on the heels of Microsoft’s sell- such as UNREAL, NFL GAMEDAY '99, NEED record revenues to the tune of £25.8 off of Softimage to Avid, Autodesk FOR SPEED 3: HOT PURSUIT, and FINAL million (up from £9.4 million last year), acquired Discreet Logic for $520 mil- FANTASY VII. ■ amounting to a net loss of £3.0 million lion, creating quite a powerhouse of (compared to a £6.8 million loss last digital content creation tools. As a year). In other news, the company result, Autodesk's Kinetix division has acquired Crystal Dynamics in a deal val- merged into the new Discreet division, UPCOMING EVENTS ued at about $47.5 million, but don’t and tools such as 3D Studio MAX will expect any Gex-Croft collaborations. now carry the Discreet name. GT BAGS FUGITIVE. GT Interactive NEW PARADIGM. In the world of real- Game Developers Conference acquired equity interest in Fugitive time 3D tools, MultiGen and Paradigm RoadTrip: Seattle 8 Studios, a recent startup cofounded by Simulation merged, creating MultiGen- Greg Williams, James Phinney, Jess Paradigm Inc. MultiGen, with its strong WASHINGTON STATE CONVENTION McReynolds, and Brian Sousa. Many of modeling tool Creator (recently high- AND TRADE CENTER the Fugitive employees were among the lighted in the August 1998 Postmortem Seattle, Wash. November 9-10, 1998 contingent that bolted from Blizzard of Atari’s SAN FRANCISCO RUSH) is a good $225 after STARCRAFT shipped. In the deal, GT match-up with Paradigm’s simulation www.gdconf.com/1998/road- gets exclusive global publishing rights to tools, such as Vega. MultiGen will con- trips Fugitive software titles for both PC and tinue its operations in San Jose, and console platforms, plus print and mer- Paradigm offices will remain in Dallas, chandising rights. Fugitive’s first title and the two firms will combine their Game Developers Conference will be an “innovative 3D game” for the worldwide sales operations. RoadTrip: Austin PC, and should ship in late 1999. 3DFX’S MIXED NEWS. The burgeoning AS EXPECTED, Broderbund layoffs will 3D hardware market isn’t all happiness AUSTIN CONVENTION CENTER be heavy as a result of the company’s and joy. In fact, it’s getting awfully Austin, Texas acquisition by The Learning Company. crowded on those store shelves. 3Dfx November 16-17, 1998 Approximately 500 of Broderbund’s announced that its Q3 retail sales fig- $225 1200 jobs will be trimmed. Half of these ures would be lower than anticipated, www.gdconf.com/1998/road- cuts will come from Broderbund's due a slowdown in the retail channel. trips California operations in Petaluma Now there’s a glut of 3D inventory in (which is closing this month) and the hands of retailers, and the company Novato. The company hasn’t yet decid- is pinning hopes on a healthy Game Developers Conference ed where the other 250 layoffs will Christmas season to clear out some RoadTrip: S. San Francisco come from. inventory. Assuming there’s no increase LUCASARTS SIGNED an exclusive two- in demand, 3Dfx anticipates losing sev- SOUTH SAN FRANCISCO CONFERENCE CENTER year publishing and distribution agree- eral million dollars at the pre-tax oper- South San Francisco, Calif. ment with Activision, whereby ating level for its third fiscal quarter. November 21-22, 1998 Activision will handle all upcoming LA Fortunately for the firm, its recent set- $225 titles in the United Kingdom, tlement with Sega (over the www.gdconf.com/1998/road- Scandinavia, Central Europe, the Middle deal) gave it some wiggle room, and trips East and certain African countries. 3Dfx still anticipates a profitable third ELECTRONIC ARTS completed its previ- quarter. Following 3Dfx’s announce- ously announced acquisition of ment, Robertson Stephens downgraded Digital Content Creation Westwood Studios from Virgin 3Dfx shares from "Strong Buy" to "Buy", Interactive Entertainment (which is and the stock at press time is trading at LOS ANGELES CONVENTION CENTER itself a division of Spelling its 52-week low (about $9). Los Angeles, Calif. Entertainment Group). As a result of the On the upside for 3Dfx, software December 2-4, 1998 $595 $122.5 million cash deal, Westwood retailers Babbage's and Software Etc. just www.dccexpo.com Studios becomes EA’s tenth studio. Brett announced the creation of a special

GAME DEVELOPER NOVEMBER 1998 http://www.gdmag.com BIT BLASTS

QUICK START. The first time you run new window showing hotspots in that VTune, you’ll see an Easy Start menu module. Then you’d select the hotspot with three options: Quick Performance that interested you — and pop up Analysis, New Project Wizard, and another window. Eventually, you’d get Open VTune Project. All of these tasks to a window with a source or disassem- are just as easily accomplished from bly view. To make matters worse, you’d the File menu, and you have the frequently have to perform these opera- option of turning off Easy Start. tions by selecting a -wide bar with Quick Performance Analysis samples your mouse, and VTune’s hit testing the current CS:EIP of each processor — was sometimes off by a couple of ! VTe 3.0 yes, VTune 3.0 supports multiprocessor Now, VTune opens the hotspot win- systems — every millisecond for 20 sec- dow for the main module automatical- by Dan Teven onds. It automatically charts the results ly, saving a step. And you don’t get a by process, by processor, and by mod- new window every time you zoom in; f it seems as though we’ve devoted ule, in three tabs of a single window. A instead, windows are recycled. It’s still a lot of coverage to Intel’s VTune second window shows the hotspots possible for the hotspots to be a pixel Iprofiler this year, you’re not imag- within the main module you’ve speci- or two wide, and I wish Intel would 10 ining it. Ron Fosner awarded four stars fied. The main module doesn’t have to implement a magnifier tool to make to VTune 2.5 in an April review. Then be an executable file; it can be a .DLL, the selection process easier, but the we wrote up VTune again, in June, an .OCX, a device driver, a Java class, mouse click precision bug is fixed. when it won the Front Line Award for or even an object module. Whether you’re looking at graphs Programming Utilities. And now, Quick Performance Analysis is an or raw sample data, time-based or despite déja VTune, I’m going to tell excellent place to begin when you’re event-based sampling, or static or you why release 3.0 is worth an addi- profiling anything that takes less than dynamic code analysis, all windows tional half star. 20 seconds. The two-window view is share the same main menu and tool- I’ll assume you’ve seen an earlier just right. You not only find the bottle- bar. This is a big improvement. In incarnation of the product, or at least necks in your main module, you find earlier releases, where windows had read Fosner’s review (which is online at out if other modules are consuming their own individual interfaces, I www.gamasutra.com/tools/reviews/). more time than you expected. often had trouble figuring out how to While VTune has always been a great Behind the Easy Start menu, the old get from point A to point B. product for optimization junkies, its postage-stamp-sized main window The source and disassembly views old user interface was seriously flawed (with multiple pop-ups) has been haven’t changed much since earlier — Fosner called it “cluttered” and superseded by a full-size main window releases. It’s easy to see where you’re “annoying.” Happily, Intel has jetti- (with multiple children). Child win- spending CPU cycles, and VTune does soned the old UI and replaced it with a dows can be tiled, minimized, and an excellent job of explaining pairing far superior one. maximized. Not only is this layout issues and execution penalties. I was Releases of VTune have always more familiar, it’s less cluttered. happy to find the reference manuals advanced the art of performance mea- The Navigator window, down the left for the Pentium Pro instruction set and surement, and 3.0 is no exception. side of the screen, is a tree control that for Intel’s MMX intrinsic functions You can now view an annotated func- lets you switch quickly among myriad added to the online help. Likewise, the tion-call hierarchy, showing explicitly sampling sessions and views of the data. event-based sampling feature hasn’t how many times a function was I like this feature, but I do some of my changed much. called as well as the time taken by the work on a notebook with a 640×480 CALL GRAPH ANALYSIS. Consider a pro- function and its descendants. You can display, and it’s not worth the screen gram that decompresses a bitmap and also correlate operating system events real estate in that situation. then, accidentally, copies it to the such as context switches or page DRILLING DOWN. More improvements are screen twice. Hotspot analysis by itself swaps with your application’s behav- evident as soon as you try to drill down won’t reveal the problem. Say you pro- ior. The new information dovetails to the instruction level. In earlier ver- file with VTune 2.5 and observe that nicely with conventional hotspot sions, you would start with a system- half the time is spent in your decom- analysis, resulting in a more complete wide view and select the module that pression code, with the rest spread out picture of performance. interested you. This would pop up a among the operating system (BitBlt) and video drivers. You optimize the decompressor, but the program’s still Not so long ago, Dan Teven was obsessed with making a really cool game go really, too slow, and you’re stymied. really fast. This morning, he saw the game in a bargain bin for $15. Write him at Fortunately, VTune 3.0 lets you do [email protected] to commiserate. call graph profiling. This means collect-

GAME DEVELOPER NOVEMBER 1998 http://www.gdmag.com Excellent Very Good Average Below Average Poor ing data about every function call in Essentially, VTune tracks various events your program: not only who called during the session — processor events, whom, but how many times, and how such as cache misses, or OS events, much time elapsed between the func- such as page swaps (the same ones you tion call and the return. You find that a can display in System Monitor) — and decompression call takes twice as long graphs the data over time. Selecting a as a call to BitBlt; from the hotspot time range on the graph opens a new analysis, you’d have expected the calls window illustrating the modules that to take equally long. This can only were active during that time period. mean you’re calling BitBlt too often. However, sometimes the window VTune reveals the extra call, from an wouldn’t open. And when the feature unexpected place. Bingo — another 25 worked, there wasn’t much feedback to tried to statically analyze an object percent speed improvement. confirm what I was viewing. module from a ROM BIOS. VTune can I’m a firm believer in using call-tim- CODE AND SYMBOL FORMATS. VTune 3.0 parse COFF object files, but not ing data to crosscheck hotspot data. In supports C/C++ compilers from Intel’s own OMF. fact, I’ve often instrumented my pro- Microsoft, Intel, Inprise, Watcom, and WRAPPING IT UP. There’s a lot that I jects with function timing calls. Now IBM; Java compilers from Microsoft, didn’t discuss here, because Intel had 11 that I can use VTune to gather the Inprise, and Asymetrix; Delphi, from the good sense not to fix what wasn’t same information — more thoroughly Inprise; Microsoft Visual Basic; and broken. Instead, they fixed all the bugs and with better viewing capabilities — Intel’s Fortran. Most PC games in that used to frustrate me, added a cou- I’ll be retiring that code. development are Windows 98 titles ple of features from my wish list, and The only downside to call graph pro- using one of these compilers (OK, made the product a lot easier to use. filing is that it affects the performance maybe not the Fortran). Some features This is a mandatory upgrade, and if of a program. The instrumented calls aren’t available with all compilers. In you don’t already own the product, are slower to execute, and the extra general, the closer you are to the main- you’re in for a treat. code can have adverse effects on the stream of development, the more fea- One important feature remains on cache. VTune gives you some basic tures are supported. my wish list: an API. I’d like to be choices about which modules to instru- Alas, VTune won’t be of much help able to write loaders for different ment, but I’d really like to see an API in speeding up any legacy tools upon module types, monitors for different so I could have fine-grained control. which you may still be relying. I was performance events, and filters for dif- CODE COACHES. VTune now has code able to profile a DOS-extended build ferent output formats. I’d like to be coaches for five languages: C, C++, tool running in a DOS box. Unfor- able to control VTune’s behavior from Java, Fortran, and assembly. The tunately, I couldn’t get VTune to map my program. I’d even like a redistrib- coaches are surprisingly skilled. I ran the samples to instructions properly, utable run-time module, so I could the C coach on a program with an and I had to correlate the results write a program that monitored its obvious bottleneck: a brute-force check manually. I had even less luck when I own performance. for duplicate strings in a list. The bot- tleneck is so obvious that a comment in the source code warns about it and VTune 3.0: suggests binary searching as a fix. Company: Intel Corp. Pros: Cons: VTune not only recognized that the Santa Clara, Calif. 1. Shows performance 1. Needs an API that devel- problem lay with the algorithm, it (800) 253-3696 information in abundant opers can use to control offered better advice than the com- http://developer.intel.co detail, by instruction, and extend the product. m/design/perftool/vtcd/ ment, suggesting both binary search- module, process, or 2. Data in Chronologies ing and hashing as solutions. Price: $429 ($169 upgrade processor. view is hard to correlate from any previous ver- The assembly coach, which is new in 2. New call graph profiling with other views. sion) 3.0, looks for assembly-level optimiza- feature counts, times, 3. Limited support for non- System Requirements: and charts function calls. tions such as instruction scheduling Windows code running Windows 95 or 98, and partial stall elimination. It won’t 3. Code coaches and online on the Intel architecture. Windows NT 4.0 (SP3) or help are excellent teach- find much that a good optimizing NT 5.0 beta 2. Intel ing tools. compiler wouldn’t, but it would be an Pentium, 32MB RAM, excellent learning tool for an assem- 50MB disk space. The bly-language programmer. event-based sampling feature requires a EVENT CHRONOLOGIES. Two new features Pentium Pro family that promise more than they deliver processor. are Processor and OS Chronologies. http://www.gdmag.com NOVEMBER 1998 GAME DEVELOPER BIT BLASTS

one-shots don’t loop — they tend to be note for transposition, number of beats crash cymbals, drum hits, vocal snip- and/or tempo for time scaling, and so pets, and so on. Disk-based files are forth. This pane also lets you access a often larger files that Acid can get off Mixer application, which presents level disk as the project plays. So you might controls for all wave devices installed build a rhythm track out of a bunch of in your system (nice — discrete outs drum and bass loops, then load in (or for multiple sound cards). Finally, there record) a long vocal track to play along are tabs to select settings for up to with it. That file would be a disk-based eight DirectX-compatible effects plug- stream by default. If for some reason ins (I used some CFX plug-ins installed you wanted to load it into RAM, and by Cakewalk Pro Audio 6.01). had enough available, you could over- The first thing that’s noticeable about ride the default settings to do just that. using Acid is that it has essentially no The program presents a screen split learning curve. If you’ve ever done any- into three adjustable viewing panes: the thing with computer audio before and Soic Fod Acid Track View, the Track List, and a multi- have even a basic idea of how looping function section that can be set to works in a musical context, you’ll be 12 by Andrew Boyd show an Explorer, an Edit Window, a making music in minutes. The program Mixer, or Effects plug-in pages. The pri- ships with a number of very usable cid is not, and is not intended mary pane is the Track View — this is loops on its CD (additional Loop to be, a standard multitrack where you put together loops, draw Libraries from Sonic Foundry are about A audio environment. Unlike automation curves (“envelopes” in Acid $60), and these are a great place to Pro Tools or Cool Edit Pro or even digi- parlance), drop markers, and so on. start. Set the bottom pane to Explorer tal audio sequencers, Acid is completely Though this section looks a lot like a view and locate the loops on the CD. focused on building music from loops. typical multitrack editing environment, As you click on them, they’ll automati- You can’t do much in Acid that you its function is pretty different. For cally play an audible preview. When couldn’t also do in one of these other instance, a given track can only hold a you find one you like, a double-click environments, but if you find yourself single sound. It can be any supported will add it to the Track List and create a making music out of looping audio, type and can have as many instances as track for it in the Track View pane (you you won’t find an easier, faster, or more you want, but you can’t slip a drum fill can also drag and drop it into either fun program in which to do it. And into a space in a drum loop track to pane). Click and drag anywhere in the Acid does offer enough peripheral fea- save tracks — the fill will initiate its Track View with the pencil tool (here’s tures to make it flexible. It isn’t perfect, own track. The down side is that pro- one of those really innovative features), but it is very impressive, and it could as jects build up a lot of tracks very quick- and you’ll draw a perfectly looped and easily find a place with a complete ly and viewing and navigating through quantized bit of that sound. Oops, novice as with a hardcore professional. them can become a bit of a chore. dragged for five bars instead of four! Essentially, this is a product you proba- The Track List sits next to the Track Hold the cursor near the end of this bly didn’t know you needed, but that View and provides the name of the file chunk of sound and it becomes a trim- once you’ve tried, you won’t give up. in the track, an icon to indicate its ming tool. Click and drag back and it USING ACID. Acid isn’t so much about type, and some mixing controls (level, will snap to the next bar (or whatever composing or even editing as it is pan, effects sends, output assignment, quantization resolution to which you’re about assembly. It accepts sound files solo, and mute). The bottom pane has currently zoomed). On the next track, of three basic types (in several formats) a number of modes selectable by stan- drop another loop that works well with — loops, one-shots, and disk-based — dard Windows-style tabs. Most often I the first (because tempo and key are and gives you a set of specialized tools used it in Explorer mode, where it pro- matched automatically, nearly every- with which to piece them together. vides a standard Windows Explorer thing sounds good together), draw a Loops and one-shots tend to be short view from which to select loops and section of it out, and a song is born. sounds loaded in RAM (Acid provides a sounds to load into the project. Repeat until done. RAM monitor so you’ll know when Another mode allows for “Acidizing” a WILL COMPOSE FOR FOOD. Of course, if you’ve filled available memory). The loop, which involves adding propri- you really consider yourself a musician main difference between them is that etary information, including a root or a composer, there’s a chance Acid will insult you. Let’s face it: it’s cheat- ing. Using Acid to compose music is Andrew Boyd has been creating sound for games since 1993. He now runs Audible like sculpting with Legos rather than Images, a music and sound design house in San Francisco, Calif. He can be reached at [email protected]. clay. One method requires talent, skill, training, and patience while the

GAME DEVELOPER NOVEMBER 1998 http://www.gdmag.com Excellent Very Good Average Below Average Poor other… well, if you have thumbs to Also, the mixing function- grasp the pieces, you’re pretty much ality is too limited. For on your way. Still, schedules and bud- instance, while eight effects gets being what they are for game sends is pretty generous, sound, you’ve probably found yourself because individual tracks building pieces entirely out of samples don’t have even simple EQ and loops anyway. Why not make it controls, if you want EQ easier on yourself? You’ll be able to put (and to mix a lot of pre- together polished pieces that impress made loops well, you will) clients in no time, you’ll own the you’ll have to start burning license to the music, and you’ll even through those sends. Because have fun. If you know music and the source material is usually audio, your Acid arrangements will be a bunch of little files, it’s the better for it, plus you’ll work faster easy and fast enough to pop them into power, occasionally peaking as high as and more efficiently. your wave editor (a single button- 70 percent. Enabling some time and One potential use for this program in click), EQ them, and reopen them in pitch scaling added around 5 to 10 a serious music environment is as a Acid. But given the clean, simple percent to these numbers. But on a 13 writing or practicing tool. Use it as a approach of the rest of the program, it current, fast machine you should run super sophisticated drum machine — doesn’t seem as though that should be out of the desire to add loops or effects get a CD full of drum loops, pick out a necessary for so fundamental a process. before you run out of horsepower. couple that fit the direction you want PERFORMANCE. Sonic Foundry has obvi- WHAT A TRIP. When I first heard about to go, and set them to looping. Then ously got some real throbbing-brain Acid, I thought it seemed like a good you can play your own parts — say on types engineering its stuff. Acid’s per- idea, but I really didn’t see the point. a guitar — over the loops until you get formance is stunning. My test machine I’ve built plenty of pieces of music out them just right. Want to change the ran Windows 95 on a not-very-impres- of licensed loops and samples, and I tempo? Just drag the slider (no process- sive-anymore Pentium 200MMX with have plenty of tools with which do it. ing all the loops and reloading them 64MB RAM and a Turtle Beach But as I started playing with this tool, I into the project or any of that kind of Pinnacle sound card. Acid was always thought about how many hours of my nonsense). Add a baseline to fill out the quite responsive, even while playing life have been sunk into searching groove and you can easily transpose its huge projects with time and pitch scal- around for that perfect loop at the key too. When your jam sounds good, ing and a couple of effects plug-ins right tempo, trying to pitch-adjust all you can record the guitar part right running. Specifically, I noted the fol- the loops in a song individually so into Acid along with the rhythm track, lowing: on a 15-track piece with no they’ll work in the right key, and so and then export it as a sound file to time or pitch modulation and a CFX on. Acid does what it does so well, and whatever program you use for final two-band EQ on FX1 and a CFX is just so much fun to use, that I have production. Acid doesn’t really have Reverb on FX2, the program used little doubt it will soon be a standard the features to do a full production, but about 50 percent of available processor audio tool. ■ as an accessory to a more general tool, its simplicity and ease of use can free up time and creative energy. Sonic Foundry’s Acid: Which brings me to a few of Acid’s Company: Sonic Foundry Pros: Cons: limitations and shortcomings. For Madison, Wis. 1. Very fast and transparent 1. Somewhat inadequate instance, because each loop gets its own (800) 57 SONIC way to assemble loop- mixing functionality. track, screen real estate becomes very http://www.sonic based productions. foundry.com 2. Limited built-in wave precious very quickly. The ability to 2. An interface so intuitive editing. Price: $399 resize the various viewing panes pro- it’s actually fun to use. 3. Homemade loops require vides some flexibility, and there is a System Requirements: An 3. Excellent sounding (and more fine-tuning than Intel Pentium 133 or zoom shortcut menu available through efficient) real-time pitch claims indicate. Alpha AXP microproces- a simple right-click, but the only real and time scaling algo- 4. As fun as it is, it’s a bit sor, Microsoft Windows rithms. solution is to run in absurdly high reso- 95 or Windows NT 4.0 or pricey for a toy — make lutions. I tested at 1,024×768, and it later, a Windows-com- 4.Ability to utilize discrete sure you actually have a outputs is a nice touch. use for it. wasn’t nearly enough to get a good view patible sound card, a of the piece being edited. I don’t have a VGA display, a CD-ROM drive, 32MB RAM, and suggestion for how to show the infor- 5MB hard-disk space for mation better, but the way it is now can program installation. get pretty frustrating on a big project. http://www.gdmag.com NOVEMBER 1998 GAME DEVELOPER by Mel Guymon ARTIST’S VIEW

Painting With Vertex Colors

et another weapon in the arsenal of today’s 3D artists, vertex colors allow us to get more bang for our pixel buck without spending an iota of texture space. Most of today’s cutting edge 3D engines support light- Y ing of some sort, either dynamic or precalculated, and in many cases, this is done through the use of color • Color vertices can be procedurally add areas of shadow to your environ- vertices. Color vertices allow us to give generated through lighting ments. Typically, large flat floors are life to our environments through the • Color vertices can be procedurally made up of a minimum number of use of light and shadow, and also allow generated through texture sampling. polygons simply for efficiency. Yet, as us to alter the colors of our 3D models While there are many capable pro- Figure 1 shows, trying to use color ver- without changing the textures or map- grams on the market that support and tices to represent cast shadows requires 25 ping coordinates. Although the tech- allow modification of color vertices, that you have sufficient vertices to add nology for using color vertices has we’ll only be looking at two, 3D Studio color. You may find yourself doing been around almost as long as we’ve MAX 2.5 and Softimage 3.8. some tesselating in certain areas simply been rendering polygons, the applica- VERTEX COLOR LIMITATIONS. The main limi- to get enough vertex resolution. tion and widespread use of the tech- tation when working with color ver- BASIC COLOR THEORY. There are many niques has been largely ineffective due tices is that you need to have a vertex excellent references on this topic, and to limited on-screen polygon counts. in order to have vertex color. This com- it helps to have an idea of what works This is yet another example of how the mon-sense notion comes into play par- before sitting down to add lighting to increase in rendering power of today’s ticularly when you use color vertices to a scene. Here are some very general hardware accelerators has an unexpect- ed side-benefit. This month we’ll look at three exam- ples of how to use color vertices to our advantage, and also talk about the tools and technology that make these changes possible.

Terms and Definitions

OLOR VERTEX. In many real-time 3D C engines, the RGB value of each vertex is stored right along with the geometry. In most cases, this value is normalized to somewhere in the lighter end of the spectrum (on a scale from 0 to 255, values of 175, 175, 175, or about 2/3 the distance between black and white). If at some point in the data generation process these val- ues can be altered, we can add and adjust the colors in our geometry with- out spending any of our valuable tex- ture space. GENERAL COLOR VERTEX APPLICATION. Color FIGURE 1. When using color vertices to represent cast shadows, you must have a vertices derive their color through a sufficient number of vertices to add color. combination of up to three basic processes: Mel has worked in the games industry for several years, with past experience • Color vertices can be modified by at EIDOS and Zombie. Currently, he is working as the art lead on DRAKAN hand, by directly choosing the color (www.surreal.com). Mel can be reached via e-mail at [email protected]. of each vertex http://www.gdmag.com NOVEMBER 1998 GAME DEVELOPER ARTIST’S VIEW

principles to remember when working allows the user to “bake” the colors want to color, then you execute the with color: into the vertices based on the material RenderVertexColors utility. The pro- • Colors affect emotion. Reds are hot properties and lighting in the scene. gram then renders the object internal- and elicit excitement and restless- It’s actually as simple as it sounds; you ly, and determines the color of each ness, while cool blues and warm select the object whose vertices you vertex based on the lighting and/or greens tend to engender feelings of happiness and calm. • Color affects perception. Objects that are lighter in color appear larger, especially when placed in dark spaces. The flip side is true as darker objects appear smaller. • Complementary colors contrast. The boundary between complementary colors acts as a focal point; choose yellow lights to highlight areas in a blue-lit environment, red for cyan, and so on. • Color balance is key. Subtle lighting 26 effects are usually more effective in setting the mood; try to stick with two or three colors in each scene.

Environmental Lighting

n this case, we’ll look at environ- I mental lighting with procedural color generation through raytraced lighting. Most 3D engines support real-time dynamic lighting using sim- FIGURE 3. The wireframe scene after the application of textures and a generic ple point lights in 3D space. These lighting model. lights can greatly enhance the mood of an environment, but can be com- putationally expensive. In this exam- ple, we look at how to create a lighted environment in Softimage without using any real-time lights. Although animation is probably Softimage’s real strength, Softimage does have a rather robust native mod- eling and texturing package, as well as a color vertex utility called RenderVertexColors. This aptly named plug-in, found in the Matter module,

FIGURE 2. Wireframe-rendered envi- FIGURE 4. The scene was lit using several point lights, and then the lights were ronment in Softimage 3.8. removed, so that the lighting values remain, stored in the vertices.

GAME DEVELOPER NOVEMBER 1998 http://www.gdmag.com texturing of the object. The vertex is time is often wasted if the geometry polygon-count considerations. Don’t then assigned that color, and the data needs to be modified for game play or be afraid to use primary colors. A good is hardcoded into the geometry. The lights can now be removed from the scene and the geometry exported to the 3D engine. In Figure 2, we have a Softimage wireframe of a scene in a real-time 3D game. Figure 3 shows this same scene with a generic lighting model and tex- tures applied (this is similar to what we usually see in most 3D engines: a statically lit world with some areas of color). Figure 4 shows the result of lighting the scene with several point lights, removing those lights, and then storing the lighting values “in the ver- tices.” Note that to light this single scene in real-time with eight to ten lights would bring most 3D engines to 27 a shuddering halt, yet we’ve accom- plished the same result without the use of a single real-time light. SUGGESTIONS FOR IMPLEMENTATION. Leave the lighting alone until the final pass. Taking the time to get the lighting right can make the difference between a really stunning environment and FIGURE 5. Character before the addition of color vertices in 3D Studio MAX 2.5. one that’s just run of the mill. But this

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

lighting scheme is a blend of both we’ll look at ways to accomplish the Colors. Vertices receive their color data high and low-saturation light sources, same effect using 3D Studio MAX’s ver- either from a texture map or from blue/yellow, purple/orange, purple/ tex coloring tool without adding a sin- lights in the scene. We can also modify green, and blue/red combinations are gle pixel to the texture budget. the vertex colors by selecting the ver- all pretty safe. 3D Studio MAX’s Assign Vertex tices and assigning the colors directly. Procedural coloring routines, such as Color utility works in much the same Figures 5 and 6 show a player character the one in this example, are fine for way as Softimage’s RenderVertex- in a “before” and “after” mugshot. To making macroscopic adjustments to ter- rain and environments, but what if you want to do some fine detail work, such as coloring the vertices on a character?

Hand-Adjusted Color

enerating color vertices based G upon lighting for characters is usually not effective. Characters tra- verse several lighting schemes while 28 interacting with their environments, so it’s virtually impossible to find a single set of color vertices that works for all cases. We can, however, modify the color vertices by hand to give highly detailed results. Coming up with ways to distinguish between damaged and healthy characters without blowing a texture budget can drive a good texture artist off the deep end. In this example

FIGURE 6. Hand-painted color vertices using MAX’s Assign Vertex Color utility.

FIGURE 7. The two textures that cre- ate the terrain in Figure 8. FIGURE 8. Textured terrain using color vertices.

GAME DEVELOPER NOVEMBER 1998 http://www.gdmag.com get this same effect using textures, we would need to dupli- cate the entire set of textures for the face and upper body. Furthermore, until we get a really good 3D paint tool, the process of painting blood onto a character is anything but an exact science; you’ll end up swapping back and forth between paint programs and 3D programs to get it right. To achieve this effect using vertex colors literally took about five minutes. Using MAX’s vertex selection tool, you simply select the vertices you want to color, and then select the color you want. The process is fully interactive, and the result updates in the shaded window as you change the col- ors. This same method can be used on static objects to create the illusion of dirt and grime, or to make an object appear damaged. The only limitation is the number of vertices in the model, because the resolution of the color vertices is directly linked to the detail you can achieve. SUGGESTIONS FOR IMPLEMENTATION. Most engines allow you to store multiple versions of each object, usually for level of detail. One way to take advantage of this process is to store multiple versions with identical vertex counts, but with differing color vertex sets. And because the storage space required for 3D geometry is virtually nothing compared to that required for texture space, it’s possible to get a large degree of diversity at virtually no expense. The last exam- ple uses both of the previous techniques, as well as a third aspect of the color vertex process: baking a texture map into the geometry.

Large-Scale Terrains

ne of the problems encountered by people doing flight- O sims is how to texture map extremely large expanses of terrain. This is one case where the application and use of color vertices provides an interesting solution to an otherwise daunting problem. Figure 7 shows the two textures that were used to create this terrain. The first is a simple color gradient and the second is a tiling noise map. The gradient texture is applied with a hori- zontal projection, so that vertices of a given height all corre- spond to the same color. Note the high, uniform vertex densi- ty in this example — this would probably represent a fairly highly detailed patch. Figure 8 shows the fully lit terrain after the application of color vertices, and the small noise map which serves to pro- vide the requisite pixel detail. Again, note that there are no lights in this scene; the lighting information has already been stored in the color vertices. The final result is pretty impres- sive, since we only take up around 20K of texture space, and we get several square miles of detailed terrain in the bargain. SUGGESTIONS FOR IMPLEMENTATION. Try a combination of all three processes; bake the lighting and texture values in, and then go back and adjust areas of interest by hand. Try using a high-density mesh with a top-down project of a photo- realistic texture map, then go back with a noise map and tweak the result. We’ve just scratched the surface when it comes to ways to effectively use color vertices, and with our polygon-budgets continually on the rise, we are sure to see even more. Special thanks to Melisa Bell, Hugh Jamieson, Hayley Reed, and Louise Smith. ■ by Omid Rahmat HARD TARGETS

Trends in the Sales Channel

here are many changes happening in software sales channels today. As a result, the opportunities for game publishers and developers are shifting. This is especially true for game companies in the PC sector; the large chains T and the big warehouse clubs are eating up the market. The value of PC game sales through direct mail vendors, don’t want to stock hardware, peripherals and software the various retail channels comes to a large selection of titles. These firms (and the commensurate margin about $3 billion. Let’s look at how these want to pitch a product, get the order, squeeze that accompanies this kind of 4,200 titles find their way into homes. collect the money, and ship it from a selling), the computer superstores want consignment warehouse belonging to a publishers to prominently display their distributor or publisher. To get 4,200 titles and offer them at low prices to 31 Skewed SKUs SKUs out before the public would boot. This is how Broderbund keeps require one monster consignment ware- selling copies of MYST and Print Shop ccording to PC Data, software and house, and I doubt that level of coopera- Deluxe: the titles are easy to recognize, A computer stores carry approxi- tion between the various publishers and easy to find, and a nice item to dunk in mately 1,500 SKUs each (these include distributors will happen anytime soon. the shopping cart as a person walks all software — games, applications, utili- What about taking the Internet to the down the aisles. Unfortunately, not ties, and so on). Direct mail vendors next step and making it a delivery vehi- every publisher can afford lavish dis- carry nearly 700 SKUs, and the Wal- cle for software as well? Ideally, con- plays or cut margins enough to succeed Mart-types carry about 500 software sumers would embrace the idea of pur- in computer superstores. titles. (Note that CompUSA, with over chasing and downloading a title, Next, let’s examine consumer elec- twenty thousand square feet of store thereby eliminating the box and printed tronics stores. These stores, such as Best space, carries fewer than 6,000 SKUs.) documentation. But at today’s retail Buy and Circuit City, currently sell Compare these numbers to a large prices that’s a no-go. Psychologically, tremendous amounts of software. bookstore like Barnes & Noble, which when you pay big money for goods you Recently, though, they have begun to can carry up to 12,000 book titles at any want something more substantial than cut back on their computer products one time. Granted, there may only be a three-hour download. Hence, I’m not sections to enlarge their consumer elec- one or two copies of some books in enthusiastic about the Internet’s tronics and appliances sections (which stock, but most titles can sit there on chances as a fulfillment mechanism. have fatter margins and are poised for the shelf quite happily for six months or high growth with the emergence of digi- more. Unfortunately for us, these condi- tal television products). So I don’t view tions don’t apply to software. Software Segment and Conquer stores like Best Buy as a source of growth retail establishments simply don’t have for the PC game industry. enough shelf space for all of the titles ’ve noticed an interesting phenome- Toy stores such as Toys ‘R Us can’t the game industry puts out, and this I non in the retail sales channel: the help the PC game industry much. The shortage of “shelf space” is especially best place to sell game titles is not nec- young demographic of the Toys ‘R Us detrimental to independent developers essarily the best place to buy game titles. shopper certainly appeals to publishers and self-publishers. (Although, sadly, For example, although a computer store of console games, but not necessarily to since the top ten game titles account for like CompUSA or Fry’s Electronics may PC games publishers. 15 percent of all the game industry’s continue to be the primary source of revenue, the lack of shelf space might be sales for PC games by market share (see a moot point.) Table 1), these types of stores don’t ful- A Console Future? Internet game sales aren’t even a blip fill the entire game industry’s needs. on the radar right now. Many publish- The reason is that computer stores cater ’m more optimistic about console ers, however, feel that the Internet to all computer users, from novice con- I games. Console game publishers are could account for as much as 20 percent sumers all the way up to large corporate not too reliant upon the traditional soft- of all revenues within the next five buyers. With a desire to move volume ware retail channels like CompUSA, and years. Could this be possible? Even if this prediction pans out, I don’t think Omid Rahmat works for Doodah Marketing as a copywriter, consultant, tea boy, and that we will see a jump in the number sole employee. He also writes regularly on the computer graphics and entertainment of SKUs retailers put before consumers. markets for online and print publications. Contact him at [email protected]. The reason is that Internet vendors, like http://www.gdmag.com NOVEMBER 1998 GAME DEVELOPER HARD TARGETS

TABLE 1. Top retailers by software sales alone (Source: Computer Retail Week).

Store Type Name Number of Total Software Sales Stores ($M)

Consumer Electronics Store Best Buy 285 $3,422.00 Computer Store CompUSA 153 $3,178.00 Office Superstores Office Depot 565 $2,350.00 Consumer Electronics Store Circuit City Stores 493 $1,810.00 Computer Store Computer City 96 $1,375.00 Office Superstores Staples 523 $1,250.00 Office Superstores OfficeMax 713 $1,080.00 Computer Store Micro Center 13 $1,030.00 Department Store Sears, Roebuck 835 $890.00 Warehouse Clubs Sam's Club 444 $728.00 Computer Store Fry's Electronics 16 $705.00 Mass Merchants Wal-Mart Stores 1,700 $700.00 Warehouse Clubs Costco 204 $502.00 32 Consumer Electronics Store RadioShack 6,906 $341.00 Military Store Army Air Force Exchange 142 $305.00 Software Stores Egghead Computer 86 $280.00 Computer Store PC Warehouse 82 $263.00 Software Stores Electronics Boutique 470 $229.20 Computer Store J&R Computer World 1 $195.00 Consumer Electronics Store Future Shop 27 $194.80 Software Stores Babbage's Etc. 466 $175.00 Consumer Electronics Store Sun TV & Appliances 48 $160.00 Consumer Electronics Store The Good Guys! 76 $140.00 Retail Dealer Computown 5 $140.00 Retail Dealer Creative Computers 8 $126.00 Consumer Electronics Store Nobody Beats the Wiz 49 $125.00 Retail Dealer Computer Renaissance 187 $107.00 Bookstore Barnes & Noble 1,013 $105.00 Consumer Electronics Store Nationwide Computers 4 $95.00 Computer Store CDW Computer Centers 2 $84.00 Toy Store Toys R Us 686 $75.00 Retail Dealer PC Club 15 $73.00 Warehouse Clubs BJ's Wholesale 87 $70.00 Mass Merchants Target Stores 799 $69.00 Computer Store RCS Computer Experience 2 $59.00 Music Stores Musicland 226 $58.00 Consumer Electronics Store P.C. Richard & Son 40 $57.80 Consumer Electronics Store American TV 8 $56.40 Retail Dealer SBI Computer Warehouse 6 $56.00 Retail Dealer Computer Ware 10 $52.00 Computer Store DataVision 1 $50.00 Retail Dealer Lucky Computers 18 $48.00 Retail Dealer Computer Town 7 $46.00 Direct Mail Global DirectMail 2 $25.00 Direct Mail Micro Warehouse NA NA Direct Mail Insight Enterprises NA NA Direct Mail PC & Mac Connection NA NA Direct Mail Multiple Zones NA NA Direct Mail Damark NA NA

GAME DEVELOPER NOVEMBER 1998 http://www.gdmag.com with Sega, Sony, and Nintendo spend- big publishers have already started to direct sales. The losers in this scenario ing hundreds of millions of dollars on filter the titles carried by outlets such will be the small retailers who can’t Christmas promotions and sales, the as CompUSA and Wal-Mart. These compete with the superstores or take a console industry is set for healthy retailers see the game market as benefi- slice of the direct marketing business. growth for the next two years. cial to their business, but they will I believe that PC game development The onslaught of console marketing become increasingly stringent about is going to shrink in the next two dollars means that direct channels, such what products make it to their shelves. years, and be replaced in part by con- as mail order and Internet sales, have Just look at the way EA and GT sole development projects. The cost of the most potential for the PC game Interactive already control their chan- goods and sales on games will rise, industry. The factor damping the nels. The publishing community is while the retail prices will continue to growth of these direct channels is sim- becoming a closed set, a private club drop. These big publishers with large ply the present industry structure. The with a waiting list. catalogues of titles and economies of top ten PC game publishers are loathe The only option available to small scale will be the firms that flourish. ■ to damage their existing distribution publishers and developers going the channels, limited or not, by putting too self-publishing route is to circumvent much emphasis on direct sales. So the the whole process – to market directly Top Ten Entertainment Software two-tier distribution model (where a big to the consumers. It’s analogous to the Publishers In Computer Retail Channels distributor warehouses products, takes situation facing the makers of PC orders directly from retailers, and ships clones. These firms must market direct- 1. Cendant these stores their inventory) will not see ly via mail order and the Internet, too. 2. Broderbund 33 any significant changes for some time. Some clone vendors may someday 3. The Learning Company grow up to be the next Dell or 4. EA Gateway, but for most that’s a long 5. GT Interactive Putting the Squeeze On way off. 6. LucasArts Entertainment PC game developers have to start 7. Microprose hat we can expect from the viewing publishers as brand equity in 8. Interplay W top-ten PC game publishers is the channel. If developers want inde- 9. Activision that they will squeeze more out of the pendence, they must look for niche 10. Mindscape existing distribution channels. These audiences that can be targeted with

http://www.gdmag.com NOVEMBER 1998 GAME DEVELOPER Run

GAME DEVELOPER NOVEMBER 1998 http://www.gdmag.com raphics programmers are constantly looking Gfor ways to improve the realism of the Time graphics in games. One of the simplest techniques employed to do this is tex-

ture mapping, and

MIP-MapMiP-Mapwhile

does add considerable realism to a scene, it 35 FilteringFiltering also adds a number of new problems. The by most obvious visual problems that appear when using Andrew Flavell textures in a scene are the aliasing artifacts that are

visible when texture-mapped polygons are some dis-

tance from the viewpoint. If you’re moving rapidly

around your virtual world, these artifacts appear as

flashing or sparkling on the surface of the texture. Or,

if the viewpoint is fixed, the artifacts appear as

unwanted patterns within the texture after it has been

mapped to a polygon. This is clearly visible in Figure

1, where the checkered texture map becomes distort-

Illustration by Robert ed as its distance from the viewpoint increases. Zammarchi

Andrew Flavell is yet another out-of-work PhD grad, wondering why he spent all of those years at school studying graph-theory and Markov models. Questions regarding the article and job offers can be sent to [email protected]

http://www.gdmag.com NOVEMBER 1998 GAME DEVELOPER MIP-MAPPING

FIGURE 1. Checkerboard with no MIP-mapping.

36 MIP-mapping helps alleviate this problem. The acronym tion within the samples to appear as a sine wave of lower fre- MIP comes from the Latin phrase multum in parvo, meaning quency than the original. From these figures, we can guess “many things in a small place.” Researchers at the New York that for complete recovery of a sampled signal, the sampling Institute of Technology adopted this term in 1979 to frequency must be at least twice that of the signal being describe a technique whereby many pixels are filtered and sampled. This is known as the Nyquist limit. So, from where compressed into a small place, known as the MIP-map. To does the seemingly magic value of twice the signal being see how MIP-maps improve visual clarity, see Figure 2, in sampled come? In order to answer, that we’ll have to digress which MIP-mapping with bilinear filtering has been used to a bit further and take a stroll into the Fourier domain. smooth the texture. In order to understand what is what’s causing the prob- lems in the Figure 1, you have to look within the texture- A Stroll in the Fourier Domain mapping renderer and understand how the process of sam- pling the texture maps affects what’s displayed on the complete discussion of Fourier theory could take up sev- screen. Look at Figure 3A, in which a sine wave is being sam- A eral books by itself, so for those of you who haven’t suf- pled at a much higher frequency than the wave itself. As you fered through a signal-processing course at college, I suggest can see, a fairly good representation of the wave can be that you take a look at the text by Bracewell that’s mentioned obtained from these samples. However, if the sampling fre- at the end of this article. What follows is a very limited intro- quency drops to exactly two times the frequency of the duction to Fourier transforms and sampling, but it should be wave, as shown if Figure 3B, then it’s possible that the sam- enough to demonstrate how the Nyquist limit is derived. pling points will coincide with the zero crossing points of Figure 4A shows a plot of the function h(t)=sinc2x and a the sine wave, resulting in no information recovery. plot of its Fourier transform, H(f). It’s convenient to think of Sampling frequencies of less than twice that of the sine wave H(f) as being in the Fourier (or frequency) domain and of being sampled, as shown in Figure 3C, causes the informa- h(t) as being in the time domain. (If you’re wondering why I

FIGURE 2. Checkerboard with MIP-mapping and bilinear filtering.

GAME DEVELOPER NOVEMBER 1998 http://www.gdmag.com 2 chose to use sinc x for this example, it’s because it has a sim- pling frequency drops below 2fmax, adjacent spectra overlap ple plot in the frequency domain.) To convert from the time at higher frequencies, and these frequencies are then lost in domain to the frequency domain, the following transform is the resulting signal. However, instead of disappearing com- applied to h(t): pletely, these high-frequency signals reappear at lower fre- ∞ quencies as aliases; this is where the term aliasing originat- − π Hf( ) = ∫ hte( ) ift2 dt ed. To prevent aliasing from occurring, either the signal −∞ being sampled must be bandlimited to less than 2fs or the Eq. 1 sampling frequency must be set to be higher than 2fmax. In this form of the Fourier transform, f defines the frequen- cies of the sine waves making up the signal, and i =−1 tells us that the exponential term is complex (that is, it has both real MIP-Mapping Basics and imaginary parts). The operator ⊃ is often used to denote “has the Fourier transform,” so we can write h(t)⊃H(f). Figure et’s look at how MIP-mapping helps to reduce aliasing 4B shows the train of impulses used for sampling and the L artifacts in our texture-mapped image. Remember that Fourier transform of the impulses. An impulse, denoted as texture mapping is designed to increase the realism and δ(t), is a theoretical signal that is infinitely brief, infinitely detail in scenes. However, all of the fine details in the tex- powerful and has an area of one. An interesting property of ture maps are effectively-high frequency components and an impulse train with a period of Ts is that its Fourier trans- they are the cause of our aliasing problems. Since we can’t ∆ ∆ form is an impulse train with a period of 1/Ts. really modify our sampling frequency (1/ U and 1/ V in the ∞ texture-mapping portion of our renderer), we have to filter 37 1  fn−  ∑∑δδ(tnT− ) ⊃   the textures to remove the high-frequency details. s T  T  n=−∞ s s Although it would be possible to filter each individual Eq. 2 texel at run time, this would require a significant amount The effect of sampling h(t) with the sampling function s(t) of effort. To get around this problem, we can use MIP- is shown in Figure 4C. In the time domain, the sampling can maps, which are made up of a series of prefiltered and be thought of as multiplying h(t) by s(t), and in the frequen- prescaled textures. The filtering of the textures either can cy domain, it can be thought of as the convolution of H(f) be carried out during the startup of your game, or you can and S(f).

ht( ) st( ) ⊃ H( f) * Sf( ) FIGURE 3. Sampling a sine wave with varying sampling intervals. Eq. 3 Convolution of any two functions f(x) and g(x) is given by 1 ∞ f( x) * gx( ) = ∫ fugx( ) ( − udu) −∞ Eq. 4 1 2 3 4 5 If the thought of plugging the Fourier transforms of both h(t) and s(t) into Equation 4 has you wanting to skip to the current Soapbox article (p.72), just hold on a second — it -1 isn’t as bad as it looks. The convolution of a single impulse A. located at t=t0, with h(t) is just the value of h(t) shifted to that location. 1 ∞ ( ) δδ( − ) = ( ) ( −−) =−( ) ht* tt00∫ hutt uduhtt 0 −∞ Eq. 5 1 2 3 4 5 We can apply the result of Equation 5 to find the convolu- tion of H(f) and S(f). 1  fn−  -1 ht( ) st( ) ⊃ ∑ H    TssT B. Eq. 6 1 Equation 6 simply means that the result of the convolu- tion of H(f) and S(f) is such that H(f) is duplicated at inter- 2 vals of 1/Ts, as can be seen in Figure 4C. The sinc x function is bandlimited (that is, its bandwidth is limited) to f , so max 1 2 3 4 5 the only requirement needed to ensure that there are no overlapping portions in the spectrum of the sampled signal is that fs>2fmax, where fs=1/Ts. So, this is from where the -1 Nyquist limit comes. As you can see in Figure 4D, if the sam- C. http://www.gdmag.com NOVEMBER 1998 GAME DEVELOPER MIP-MAPPING

FIGURE 4. Fourier analysis of sampling.

h ( t ) H ( f ) 1

-2 -1 1 2 fmax A. s ( t ) S ( f )

38 1 Ts B. Ts h ( t ) s ( t ) H ( f ) * S ( f )

C. h ( t ) s ( t ) H ( f ) * S ( f )

D.

prefilter all of your textures during development. Another alternative with some graphics cards, such as those using the Nvidia RIVA 128 accelerator, is to have the card auto- matically generate MIP-maps for you when textures are uploaded into video memory. Figure 5 illustrates the pyra- mid-like structure formed by the MIP-map for a 64×64 pixel texture. As you can see in the figure, the level of detail (LOD) decreases as the MIP-map level increases. Once textures have been filtered, all you have to do at run time to achieve basic per-polygon MIP-mapping is to select the correct MIP-map level (or LOD) for the desired texture and pass this to the renderer.

Generating MIP-Maps

here are a number of ways to generate MIP-maps. One Toption is simply to prebuild them using a graphics process- ing tool such as Photoshop. The alternative is to generate your MIP-maps on the fly. Prebuilding MIP-maps requires about 30 FIGURE 5. A MIP-map pyramid. percent more storage space for your textures when you ship

GAME DEVELOPER NOVEMBER 1998 http://www.gdmag.com FIGURE 6. Texture distortion after perspective projection. X U

V

Y Screen space Texture Space 39 your game, but it gives you finer control over their generation associated with this texture to find the entry that most closely and it lets you add effects and details to different MIP levels. matches the desired color. This process is shown in Listing 3. Regardless of which method you choose, MIP-maps require 30 The color search process is quite simple, but it can be time- percent more storage space at run-time than the original tex- consuming, as we need to search the palette for a color match tures, so they can have a significant effect on your game’s for every pixel in each level of the MIP-map. Thankfully, this memory requirements. step is only required during the initialization of the MIP-map, Let’s begin by generating a MIP-map for an 8-bit texture. so it’s not much of a problem. However, if you want to per- Generating a MIP-map is a fairly simple process and form other effects during rendering (such as bilinear or trilin- although there are many possible filtering techniques that ear filtering), the search process will be too slow. could be applied during MIP-map generation, a standard box In this case, we’ll need to use 16- or 24-bit textures. Because filter usually suffices. The first level of the MIP-map is gener- most graphics cards currently support 16-bit screen depths, ated by taking the raw input texture and copying it directly we’ll use 16-bit textures here. The process of building MIP-maps into the MIP-map data structure shown in Listing 1. [In the for 16-bit textures is very similar to that used for 8-bit textures, interest of conserving editorial space, code listings are avail- as you can see in Listing 4. Because 16-bit textures don’t require able for download from Game Developer’s web site. -Ed.] a palette, averaging the color values from the four correspond- Creating the rest of the MIP levels of a texture is an itera- ing pixels in the preceding level directly gives each new pixel tive process. Each successive level of the MIP-map is generat- value. One problem that can occur as a result of repeatedly ed using the preceding, larger, MIP-map level. As each level averaging the color values for each LOD is that the texture map of the MIP-map is created, it’s stored consecutively in mem- will become darker at each successive LOD. You can compen- ory, and a pointer to the starting memory address of the MIP sate for this effect by adding a small amount to each color com- level is stored as well, so that the game engine can quickly ponent at each LOD, but this compensation usually isn’t neces- access the correct LOD during rendering. sary, as the loss of color during the entire process is very small. The first step in generating a new pixel value is to calculate the average color value from the four corresponding pixels in the preceding level, as shown in Listing 2. As there is a palette Applying MIP-maps at Run Time associated with the texture in this example, once the new color value has been calculated, we need to search the palette igure 6 shows some of the problems you can encounter F when selecting which LOD to apply at run time. In the fig- ure, the rectangular texture that’s mapped onto the triangle in texture space is transformed into a quadrilateral in screen space, and the perspective projection of the texture causes the

FIGURE 7. Texture mapping with incorrect LOD. FIGURE 8. Road rendered with per-polygon MIP-mapping.

http://www.gdmag.com NOVEMBER 1998 GAME DEVELOPER MIP-MAPPING

individual texels to become quadrilaterals of varying sizes. In a mapping. Another problem is that visible popping may case such as this, where the orientation of a polygon is skewed occur as a texture’s LOD is changed due to movement of the in screen space, determining the best LOD to apply to a poly- viewpoint (or the polygon). gon is especially crucial if you want to produce good visual AREA-BASED LOD SELECTION. Area-based LOD selection comple- results. If the chosen LOD is too high (the texture dimensions ments per-polygon MIP-mapping techniques. In this are too large), aliasing will occur in the texture. If the LOD is method, you select the LOD by determining the amount of too low (the dimensions of the texture are too small), then the texture compression that will be applied to the texture in image will appear blurred. For example, the LOD chosen for screen space. To determine the proper texture compression, the texture in Figure 7 is much too low, as can be seen by the you calculate the area of the polygon in screen space and the large texels visible in the inset zoomed image. Many different area, in texture space, of texture that is mapped onto the methods can be used for LOD selection, all of which have polygon. As shown in Listing 5, you can determine the ratio advantages and disadvantages. The two well-known methods of texels to pixels and then determine which LOD to use. The that we’ll examine here are the selection of the LOD based on u and v dimensions of each successive LOD are one-half the the area of the texture in screen space, and the selection of the size of the preceding LOD, so each successive LOD has one- LOD using the projected u and v vectors. quarter the area of the preceding level. During LOD selection, One further point to consider here is that it’s possible that a we step up one level in the MIP-map pyramid for each multi- different number of texels map to each pixel in screen space. ple of four that the texel area is greater than the pixel area. As a result, correct LOD selection requires calulating the LOD For example, if the texel-to-pixel ratio is 3:1, we would select for each pixel. Calculating which LOD to use can be quite MIP-map level zero, or, if the texel-to-pixel ratio is 7:1, we 40 slow; consequently most software renderers (and quite a few would select MIP-map level one. Once the LOD has been older hardware accelerators) calculate the LOD on a per-poly- selected, we can pass a pointer to the correct LOD, along with gon or per-triangle basis. An added advantage of per-polygon the LOD’s dimensions, to our normal texture-mapping rou- MIP-map selection, especially for software-based renderers, is tines. One problem with any approach that uses the project- that you can use smaller versions of textures for distant (small- ed area of the polygon and the texture area as the basis for er) polygons, helping to reduce the amount of processor cache LOD selection is that aliasing will tend to occur whenever a that’s required during texturing operations. However, per-pixel projected polygon is very thin, due to the anisotropic nature LOD selection lets you do a number of other things with MIP- of the texture compression (that is, the texture is compressed mapping, including point sampling, bilinear filtering within a more in one dimension than the other). single LOD, or trilinear filtering between the two closest LODs. Per-Pixel MIP-Mapping Per-Polygon MIP-Mapping er-pixel MIP-mapping offers far better control of LOD er-polygon MIP-map selection is the least expensive P selection than per-polygon MIP-mapping, and it also P method from a computational standpoint, becuse you permits additional texture filtering — but at some additional only do MIP-map selection once per polygon. There are, cost. All of the per-pixel methods require storage of the however, a couple of drawbacks to this approach. One prob- entire MIP-mapped texture in memory, and adding LOD lem is that adjacent polygons that share a texture may be selection to the inner loop of a renderer’s texture-mapping drawn using differing LODs; this will be appear as a disconti- routine can significantly reduce rendering performance. nuity in the texture when displayed on the screen (this is Fortunately, most of today’s 3D chips support per-pixel MIP- called MIP-banding). Figure 8 shows a small amount of MIP- mapping with bilinear filtering (a few of the latest devices banding that is occurring due to the use of per-triangle MIP- even support trilinear filtering), so we’ll look at what it takes

FIGURE 9. A single pixel back-projected into texture space.

P0 =()x,y P1 =()x+1,y P1 ' 2 v x ∂ 2 + u = u u x x ∂x ∂ Pu0'=(),v = v vx ∂ 1 Pixel x ∂ = u uy 2 ∂y u + y v 2 ∂ y v = v y ∂y P2' 1 P2 =()x,y + Screen Space Texture Space

GAME DEVELOPER NOVEMBER 1998 http://www.gdmag.com to implement sophisticated per-pixel MIP-mapping. Although we could use area-based LOD selection here also (we’d need to calculate the texture area underneath each pixel rather than for the entire polygon), we’ll look at an all- together more accurate method. EDGE COMPRESSION-BASED LOD SELECTION. In 1983, Paul Heckbert probably examined more LOD calculation techniques than he’d care to remember before he decided that techniques based on the compression that a texture suffers along the edge of a pixel seem to work best. Figure 9 shows a single pixel in screen space and the corresponding parallelogram in texture space. To prevent aliasing from occurring, we want to select FIGURE 10. Road rendered with per-pixel MIP-mapping the LOD based on the maximum compression of an edge in and point sampling. texture space. This corresponds to the maximum length of a side in texture space, which is given by Equation 7. Where a, b, c, d, e, and f are given by Equations 14  22++ 22 max uvxx , uv yy through 19. a =∗dUOverZdX dOneOverZdY - dOneOverZdX ∗ dUOverZdY Eq. 7

The values of ux, uy, vx, and vy are given by four partial deriv- Eq. 14 41 atives. Because we already know how to calculate the u and v b =∗dVOverZdX dOneOverZdY - dOneOverZdX ∗ dVOverZdY values for any pixel on the screen, we can use this knowledge to determine the partial derivatives. We know that, given the Eq. 15 u/z, v/z, and 1/z gradients in x and y, and the starting u/z, v/z, c =∗dUOverZdX OneOverZ - dOneOverZdX ∗ UOverZ and 1/z values at the screen origin, the u and v values for the 00 texture at any pixel can be found using Equations 8 and 9. Eq. 16 The notation in Equations 8 through 19 is derived from Chris =∗ ∗ d dVOverZdX OneOverZ00 - dOneOverZdX VOverZ Hecker’s series on perspective texture mapping, which can be found on his web site (see “Acknowledgements” for the URL). Eq. 17 =∗ ∗ e dUOverZdY OneOverZ00 - dOneOverZdY UOverZ dUOverZdX∗+xy dUOverZdY ∗+ UOverZ u = 0 Eq. 18 dOneOverZdX∗+xy dOneOverZdY ∗+ OneOverZ 0 =∗ ∗ UOverZ f dVOverZdY OneOverZ00 - dOneOverZdY VOverZ = Z Eq. 19 Eq. 8 An important point to note here is that the numerators of

∗+ ∗+ the partial derivatives ux and vx are functions of y only, and dVOverZdXxy dVOverZdY VOverZ0 v = the numerators of the partial derivatives u and v are func- dOneOverZdX∗+xy dOneOverZdY ∗+ OneOverZ y y 0 tions of x only. The values of a, b, c, d, e, and f are calculated VOverZ = once per polygon, along with the usual texture gradients, as Z shown in Listing 6. Finally, the formula for finding the max- Eq. 9 imum edge compression is given by Equation 20. We can use these results to find the partial derivatives, as 1 shown in Equations 10 through 13. Compression = max( xll,y ) Z2 Z∗−∗ dUOverZdX UOverZ dOneOverZdX cay+ where u = = x Z22Z  22 xl == ( c ay) ++( d by)  Eq. 10   Z∗−∗ dVOverZdX VOverZ dOneOverZdX dby+  22 = = yl == ( e ax) ( f− bx)  vx 22  Z Z Eq. 11 Eq. 20 ∗−∗ At first glance, it would seem that we would need to carry = Z dUOverZdY UOverZ dOneOverZdY = eay+ uy out a square-root function at each pixel. However, if you look Z22Z closely, you’ll see that we only need to compute yl once for Eq. 12 the polygon’s range of x values. Furthermore, we only need to

∗−∗ compute xl once per scan line. Listing 7 shows how we pre- = Z dVOverZdY VOverZ dOneOverZdY = fby+ vy compute the y values for a polygon’s range of x values during Z22Z l the normal set-up for texture mapping, and also that we only

Eq. 13 calculate xl once per scan line. We also don’t have to worry http://www.gdmag.com NOVEMBER 1998 GAME DEVELOPER MIP-MAPPING

FIGURE 11. Bilinear filtering calculation. U

T 00 ru T0 T01

rv FIGURE 12. Road rendered with per-pixel MIP-mapping

Tb and bilinear filtering. V be implemented using three linear interpolations. We calcu- late the correct LOD and retrieve the pointer to our texture in exactly the same way that we did with point sampling. T10 T T 1 11 However, we then retrieve four texture values and apply 42 bilinear interpolation to each color component to generate the new pixel value. Figure 12 shows our road after MIP- mapping and bilinear filtering. Although Figure 12 is an improvement over Figure 10, you can still make out the MIP-banding. Nothing has been done to remove the discon- tinuities that occur when we switch between LODs. T0 =T00+ ru ()T10- T00 TRILINEARLY FILTERED PER-PIXEL MIP-MAPPING. The current state-of- T1 =T01 + ru ()T11- T01 the-art for 3D hardware-accelerated MIP-mapping is trilinear Tb =T0 + rv ()T1 - T0 filtering. Trilinear filtering attempts to remove the problems associated with MIP-banding by smoothly blending between about the divide required for the denominator, because it’s differing LODs. As you can see in Listing 10, we once again already required for standard texture lookup. So the overhead calculate the correct LOD in exactly the same way that we did for the compression calculation within the texture-mapping it for point sampling, then retrieve pointers to the calculated inner loop is just two multiplies and a compare. Now that we LOD and the next lower LOD (the next level up in the pyra- know how to calculate the edge compression, let’s apply per- mid). Trilinear interpolation is implemented using eight lin- pixel LOD selection to our texture-mapping routines using ear interpolations. We begin by carrying out bilinear interpo- point sampling, bilinear filtering, and trilinear filtering. lation separately for each of the selected LODs, then finish off POINT-SAMPLED PER-PIXEL MIP-MAPPING. Point sampling is the by linearly interpolating between the two LODs. As you can simplest form of per-pixel MIP-mapping, and as you can see seen in Figure 13, trilinear interpolation does result in a in Listing 8, there isn’t much difference between our normal smooth transition between LODs (though the overall scene texture-mapping loop and one that uses point sampling. appears somewhat blurred). Unfortunately, this feature comes Once we’ve found the amount of edge compression for the at a considerable cost: the straightforward implementation of current pixel, we need to determine the correct LOD. The raw trilinearly filtered MIP-mapping presented here requires eight compression value ranges from a zero to one, but we need to texture accesses for each pixel and a considerable amount of scale it by the texture dimensions to get a meaningful height computation. Although it’s possible to cut down on the num- in our MIP-map pyramid. Once we have the height, we deter- ber of texture look-ups by saving texel values between loop mine the correct LOD by stepping up one level in the pyra- mid for each power of two that the height is greater than one. We then use our fast LOD lookup table to get a pointer to our texture and access the correct texel as usual. Figure 10 shows the same object that we used to generate Figure 8, but this time we’re applying point-sampled MIP-mapping. As you can see in the figure, the main problem with point-sampled MIP-mapping is that MIP-banding is clearly visible at the points where transitions between different LODs occur. This is because adjacent pixels can have different LODs, so a dis- continuity appears as we switch between LODs. BILINEARLY FILTERED PER-PIXEL MIP-MAPPING. Bilinear filtering attempts to further reduce any aliasing errors present in a scene by averaging the values of the four pixels that are clos- FIGURE 13. Road rendered with per-pixel MIP-mapping est to the real u and v texture values for each pixel. As you and trilinear filtering. can see in Figure 11 and Listing 9, bilinear interpolation can

GAME DEVELOPER NOVEMBER 1998 http://www.gdmag.com 43

FIGURE 14. Screen shot of CHAOSVR rendered using trilinear filtering on a Voodoo2. iterations, the interpolations themselves need to be per- and our scene will appear blurred. You can clearly see this formed for each loop, so achieving acceptable frame rates effect in Figure 14, which is a screen shot from the CHAOSVR with software-based trilinear filtering is very difficult. demo that was rendered using a card based on 3Dfx’s Voodoo2 chipset. This problem will occur with any 3D accelerator that uses methods similar to the ones that we’ve Closing Remarks developed here for calculating the LOD — not just the Voodoo2 card that I’m using. Clearly, the next step to e’ve covered a lot of ground for one article, and improve rendering accuracy will be to adopt some form of W although the output of our renderer using trilinear anisotropic filtering. I’m sure that it won’t be long before MIP-mapping is significantly better than plain old texture this capability appears on high-end accelerators. ■ mapping, it still isn’t perfect. The biggest defect remaining in our filtering is that, as I mentioned earlier, we’ve ignored Acknowledgements the fact that the texture compression is anisotropic. We’re Thanks go out to Chris Hecker who kindly allowed me to plug selecting LODs using the maximum compression along one my MIP-mapping into his texture mapping routines, saving me edge, but what if there’s a significant difference in the a lot of time. Check out Chris’s home page, http://www.d6.com/ amount of compression between each edge? In this case, the users/checker, for more information on texture mapping and LOD selected will be too low for the least compressed edge, his old columns from Game Developer. I’d also like to thank Paul Heckbert for taking the trouble to F O R F U R T H E R I N F O send me one of the first publications to ever discuss MIP-map- Bracewell, R. N., The Fourier Transform and its applications, ping. You can also find a lot of information about texture map- McGraw-Hill Book Co., New York, 1986. ping and myriad other graphics techniques on Paul’s home page Williams, L., “Pyramidal Parametrics,” Computer Graphics, http://www.cs.cmu.edu/afs/cs/user/ph/www/index.html. vol. 17, no. 3, (Proc. SIGGRAPH 1983). Finally, I’d like to thank Peter Laufenberg for allowing me to use Heckbert, P., “Texture Mapping Polygons in Perspective,” a screen shot from Virtually Unlimited’s CHAOSVR demo. You NYIT Tech. Memo No. 13, 1983 can find out more about the demo at http://www.virtually3d.com.

http://www.gdmag.com NOVEMBER 1998 GAME DEVELOPER POLYGON REDUCTION

f you’re a game developer, there’s a good

chance that 3D polygonal models are part

of your daily life and that you’re familiar

with concepts such as polygons per sec-

ond, low-polygon modeling, and levels of

detail. You probably also know that the

44 objective of a polygon reduction algorithm is to take a high- detail model with many polygons and generate a version I using fewer polygons that looks reasonably similar to the Ioriginal. In addition to talking about what polygon reduc- A Simle, Fa, tion is and why it is useful, this article explains one method for achieving it. Before going any further, I suggest you download my application, BUNNYLOD.EXE, which demon- strates the technique that I’ll explain. You can find it on the ad Effecie Game Developer web site. Polgo Motivation efore diving into a sexy 3D algorithm, you may be ask- B ing yourself if you really care. After all, there are com- mercial plug-ins and tools that reduce polygons for you. Redcio Nonetheless, there may be reasons why you want to imple- ment your own reduction algorithm. • The results of your polygon-reduction tool may not meet your specific needs, and you would like to build your own. Algoihm • Your current polygon-reduction tool may not produce the morph information that you require for smooth transi- by Stan Melax tions between different levels of detail. • You want to automate your production pipeline so that the artist has to create only one reasonably detailed model, and the game engine does the rest. • You’re creating a VRML browser, and you want to provide a menu option for reducing those huge VRML files placed on the Web by supercomputer users who didn’t realize the would be slower on a home PC. • Special effects in your game modify the geometry of objects, bumping up your polygon count and requiring a method by which your engine can quickly reduce polygon counts at run time.

Stan Melax is researching interactive 3D techniques and algo- rithms for his Ph.D. in computer science at the University of Alberta. He is also the Director of Technology at Bioware, where he had worked on SHATTERED STEEL and is now imple- menting cool stuff for their next 3D titles. He can be contacted via e-mail at [email protected].

GAME DEVELOPER NOVEMBER 1998 http://www.gdmag.com FIGURE 2. Edge collapse.

v v u

Before After

them (u) is “moved” or “collapsed” onto the other (in this case, v). The following steps implement this operation: 1. Remove any triangles that have both u and v as vertices (that is, remove triangles on the edge uv). FIGURE 1. Effect of Boolean operations on polygon count. 2. Update the remaining triangles that use u as 45 a vertex to use v instead. 3. Remove vertex u. Still not convinced? Figure 1 shows a concrete example of This process is repeated until the desired polygon count is an instance in which a game engine requires polygon reduc- reached. At each step, one vertex, two faces, and three edges tion capabilities. are usually removed. Figure 3 shows a simple example. At Bioware, I implemented real-time Boolean operations and used them in a game prototype that we developed to impress our publisher. Players could shoot and blast arbi- Selecting the Next Edge to Collapse trary chunks out of a solid object wherever they decided to point the gun. Modifying the game environment where the he trick to producing good low-polygon models is to bullets impact produces much more stunning results than T select the edge that, when collapsed, will cause the the typical “place pipe bomb here” technique, in which the smallest visual change to the model. Researchers have pro- game world only changes in a predetermined manner. posed various methods of determining the “minimal cost” Unfortunately, repeated use of Boolean operations per- edge to collapse at each step. Unfortunately, the best meth- formed on polygonal objects generates lots of additional tri- ods are very elaborate (as in, difficult to implement) and angles, as you can see in Figure 1. Many of these additional take too long to compute. Motivated to find a way to reduce faces are small or splinter triangles that don’t contribute to polygons during run time in a game, I performed many the visual quality of the game — they just slow it down. The experiments and eventually developed a simple and blazing- situation demanded run-time polygon reduction, so I began ly fast approach for this selection process that generates rea- my quest to find an algorithm that would do this efficiently. sonably good low-polygon models.

Collapsing Edges FIGURE 3. Polygon reduction via a sequence of edge collapses.

ather than attacking this problem R all by myself, I studied polygon reduction with some other people at the University of Alberta Graphics Lab. (It helps to work with a team in order to fig- ure out how the different algorithms work and which technology is appropri- Original Final ate for which task.) A lot of research has gone into this subject recently, and most of the better techniques are variations of EQUATION 1. The edge cost formula. the progressive meshes algorithm by H. Hoppe (see “For Further Info”). These techniques reduce a model’s complexity cost(u,v) =−× u vmax{} min{}(12 − f . normal • n . normal)÷ ∈∈ by repeated use of the simple edge col- f Tun Tuv lapse operation, shown in Figure 2. where Tu is the set of triangles that contain u and Tuv is the set of triangles that contain In this operation, two vertices u and v both u and v. (the edge uv) are selected and one of http://www.gdmag.com NOVEMBER 1998 GAME DEVELOPER POLYGON REDUCTION

case of an animating mesh, you might FIGURE 4. Good and bad edge collapses. want to develop a formula that will look at more than just one keyframe when computing the cost of a potential edge A C collapse. If quality is more important to B you than the reduction algorithm’s exe- cution time, then you should consider using Hoppe’s energy function. We’ve Original added our own extensions to deal with texture coordinates, vertex normals, B to A B to C A to C border edges, and surface discontinu- ities such as texture seams. A A A C B C B C B Results

he effectiveness of a polygon T reduction algorithm is best demon- A to B C to A C to B strated by showing a model before and 46 after it has been simplified. Most research papers demonstrate their C A C A C A B B results using highly tessellated models B in the neighborhood of 100,000 poly- gons, reducing them to 10,000 poly- gons. For 3D games, a more appropri- ate (and challenging) test of an Obviously, it makes sense to get rid mining which edge to collapse. Note algorithm is how it demonstrates its of small details first. Note also that that the cost of collapsing vertex u to v prowess by generating models that use fewer polygons are needed to represent may be different than the cost of col- only a few hundred polygons. nearly coplanar surfaces while areas of lapsing v to u. Furthermore, the formula For instance, Figure 5 shows a bunny high curvature need more polygons. is effective for collapsing edges along a model taken from a VRML file created Based on these heuristics, we define the ridge. Although the ridge may be a by Viewpoint Datalabs. The initial ver- cost of collapsing an edge as the length sharp angle, it won’t matter if it’s run- sion (left) of the model contains 453 of the edge multiplied by a curvature ning orthogonal to the edge. Figure 4 vertices and 902 polygons. Reductions term. The curvature term for collapsing illustrates this concept. Clearly, vertex to 200 (center) and 100 (right) vertices an edge uv is determined by comparing B, sitting in the middle of a flat region, are shown. Hopefully, you’ll agree that dot products of face normals in order can be collapsed to A or C. Corner ver- the models look reasonably good given to find the triangle adjacent to u that tex C should be left alone. It would be the number of polygons used in each faces furthest away from the other tri- bad to move vertex A, sitting along the image. Figure 6 shows the conse- angles that are along uv. Equation 1 top ridge, onto interior vertex B. quences of not selecting the right edge shows the edge cost formula in more However, A could be moved (along the to collapse at each step. In this case, formal notation. The specific details ridge) onto C without affecting the edges were chosen randomly. can also be found in the source code overall shape of the model. After completing animal testing, we (which you can dowlnoad from Game If you’re implementing your own began human clinical trials for the algo- Developer’s web site). reduction algorithm, you may wish to rithm. Figure 7 shows three versions — You can see that this algorithm bal- experiment with this equation in order at 4,858; 1,000; and 200 vertices — of a ances curvature and size when deter- to meet your needs. For example, in the

FIGURE 6. Random edge selection FIGURE 5. Bunny model at (left to right) 453, 200, and 100 vertices. (200 vertex version).

GAME DEVELOPER NOVEMBER 1998 http://www.gdmag.com female human model made by Bioware. Implementation Details list of triangles that contain indices into (From Euler’s formula, we know that the the vertex list. For example, polygon counts are roughly double these his algorithm only works with trian- Vector vertices[]; numbers.) Once again, these images are T gles. Nothing is lost by this limita- class Triangle { shown with flat so you can see tion; polygons with more sides are easily int v[3]; // indices into vertex list the difference in the meshes. When triangulated if necessary. In fact, many } triangles[]; smooth shading and textures are applications use triangles exclusively. The Indexed Face Set node data type applied, the differences are less apparent. Most data structures for storing polyg- used in VRML is another example of onal objects use a list of vertices and a this type of data structure. When two

Practical Application LISTING 1. The enhanced data structure.

ur initial goal was modest: we class Triangle { O wanted to find a way to get rid of public: a few excess polygons caused by too Vertex * vertex[3]; // the 3 points that make this tri many Boolean operation effects. Vector normal; // orthogonal unit vector However, after developing the reduc- Triangle(Vertex *v0,Vertex *v1,Vertex *v2); tion algorithm and noticing better- ~Triangle(); than-expected results on actual models, void ComputeNormal(); we decided that the technique was void ReplaceVertex(Vertex *vold,Vertex *vnew); 47 good enough to generate the level of int HasVertex(Vertex *v); detail (LOD) models for the game }; engine. An improved version of this class Vertex { basic algorithm has since been incorpo- public: rated into Bioware’s 3D graphics Vector position; // location of this point engine, Omen. Now, for many game int id; // place of vertex in original list objects, our artists only have to create List neighbor; // adjacent vertices one detailed model. A preprocessing List face; // adjacent triangles step does the polygon reduction. Then, float cost; // cached cost of collapsing edge when the frame rate falls below a prede- Vertex * collapse; // candidate vertex for collapse fined threshold or an object is to be Vertex(Vector v,int _id); rendered in the distance, a lower poly- ~Vertex(); gon version is used instead. Being able void RemoveIfNonNeighbor(Vertex *n); to make these choices at run time }; increases the scalability of a game. The List vertices; game adapts itself to the horsepower of List triangles; the system on which it’s running.

FIGURE 7. Female human model showing 100 percent of the original polygons (left), 20 percent of the original polygons (cen- ter), and 4 percent of the original polygons (right).

http://www.gdmag.com NOVEMBER 1998 GAME DEVELOPER POLYGON REDUCTION

triangles on an object meet at the be maintained as vertices and triangles tialize the vertex and triangle lists with same vertex, they’ll have the same are added, deleted, or replaced. The con- the object’s geometry, and then do index (so they share the same entry in structors, destructors, and member func- something like this: the vertex list). tions contain code to keep things in while(vertices.num > desired) { We’ve enhanced this data structure order. We cache face normals because Vertex *mn = MinimumCostEdge(); as required by our polygon reduction they are frequently used by the edge Collapse(mn,mn->collapse); algorithm. One major improvement is selection formula. In order to save us the } that we now have access to more infor- effort of recalculating these costs, the The demo, BUNNYLOD.EXE, doesn’t mation than just which vertices each best edge and its cost is cached for each use this simple loop. Instead it creates triangle uses — we also know which tri- vertex. The implementation of the an additional data structure for the angles each vertex bounds. Further- member functions is fairly straightfor- animation. more, for each vertex, we have direct ward, so I haven’t included it in this arti- access to its neighboring vertices cle. If you’re interested, simply examine (which gives us the edges). Listing 1 this algorithm’s source code on the Making Better Use of the Data shows the enhanced data structure. Game Developer web site. Listing 2 con- Member functions such as tains the code for determining edge costs ather than throwing away infor- ReplaceVertex() have been added to per- and doing the edge collapse operation. R mation about triangles and ver- form edge collapses during polygon Performing polygon reduction is tices that have been removed, this reduction. Consistency of this data must easy given these functions. Simply ini- information can be preserved so that a 48 LISTING 2. Determining the edge costs and performing the edge collapse operation.

float ComputeEdgeCollapseCost(Vertex *u,Vertex *v) { float c; // if we collapse edge uv by moving u to v then how c = ComputeEdgeCollapseCost(v,v->neighbor[i]); // much different will the model change, i.e. the “error”. if(c < v->cost) { float edgelength = magnitude(v->position - u->position); v->collapse=v-neighbor[i]; float curvature=0; v->cost=c; } // find the “sides” triangles that are on the edge uv } List sides; } for(i=0;iface.num;i++) { if(u->face[i]->HasVertex(v)){ void Collapse(Vertex *u,Vertex *v){ sides.Add(u->face[i]); // Collapse the edge uv by moving vertex u onto v } if(!v) { } // u is a vertex all by itself so just delete it // use the triangle facing most away from the sides delete u; // to determine our curvature term return; for(i=0;iface.num;i++) { } float mincurv=1; int i; for(int j=0;j < sides.num;j++) { Listtmp; // use dot product of face normals. // make tmp a list of all the neighbors of u float dotprod = for(i=0;ineighbor.num;i++) { u->face[i]->normal ^ sides[j]->normal; tmp.Add(u->neighbor[i]); mincurv = min(mincurv,(1-dotprod)/2.0f); } } // delete triangles on edge uv: curvature = max(curvature,mincurv); for(i=u->face.num-1;i>=0;i—) { } if(u->face[i]->HasVertex(v)) { return edgelength * curvature; delete(u->face[i]); } } } void ComputeEdgeCostAtVertex(Vertex *v) { // update remaining triangles to have v instead of u if(v->neighbor.num==0) { for(i=u->face.num-1;i>=0;i—) { v->collapse=NULL; u->face[i]->ReplaceVertex(u,v); v->cost=-0.01f; } return; delete u; } // recompute the edge collapse costs in neighborhood v->cost = 1000000; for(i=0;icollapse=NULL; ComputeEdgeCostAtVertex(tmp[i]); // search all neighboring edges for “least cost” edge } for(int i=0;i < v->neighbor.num;i++) { }

GAME DEVELOPER NOVEMBER 1998 http://www.gdmag.com model at any specified number of ver- tices can be retrieved on demand with- FIGURE 8. Comparison of techniques. out having to recompute the polygon reductions. This feature is easily imple- mented by storing the vertex to which each vertex is collapsed and sorting the vertices by the order in which they were collapsed. The BUNNYLOD.EXE demo uses this method. Initially, the bunny is reduced from 450 to 0 vertices in approximately Original Octagon Regenerated from circle Edge Collapse one second. Then, as the slider on the equation using 7 edges left animates the bunny, the model is rendered in increasing detail using the specified number of polygons. Another model. An artist, on the other hand, based reduction methods are more gen- way to think of this animation is as a knows the object that he or she is creat- erally useful, and work with typical sequence of models for every number ing (be it a rabbit, a chair, and so on) models used these days. of vertices between 0 and the number and can make careful aesthetic deci- While I hope that this information in original model. sions as he or she manually reduces the and the accompanying demonstration The edge collapse sequence could face count. The human visual system is application that I’ve provided are use- 49 also be used for progressive transmis- biased towards certain details, such as ful, this article has not touched on sion. Just as interlaced .GIF and .JPG the eyes and mouth, and pays less issues such as dealing with texture pictures come over the Web in increas- attention to other details such as the coordinates, vertex normals, border ing detail, the vertices of an object can collarbone or kneecaps. On the other edges, nonmanifold topology, texture be broadcast in the reverse order from hand, our simple algorithm merely seams, and so on. These subjects have which they were collapsed. The receiv- compares a few dot products and edge been left as an exercise for the reader. ing computer can display the model lengths, and obviously doesn’t have the Furthermore, many other variations while it is reconstructed from the intelligence to place automatically and enhancements to this algorithm incoming data stream. This is a nice varying amounts of importance on dif- are worth exploring. One exciting topic idea, but it’s probably not relevant for ferent pieces to optimize for human is adaptive simplification, in which dif- game developers just yet. perception. The advantage to using a ferent parts of the same mesh are ren- An important component in many polygon reduction algorithm is that it dered at different levels of detail games is the LOD of models. A handful automates the process. according to run-time parameters. This of models can be selected from the Another technique for doing LODs is especially useful for open terrain sequence generated by our algorithm in a game is to represent an object’s environments so that more detail can to represent the object at various LODs. geometry using parametric surface be used near the current viewpoint. ■ One problem with swapping models is patches, which are tessellated on the that players often notice when this fly to the desired detail. Shiny’s F O R F U R T H E R I N F O occurs (the phenomenon known as MESSIAH engine uses a similar “popping”). A solution to the popping approach. Certainly, these surface- Polygon reduction has been a hot effect is to morph smoothly between based methods are preferable (and research topic lately, and most of the the models. In order to morph between probably optimal too). Figure 8 illus- literature about it can be found in pro- two models, the vertices of one model trates the advantage using a 2D analo- ceedings from academic computer must be mapped onto the other. gy. An octagon reduced by one edge is graphics conferences. Some more Fortunately, this information can be regenerated as a regular heptagon by places you can look: extracted from the edge collapse the parametric approach. Collapsing an • Cohen, J., M. Olano, and D. sequence. The BUNNYLOD.EXE demo edge on the octagon produces non-reg- Manocha. “Appearance-Preserving also shows an example of morphing. ular results. Simplification”, SIGGRAPH ‘98. Unfortunately, using curved para- • Hoppe, H. “Progressive Meshes,” metric surfaces isn’t always appropri- SIGGRAPH ‘96, pp. 99-108. Alternatives to Edge Collapse ate. Some of the challenges include get- • Luebke, D. and C. Erikson. “View- Techniques ting the object into this sort of Dependent Simplification of Arbitrary representation and being able to gener- Polygonal Environments”, SIGGRAPH olygon reduction algorithms ate polygons at render time so that ‘97, pp. 199-207. P aren’t the only way to create a adjacent surfaces fit together properly • I have a demo on my university web model with fewer faces. Artists will (without gaps or T-intersections). site at http://www.cs.ualberta.ca/ always be able to do a better job of rep- Furthermore, jagged objects aren’t ~melax/ polychop resenting a model using fewer polygons good candidates for use with curved • H. Hoppe, the Guru of polygon than any reduction algorithm. One rea- surface patches because the number of reduction, maintains a web site at son is that algorithms have little or no surfaces would be no less than the http://research.microsoft.com/~hoppe/ higher-level understanding of the number of polygons required. Polygon- http://www.gdmag.com NOVEMBER 1998 GAME DEVELOPER FACIAL ANIMATION

he challenge of capturing the sub-

tleties of facial movement is what

brought me back to motion capture

after a brief but scarring first experience

and, consequently, what compelled me to

write about my trials. Now that I’ve taken

my lumps, I’m in a good position to help you understand your options and teach you a bit about the process itself. 51 First, let me say that you’d have to be crazy to try to ani- Tmate a face to match a voice. Entire regions of the human Tbrain are dedicated to recognizing facial patterns and body Aimaig language. Hundreds of muscles in a human face move, con- tract, and slide in and out of one another, mocking our attempts to duplicate their deceptively simple duties. One simple mistake can transform your life-like character into an Facial evil pile of face parts and prompt reactions such as, “Ooh, that’s disturbing,” from passersby. It didn’t take much for me to realize why I’d never seen a convincing realistic 3D head model talking, especially one Eeio composed of only a few hundred polygons. After being briefly exposed to the technology and noting the queer ges- tures and difficult timing problems of facial animation, I felt by Jake Rodgers that the technology simply wasn’t ready. But if you have to make it work, and we had to make it work, what can you do? We had a very large script with many medium and close-up shots, and I had to come up with a way to animate pages of script spoken and acted out by low-polygon characters.

Approaches

ou can approach facial animation in any one of several Y ways; you’ll need to decide early on which way you’d like to go. Probably the most flexible and powerful of these is the approach used by Pacific Data Images in the upcoming DreamWorks film Antz. This solution involves researching all the muscles of the face and using a huge team of artists and programmers for a couple of years to develop an animation system based on the way human facial muscles move and slide on the skull. You probably don’t want to approach the problem in this way, however. A more reasonable approach is

Jake Rodgers has earned the prestigious title of “One of many” at Digital Anvil, and his dream is to art direct the Second Coming. His first game experience was WING COMMANDER II, VENGEANCE Image courtesy of Pyros Pictures. OF THE KILRATHI, and he has a feeling his career is “about to real- ly take off.” He can be reached at [email protected]

http://www.gdmag.com NOVEMBER 1998 GAME DEVELOPER FACIAL ANIMATION

Phoneme blending is a good solution if you want the ability to change the timing of the voice after you’ve ani- mated the face, if you have quick ani- mations, if you’re working under a tight budget, or if you really enjoy phoneme blending.

2D Facial Capture

wo-dimensional facial capture is a T widely used, efficient way to apply motion to a character’s face. The hard- ware typically used for 2D facial cap- ture is Adaptive Optics Associates’ FaceTrax, Motion Analysis’s Face- Tracker, and Vierte Art’s Xist. These products use head-mounted devices 52 that track markers applied to an actor’s face, usually using one camera. Two- dimensional facial capture is a good method for performance animation and near-real-time animation. FIGURE 1. Lambsoft’s ProMotion lets the user actually draw over the function Another method uses a regular video curves for markers. This made cleaning up spikes in the data fairly easy. camera and a tool such as Techimage’s ProMotion also lets the user apply global filters such as median and average, as Artiface. This tool uses a sophisticated well as a Fix Eulers filter that takes away unwanted flips in rotation data for body edge-detection program to track the motion capture. ProMotion is very good at taking motion capture data and putting movement of the lips (and only the lips) it on characters whose proportions don’t match the actor. The screenshot is from of a filmed actor. The user then imports a beta release of ProMotion. a 3D object, applies some simple muscle structure to the object to control the way the mesh is deformed, and then to use either some form of phoneme tar- gesture. A channel updates only the ver- applies the captured animation. get blending, 2D or 3D motion capture, tices of the polygon in the face used If your character is going to be look- or a combination of these. I will explain with a particular phoneme’s gesture, ing directly at the camera, and not gen- each of these methods briefly just in allowing you to mix a frown with a erally seen at different angles, 2D cap- case you aren’t familiar with them. yawn, or a wink with a smile, and so on. ture might be suitable for your project. Plug-ins such as Lambsoft’s Smirk and However, this method is limited in that Platinum Pictures’ MorphMagic work in it really can’t capture subtleties on the Phoneme Blending this way. Kaydara’s FiLMBOX has a fea- face, and it can’t accurately reproduce ture called Voice Reality that can recog- what’s happening in the z axis (which ebster defines phoneme as, nize phonemes from a voice track and is very important for smiles). W “Any of the abstract units of the lip-sync the animation for you. The other problem with 2D facial cap- phonetic system of a language that cor- Phoneme blending is a way to make ture is that the head-mounted cameras respond to a set of similar speech sure your gestures look correct (assum- can hamper the actor’s natural motion, sounds (as the velar \k\ of cool and ing that you have a good template of and you want him or her to be comfort- the palatal \k\ of keel) which are per- phonemes) because it allows you to able (especially during lengthy capture ceived to be a single distinctive sound interactively see the results. You can sessions). I’m sure there are lighter units in the language.” then say, for example, “Hmm, it needs coming out on the market, but consid- There are many different ways to more frown” or “More ‘ooooohh’ ering the aforementioned cons and the blend phonemes in an animated charac- please.” Unfortunately, this process particulars of our project, 2D facial cap- ter, but the vast majority of software leaves the burden of timing on your ture was not a good solution for us. tools share the same process. The shoulders. Animators may be reading process involves creating a template of this and saying to themselves, “No phonemes, or gestures, then assigning problem. I’m an animator, after all.” 3D Facial Capture each of them to specific MIDI channels, However, remember that my project which are in turn controlled by slider involved a large script that would have hree-dimensional facial capture controls. The position of each slider driven even the purest animator nuts T gives you the most movement determines the percentage of that trying to keyframe every sequence information, including head move- phoneme’s contribution to the overall using these kinds of tools. ment and almost any facial gesture

GAME DEVELOPER NOVEMBER 1998 http://www.gdmag.com your talent can muster. It also gives a few years of real customer feedback er signs off on concepts, scripts, and you the ability to match up, with rela- and some very useable plug-ins, which storyboards. (Of course, in practice, tive ease, any actor’s face with a com- made it the winner for us. we’ve never strictly adhered to this puter generated character (I’ll explain Another noteworthy tool is Sven rule. But you must agree it is a wonder- this process shortly). Although this Technology’s SurfaceSuite Pro. It’s per- ful model to which to aspire.) approach also poses the most potential fect for creating head textures, using problems, at least you’re capturing a multiple projections on one object great deal of data. With the right mix (top, sides, front, back), and masking Getting Started of accurate captures and good clean-up projection layers so that you can blend software, you’ll be able to use this data several photographs (for example, a nce you have a good script and once you’re back in your office. front view, a side view, and so on) O your characters have been fleshed One of the known problems of 3D seamlessly onto a head (Figure 2). out visually, the next step is to get facial capture is that it’s difficult to SurfaceSuite then uses its own renderer voice talent. For a number of reasons, manipulate the geometry of a face once to create a single, seamless cylindrical it’s likely that the voice actor and the you’ve applied the motion to it. One texture for real-time export, asking face model won’t be the same person. process I’m currently trying to develop only that you define the resolution. In this case, it’s best to get the audio is a hybrid of 3D capture and phoneme recording out of the way first, and let blending. During the capture session, the facial actor synchronize his or her the face actor is asked to go through the Process gestures to the prerecorded voices dur- typical phonemes — frowns, smiles, ing the motion capture session — in 53 and so on — from which we would he preproduction stage is critical to other words, lip sync. If possible, find construct a base phoneme library. Each T a project, particularly if you’re someone who’s done facial motion gesture would have a keyframe for each going to employ a nascent technology capture before, and knows exactly marker, which could be layered upon such as facial motion capture. Figure 3 what’s expected. Directing the talent to the capture data. Just as with phoneme illustrates our development process over-exaggerate all motions, including blending, we would assign each marker workflow for everything relating to eyebrow activity, worked well for us. to a MIDI channel. Now, if we need the facial animation, from concept to game Overacted movements are much easier character’s mouth to shut more, we engine. Note that everything sprouted to remove, modify, or subdue than try- simply adjust the appropriate sliders, from the script and storyboards. A little ing to exaggerate a subtle performance. which in turn moves the markers a cer- inspirational art before that stage is Because one group of people will tain percentage of the way towards the helpful, but in our company, no true produce the audio and another team keys we had previously set. production is allowed until the produc- will work on the motion capture data,

Tools

everal tools are available to game S developers trying to achieve good facial animation results. And even though it might not be a good idea for someone to stick their neck out and rant about tools, I did a modest amount of research on every major solution I could find. Right now, I would argue that the combination of Kinetix’s 3D Studio MAX, Character Studio, and Lambsoft’s ProMotion (Figure 1) makes the most sense on several levels. The most obvi- ous advantage is cost. Most comparable packages (such as Alias|Wavefront’s PowerAnimator or Maya in its impres- sive, but young form) would have cre- ated a budget problem for us, especially considering that our desired result was a real-time animated object with a low- polygon count. To us, the tool(s) in FIGURE 2. This head was created to get a low polygon count (about 700) and to question had bend to the specific needs limit anomalies when animating. Kelcey Privett created the texture using three of our game engine, yet still have suffi- photos and SurfaceSuite. There are few things more frustrating than a face that cient power and a relatively short almost works. learning curve. MAX had the benefit of http://www.gdmag.com NOVEMBER 1998 GAME DEVELOPER FACIAL ANIMATION

FIGURE 3. Sample workflow. Make Your Face dding detail where it’s most need- ed is essential for animating. Character A Script/ Before you create the face mesh, con- Storyboards Concept Sketches sider how your character will animate. This advice may sound completely obvious, but it’s important to add Character Bodies Ready to deform nonetheless. The fundamental thing to remember is to check all the phonemes, emotions, and proper Character Heads blinking against your model (Figure 4). Ready to deform Voice talent One good way to do this is have a face Final Audio Body Mocap calibration motion capture file, which consists of your face actor going Key through a series of phonemes and extreme facial positions, so you can see Supervisor where your face needs editing. Ideally, Cleanup Audio Director Face Mocap Choreographer/Director in the near future we’ll be using patch- 54 Mocap Studio es to animate faces smoothly and to do Modelers/Texturers automatic levels of detail. Don’t count on your first low-detail head to work Cleanup with the captures you get; the initial calibration is more of a test-and-see- what-works kind of process. Generic Conversation Fidgets TWEAK Game/Scripting Put the Motion on Your Skeleton Engine t would be nice if there were a very Generic Room DEPT. Fidgets I simple way to deform your low-reso- lution mesh, but there isn’t. Many tools out there help the process, but complica- Cleanup tions always arise. We faced a number of challenges when we tried to apply our motion capture data to our geometry. First, it became obvious to us was make sure you chop up the script into method saves huge amounts of time that no matter how hard the actor small pieces. The captures should be later on trying to synchronize the tried, the starting position for each short enough that the talent can easily audio with the motion capture data. capture was not constant. Luckily, I perform sections in one or two takes, I recommend that you send your face was working closely with Jeff but not so short that you have millions actor the script and audio tracks as early Thingvold, chief scientist at Lambsoft, of individual captures (note that some as possible. It really helps to have some and he came up with a way to create a motion capture studios charge by the kind of description of the characters you basis file that allowed us to base a series capture). One or two sentences per cap- want them to portray. One of our actors of animations on a given start frame. ture seems to be a good rule of thumb. wanted to know a lot about the charac- As long as the markers start in pretty A good optical motion capture sys- ters beforehand. Initially, I felt that this much the same spot, they will work. tem — such as Motion Analysis’s sys- person was just being diffi- tem — lets you trigger a capture from a cult. I thought that giving the .WAV file. For example, after we break actor the voice track would up the script into separate audio files, suffice. Now that I’ve had a we add three audible beeps one second chance to look at the motion apart before the voice recording. The capture data, I understand a third beep is at 500Hz, which activates little more about the sub- the motion capture. Another 500Hz tleties that can make a gesture beep is played after the actor stops talk- either look believable or total- ing, automatically stopping the capture ly disturbing. In fact, now I’d session. These beeps help the actor even recommend videotaping practice ahead of time, and once you the voice actor’s recording FIGURE 4. Checking the phonemes to make sure get the data back, the audio is already sessions so the face actor can the face will hold up. matched up to your capture. This review them.

GAME DEVELOPER NOVEMBER 1998 http://www.gdmag.com The flip side to having complete 3D between the bones. data from a capture is that you need a We solved the prob- way to separate out the whole head’s lem by creating motion from the just facial expres- longer bones and sions. ProMotion can compare the setting their pivot positions of the markers and subtract points close to the the motion that all markers have in corners of the common so that only the relative face mouth. Next, we motion remains. Later, you can take assigned a “look at” this whole head motion and apply it to expression to the your neck bone separately. the next closest FIGURE 5. The markers on the face, the bone structure at We had a problem with head shapes. bone to the center a neutral pose, and the combination of the bones and The game characters had differently of the lip. This struc- markers. shaped heads, and none of them resem- ture assured a bled the shape of our face actor’s head. smooth continuity To remedy this discrepancy, we came up between the bones and prevented the someone attempting to sell you some with a bone structure that matched our geometry of the mouth from tearing — very expensive hardware or software. actor’s face and linked it to the markers, even in extreme circumstances. The hardware people will try to con- rather than using the markers them- vince you that you need to spend big selves to deform the mesh (Figure 5). bucks on a new optical system, when 55 Thus, for each head, we just moved the It’s Not in the Game Yet all you need are some generic motions bones to match the face, regardless of that you could buy from House of the polygon count. As a side benefit, we e spent most of our time clean- Moves. On the other hand, motion were able to assign to the markers vary- W ing up the motion capture data capture studios aren’t always clear ing amounts of influence over the and applying it to the geometry. At this about their pricing schemes. bones. For example, some of the motion stage, you’ll find out how well you The bottom line is that regardless of capture files had a little too much eye- planned. The clean-up and application the amazing hardware and software brow motion. To fix this, I wrote expres- of data requires a few people (affection- you use, everything rides on your sions for the eyebrow bones that scaled ately called the Tweak Department in actor’s abilities. The acting is what the back their movement to a percentage of Figure 3), who are typically animators. audience sees. You don’t want to spend their respective markers’ motions. Here These individuals need a very high any time covering up bad acting — are some other problems that we faced: threshold for pain. Tweaking anima- make sure the moves are right before EYES. Obviously, we couldn’t place any tion data isn’t the most glorious job, the reflectors leave the face. Today, of markers on the face actor’s eyelids or but it is a very necessary production course, the tools affect the outcome of eyes. Nonetheless, we found that creat- step that requires hard work. a motion capture shoot, and I look for- ing eye blinks was straightforward once If you’ve never worked with facial ward to the day when the actors are in we got the timing right. Later in devel- motion capture before, I suggest con- charge and the motion capture tools opment, we arrayed and moved blink ducting the following test. First, go to a are an afterthought. ■ keys to more natural positions. motion capture studio and spend a day The eyes themselves can be difficult capturing facial animations. Have your F O R F U R T H E R I N F O to create at first. Try creating a half team clean up the data and apply it to Lambsoft sphere, set the pivot point just a little in your skeleton. See how well the data http://www.lambsoft.com front of the center, then assign a “look deforms the face, and then put it all at” (how appropriate) controller to the into your game engine. Document how Platinum Pictures eyes. Another trick that’s helpful is to long each step takes and how much it http://www.platinumpictures.com create an invisible target object in the costs. This practice will give you Kaydara scene a few feet in front of the head, (and/or your boss) an idea of how the http://www.kaydara.com and force the character’s eyes to track it. process works and what it involves. Once you take the creepiness out of Adaptive Optics Associates your character’s look, it’s extremely easy http://www.aoainc.com to adjust where the character looks by This Is Not a Postmortem Motion Analysis simply moving the target object around. http://www.motionanalysis.com JAW. The jaw is easily deformed by t’s difficult to figure out a reason- defining bones that are the length of I able solution for facial motion cap- Vierte Art the jaw bone. Their pivot points ture. After attending several SIGGRAPH http://www.vierte-art.com should be where a jaw’s joint actually talks earlier this year on the subject, I Techimage is (directly below the ears), with expres- suspect that many left more confused http://www.techimage.co.il sions or controllers that point them than when they arrived. Furthermore, towards the chin. as you research the pros and cons of Sven Technology MOUTH. We had problems moving the motion capture, almost invariably the http://www.sven-tech.com mouth; the face model would tear in bulk of your information comes from http://www.gdmag.com NOVEMBER 1998 GAME DEVELOPER POSTMORTEM DeamFoge SANITARIUM

by Chris Pasetto

ANITARIUM is an original adventure game filled 56 with madness, delusion, and personal anguish. The

same can be said for the development cycle.

SANITARIUM was developed by DreamForge

Intertainment Inc., set in the heart of

Greensburg, Pennsylvania. DreamForge employs about SS45 people working on three to four projects at a time. We had previously developed an adventure game entitled CHRONOMASTER, and

our staff has a strong background in the development of computer

RPGs. SANITARIUM was a landmark game for us, primarily because the

project originated in-house,

and we had so much of our-

selves invested in it.

Chris Pasetto is the co-writer of SANITARIUM. He can be found at your neighborhood bar, wearing a kimono made out of a Dukes of Hazzard bedsheet and repeatedly screaming, “These are not my pants!” He can nei- ther walk nor chew gum. He can be reached via e-mail at [email protected].

GAME DEVELOPER NOVEMBER 1998 http://www.gdmag.com The Designers’ Tale

ANITARIUM was born of a simple desire to create some- S thing special, something different. About two years ago, a few of us at DreamForge were feeling burnt out. We were tired of bandwagon games, eager for a fresh concept that we could dig into with enthusiasm. Most important, we wanted to make a fun game with substance and soul. So, over some lukewarm cheeseburgers, Chris Straka (Director of Creative Development) asked Chad Freeman (Lead Programmer), Jason Johnson (3D Art Coordinator), Mike Nicholson (Lead Art and Design), Eric Rice (Art Director), and Tracy Smith (Post-Production Art Coordinator) what games they liked and why. Ideas were offered, counter-ideas brought forth, cheeseburgers grew cold and at times were nibbled upon. We discussed other forms of entertainment that would pertain to the game we wanted to make. Movies such as Jacob’s Ladder, Seven, and 12 The original SANITARIUM design team: (left to right) Eric Monkeys were mentioned repeatedly, television shows such Rice, Jason Johnson, Mike Nicholson, Tracy Smith, Chad as The Outer Limits and the original Twilight Zone episodes Freeman, Chris Straka, and Scot Noel. (The author is off to 57 were discussed. At a certain point in the discussion, it the side, chasing squirrels.) became clear that we wanted to make an adventure game. However, predictably, each of us had his own ideas of what the game should be about. Once the sound of human to create detailed, realistic dialogues for the worlds’ inhabi- heads cracking together reached a deafening pitch, Chris tants. He went back to the design document and wrote back- Straka suggested that we make a game incorporating all of ground stories for each of the worlds, fleshing out the under- the ideas. He drew a crude wheel on a piece of paper, with a lying themes and character motives, and smoothing over central hub and spokes radiating outward. The spokes would any inconsistencies. Mike also pushed the Sarah/Max con- eventually become the diverse worlds within the game. The nection and drafted the infamous “death scene.” When he hub, that all-important plot framework that linked those read his proposal to the design team, three of them nearly worlds, had yet to be decided upon. Soon we realized that cried. With a concrete story in place, the characters all had those separate ideas could be played out as psychotic rich backgrounds from which to draw and the same refer- episodes seen through the eyes of a mentally disturbed char- ence points to which they could refer. Scripting from that acter. From that point on, the project was code-named point on became relatively easy. Asylum. This would have been the game title, but we later After Mike put together a rough draft of the script, discovered that the name was in use elsewhere. Hence the DreamForge hired Chris Pasetto as the project’s writer. His game was called SANITARIUM. primary responsibility was to refine all character and cine- Once the design process started in earnest, we had matic scripts. As the development process went on, the SANITARIUM on the brain twenty-four hours a day. Each of us scripts became more complex (as we noticed things we’d put a lot of fist-clenching, heart-soaring, spleen-churning missed) then simple (as we tried to streamline the dia- effort into the project. It was a rewarding process for us, logues). Eventually, the script files looked like a slaughter- because most members of the team were new to the design house — tatters of butchered text casually strewn about like experience. Sometimes at the end of the day, loose ends soggy meat by-products. remained — questions regarding some story element or To maintain a consistent flow of game play and story, problems with the configuration of a certain puzzle. Many a Chris had to balance the amount of dialogue that occurred wide-eyed game designer went to bed with visions of gar- goyles and deformed children dancing around his head. When morning came, new angles and twists would reveal SANITARIUM DreamForge Intertainment Inc. themselves like spirited flashers in the dawning sun. Greensburg, Penn. We knew that we were on to something good. Though the (724) 853-0200 core story was an afterthought in those original design meet- http://www.dreamforge.com ings, we were determined to create a main plot line that held Team Size: 37 men and women who no longer feel any pain the game together and evoked strong emotions in the play- Release date: March 1998 er. Working from disparate design notes, Mike Nicholson, Time in Development: 16 months the art and design lead, assumed the monumental task of Critical tools: 3D Studio MAX, Adobe After Effects, Adobe scripting the game dialogue and creating the dialogue trees. Photoshop, Adobe Premiere, Cool Edit Pro, DeBabelizer Pro, As if he’d been suddenly transplanted into a Roger Corman FileMaker Pro, Inprise’s Delphi, Inprise’s Paradox, Microsoft movie, Mike quickly found himself neck deep in awkward Project, Microsoft Word, Smacker video codec, Sound Forge, lines and weak characters. After several days of confusion, he Strata MediaPaint, Visual C++, Visual SourceSafe. realized that the problem resided in the game worlds them- Target platforms: Windows 95 selves. They had no true history, thus making it impossible http://www.gdmag.com NOVEMBER 1998 GAME DEVELOPER POSTMORTEM

it. Steve Bennet, Our faces turned Barney-purple with our music and indignation. We felt that such a move sound effects would both compromise the game’s composer for the sophistication and seriously jeopar- project, did some dize our completion of the project. awesome work We were a few weeks away from the with the sound- final ship date and being asked to track. Working undergo a major revision of our basic from lists gener- approach to the game design. Also, we ated by the were stubborn. design team, Travis Williams came out to discuss Steve searched a what could be done and what couldn’t huge sound CD be done in a reasonable amount of library for the time. Our original approach to game necessary effects. play could be summed up as, “You’re Then he an adventure gamer. Figure it out.” processed the This new way of thinking forced us to sounds using Cool ask hard questions, such as, “Where in during any one non-player character Edit Pro and Sound Forge, sometimes the game is this information conveyed 58 interaction with how NPCs were dis- working over a sound effect multiple to the player?” In many cases, it sim- tributed throughout the levels. During times to match the atmosphere of the ply wasn’t. This led to a lot of easy beta testing, testers complained that level. The moody music he added, fixes — having the main character many of the dialogue interactions were entirely original compositions created utter a strategically placed bit of dia- too long and that the keyword-based on a Kurzweil keyboard, brought a def- logue or even altering existing dia- interaction trees were sometimes too inite style to the levels that enhanced logue to help the player make puzzle complex. In addition, characters could the creepy atmosphere. connections. When this couldn’t be end up talking about subjects that Nonetheless, the voice acting done without a metric ton of con- seemed strangely out of order, jumping should have been better. It’s difficult trivance, we adjusted the puzzles to be between disparate topics like a bad to compete with other developers who more user-friendly. news segment. Since a lot of us here have access to name tend to work that way anyway, we actors and meet every- didn’t find it too confusing. one’s expectations. This Travis Williams, our executive pro- isn’t an excuse, but a sim- ducer, insisted that we trim some of ple matter of economics. the encounters and link many key- Would we have liked to words together to prevent confusion. A have, say, James Earl lot of the original dialogue was purely Jones for the voice of atmospheric and time-consuming for Morgan? Of course. But the player to wade through in search of with 80 NPCs and a limit- real answers. The final version had an ed budget for voice act- improved narrative flow and better ing, big-name actors were pacing through a balance of dialogue an impossibility. and action. The final hurdle in the We were constantly concerned that design process came from the emotional content of the game our publisher. Late in the would be lost in the medium. Our goal project, during beta test- was to give the player the creeps. We ing, ASC Games took the time to think out what we approached us with a sig- wanted the player to feel on each level, nificant design change. what message and mood we wanted to Dave Klein, the president get across. Our efforts in creating a of ASC Games, was whole- cohesive atmosphere included not just heartedly behind the pro- a good storyline, but an immersive ject and loved our game. audio experience as well. But… “Could you make it SANITARIUM was DreamForge’s first easier to play?” He product to utilize stereo sound. The explained that ASC point-sourced sound system made for Games wanted SANITARIUM very natural-sounding effects within to have mass-market each level. But technology alone appeal and to be accessi- couldn’t make the sound great without ble to everyone, not just the right people to take advantage of adventure game players.

GAME DEVELOPER NOVEMBER 1998 http://www.gdmag.com Admittedly, the changes made maintain that SANITARIUM focus more on entertain- disturbing, realis- ment than frustration. Players aren’t tic visual style as perpetually stuck on difficult puzzles, much as possible. so they participate in the story at a One of the first consistent pace and are able to enjoy it. hurdles was an Even the hardcore adventure game accurate isomet- players that we initially targeted were ric camera view. satisfied by the balance of puzzle diffi- Finding a way to culty and richness of story. render six by four screen widths of land- The Artists’ Tale scape from twen- ty-four view- or all the designers’ concentration points and seam F on SANITARIUM’s story, many of the the shots togeth- game elements were conceived in artis- er without any tic terms. We knew that the visual perspective warp- atmosphere of the game would be ing was daunting. Tracy Smith worked artwork for any given level. It was extremely important to the game play. out the bugs on this one. The final tough to create a palette that could 59 The art conveyed the emotions that solution was to pull the cameras back support the massive environments the player would feel, as well as the to what would be the equivalent of and all the NPCs. The enormous num- player character’s state of mind. viewing a city block with the Hubble ber of colors used in the game was a Because it’s all about emotions and telescope. nightmare for our post-production states of mind, SANITARIUM is a very art- The biggest bottleneck that occurred team. Using DeBabelizer Pro, these intensive game. Thus, early in the during SANITARIUM’s development guys had to reduce entire levels of process, the design team spent a lot of came during the post-production of true-color renders to less than 230 col- time determining the correct look for the art. We call the post-production ors. At that point, the original artists each part of the game. department “5D,” not because they would walk over and ask, “Hey, what One of the first things that we did exist on some H.P. Lovecraft penta- did you do to my level?” or manage- was to gather reference material. We dimensional plane, but because they ment would say, “Is it gonna look like went on field trips to cemeteries, took work on a combination of 3D and 2D that when it’s done?” pictures of St. Vincent’s Cathedral, art. Once materials such as screens, The steps continued. Still barriers and raided local libraries. Eric Rice characters, and animations poured in the temporary palette were refor- even captured a picture of a haunted smoothly out of 3D like good scotch, matted into the new palette. gravestone on one of our cemetery they had to go through the 5D twelve- Animations were then clipped and photo shoots. step program before they would be coordinates determined. Free-walking Back in the office, the heavy-duty ready for programming. NPCs were retouched and clipped. work was getting underway. From con- For the game art, Jason Johnson Cursors, icons, and inventory were cept sketches to full 3D models to coordinated DreamForge’s art staff as retouched and clipped. The player touched-up game art, we strove to they used 3D Studio MAX to make the characters were put into a 24-color designers’ vision a reali- palette, retouched, and clipped. This ty. The artists retouched was mind-numbing work at times. the 3D background in Even as brains turned to protein-rich Photoshop, then gener- pudding and limbs lost all feeling, the ated a temporary game art was taking shape. palette. Still barriers All of this took anywhere from 50 to were clipped in true 350 man-hours per level. It was a color, then squeezed demanding set of tasks requiring not into the temporary only technical skill but the experience palette; coordinates of having worked on games before and were determined. 3D knowing how to deliver game art to a animations underwent programming team in a perfectly alterations, retouches, usable form. Problems arose mainly and special effects as due to inexperience. necessary. The artists The final look and quality of the lev- then composited the els and animations in SANITARIUM is a animations into the testament to some very determined retouched background. artists who stayed late, worked week- A final palette was gen- ends, and apologized when they were erated and applied to all too sick to crawl to their desks. http://www.gdmag.com NOVEMBER 1998 GAME DEVELOPER POSTMORTEM

The Programmers’ Tale project to sprawl in great big chaise For SANITARIUM’s bug testing, we lounges and sip tequila from fishbowls. entirely divorced ourselves from track- t first, we planned to convert an Actually, that’s not true either. Once ing bug reports on paper. Both our in- A existing adventure game engine. the basic engine was complete, most of house testers and the test team at ASC Initial prototyping showed that this our time was spent on level building. A Games used FileMaker Pro 4.0 to gener- was about as likely as an Oscar nomi- level scripting system based only on ate, sort, and track the status of all nation for Jackie Chan. So, we set out actions, flags, and flow control simpli- bugs. Because we were both using the 60 to create a new engine, re-using exist- fied the work. The rest of our time same software, we were able to trade ing source code wherever possible. By (those hours normally reserved for databases with ease, do proper triage, using source code from earlier finished basic human functions such as sleep) compare priorities, and eliminate products, we avoided absolutely all was devoted to interaction scripting duplication. SANITARIUM was bug-hunting hassles. Ha ha. That’s a and special case programming, includ- DreamForge’s most thoroughly tested bald-faced lie. But using proven code ing blow-up puzzles and action areas. product to date. did give us less to worry about — we We had originally planned to create a But even with this extensive testing knew it had worked at some point. blow-up puzzle editor, but time did not regimen, the game still shipped with The basic engine was completed allow it. Reaching into the wiry guts of the infamous “lockout bug” on Level 2. early in the project cycle, leaving us the beast, we hand-coded each blow-up If the player wandered around the plenty of time during the rest of the puzzle instead. town long enough and fulfilled certain Deciding on a conditions, it became impossible to codec for cut scenes enter any of the buildings. This was a was like clipping a big disappointment. In the countless lion’s toenails. The man-hours of testing between ASC first codec we looked Games and DreamForge, no one at, True Motion, pro- encountered this bug. Herein lies a vided better visual valuable lesson, grasshopper. There is quality but lacked simply no test group more likely to support and ease of find a crash bug than those tens of implementation. thousands of initial buyers. The second codec, Smacker, had just the opposite traits. The Sweet We couldn’t wait around for some- ANITARIUM represented a signifi- body to achieve the S cant success for DreamForge in balance of properties several areas. Many of these have to do that we needed with our personal sense of accomplish- because: first, we ment in making this game, but others didn’t have time; are things we learned along the way. and second, we did- BRING IT ON HOME. As a game that n’t know if anyone 1. was designed in-house, an enor- would get it right mous amount of energy and personal any time soon. The pride went into SANITARIUM. Remember final decision came that this project began as a few guys late in the develop- hanging out after work saying, ment process: sup- “Wouldn’t it be cool if we made the port and ease of game that we would enjoy playing?” implementation Even after months of work, we weren’t won out over visual sure if the game would ever reach the quality. shelves. As the team’s hard labor began

GAME DEVELOPER NOVEMBER 1998 http://www.gdmag.com to bear fruit, the whole company’s flashback cut scenes to deliver an emo- matic material that we used, 3 more energy and enthusiasm grew, sustain- tional impact to the viewer, because seconds were tossed out) — that’s pret- ing us through the crunch periods. they dealt directly with Max’s life, love, ty good when you consider that the That sense of personal ownership in a and suffering. To support that idea, we average movie has a 20:1 shooting product cannot be underestimated. It shot the scenes to mimic the letterbox ratio. The polished cut scenes that defined the experience of SANITARIUM look of movies. Our cinematic coordi- went into the game were the best for us as developers. nator, Marty Stoltz, drew upon his DreamForge had ever produced, Not only that, but our staff offered filmmaking background to guide us in anchored thematically by a unique and 61 us an inexpensive focus group. Fairly precise cinematic screen direction. Joe consistent vision. early on in the project, the ideas we Skivolocke also lent his post-produc- MODULAR FURNITURE. We had all designers had been bouncing off one tion expertise to the effects for all 3. worked on other games and were another seemed like stale old super- memory cinematics. A lot of work went familiar with the potential threat of balls. We needed more outside opin- into ensuring correct camera usage and cutting levels, puzzles, and whatever ions to give the project perspective. post-production of cinematic scenes — else seemed expendable when the We invited small clusters of Dream- especially for the flashback sequences, crunch was on and no amount of Forge employees to join us in the which were meant really to touch the Mountain Dew could keep us going. design room. Like a nightmare ride at player emotionally. From the beginning of the design, we Disney World, we took these groups All cinematics came into the world prepared for such eventualities by through the game puzzle by puzzle, as storyboards — plot twist by plot twist. Questions and carefully laid out in comments gave us valuable informa- Adobe Premiere and tion — what looked interesting and passed on to the what seemed confusing. artists. The 3D staff As a result of those walkthroughs, it worked from story- became painfully clear that Level 6 of boards to create raw our design just wasn’t cutting it. It was .AVIs. Our post-pro- as though Al Gore had walked into the duction team worked room. People’s eyes glazed over at that with these .AVIs, point in the walkthrough; yawns were touching up the abundant. We looked at each other rough edges and and said, “This is not good.” So we applying special asked people, What would be clever, effects using Adobe interesting, and creepy? Bugs seemed Photoshop, Adobe to be the answer. Based on staff input, After Effects, and the resulting Level 6 of SANITARIUM is Strata MediaPaint. much stronger and enjoyable than our Some of the raw .AVI original design. material had to be HOME MOVIES. From the very thrown out in the 2. beginning of the development end (because it didn’t cycle, we wanted to give SANITARIUM a work, because some- dark, cinematic feel. In most games, thing looked wrong, the cut scenes are treated like a neces- because one of the sary evil or worse — a pageant of plug- lighting crew mem- ins du jour meant to dazzle viewers and bers was eating a draw their attention away from the sandwich in the game play. We were determined to background). Still, establish a style for the cinematic cut our shooting ratio scenes, to make them an integral part was about 3:1 (for of the game. We especially wanted the every second of cine- http://www.gdmag.com NOVEMBER 1998 GAME DEVELOPER POSTMORTEM

We chose SourceSafe specifically because it allowed multiple check-outs; the structure of our C files prior to adopting SourceSafe was such that it was com- mon for more than one per- son to be working on a single file at the same time. Source- Safe also allows a project to be branched off, letting one person work on a demo while another continues development of the game. The projects can later be re- merged, so that fixes in the demo can be integrated into the main source. PROJECT MANAGEMENT FOR 62 5. THE INSANE. Using Microsoft Project and his own devious tracking tables structuring the game in a modular Because this process was experimen- prepared in Microsoft Word, project fashion. We constructed the game in tal, we weren’t able to fully exploit the manager Scot Noel would recalculate portions that would add to game play database system. For example, the pro- our progress every week to two weeks. and advance the story, but wouldn’t grammers were the only ones who uti- This method accounted for the detract from the game overall if they lized the system during the level-cre- progress of every single game element, were taken out. In the end, we were ation process. However, Chad Freeman from blow-up puzzles to art fixes to able to keep the amputations to a min- would eventually expand the system so code implementations. GANTT charts imum. A big combat zone and some that artists and sound technicians demonstrated the flow of work blow-up puzzles took a trip through could add assets to the database and between departments and individuals. the plumbing, but otherwise the cuts level creators could access them direct- These enabled us to respond promptly were fairly minor. Modular design at ly from there, eliminating redundant to the most critical problems by show- the start of the project ensured that file storage. In addition, the system ing how the late delivery of a particular the final game would remain true to its could also store level information, asset might throw off the final ship initial vision. allowing these same types of reporting, date by days or weeks. HEY, NICE ASSETS. As an experi- sorting, and other benefits to be Critical paths were plotted using 4. ment, lead programmer Chad extended to the levels themselves. PERT charts in Microsoft Project. Upon Freeman implemented an asset man- Overall, the development of seeing these Daedalean webs of near- agement system utilizing a Paradox SANITARIUM never made full use of infinite complexity, many of us felt database, which centralized all of the these database management tools. As that Scot had gone, finally and irrevo- game assets in one place. Tools devel- game content grows larger and larger cably, insane. But once we penetrated oped in Delphi and Visual C++ (DVD and beyond), using database the mysteries of the PERT chart, we saw accessed the assets from this database. tools for data storage will help develop- the value of tracking the sensitive This solution provided several bene- ers more and more. interdependencies of tasks through fits. For one thing, we could easily We also utilized Visual SourceSafe critical paths. As different departments, analyze the asset data and take appro- for the first time during SANITARIUM’s or even particular individuals, caught priate actions when total asset size development. Historically, program- up with one another or moved ahead broke the budget for a level. We could mers have been beset with the of expected schedules, the critical path also view filenames and descriptions extremely time-consuming and would change. Armed with this knowl- of individual assets. The database sys- tedious job of hand-merging code. edge, Scot could walk up to any given tem let us group assets by levels or by Never again. Like a divine beam of programmer and say, “The critical path other criteria. A single game level had light shining into our otherwise dank for this game is going right through hundreds of art and sound files. and shadowy cubicles, SourceSafe you at the moment.” Searching for a particular asset by the made code merging far easier and Such monitoring helped direct the filename alone would have been the more reliable. SourceSafe also has pressure and motivate the right people, equivalent of finding the fat guy wear- other benefits, including the ability to letting others go home and get a good ing the Star Trek shirt at a sci-fi con- keep a precise revision history of your night’s sleep. As are all systems, the vention. Naturally, the ability to sort code, so that you can painlessly PERT charts were imperfect. Some peo- through assets quickly saved time and retreat from the inevitable “bad ple always seemed to be on the critical energy. move” programming-wise. path, most notably Chad Freeman, the

GAME DEVELOPER NOVEMBER 1998 http://www.gdmag.com game’s lead programmer. All of us here angles looked a little stiff, it was too We’d hoped to make “Grimwall vs. the at DreamForge hope that Chad will be late. The limited angles also caused Hive” one of the most fun and integral able to leave the hospital soon. We problems for players trying to navigate combat areas, but it was cut from the already have a respirator set up along- Max through the levels. He’d often get game for various reasons. side his desk. stuck on corners, then either walk in STURM UND DRANG. When you have PUBLISHER BUY-IN. Our publisher, place like some demented mime or 3. a company of forty to fifty peo- 6. ASC Games, believed in what we frustrate the player with a litany of, ple, it’s impossible to do anything were trying to accomplish and provid- “Can’t go that way.” without rubbing someone the wrong ed valuable input throughout devel- Getting consistent lighting between way. SANITARIUM was put together by a opment. They behaved as if they were the characters’ standard animations design team that in part came together buying into our vision rather than just (status quo, walk, use, and so on) and naturally and in part was hand-picked purchasing it. For the most part, they the specific animations requiring inter- by Chris Straka, our head of creative took a hands-off approach, and only action with the environment (such as development. Individual employees required changes that they were con- kicking in the school door) was anoth- (usually Chris) designed our previous vinced would significantly improve er nightmare. Different artists did these titles. But we decided that team design the quality and salability of the game. animations months apart, and this was would be the way to go. While team Travis Williams, SANITARIUM’s execu- a constant battle from beginning to design has the potential to fracture the tive producer, put a lot of heart into end. A huge amount of time was spent unified vision of a game, the various the project — not to mention all the fixing things as opposed to advancing team members ultimately complement cool prerelease games and toys he sent the project. each other’s interests and goals, lend- 63 us. We were so grateful, we put his COMBAT ZONES. The action ing more depth to the game. This is a head in the game. 2. sequences needed more atten- nice way of saying, “The team argued a We were very pleased with ASC tion. They were important for guiding lot, but came up with better solutions Games’ strong commitment to market- the pace of the story, but didn’t have as a group.” ing SANITARIUM. The box is a work of the feel that we were after in the end Difficulties didn’t end there. Once art in itself, and the rule book has product. The original idea behind these SANITARIUM became a full-time project, received praise for its strength and sim- areas was based on one of many staff members complained, “Why plicity. The magazine ads are impres- DreamForge’s earlier titles, VEIL OF didn’t I get a chance to be on the sive and true to the spirit of our game. DARKNESS. It had wonderful combat design team?” Quite a bit of friction One simple act for which the team is areas that helped break up the pacing was generated because people felt as eternally grateful: ASC Games’ market- between the puzzles. However, in though they’d been snubbed. ing department didn’t give away the SANITARIUM, multiple factors forced us Unfortunately, a design team reaches game plot on the box or in the manual. to water down the combat zones or in critical mass once it has more than six It’s always a relief when you don’t see some cases cut them altogether. We members. Design teams work in much the central mystery of your game print- had originally planned a large combat the same way as clown cars. Too many ed in big red letters across the back of zone for the Hive level of the game. people cramming themselves into the the game box.

The Sour

hile SANITARIUM represents a W phenomenal success for us here at DreamForge (both professionally and personally), there were some unfortunate stumbling blocks along the way. We keep telling ourselves: that which did not kill us has made us stronger. Never mind the scar tissue. ANIMATIONS. Due to the size of the 1. game, each character had a limit- ed number of animation frames. In many cases, this caused the movement to look stiff and unnatural. Looking back on it, we would have preferred smoother animations with more angles — especially for the main char- acter, Max. If we had taken this into account earlier in the project, we might have had an opportunity to fix it. By the time we realized that eight http://www.gdmag.com NOVEMBER 1998 GAME DEVELOPER POSTMORTEM

design would have certainly brought an ship positions. Now, rather than say- could have allowed for shorter initial already volatile process to a grinding ing, “Why wasn’t I included?” every- loading times, larger levels, and so on. halt. At the same time, SANITARIUM’s one moans, “Why did I get into this?” NEW KIDS IN THE CUBE. SANITARIUM is personnel power structure created It’s great fun. 5. a huge game. A lot of people inequalities between staff members that LOAD TIMES.While long level load- worked on it, meaning additional were never meant to happen. 4. ing times were an accepted efforts had to be taken to coordinate DreamForge learned much about design limitation from the beginning and organize everyone’s labor. design teams from SANITARIUM, and of the project, a system that could bet- Familiarizing people with the vision we’re having great success with the ter manage memory and allow for of the game from an artistic and design team setup in our current pro- streaming of more data from the CD design point of view was a real chal- jects. We’ve taken steps to recognize could have benefited the game. The lenge. Sometimes, keeping everyone people’s desire and initiative, and have tight schedule left such a system on the same page seemed to be a parceled out responsibilities to those impossible to pursue. A more sophisti- chore, especially as new people came individuals willing to take up leader- cated memory-management scheme onto the project. A lot of time was spent getting peo- ple to understand the status of the project and the direction in which it was headed. A new artist would ask, “Why am I making this one-eyed 64 guy?” and we’d say, “Didn’t anyone tell you?” We made the mistake of projecting time schedules as if new hires, following a brief training peri- od, would be as competent as our most experienced people. Some of those experienced people were per- forming administrative and training tasks, and thus weren’t producing much art. Art delivered by our new people often had problems when it went to the programmers. This meant doing things twice, sometimes three times. Projections and flow charts slid downhill, taking into account the flow of asset delivery, identification of problems, correction of problems, and re-implementation of assets. Since art delays were slowing down program- ming, we tried to use temporary art. This didn’t work out because creating useful temporary art for the program- mers proved to be nearly as time-con- suming as the real thing. And just to throw a little cherry on top of the three-layered cake of delays, we lost two artists during production. Even though SANITARIUM had a longer production time than any pre- vious DreamForge project, there were still some things that we would have liked to tweak or add to make it bet- ter. As it was, we went through a lot of crunch periods in order to get things done on time. The sheer amount of artwork required for the game nearly overwhelmed us. Unfortunately, due to the nature of the game, delays in artwork had a snowball effect because the level implementers needed the actual art- work in order to set up their levels. ■

GAME DEVELOPER NOVEMBER 1998 http://www.gdmag.com SOAPBOX by Jeanne Collins

Turbo-Charge your Test Lab

et’s face it, Microsoft may have a corner on the

operating system business, but that doesn’t imminent release Windows NT 5.0, and that all games currently in testing mean we have any fewer operating systems or should be tested on the version of that system as well.) software configurations to support. The biggest obstacle to adopting an L Imaging QA Test Bed System NT Workstation may cohabitate with to test a wide variety of operating sys- either Windows 95 or Windows 98, but tems and installation scenarios. have you tried getting Windows 95 and 72 Windows 98 to live together? Don’t bother trying — it’s not going to happen. So, how can a meager game developer have access to lots of operating systems and multiple test beds on a limited budget? The answer is: images! There are several products now available that will give you the ability to make a sector-by-sector image of a hard drive and/or hard drive partition. Here are (IQATBS) that the two with which I am I’ve heard is “We can’t most familiar: afford it.” My answer to that •ImageBlaster. A module in is “You can’t afford not to!” Take a Rapid Deploy by Keylabs’ look at Tables 1 and 2 (see page 71). new spin-off software company, Let’s take the typical game develop- With these estimates, there is one Altiris (Preferred Product mention in ment test lab as an example. If they’re image for each machine, and room to the 1997 FLA Awards). http://www. lucky, they have 15 to 20 test add several more images for each keylabs.com/software/rdeploy/ machines. (Hey, I said “lucky.”) They’ve machine at the cost of approximately index.htm. done their best to amass the widest $45-$49 per image (including labor, •Ghost. (Which we recently purchased). variety of hardware components possi- image licenses, and materials). Now, By Symantec. http://www. ble within these 15 to 20 machines. But where are the savings? symantec.com/sabu/ghost/index.html. with such a relatively small number of Compare those costs to the testing Pricing for these products is based on machines, it’s impossible to have every time lost by constantly rebuilding sys- a sliding scale that takes into account potential configuration. tems to recreate usable test beds with- their usage, so it’s best to contact the In terms of operating systems, a test out stored images, or the costs of buy- publisher’s sales team for pricing. These lab needs Windows 95, Windows 98, ing enough hardware to have a separate manufacturers gear their products more and Windows NT 4.0. But rebuilding machine for each scenario. And don’t towards the hardware builder who each system every single time those forget that those systems would need to builds several computers with the exact operating systems need testing con- be rebuilt every time the test bed is same components. However, these sumes hours and hours of labor time, altered by the installation of a new products are a dream-come-true for and completely obliterates productivi- build. Let’s look at a testing scenario as quality assurance test labs who need to ty. (The preceeding list of operating sys- an example. It takes place in the same maximize their budget dollars in order tems doesn’t even take into account the ten-computer lab, and involves testing one station with eight operating sys- Jeanne Collins is a quality assurance manager at GTE Internetworking. She is some- tems over the course of one week. We’ll times referred to as a “self-proclaimed evangelist for quality assurance in the gaming compare the costs and productivity of industry.” Send her feedback at [email protected]. working with rebuilds vs. Continued on page 71.

GAME DEVELOPER NOVEMBER 1998 http://www.gdmag.com SOAPBOX

Continued from page 72. hardware that will become obsolete in working with images. This scenario is another month. represented in Table 3. These are elementary figures based By comparing the figures in Table 3, on sequential work. When a system is you can see that the cost difference rebuilt manually, the employee must between rebuilds and images amounts sit in front of the machine to be avail- to a total savings of $306.68 for just able to answer installation questions. one machine in one single week. If all With images, employees can start a re- machines could be tested with eight build and move to the next machine, operating systems, the savings would and the next, and the next. Also con- be $3,066.80 in labor alone for one sider the flexibility of building test week. Using the CD-ROM method beds for each scenario when testing dif- with existing CD-ROM mastering ferent drivers for the same . equipment, just two workstations The possibilities are endless. Put your nearly pay for the setup expense in a own scenario in here and see if using week. Not to mention the savings the IQATBS method wouldn’t save you gained by not purchasing duplicate time and money in your labs. ■

TABLE 1. The cost of setting up a network-based imaging system with ten exist- ing test machines [labor at $10/hour, imaging software at $300 for ten station licenses, and all system builds at 4 hours].

Task Unit Cost Total Cost 9GB+ hard disk space on the LAN $1,000 each $1,000 Network cards for each system $50 each $500 Imaging software license per machine $30 $300 Boot floppies $1 $10 Labor to setup and image ten systems $40 $400 Total Setup Cost $2,210

TABLE 2. The cost of setting up a CD-based imaging system useing existing CD- ROM mastering equipment and temporary space on existing network.

Task Unit Cost Total Cost Network cards for each system $50 each $500 Imaging software license per machine $30 $300 Boot floppies $1 $10 Labor to setup and image ten systems $40 $400 CD-ROM Media $5 $50 Total Setup Cost $1,260

TABLE 3. Testing one station with eight operating systems in a week from the ten-computer lab. A comparison of costs and productivity.

OS Tested Time for Cost of Time for Cost of rebuilds rebuilds images images Windows 95 Gold 4:00 $40 0:10 $1.67 Windows 95 SR2 4:00 $40 0:10 $1.67 Windows 95 Plus 4:00 $40 0:10 $1.67 Windows 95 SR2 Plus 4:00 $40 0:10 $1.67 Windows 98 Gold 4:00 $40 0:10 $1.67 Windows 98 Plus 4:00 $40 0:10 $1.67 Windows NT 4 4:00 $40 0:10 $1.67 Windows NT 5 BETA 4:00 $40 0:10 $1.67 System Total 32:00 $320 1:20 $13.32

http://www.gdmag.com NOVEMBER 1998 GAME DEVELOPER