<<

OCTOBER 1997

GAME DEVELOPER MAGAZINE SAYS YOU

More Caviar? probably uses a variation of A* with a lim- Design Documents ited search horizon, possibly using some- thing similar to the cut-locked path read Dave Sieks’ interesting report method for avoiding other units. I guess just finished Tzvi Freeman’s article I about Caviar technology (“Dawn of they also had some look-up tables in I (“Creating A Great Design the 3D Sprite,” pp.58-61, Game there to decide which paths were impossi- Document,” pp.58-66, Game Developer, June 1997). I am a program- ble (the way their sea transport boarding Developer, August 1997). Many mer with a restricted budget. I want to algorithm works suggests this). While I thanks! The article provided many experiment with something like this think the original COMMAND & CONQUER insights for me and several ways that technology. I guess it’s Animatek’s used a variation of the wall-tracing algo- I can improve my next game develop- secret, but would you guide me further? rithm, RED ALERT probably uses A*. Unit ment cycle. How could I get more information about avoidance there is almost definitely step- I am a producer in the game indus- the technique? If you know of some lit- based (the way the units deal with try, and my last project had me writ- erature references it would stimulate my blocked bridges points in that direction), ing the design document. Many of imagination. but some interunit communication might the foul-ups that can happen, did (it Ahmet Engin Karahan also be present. Obviously, RED ALERT gave me a good chuckle to read that also has code in it that allows several they happen to others too!). I espe- CONTRIBUTING EDITOR DAVE SIEKS units to follow a main path, which is easy cially liked your acknowledgment of RESPONDS: Yes, Animatek has patented their to do if you work with step-based unit the “soul” of a game, and how it can Caviar technology. As mentioned in the arti- collision avoidance. focus those wildly creative members 7 cle, you can download freeware Caviar view- of the team. I also agree ers from their web site (http://www.ani- with Freeman’s matek.com/VoxelCh.htm), which will at least Rant thoughts on afford you a glimpse of the process in action. Hey Folks! Drop us a line at how to allow a Also available for licensing by game devel- [email protected]. Or write to Game game design opers is another implementation of voxel would like a moment of your Developer, 600 Harrison, San document to sprite technology from Attention To Detail. Itime to let you know that I guide the You can find details and a downloadable like the “new” look, Francisco, CA 94107. development demo online (http://www.atd.co.uk/ but I am a little without restrict- voxel.html). And though it’s not voxel fearful that the ing the creativity and sprites, you might be interested in checking content will allowing “sparks” of brilliance to out a list of 3D voxel landscape engines drop to adver- improve the overall product when maintained by Karsten Isakovic at the tising like appropriate. Technical University of Berlin. The list cur- other “used-to- Anyway, I just wanted to say rently boasts 33 different engines, with avail- be-good” maga- thanks. Keep up the good work! able source code and documentation - zines. Chris Longpre (http://cg.cs.tu-berlin.de/~ki/3de_land.html). I own every Good luck. issue of Game Y Developer. I enjoy it that much. The problem is that I have Secure Them Pants! Algorithms for Warcraft, C&C already noticed a drop in content; Game Developer spends more and more time with “talk-to-this person” stuff, our editorial in the July 1997 hat was a great article on multiple “political” issues (in the form of “what Y issue of Game Developer made me T object pathfinding in the June I think about the industry”) and laugh out loud when I visualized 1997 Game Developer ("Real-Time “advertising” in the form of new game “security breeches.” Yeah, I guess that Pathfinding for Multiple Objects," pp explanations. confirms that I’m a geek. 36-44). What type of pathfinding algo- Yes, I like to know when the games Anyway, I know that you know rithms do popular real-time strategy come out and if they’re worth looking what you meant. games such as WARCRAFT II and into, but I don’t want to see the impor- Dan Kollmorgen COMMAND & CONQUER: RED ALERT use tant things such as how-tos and exam- when moving large numbers of vehi- ples disappear to this “talk-mag” style EDITOR ALEX DUNNE RESPONDS: That is cles? It's great to learn how to do (examples past and present include really funny. You’re the first person to things the right way, but as a game Commodore and magazines). point that out to us, and I nearly died developer, I'm also interested in learn- I am sorry that I felt compelled to laughing when I reread that particular ing how the other guy did it. write a not-so-positive review, but I just sentence. Dylan Miller don’t want to lose the valuable infor- Therein lies the main problem with spell mation I glean from articles in Game checkers — there’s no way to check the AUTHOR SWEN VINCKE RESPONDS: I have Developer. Thank you for listening. context of the sentence with them. to warn you, this is pure speculation, and Anyway, perhaps security breeches are a I'm doing this from memory. WARCRAFT II Gregory L. Miller good idea too, in certain situations! http://www.gdmag.com OCTOBER 1997 GAME DEVELOPER GRAPHIC CONTENT

The Zenith of Hardware Accelerated Rasterization and Beyond…

ast month, I talked about what I’d like to see as the baseline of features for 3D accelerators in the 1998 timeframe. This month, I’m going to get into the future of 3D acceleration, including the apex of hardware accelerated rasterization L and moving beyond the triangle model of representing and rendering data. So I’d like to finish up our coverage some noticeable quantization error 10 The Peak of Rasterization of hardware accelerators and then talk with 16-bit frame buffers. Significant or the next few years, we’re still a bit about what the future of hardware errors can be introduced as early as the F going to be using hardware accel- acceleration and 3D graphics might third pass. With 24-bit frame buffers, erators that represent objects as tri- look like when it comes to games. however, quantization errors due to angles. This model is still viable for a 24-BIT AND 32-BIT FRAME BUFFERS. Twenty– multipass rendering are greatly reduced. few more years, but it’s getting a little four-bit (RGB) and thirty-two bit Currently, hardware vendors are long in the tooth for a lot of applica- (RGBA) frame buffers will become shying away from deep frame buffers tions, and with games pushing the increasingly important in the future as because of their higher bandwidth envelope far harder than “real” appli- fill rates increase and developers use requirements (deeper frame buffers cations, I wouldn’t be surprised to see that fill rate for multipass rendering consume more refresh time and also games that represent data in radical techniques. As I’ve bemoaned before, require more bandwidth for fill opera- new ways. multipass rendering can introduce tions) and their greater memory foot-

GAME DEVELOPER OCTOBER 1997 http://www.gdmag.com by Brian Hook

print. But with memory speeds getting ly useful, especially if there is no perfor- back to very high resolution, 8-bit per faster and memory parts getting mance penalty for enabling it. component texture maps. cheaper, I’m hoping that deeper frame When it comes to filtering, I guess it 24-BIT AND 32-BIT Z-BUFFERS. The limita- buffers become a reality. boils down to this: the less aliasing and tions of 16-bit Z-buffers are becoming A 32-bit frame buffer with a destina- visual artifacts, the better. If a hardware obvious even with today’s games — tion alpha channel would be even bet- ter — if you give game developers more buffers, they will figure out something Currently, hardware vendors are shying cool to do with them (such as alpha saturate antialiasing). away from deep frame buffers because of PER-PIXEL MIP MAPPING AND BETTER FILTERING. As of today, the only accelerators that their higher bandwidth requirements and I’ve seen with usable per-pixel MIP mapping have been the PowerVR PCX2 greater memory footprint. and the Voodoo. I used to think it wasn’t a vital feature, accelerator does this by traditional tri- GLQUAKE exhibits some Z-buffer alias- but after seeing GLQUAKE’S horrible linear-filtered MIP mapping, anisotrop- ing artifacts on 3Dfx Interactive’s aliasing artifacts on non-MIP-mapping ic filtering, or by contracting the Voodoo accelerator’s 16-bit Z-buffer. A hardware, I’ve revised my opinion. Per- antialiasing fairy to sprinkle magic filter move to a 24-bit Z-buffer format would pixel MIP mapping really is going to be dust on every chip that gets stuck on a help with Z-aliasing problems greatly. A 11 a necessity. board, I don’t care — just make texture 32-bit Z-buffer might be overkill, how- While I don’t consider trilinear filter- aliasing go away, hopefully without ever, but I imagine in a few years it will ing completely necessary, anyone who blurring everything into the Hell of be the norm. has played GLQUAKE on a 3Dfx Marshmallowy at the same time. UNRESTRICTED EDGE ANTIALIASING. Unre- Voodoo-based graphics adapter has 24-BIT AND 32-BIT TEXTURE MAPS. We’ll be stricted edge antialiasing has been probably seen the noticeable MIP-map reaching the limits of what can be talked about for a very long time — banding effect when running down a accomplished with 16-bit artwork pret- improving image quality without hallway. Trilinear filtering is a memory ty soon (especially the 4444 ARGB for- requiring larger resolutions, more mem- bandwidth hog since it requires twice as mat, where 4 bits simply isn’t enough ory, or inconvenient programming much data to be fetched as bilinear fil- for each channel), and game developers techniques is one of the Holy Grails of tering. Still, trilinear filtering is definite- will want the ability to selectively fall computer graphics. The ability to have

http://www.gdmag.com OCTOBER 1997 GAME DEVELOPER GRAPHIC CONTENT

antialiased polygon edges without any be dictated by hardware designs, so it tough, so this is sort of wishful think- significant application burdens is would be nice if any state changes ing. Nonetheless, if OpenGL and/or probably going to be one of the key were done as quickly as possible, espe- expose a more flexible hard- technologies to arrive in the next gen- cially things like changing the texture ware abstraction for fog, I’d really like eration of consumer accelerators environment, the light mode, and the to see hardware vendors support it. (assuming someone doesn’t figure it current texture. Changing the current But this presumes that the “fog this out, patent it, and screw the rest of texture should not take a lot of time. pixel based on some function depen- the industry). Today, you can do a PERSPECTIVE-CORRECT LIGHTING ITERATORS. dent on screen Z” model is the right hacked-up form of antialiasing using This actually addresses two separate direction, and I’m unconvinced that it alpha saturate techniques with some issues. For starters, it would be nice if is. John Carmack has convinced me accelerators, but it requires rendering hardware supported independent dif- that the generic fog most accelerators in front-to-back order. fuse and specular lighting iterators — implement is generally unimpressive and boring. Since I came from a hard- ware accelerator background, I’ve A nice side benefit of computing data on the always thought that hardware fog was neat, but that was more of a historical fly is that level-of-detail can be controlled bias than an honest opinion. When you think about it, hazing stuff based very precisely, letting future software scale on screen Z is just… cheesy. There’s no 12 real sense of realism there — there’s a very cleanly from very fast to slow machines. big difference between a static hazing effect and multicolored patches of fog Complete scene sorting is no longer Direct3D exposes this already, and swirling in and out of windows. acceptable for modern games, espe- some type of implementation of this Next-generation games want to cially if all it buys you is antialiasing will hopefully be introduced into implement true patchy fog, swirling with a select few accelerators. OpenGL at some point in the near mists, streamers of smoke, all integrat- Developers are adopting the Z-buffer for future. Game developers can always ed effectively with each other. A cheap hidden surface removal in droves, so find uses for more iterators. distance attenuation effect doesn’t the likelihood of future games keeping Also, it would be nice to start seeing give us these effects. In order for us to data in an easy to sort format is very perspective-correct lighting iterators. achieve this kind of control, we need slim. Even ignoring the data structure For the longest time, developers to be able to have a fine grain control issue, rendering in depth-order intro- assumed that perspective correction over fog at each pixel, or at least at duces the problem of excessive state for Gouraud wasn’t necessary. each vertex if triangles are small changes, which won’t make things any In reality, this hasn’t proven to be the enough. Last month, I talked a little faster. case – sure, with very high polygon about fog color iterators, and this is STENCIL PLANES. Stencil buffers have a lot count scenes where your average tri- definitely the direction I think things of interesting uses, including applica- angle size is four pixels, perspective need to be heading for triangle-based tions that use mirrors, shadows, and correct lighting (and even texturing!) hardware accelerators. reflections. Once again, this comes isn’t needed. But for a lot of game HOW MUCH RAM IN OUR ÜBER-ACCELERATOR? down to the same philosophy – build titles where you have large walls and Okay, I know I’m asking for a lot, and I it, and we’ll find a use for it. floors, linear lighting just looks weird. don’t necessarily see even a fraction of MULTIPLE TEXTURE SUPPORT. Wouldn’t it be BETTER FOG. Both Direct3D and my wish list being implemented nice if we could do multipass rendering OpenGL are pretty bad when it comes (unless RAM prices manage to drop yet in a single pass? Well, this is the crux to specifying fog — you can specify lower, which I find hard to imagine), of multiple texture support — the abili- the general types of curves you want but let’s just see what kind of RAM ty to specify multiple textures and tex- (linear, exponential, or exponential requirements we’re asking for from the ture coordinates for a single triangle. squared), but you can’t actually speci- Ultimate 3D Accelerator. Let’s assume Future hardware should support this fy an arbitrary set of fog densities or a a 32-bit ARGB double-buffered frame technique, as it can scale performance general equation for fog. With some buffer, a 24-bit Z-buffer, an 8-bit sten- nearly linearly with the number of APIs and hardware, such as Glide for cil plane, and 4MB of local texture passes saved. the 3Dfx Interactive Voodoo, you can RAM (which may not even be neces- INEXPENSIVE STATE CHANGES. State actually upload a fog table yourself. sary if AGP works out, but I’m not changes are expensive with today’s This is really handy for achieving cool holding my breath). Depending on the hardware. Because of this, game effects other than fog. You can do a screen resolution, we’re looking at developers are having to bend over “free” blend to a constant color à la almost 8MB to run at 640×480, and backward trying to minimize state VGA palette tricks without having to around 20MB to run at 1280×1024. changes as much as possible — sort- do a screen-sized alpha-blended poly- This presumes we’re running in a full- ing polygons in material order, ren- gon. screen exclusive mode and not sharing dering similar objects at the same Unfortunately, coming up with a memory with the Windows desktop — time, and so on. clean abstraction that isn’t fundamen- things get worse if we’re trying to run Ideally, rendering order shouldn’t tally broken on everyone’s hardware is in a window.

GAME DEVELOPER OCTOBER 1997 http://www.gdmag.com GRAPHIC CONTENT

Now, a consumer-level 8MB 3D come from? The source data must be erating the requisite data, we still accelerator isn’t that far-fetched, espe- computed or fetched, then it has to be need some way to get our data to the cially given that several 8MB Windows transferred to the hardware accelerator accelerator. Triangles can consume a accelerators are available even today across a , and finally the graphics lot of bus bandwidth. Assuming the based on and Number Nine accelerator has to digest and regurgi- unlikely case that our data is perfectly (8MB is necessary to support a tate the data in a pleasing form. stripped, meaning that there is a ratio Windows desktop of 1600×1200×32- This model is rife with potential of a little over one vertex per triangle, bits). Today, there are high-end accelera- bottlenecks. If we’re using a lot of and assuming that vertices consist of tors that can come with 16 or more precalculated data stored in main x, y, z, s, t, w, and two packed color megabytes of RAM, and prices for graph- memory, then memory bandwidth values (à la Direct3D), then each ver- ics adapters have been plummeting the could be a bottleneck. If a lot of com- tex consumes 32 . Say a game past few years. The price of a 4MB plex data is being generated on the slated for release in 1999 requires one Windows accelerators today is between fly, then the CPU could be a bottle- million triangles per second, then this one-half and one-fourth the price of a neck. If a lot of data is being sent over game will consume 32MB/second of comparable accelerator circa 1995. the bus, then the bus could be a bot- bus bandwidth just for vertex data. So while it’s theoretically possible tleneck. And if our scene is particular- That’s quite a bit, especially given that we’ll see 12MB and 16MB acceler- ly pixelicious (lots of big polygons, that there is also going to be con- ators coming in at the consumer level lots of overdraw, and many rendering tention on the bus for state data, tex- in a couple years, I don’t expect to see passes) hardware rasterization perfor- ture downloads, audio samples, and 14 this anytime soon. The fact of the mat- mance could be the bottleneck. So we whatnot. ter is that you need less than 11MB to have all kinds of things waiting to If the data is not stripped, then mul- run an 1800×1440×32-bit Windows thwart us in the performance depart- tiply that figure by three — 96 MB/sec- desktop, and very few Windows users ment; in all likelihood, any problems ond required just to render those trian- need that much real estate (you’d need will arise from a combination of these gles. PCI can barely do that today, a big monitor for that to do anything bottlenecks. assuming that the entire bus’s band- but cause eyestrain). Our fully loaded MEMORY BANDWIDTH. Main memory per- width is devoted to triangle data; accelerator would get by with 8MB at formance has been a problem since the maybe AGP can solve some of these 640×480, which is a pretty reasonable introduction of the Pentium, and it issues. Either way, cranking up bus resolution to work with, especially if continues to be a problem on very high bandwidth is only a stopgap solution. antialiasing is available. performance processors. With this in Clearly, then, the right thing to do is to Anything past 8MB is simply gravy mind, it’s probably a bad idea to store reduce the amount of data being sent — higher resolutions and more texture lots of data in main memory. Thus, tra- across the bus. RAM, and that’s it. And if that’s all the ditional static model representations FILL RATE. Software can’t do much to extra RAM gives you, it may be a pret- (lists of vertices and connectivity data) make up for poor fill rate. It looks as if ty tough sell. But hey, that’s what they aren’t the right thing anymore. the upcoming crop of 3D accelerators said about systems with 32MB of sys- CPU PERFORMANCE. Since CPU horsepow- isn’t going to be all that bad, and if we tem RAM, so I’m probably wrong. er keeps growing at a phenomenal rate, can count on 3D chip manufacturers to Forgive me if my imagination isn’t it would be safe to assume that we can maintain their current pace, we should what it should be. lean on the system processor to make be O.K. when it comes to fill rate for up for memory bandwidth constraints. the foreseeable future. This means computing data dynami- What’s Wrong with the Triangle? cally from procedural representations whenever possible, rather than using What’s Better Than the Triangle? o far, I’ve described everything stored data — a 180-degree turnabout S that we’d like to see from triangle- from the days of the 386, when “tables, o there are all these potential bot- based hardware accelerators. However, tables, and more tables” was the way of S tlenecks — memory bandwidth, I don’t think the triangle model of ren- the day. CPU performance, bus bandwidth, and dering things is long for this world. It’s A nice side benefit of computing data fill rate. There are different approaches been around for over a decade now on on the fly is that level-of-detail can be to solving these problems, some of workstations, and its weaknesses and controlled very precisely, letting future which are the Wrong Answer and some failings are becoming all too clear on software scale very cleanly from very of which may be the Right Answer. the PC platform now that game devel- fast to slow machines. A level frame THE WRONG ANSWER. Some hardware ven- opers have started thrashing on it. rate is maintained, but slower systems dors are using the brute force method So what’s wrong with this model? get coarser looking worlds and models. right now to solve these problems, Essentially, the triangle/polygon ren- A reasonable enough trade off, espe- which often introduces new problems dering paradigm requires specifying a cially compared to today’s situation, along the way. For example, chips that rendering state (texture, lighting, Z- where slow machines get slide shows. accelerate transformations and lighting buffer functions, and so on) and then BUS BANDWIDTH. Assuming that we want have been announced. The advantage tossing polygonal primitives at the to generate scenes with lots of depth here is that the chips offload work accelerator. Herein lies the rub — and geometric complexity, and con- from the CPU — but is this work really where do the polygonal primitives veniently ignoring the issues of gen- worth offloading? I don’t know the

GAME DEVELOPER OCTOBER 1997 http://www.gdmag.com GRAPHIC CONTENT

answer to that, but today I just don’t cept was sound. It was the implemen- come directly from game developers. see transformations and lighting being tation and timing that really hurt its If you’re a game developer and think the key bottleneck. acceptance. Developers weren’t ready I’ve missed something, please let me To alleviate bus bandwidth prob- for patch-oriented rendering, and the know and I’ll pass it along. If you’re a lems, some hardware vendors are NV1 didn’t have the features or per- hardware developer and think I’m investigating caching vertices across formance necessary to really push a smoking crack, please let me know the bus, a form of display list. For new graphics paradigm. and I’ll tell you why you’re wrong. example, an application could define NEC/VideoLogic has also attempted a set of vertices and faces and call it to utilize a non-triangle–based archi- something such as “airplane,” at tecture in the PowerVR PCX1 and Spread the Knowledge

‘d like to point out that many of the I can’t fault for developing the NV1— Itechniques that I discuss were not invented by me. I'm simply your hum- fundamentally, the concept was sound. It ble scribe, writing down these tech- niques. For example, much to my cha- was the implementations and timing that grin, I realized that I neglected to note the contributions of Gary McTaggart of really hurt its acceptance. 3Dfx Interactive in my August 1997 col- 16 umn on multipass rendering. Gary has which point the hardware driver PCX2 accelerators. The PCX1 wasn’t done a lot of work for the game devel- uploads the data (across the bus) into very fast, and it lacked bilinear filter- opment community while at 3Dfx, by card memory. Now the “airplane” can ing; once again, developers weren’t both exploring techniques such as mul- be rendered by simply sending along a ready to adopt such a wildly new tipass rendering and lightmap technol- very small rendering command. architecture (the so-called “infinite ogy with radiosity, and, more impor- The problem with this way of doing planes” method of scene and object tantly, exposing these techniques freely things is that it presumes that we’re description). The PCX2 addresses a lot to game developers around the world going to be using static geometry when of these issues, but convincing devel- (including presenting a very well- these hardware accelerators finally opers to support infinite planes direct- received talk at this year's Computer reach the market. As I’ve stated earlier, ly isn’t going to be easy, which means Game Developer's Conference). There I find it highly doubtful that in the that PCX2 has to rely on good are many people like Gary who are future games will have models made up Direct3D drivers that convert triangles active in the game development com- of discrete points and faces. Future into associated sets of planes. munity and contribute, but we can games will likely procedurally generate NV1, PowerVR, and even always use more people like him. model data on the fly, so caching ver- Microsoft’s Talisman were and are So I urge any of you with cool ideas tices across the bus is of dubious value pointing in the general direction we to write articles, books, web pages, or for next-generation titles. need to be heading. At some point, Usenet articles discussing them. Simply So what’s the right answer? That’s we’re going to hit a wall in terms of put: spread the knowledge. What goes hard to say. It’s clear that the triangle transformation performance, bus and around comes around. ■ model of rendering isn’t going to be memory bandwidth, and fill rate, and the answer after a few more years. the triangle paradigm isn’t going to Brian Hook is a columnist for Game Something that doesn’t play havoc have the legs to keep going. What the Developer who worked briefly for a hard- with bus and system memory band- new paradigm will be is unknown at ware company and thus now foolishly width will have to be developed, and this point, but maybe in a year or so thinks he’s a chip designer. When not pos- in all likelihood, this may be some we’ll have a better idea of where ing as an industry pundit and futurist, he form of retained-mode hardware things need to be going. spends his time at id software working on architecture (or an all new way of And on a related note, whatever QUAKE 2. You can reach him via e-mail at CPU-based rendering that is leaps and new paradigm is adopted may not be [email protected]. bounds better than what you see from particularly amenable to the existing a hardware accelerator). Something immediate-mode APIs that we’re using F O R F U R T H E R I N F O else we may see is hardware that isn’t today (OpenGL and Direct3D). We 3Dfx Interactive quite retained mode (as in, fully scene may have yet another set of API wars http://www.3dfx.com/ oriented), but instead takes simple in the next five to six years. descriptions of complex surfaces and Nvidia handles the generation of the com- http://www.nvidia.com/ plex rendered data in hardware. The Royal “We” Number Nine Nvidia developed something like http://www.nine.com/ this with their NV1 chip, which ’ve taken a lot of liberties with the wasn’t very well received by develop- I pronoun “we,” but a lot of the sug- NEC/VideoLogic ers. I can’t fault Nvidia for developing gestions and features that I’ve out- http://www.videologic.com/ the NV1 — fundamentally, the con- lined in this month’s column have

GAME DEVELOPER OCTOBER 1997 http://www.gdmag.com PRODUCING INTERACTIVE AUDIO:

THOUGHTS, TOOLS, & TECHNIQUES 25

imes have changed in the game development industry.

All of the stupid money has fled to Internet commerce

applications, and companies in the game world are left having

to make their way as viable businesses. There is no market toler-

ance left for “junk,” or as it used to be referred to by a producer

at some years ago, “library titles.” The “B” and “C” titles

that filled out your publishing profile aren’t viable any more —

in fact, they can be downright deadly. Every game made from

now on has to have a legitimate shot at becoming a hit; other-

wise, it’s just not worth making. This philosophy has inevitably

trickled down to audio departments, where the focus now is

squarely on quality.

Thttp://www.gdmag.comT OCTOBER 1997 GAME DEVELOPER INTERACTIVE AUDIO

A Rant on Interactivity has stumbled into a job working on a just linear playback. Interactive audio CD-ROM or web site and is desperately should be constructed in such a way hat exactly does it mean to trying to figure out how make 8-bit, that that the user can affect its perfor- W produce interactive audio? For 22Khz Red Book audio not sound as if mance in real time during playback. some time, interactive audio suffered it’s being played back across two tin I’m talking about reactive, responsive from an identity crisis. The term has cans connected by string. To this per- audio, coming from audio drivers that come to mean less and less. In my own son, “interactive audio” simply means are “aware” of what’s happening and jaded way, I always imagined the sound for nontraditional media: CD- can respond by changing the music adjective “interactive” modifying a ROMs, console games, kiosks, and web appropriately. Spooling a two-minute noun such as “media” or “audio.” sites. To me, the term means some- pop song in an unchanging, endless When a person says that they are thing entirely different. loop during a real-time strategy game “doing interactive” in reference to If you’re describing audio as “inter- is not interactive audio. Perhaps the audio, it usually means the individual active,” you’re implying more than term “audio for interactive media” would be appropriate instead. Imagine instead audio that is an interwoven part of a 3D, free-roaming Tools of the Trade world. As you explore the world, the sound smoothly accompanies you, ris- Workstations and Sequencers ing as you encounter danger, falling 26 away as you explore in peace. It try to use off-the-shelf tools whenever sounds triumphant when you succeed, I I can. When I evaluate commercial and distant and mournful when you tools, I look for unique functionality, effi- fail. And all of this happens with the ciency, reliability, and cost-effectiveness. precision and emotional impact of a Our main control room at Crystal great film score. In a user-driven world Dynamics is based around a Macintosh StudioVision Pro 3.5 such as a game, you have no linear Power PC running Digidesign’s Pro Tools timeline by which to synchronize the III 4.0, Digital Audio workstation hard- changes in the music, as you do in a ware and software, and Opcode’s Studio limiter and movie. The audio entirely depends Vision Pro 3.5 MIDI plus digital audio C1 digital upon the unpredictable input of the sequencer. Pro Tools was an easy choice compres- user. How can you make this work? for me because of the TDM (time domain sor, Pro The answer lies in the nature of an multiplexing) real-time plug-in architec- Tools turns interactive 3D world and is made pos- ture. This allows me to use Pro Tools as a into a rack sible by new tools and technologies. general purpose DSP platform. In addi- of super The StudioVision Audio The 3D game world is open-ended, a tion, version 4.0 is native PowerPC soft- high-quali- to MIDI converter database of terrain, objects, anima- ware and is much faster than the previous ty dynamics window. tions, behaviors, and their various version . The upgrade includes extensive gear that relationships. Therefore, the music real-time automation, rivaling or surpass- can be used to control unwieldy audio must also become a database of musi- ing that of most high-end mixing con- volume levels and minimize noise. These cal ideas, sounds, instruments, and soles. The value of Pro Tools as a plat- two plug-ins are excellent for maximizing relationships, imbued with awareness form really shines when you get into the dynamic range and are essential for any- of the other objects in the world and plug-ins from K.S. Waves. With L1 digital one who needs to work in low bit rates or programmed with responsive behav- just needs to be loud. Wave’s iors of its own. Q10 is the most flexible and best sounding equalizer that I have used, and their Truverb The Rules of Interactive Sound reverb is warm, clear, and very Design programmable. In addition to handling all of ver the years, I’ve worked on our the MIDI composition O about 100 titles, 60 or so in a chores, the recently upgraded substantive way. I can distill much of StudioVision Pro 3.5 has some what I have learned from this in a essential digital audio features. short set of rules. Like Pro Tools, the recent update “went native” and is 1. There will always be limitations. therefore much faster. Still, Hardware limitations, space limita- the most unique feature of tions, design limitations… you Digidesign’s Pro Tools III 4.0. StudioVision Pro is the ability name it, and it will be restricted at one time or another. The only Continued on page 27 resource that’s never limited is your

GAME DEVELOPER OCTOBER 1997 http://www.gdmag.com ability to come up with creative solu- tions to these problems. Tools of the Trade (cont.) 2. Every drop of energy that goes into being discouraged by the limitations to convert digital audio to MIDI and then of a particular project is energy taken back again. The best way to describe this away from making a great sound is to give an example of how we use it. As design. you know, there is nothing like a live gui- tar track to “humanize” a MIDI composi- 3. Know your role on the team. Projects tion. Unfortunately, it’s seldom possible need to be driven by a singular, for us to record such a track and have any Yamaha VL-70m synthesizer cohesive vision usually espoused by way to play it back as a digital audio a producer, lead designer, or direc- stream. MIDI guitar tracks, which are tor. Unless you’re working on an recorded with a keyboard and played adds some much desired features. For “audio only” product, audio is a sup- with a guitar sample, are more realistic, one thing, it now allows you to use all of porting member of the cast; it but tend to lack all of the subtle pitch Wave’s high-end plug-ins. You can also doesn’t lead the design. Audio is no gestures and tonal variations that make save job lists in order to keep track of and less important to the overall success the track sound “real.” Our solution is to reload your files and settings from previ- of the project; but, it follows and record a live guitar track into ous jobs. The job list is exported as a text supports the design ideas and con- StudioVision Pro. We convert that track to file, which is great because you can get in 27 straints defined by the project’s sin- MIDI, which yields a stream of notes and and edit it by hand if you want to make a gular vision. The sound designer pitch bend data that matches the perfor- small change to a big job. If all of that should become comfortable in this mance. Next, we move all of the pitch this isn’t enough, they even include their role so as to avoid great heartache bend data to another track and reconvert own Waves IMA ADPCM (Adaptive Pulse and suffering. However, this doesn’t the MIDI data back into the digital audio Code Modulation) compressor, which mean that there is no opportunity track. This gives us a less interesting, but simply kicks ass. for creativity. (See Rule 4.) more easily looped set of guitar samples.

4. This is the “two things” rule. Most of Synthesizers & Digital Audio the time, you’ll be taking direction Processing Software from someone who knows less about audio than you do. By saying this, I rely on four main units: Digidesign’s don’t mean to denigrate the skill of I SampleCell II, Kurzweil’s K2500, my the project director; I’m just stating a Oberheim Matrix 1000s, and the new simple fact. The sound designer is Yamaha VL-70m. SampleCell is great the expert when it comes to the because, as a NuBus board, it is integrat- details of audio. Yet the direction for ed into the Mac’s file system. There is no the sound design must come from need to transfer files over SCSI or (God the person who is responsible the forbid) MIDI. I like to make my own sam- K.S. Wave’s WaveConvert Pro. project’s overall vision. Otherwise ples, but I recently got a some great disks the sound will not hang together from ILIO’s Heart of Africa and Supreme with the product. My highly unsci- Beats series, which I’m using extensively entific experience has shown that a Choosing the individual notes (samples) on ENTER THE GECKO. project director is unlikely to have that have the most tumbrel variation, we Continued on page 28 more than two identifiable design build a compact, but varied guitar instru- needs for any given part of the ment . Finally, we play this instrument sound design. If you, as the audio with the full MIDI plus pitch bend track designer, satisfy these two things, and use program changes or velocity to you’re usually free to complete the switch between the different guitar sam- bulk of the task with your full cre- ples, thus recreating (approximately) the ative input. It’s best to know what original performance. these two things are before any sig- nificant amount of work is done. Audio Batch Conversion Tools 5. Run-time resources will always be ave’s WaveConvert Pro is the shared among different disciplines. W latest update to WaveConvert, a batch converter that I often refer to as 6. As soon as the artists or program- “the third member of my staff.” The new mers figure out how to use some- version of the product is as easy to use Digidesign’s Turbosynth. thing effectively, it will no longer be and as solid as the old version, but it available for audio (for example, the http://www.gdmag.com OCTOBER 1997 GAME DEVELOPER INTERACTIVE AUDIO

CD-ROM drive on any game plat- form).

7. Making audio interactive is a team effort. The application must be altered by designers and program- mers to support interactive audio. Team buy-in is essential because interactive audio, although very valuable to a project, is more work for everybody.

8. The likelihood of audio becoming interactive for any given product is inversely proportional to the amount of programming that’s required of individuals who are not specifically assigned to the audio team. 28 9. It’s far better to determine how the sound design will interact with the world before you begin creating assets. Retrofitting interactivity into audio designs, especially music, is

Tools of the Trade (cont.)

Since it’s not Digital Looping Tools easy for me in my limited space to nfinity is the definitive set of digital audio looping tools. record live players, I The term “looping a sample” refers to defining a section I’ve been looking of the sound data to repeat as many times as necessary to for a physical mod- last a specified duration, as opposed to writing all of those eling synthesizer to repeats out longhand. When you have 512K of sound RAM to Antares Infinity digital audio add some human work with, compressing your instrument and sound effects processing software. feel to my Red Book data with looping technology may be your best and only tracks. I found one option. Looping is a very tricky business, however, and that I like in Yamaha’s VL-70m. Physical modeling is a technique there’s nothing even close to Infinity’s set of advanced for creating sounds that is very different from sampling. In a tools. physical model, rather than recording a single performance and Infinity’s Rotated Sums Looper is especially well-suited to looping it, you model the physical characteristics (length and the PlayStation. The PlayStation has built-in ADPCM compres- diameter of a pipe; length and thickness of a string; size, shape sion with a 28-sample block size. While this is essential, as it and reflectivity of a body of a real or imagined instrument) in gives you, effectively, more space to store sound in, it also DSP. You can then tweak these parameters to get the nuances of puts a limitation on your ability to loop sounds. Loop points the of the real thing. Although I’ve just begun to experiment with must occur on sample numbers that are divisible by 28. it, I’ve already made some outrageous saxophone patches. Anyone who has looped small sounds before knows that it is On the software side, I spend a lot of time in Digidesign’s hard enough just to get something that sounds decent, let Turbosynth and Antares Infinity. Turbosynth, though aging with- alone to do so with such a draconian restriction. Fortunately, out much support, is a great sound effects program. It works like Infinity’s Rotated Sums Looper allows you to get a rough loop a modular digital synthesizer, allowing you to set up custom with the loop points on the mathematically correct samples patches in the old patch cord paradigm. What I like about it is and then process the data in between the loop points until it is that you have flexibility in how you route things and that you can smooth and even without screwing up the math. How exactly have very precise control over filter, amplitude, and pitch this is done is more than I have room for, but trust me, it works envelopes. You can even extract the amplitude envelope off of a wonders, especially for ambiance and other long, looping sample and then use it as you wish. sound effects.

GAME DEVELOPER OCTOBER 1997 http://www.gdmag.com difficult at best, and severely com- promised, if not impossible, at worst. Getting More Info about the IASIG 10. Leverage off of existing technology wherever possible. If you plan to nterested in interactive audio? Point your browser to www.iasig.org. This is the create new audio technology, use web site of the Interactive Audio Special Interest Group. Look under “Working off-the-shelf tools whenever you Groups” and the “ICWG” (Interactive Composition Working Group). Here, you can. For example, I can’t conceive will find the latest work of a dedicated group of industry professionals from com- of a scenario where it would make I panies such as Microsoft, Apple, Electronic Arts, Headspace, and Crystal Dynamics that sense to write your own MIDI are working toward unified, open standards for implementing interactive audio. sequencer. Programs such as Opcode’s Vision and Logic Audio are great tools. I can’t even begin to consoles (including the PlayStation) fully rendered 3D world. Making sound speculate on how many person- save money by using inexpensive drivers easy to use is important; pro- hours went into making them. It (read, slow and not very reliable) CD- grammer and game designer time are would be crazy to invest develop- ROM drives. Thus, the constant seek- limited commodities, so making basic ment dollars in a “roll your own” ing and playing of digital audio tracks implementation easier leaves more sequencer. Rather, we need to cre- is likely to tax the CD-ROM drive to time for these folks to work on making ate additional tools that map out the point of failure. Red Book audio the world ready for your interactive the territory that is unique to our should therefore be reserved for nonin- audio. 29 endeavor. Such tools should begin teractive sections of the game, such as There should also be a simple, con- with the output of commercial title screens. sistent means for your game to com- tools such as a MIDI sequencer and On the other hand, MIDI is small, municate relevant information about add functionality as needed. compact, and easily modifiable on the itself to the sound driver. Adding inter- fly. The PlayStation has its own dedi- active sound capabilities requires pro- cated sound RAM, and all of the data grammers and designers to spend more Creating an Adaptive Audio Engine needed for a level can be loaded in less time communicating information to than a second. Once loaded, the data is the sound driver about the state of the rmed with the desire for truly out of the way and the CD-ROM world and the characters within it. At A interactive audio, we at Crystal returns to its other duties. Crystal Dynamics, we tried to remedy Dynamics set out to create our own Furthermore, the PlayStation contains this situation by communicating the sound driver for the PlayStation a pretty good sampler. Respectable state of the world to the sound driver and, perhaps later, for Windows 95. music and sound effects were created in the form of a set of simple, numeri- From my notions of interactivity and for the Super Nintendo as well, but cally registered variables. Most often, set of rules for interactive audio, we that platform suffered from limited we use values from 0 to 127 so that derived a number of design goals for sound RAM. Fortunately, the they could be set from standard 7-bit our driver. PlayStation has almost ten times as MIDI controllers. Thus, the number of EMPHASIZE MIDI OVER DIGITAL AUDIO. For much sound RAM, much better sound enemies alive on the screen might be most of our products, MIDI and cus- interpolation (an on-the-fly sample represented as one 7-bit variable. Your tom DLS-like instruments are a better rate conversion technique used to distance from the level’s exit might be way to go than Red Book or streaming stretch a sample up or down the key- stored in another. We have tried to use digital audio. Rules 1 and 5 have some board from its native pitch), and supe- these same variables throughout the implications for Red Book audio. Red rior DSP (used for reverb and the like). game so that they only need to be Book audio sounds great, but fortu- In my opinion as a confirmed curmud- coded once. nately for Crystal Dynamics, our pro- geon, anyone who says that they can’t CODE OR DIE. It’s important to put the grammers know how to get the most make high-quality MIDI music on the logic programming in the hands of the out of the CD-ROM drive for game PlayStation under these conditions is sound designer, not the game program- play. Therefore, it’s not always avail- just whining about the amount of work mer. Rule 8 clearly shows the logic able for audio. Furthermore, creating involved in such an endeavor. behind this. It’s hard enough to interactive sound designs using KEEP SOUND DRIVERS EFFICIENT. When we explain which aspects of the world you streamed, branching digital audio seg- considered replacing the existing need to track. It’s almost impossible ments is limited in many ways, primar- sound driver with our own technology, (and I think unreasonable) to expect ily by disk space, seek times, bus band- we decided that our code would need the game programmers to write code to width, and buffer sizes. Red Book, or to be faster, smaller, easier to imple- mute and unmute specific MIDI chan- any kind of linear, streamed digital ment, and more capable than the code nels when various condition arise. To audio requires a lot of storage space in we would be replacing. Otherwise, the solve this problem, we created (with any situation. But it becomes even project was not worth undertaking. some help from Jim Wright at IBM’s more problematic in an adaptive set- Rule 1 dictates that sound drivers must Watson research lab) a programming ting where each variation of a given be small and fast, since both system language that allows us to author logi- section of music has to be remixed and RAM (where the driver resides) and cal commands within a stock MIDI stored uncompressed. Finally, most CPU time are scarce commodities in a sequencing environment and store http://www.gdmag.com OCTOBER 1997 GAME DEVELOPER INTERACTIVE AUDIO

them within a standard MIDI file. The the MIDI sequence beat. After some exploring, it becomes language contains a set of fairly simple has logic built into clear to the player that there are jumps Boolean functions (if then, else, endif), it. When the and expanses that cannot be passed in navigational commands (goto, label, numberofenemies regis- Gex’s normal state. Within this time, loop, loop end), a set of data manipula- ter is 0 and kills is 1, the player should also discover a num- tion commands (get, set, sweep), and the sequence is ber of chargers set out in various loca- parameter controls (channel volume, pan, paused, and playback of all tracks is tions. When Gex steps into a charger, transpose, and so on). Next, we created branched to a short stinger of the GEX he starts to glow in a green light with an auditioning tool that allowed us to theme song orchestrated with the orbiting electrons. This state lasts for simulate the run-time game environ- instrument palette of the Primal Zone 15 seconds and gives Gex the ability to ment, kick out logic-enhanced level. When the stinger is over, the use embedded “chips” in the floor to sequences, manipulate the game state main sequence is resumed. do super jumps and turn on “data variables, send commands, and see We keep a location register that bridges” that span the formerly what happens. allows the sound driver to see if Gex uncrossable chasms. has entered a new area of the map that The state of being charged up is has different music. The control track stored as a 1 in a chargedup register, and Case Study: The GEX Project checks every four beats to see if the location keeps track of the seven differ- value of location has changed. If it has, ent areas within the main level. When ost of my work this year has cen- a short transition drum fill plays, and the control track in the main sequence 30 Mtered around the interactive then the MIDI sequence that is sees a 1 in chargedup, it checks location sound design for our upcoming PC and matched with value of location is started and matches the area to one of seven PlayStation title, GEX: ENTER THE on the beat. different 15–second-long high-energy GECKO. (The PlayStation version will be SCREAM TV. Scream TV is the “horror” pieces of audio. the first title to use our new sound dri- level of ENTER THE While most often the game affects ver.) This game is the second install- GECKO. For this the sound design, this relationship can ment of the GEX franchise and has level, I used eerie also work the other way. In Circuit undergone a complete technological chamber music laid Central, we set a register at every beat overhaul by some of the best program- over some ambient of the music. Since each measure has mers and designers in the business. The loops of slow ragged four beats, I set the beats variable with a game will include at least eight worlds breathing and strange heartbeats. The 1 on the down beat followed by 2, 3, thematically based upon TV and movie same numberofenemies register is used in and 4 on the remaining three beats and parodies, as well as secret, bonus, and this level, but instead of muting and then cycle back to 1. This timing infor- boss levels — fertile ground for a sound unmuting, the value of the register mation will synchronize the lighting designer indeed. affects the harmonic center of the effects in this world. I’ll talk briefly about what we’re piece. For this type of transformation, doing currently in the game’s audio. we use a technique called “pitch map- For clarity’s sake, I’ve focused on the ping.” A pitch map in our system is a F O R F U R T H E R I N F O treatment of a variable called mechanism to remap the pitches of numberofenemies and a small number of individual notes as they come from the Antares related variables. These few examples MIDI sequence on their way to the http://www.antares-systems.com are by no means all that we plan to do physical voice. Our pitch maps are in the game, but they illustrate my built so that the transformation can be Digidesign http://www.digidesign.com main points. kept within the prevailing harmony of One aspect of the new GEX title is the piece. In other words, for a scary Ilio the game’s fast and efficient engine. It piece such as this, the pitch table will http://www.ilio.com allows us to have more enemies on confine all of the note remappings to a K.S. Waves screen moving at a faster rate. Since diminished scale. The numberofenemies http://www.waves.com this is one of the features that really value is used continuously to set the makes the product stand out, we on number of scale degrees upwards to Kurzweil the audio team designed the interac- transpose the harmonic instruments. http://www.youngchang.com/kurzweil tive audio to work tightly with the new This creates a very smooth, subtle, Oberheim engine functionality. We set up a 7-bit intensifying effect as more and more http://www.gibson.com/products variable called numberofenemies that enemies are on the screen and danger /oberheim reflects the number of enemies on the is increasing. screen and is updated by the game con- CIRCUIT CENTRAL. The Circuit Central Opcode tinually. This variable is read and used level looks like the http://www.opcode.com by the sound driver to adjust the game inside of a CPU. The Yamaha audio. opening music is http://www.yamaha.com Here’s a breakdown of the GEX weird, ambient ana- audio, by game level: log electronica with THE PRIMAL ZONE. The control track of a slow, trip-hop

GAME DEVELOPER OCTOBER 1997 http://www.gdmag.com INTERACTIVE AUDIO

Only the Beginning daptive audio is a very new field. Many challenges lie ahead, A but I firmly believe that it represents the future of sound in interactive media. To move forward, we need a major paradigm shift in how we think about music, great tools, new technology, and a healthy dose of realism. I hope that my anecdotes, rants, and factoids have shed some light on and sparked more interest in creating inter- active audio. So long for now from audio central at Crystal D. ■ Mark Steven Miller has been producing audio for interactive media since 1989, when he started Neuromantic Productions. Neuromantic Productions produced audio for over 60 titles for publishers such as Sega, Acclaim, Electronic Arts, and Virgin Interactive Entertainment. Since clos- ing Neuromantic in 1994, Mark has served as Audio Director for Sega of America and served as the Working Group Chairman of the Interactive Composition Work Group of the Interactive Audio Special Interest Group of the MMA (IA-SIG). Currently, Mark is the audio and video director for Crystal 32 Dynamics and serves as the Co-Chairman of the IA-SIG. Upon completion of his work on GEX: ENTER THE GECKO, Mark will be taking the position of Senior Producer at Harmonix Music Systems in Cambridge Mass.

GAME DEVELOPER OCTOBER 1997 http://www.gdmag.com SOUND WORLDS

CREATING AN INTERACTIVE AUDIO

34 ENVIRONMENT

udio in today’s interactive entertainment media has progressed

far beyond the bleeps of early video games. An object or an envi-

ronment within a game exhibits a number of complex relation-

ships. A creature may be surprised to see you. A robot’s gears

get stuck when it tries to move toward you. A diabolical

enemy is afraid of the dark. When encountering these ele-

ments in a game environment, we expect them to commu-

nicate to us through audio in subtle and different ways.

Aspects of emotion such as surprise, frustration, admira-

tion, and fear could easily be conveyed through an

enhanced and well thought-out object vocabulary.

BY DANIEL BERNSTEIN AGAMEA DEVELOPER OCTOBER 1997 http://www.gdmag.com Our lives are full of an ever-present collage of audio cues that we take for granted. For example, at this “quiet moment,” I can hear the cascading sound of a fountain in a pond, the intermittent quacking of ducks and geese, a baby in the background, someone pouring a bucket of water outside, and a plane flying overhead. FIGURE 1. Claw punches an enemy All of these cues, though subtle and and a hit sound is heard. An example FIGURE 2. “Maranax, infirmux!!!” A seemingly unimportant, create the of direct object communication. cultist spots the player in BLOOD. An ambience of a particular scene, imbu- example of indirect communication.

AN INTERACTIVE AUDIO VOCABULARY FEATURING

A WIDE ASSORTMENT OF SOUND CUES AND

BACKGROUND NOISES IMMERSES PLAYERS FAR 35

MORE THAN YOU MAY REALIZE. ing it with identity and significance. object to object and from context to quotes doesn’t become repetitive. From Without these background sounds, or context. There are three types of a programming standpoint, that may ambiences, our lives would sonically object interaction: direct, indirect, require a bit more intelligence to pick resemble a lunar landscape. A collec- and environmental. out the quotes. A buffer with an index tion of sound cues such as this within DIRECT COMMUNICATION. An object com- to the most recently used quotes helps a game environment refers to the non- municates directly as a cause of direct a lot because it shields the player from causal relationship of a player to the action on its part (Figure 1). When the experiencing the same “random” set of game. The sound space isn’t triggered ball hits the paddle in the old arcade sounds in rapid succession. by the player’s direct action. Instead, game PONG, it makes a bleep. This is INDIRECT COMMUNICATION. This is an indi- the sound is affected by and reacts to direct object interaction. Unfor- rect method of object interaction. That the environmental aspects of the tunately, most games haven’t is, by causing something to happen in scene that is being conveyed. explored far beyond this simplistic the game, something else responds When we go to a movie, our emo- level of object interaction. Direct com- sonically. A typical example of this is a tional response is directly related to munication is important when you “sighting” state for an enemy. When the music. The music swells, our want to convey specific audio cues, an enemy sees you, and his or her AI anticipation grows, and our adrena- such as a scream of pain when you changes, a sonic cue that signifies that line rushes. The music ebbs, and we shoot a monster, or the creak of a change may be appropriate. In feel a calming sensation. This is very wooden rocker when you push back a Monolith’s BLOOD, for example, easy to convey in a linear medium, rocking chair. In Monolith cultists scream in a terrifying foreign where the ending and the progression Production’s CLAW, I found it impor- language (created for the game drama) of events in a movie is predetermined; tant that every character had some- a series of epithets when they spot the but how do we compose a soundtrack thing different to say when you inter- player (Figure 2). In CLAW, every to a game if it can follow many paths act with him or her (or it), even if it’s enemy has something different to say and endings? An adaptive soundtrack in combat. For example, a melodra- in the “sighting” state. A female boss that responds well to game events is matic character, while dying, would taunts Claw in a mildly suggestive one of the best ways to envelop the say “I’m dying... I’m dying... I’m manner when they come into contact. player in a game experience. dying... I’m dead,” with an animation A goofy bear sailor exclaims “I don’t to suit. A more primitive character like you” when he sees a player. would emit a squawk, and a more sub- Other sonic cues may convey indi- Audio Object Vocabulary stantial enemy would yell out, “I curse rect object interaction. Your character you, Claw” as he falls to his death. may begin breathing heavily when he n audio object vocabulary is a When you hit a lounge-lizard-turned or she is tired (health is less than some A method by which game objects palace-guard-merman, he would say, coefficient). Your metal body suit (not necessarily just speaking ones) deadpan, “Ouch that hurt quite a bit.” emits a rubbing, squeaky noise that sig- talk to each other and the player. The As always, a variety of audio cues are nifies rusting. In addition to sonic cues methods of communication vary from paramount in ensuring that a set of that help convey complex visual phe- http://www.gdmag.com OCTOBER 1997 GAME DEVELOPER SOUND WORLDS

cal entity. But as with all different take you much further than a com- types of object interaction, it’s impor- mercial CD sound library ever tant to remember to keep a consistent could. Nothing kills a unique audio set of sounds from character to char- environment more quickly than the acter. In CLAW, I made a decision to phrase, "I’ve heard that somewhere use three different idle cues (environ- else before...." mental communication), four differ- 3. Collaborate with professional ent sighting cues (indirect communi- scriptwriters. Writers would jump at cation), and between eight and nine the opportunity to write a couple of FIGURE 3. “Umm, there’s nothing sounds (direct communication) to hundred lines of dialogue for some here to eat and I’m kinda hungry.” An describe each character sonically. In game characters. The results will example of environmental communi- the end, most characters used more definitely be worth the investment. cation. and some less than that average. 4. Don’t be afraid to inflate the vocab- However, planning the audio object ulary. Minimize silent time. If you vocabulary ahead of time helped to have the space for audio, use it. Set nomena, certain characters within the maximize the use of memory allotted the limit with the programmers and game display behaviors that can be con- to sound in the game. designers early as to your memory veyed easily through sonic cues, even if budget for audio, and use it wisely. they aren’t represented visually. Indirect 36 cues can be based on a number of differ- Character Development ent motivating factors, the rules of Ambient Sound which can be determined at the game he nature of a game object must design stage. For example, in Blizzard’s T be relayed in the character of its mbient sound refers to the sound WARCRAFT II, clicking on an ax-throwing “voice.” It’s very easy to screw up the A world that is generated from a troll more than once causes it to integrity of a character by giving dif- player’s location in the game space. It respond with annoyance, even though ferent visual and aural personalities. is a system of indirect and environ- no animation is being shown. This is However, giving the right “voice” can mental cues that immerse a player in a highly effective character enhancement. greatly enhance a character’s person- particular setting. As in my real-world ENVIRONMENTAL COMMUNICATION. A character ality. A weak character may be depict- example, we are surrounded by ambi- or object in the game may generate a ed through the use of a humorous ence all of our lives — a complex web system of audio cues on its own, irre- voice. A stronger character’s dramatic of sound. However, ambience is the spective of its communication to the personae can be highlighted through most underdeveloped side of sound player. This is purely a function of a the use of a deeper and more resonant design in interactive media. A game character’s existence in its environment. voice, as well as a script that relates with little or no ambient sound pre- It may be busy chatting to itself or other without question his or her authority. sents little or no connection to how characters. It may generate a sound or a TIPS AND TECHNIQUES. we perceive the outside world with series of sounds on its own. Our goofy 1. Always use professional voice our ears. An ambient sound world bear sailor from CLAW will comment on actors. Trained voice actors are pro- might be as simple as a single looping how hungry he is or where his pet rat fessionals who specialize in giving track of forest sounds or a system of might be when he’s in an idle state your character the voice it deserves. sound-producing objects all linked (Figure 3). Depending on where he is in Whether it is a cartoony or a deep together by their location within a the game, Caleb (the character you play resonant voice, a single talented given game environment. in BLOOD) may pick from a variety of actor may help develop your ideas The environment can communicate different show tunes to sing while he’s for multiple characters and realize to the player information important taking a break from the carnage. A thes- them in ways that you haven’t con- for the game-playing experience. For pian tiger from CLAW recites different ceived. When in doubt of how to example, a raven flies by in a forest, Shakespearean passages as he muses on find a good voice actor, look to tal- making a screeching sound that his own omnipotence. ent agencies and talent search ser- informs the player that he or she has Environmental communication vices for help. Moreover, making a ventured too far. A swamp makes a need not be comic, nor does it need to trained voice work with the rest of menacing gurgling sound, informing be vocal. A swishing blade and a hum- your mix is quite a bit easier than the player that he or she shouldn’t go ming motor sound signifies an indus- trying to amplify or equalize a weak there. The sound of a portal opening trial fan in BLOOD, while a phone may voice. All sound engineers can and closing in the distance informs be ringing intermittently. A character attest to this. the player that he or she is close to the may pass by an alien hive, with pods 2. Spend a little more time in sound level’s exit. emitting a terrifying whine. design. As in all cases, don't just Environmental ambiences fully Environmental communication is pull sound effects off of a CD. transport a player into the world pre- paramount in reinforcing a character Create sound effects from your own sented by the game. In CLAW, each or object’s existence in the game envi- sampled sounds as much as possi- level has a distinct set of ambient ronment. The character literally ble. A portable DAT recorder and a sounds based on the terrain that the comes alive as a personality or physi- good microphone in the field will main character is encountering.

GAME DEVELOPER OCTOBER 1997 http://www.gdmag.com Within a terrain, a single (environ- use trigger ambiences whenever mental) looping sound is used (such possible. Trigger ambiences help as the sound of a forest), along with a mask the loop point, as well as pro- set of sounds (indirect cues) that are vide overall variety in the ambi- triggered either by Claw’s location on ence. In Kesmai's AIR WARRIOR, I the map or by random chance. For used trigger ambiences to convey example, the sound of a character the sound world of a World War II whistling in a window matches the airfield. During any given time, an animation of the character shaving airplane fly-by sound, a vehicle and the background ambience of vil- drive-by sound, and an airplane lage noise. When Claw moves through startup sound would be selected another terrain, the looping ambient and played from a set of 50 or so A dark temple emits a sounds would cross-fade, and another trigger ambiences. Since these trigger FIGURE 4. menacing chant. set of ambient trigger sounds would ambiences were selected randomly be selected that corresponds to the and played at random times, the new terrain. sound world was always changing In BLOOD, I used ambience to and seldom repetitive. Another may resolve in one of an enormous enhance the atmosphere, as well as to method of avoiding loops is to queue number of ways. Event-driven music connote physical environments. In a similar sounds one after another. A engines (or adaptive audio engines) allow music to change along with 37 game state changes. Event-driven The inclusion of atmospheric elements music isn’t composed for linear play- back; instead, it’s written in such a adds to the spooky and scary nature of the way as to allow a certain music sequence (ranging in size from one game’s look and feel. note to several minutes of music) to transition into one or more other music sequences at any point in time. temple, distant chanting is heard set of three or four sounds that fit An event-driven music engine must (though the source of the chant is seamlessly end-to-end will work well contain two essential components: never discovered) (Figure 4). In a nar- if they are selected to play on a single • Control logic — a collection of com- row hallway, whispers surround the channel randomly. This helps break mands and scripts that control the player from all sides. The inclusion of up the pattern created by a single flow of music depending on the atmospheric elements adds to the looping sound. game state. spooky and scary nature of the game’s 4. Try to create fine gradations of ambi- • Segments — audio segments that can look and feel. ences. Say we’re walking from a for- be arranged horizontally or vertically TIPS AND TECHNIQUES. est into a mountain pass. We start according to the control logic. 1. Try to use consistent reverb settings. out in a deep forest then walk In Kesmai’s MULTIPLAYER BATTLE- All sounds within a given environ- through a leafy forest then into a TECH, control logic determined the ment should have a similar set of meadow before reaching the moun- selection of segments within a game reverb settings that place the entire tain pass. If we have a single sound state and the selection of sets of seg- sound world within a consistent for the forest ambience, no matter ments at game state changes. Thus, the acoustic space. There are foreground how the forest changes, the ambi- control logic was able to construct and background elements that do ence will remain the same until we melodies and bass lines out of one to stand out from within the ambience, change scenery drastically when we two measure segments following a but not so far as to mistake these reach the mountain pass. However, musical pattern. At game state changes, sound elements for characters or if we subdivide the forest into three a transition segment was played, and a objects that a player must encounter. gradations (deep, leafy, meadow), whole different set of segments was 2. Make your loops seamless. The we’d be better able to convey to the selected. However, this transition seg- looping ambiences in the game listener the transition of environ- ment was played only after the current need to be smooth and unnotice- ments from forest to mountain pass. set of segments finished playing so as able. Large variations in pitch or not to the flow of the music. I amplitude will make the loop quite selected game states and also tracked recognizable and annoying after a Adaptive Music game state changes based on the play- while. A rhythmic pattern works er’s relative health vs. the health of the well (like the sound of crickets), if he nonlinear medium of comput- opponent. Overall, I composed 220 it’s cut perfectly. Also, a longer T er gaming can lead a player down one to two measure segments that sound sample will help mask the an enormous number of pathways to could all be arranged algorithmically loop point. an enormous number of resolutions. by the control logic. What resulted was 3. Avoid loops. Though seamless loops From the standpoint of music compo- a soundtrack that was closely coupled are not an impossibility, it's best to sition, this means that a single piece with the game-playing experience. http://www.gdmag.com OCTOBER 1997 GAME DEVELOPER SOUND WORLDS

TIPS AND TECHNIQUES. 1. Music comes first. Remember that no matter how closely your music follows the game play and how interactive it is, if it doesn’t gel as a musical composition, you’re better off writing a linear score. Always explore all possibilities of transitions from one game state to the next, and see if the music reacts the way you meant it to react. Make sure that you write transition sequences and that the engine is intelligent enough not to change game states midmeasure or midphrase. 2. Decouple segments horizontally and vertically. Compose your music so that different segments may be combined end-to-end (horizontally), as well as on top of each other (vertically). This way, you can combine different melody lines with bass lines, use different ornamentation, and so on. 3. Don't give away too much information. Sometimes a musical cue might say too much, when it was meant just to highlight the game state change. For example, in a cer- tain game, an upward chord progression always signifies to a player that a starship is on his tail. When working on game state changes, make sure your event-driven music isn't used as an early warning system for the game. 4. Define a series of translation tables to track game state changes. For example, in MULTIPLAYER BATTLETECH, a game state change from “winning” to “advantage” implies a los- ing trend. The music reacts to this change by selecting a different set of segments than it would if the change occurred from “advantage” to “winning.” By composing in a nonlinear fashion, and by having the music react to the player’s actions directly and indirectly, we introduce a new level of interactivity. Emotionally, the soundtrack carries the person seamlessly along with the action in much the same way as the static, linear media of film. In this fashion, music becomes the gateway to the play- er’s emotional response to the game.

Total Immersion through Sound

s game designers and audio producers, we should be A constantly aware of the impact that a well thought-out audio environment can have on the product. It can make a graphically simple and uneventful scene become awe-inspir- ing. Effective use of an audio object vocabulary can enhance the impact a character may have on the game player. Ambient sounds, in all of their variety, can transform a game scene from a virtual one to a believable one. Surreal textures and atmospheric gestures can generate emotional responses in a player as varied as the soundscapes them- selves. As games become more and more complex and graphically spectacular, we must not overlook the role of audio in enhancing and completing that feeling of total immersion. ■ Daniel Bernstein manages Monolith Productions' Audio/ Video department in Kirkland, Washington. He has been the audio pro- ducer, sound designer, and composer on a number of successful commercial titles, most recently for BLOOD. When not listening to feedback loops, he enjoys spending time with his wife basking in the beautiful Seattle sunshine. He can be reached at [email protected]. Please, no e-mails after 10PM. DATA STRUCTURING

Fm LEDWARS LMK: Le i Scig Daa

hen I was 12 years old, I

40 wrote a DONKEY KONG clone

on a Sinclair ZX81 that had a

16K RAM expansion cartridge. The

game was embarrassingly slow, but

not entirely because of the Sinclair’s

speed. Part of the problem lay in the fact

that I coded each rolling barrel coming LEDWARS are completely different types er game, the data structures needed to down the ramps separately for every of games, they share a good deal of handle this potentially painful part of level. You can imagine the fun I had code. This reusability was possible in the design. I wanted to design the checking to see if the player collided part because I approached the develop- objects in the game so that they could be withWW one of these barrels. This was my ment of LMK (which I started first) in an handled the same way, regardless of first lesson in data structure design, and object-oriented way. whether they were controlled by the it was a valuable one. player or the computer. I also wanted to How you design your data structures make sure that the amount of data - can affect your game significantly. With Design Goals for LEDWARS essary for the AI to make decisions was careful planning, your data structures minimal, so that communication chan- can provide substantial performance f there’s one thing that’s important in nels were not deluged with data. Finally, gains. Throughout this article, I will use Ia strategy game such as LEDWARS, it’s LEDWARS needed to be able to deal with two games that I’ve been working on the intelligence of the computer oppo- many game objects at the same time. this year as examples of thoughtful data nent. As artificial intelligence usually When played in the “world war” mode structure design. The first is LEDWARS, a boils down to looking at loads of data, on a large map, the game can contain real-time strategy game (Figure 1); the this means that the data has to be easy thousands of player units and buildings. second is THE LADY, THE MAGE, AND THE to manipulate, and in a suitable format If all of this data was handled inefficient- KNIGHT (LMK), a role-playing game for the AI engine to use. The problem is ly, the game’s performance would slow (Figure 2). LMK is a multiplayer game that usually the best AI algorithms are to a crawl. set in a huge game world that you can created once the game is finished (and MULTIPLAYER CAPABILITIES. A multiplayer roam around freely. There are no levels, indeed they were in this case). Therefore, game needs some kind of messaging sys- as the entire map is connected. This it’s crucial that you can easily change AI tem, so I had to design one. I felt that brought up some interesting data struc- routines at any point in development the game’s code shouldn’t make any turing problems, which I’ll explain without impacting the rest of your distinction — beyond the user inter- shortly. Although both LMK and game. Since LEDWARS is also a multiplay- face controls — between local players

GAME DEVELOPER OCTOBER 1997 http://www.gdmag.com FIGURE 2. THE LADY, THE MAGE, AND THE KNIGHT (LMK), a FIGURE 1. LEDWARS, a real-time strategy game role-playing game

HOW YOU DESIGN YOUR DATA STRUCTURES IMPACTS 41

YOUR GAME’S PERFORMANCE AND ULTIMATELY THE

REUSABILITY OF YOUR CODE. by Swen Vincke and remote players. This code should reanalyze a situation every time it like satellites. They fly over the map send messages to a central data stream, moved a unit or constructed a build- slowly, gathering strategic information which receives messages coming from ing. Since situational analysis (for such as the importance of certain geo- all other network clients and AI oppo- example, assessing where the largest graphical areas, the threat of enemy nents. LEDWARS used a peer-to-peer sys- threat is) takes significant processor troop formations, and where the com- tem, which means that all of the code time, this section of the AI code had to puter should build its next strategic should be determinant. (Determinant be abstract enough to last multiple facilities. The master AI processes the means that given the same starting frames while a new situational analysis information that it has acquired from conditions, the game flow should be was under way. By “abstract enough,” I the sensors and game objects and the same on every machine in the net- mean that the AI really shouldn’t both- applies this information to its objec- work.) For instance, an AI opponent on er with things such as “This enemy tives. It proceeds by giving commands one computer cannot do something unit is here on this hill. If it moves a accordingly. This approach met all of other than what an AI on another com- little bit to the right, it’ll be able to the goals I had set forth: puter is doing. shoot the hell out of our unprotected • The AI has a good overview of the ARTIFICIAL INTELLIGENCE. I won’t talk much facilities.” Rather, the AI’s considera- situation at both the macro and about the AI in LEDWARS, as it would tion should be, “Look, this area, which micro levels, using its sensors and take up an entire other article (you can is of some importance to us, has some the information the game objects read about the pathfinding system in my threat to it.” An AI is better able to deal give it. article “Real-Time Pathfinding For with nonspecific information; the AI • Since game objects such as units Multiple Objects,” pp. 36-44, Game doesn’t have to track changes in a situ- and buildings supply data to the Developer, June 1997). Instead, I’ll touch ation for every frame. In the example, main AI, I have no need for addi- on how I managed the AI given the it is enough that the AI knows that tional structures other than those design goals. there is threat in this area. Even if the that already exist. An adaptable AI engine requires that enemy unit moves a bit, the threat • Modifying the AI simply requires you organize data in a straightforward remains. Given all of these considera- changing the rules that govern its way. If a lot of filters are necessary to tions, I split up the AI into three parts. decisions. I don’t have to rewrite the generate additional information, you The master AI receives most of its AI engine. might have to change the filters every data directly from game objects (for HANDLING DATA. As far as handling a large time something changes in the AI example, player units, buildings, and number of game objects, this problem code. Because so many units can be in so on) and “sensors.” The game objects was solved by distributing the workload the game simultaneously, our AI need- contain data such as the resources that for handling all objects over several ed to be able to remember previously they require, their team morale, and so frames. Only the visual aspects (such as calculated results. It couldn’t afford to on. The sensors, on the other hand, are animations and movement) are comput- http://www.gdmag.com OCTOBER 1997 GAME DEVELOPER DATA STRUCTURING

ed for every object every frame. If some- use completely rendered backgrounds, animated, a flag is set in the informa- thing more processor-intensive needs to tiles are used instead. As all game tion field of the tile that also contains be done, the object has to wait until its objects were going to be built from tiles, the collision information. A global turn. That way, a thousand units can be I decided to store collision information array, which is the same size as the handled over a single frame or twenty within the data structure of tiles. Listing number of tiles, directly remaps tiles to frames, at a processing rate of about fifty 1 shows the structures used for this, as a global array of animations. A “tile objects per frame. In this manner, it’s well as some of the other structures dis- group” is a collection of tiles with an x practically impossible for the player to cussed in the next paragraph. You’ll and y dimension. The next level in the notice any type of stall in the game dur- note that structures don’t contain object hierarchy is the “tile group col- ing computations. Once the data han- pointers to the structures they are made lection,” which is a series of tile dling section was completed, LEDWARS up off, rather they contain indexes to a groups. These different structures were was actually a fairly straightforward global array that contains all these struc- necessary to manage individual units, game to develop. tures. This is convenient because if you which consist of a tile group collection store your structures to disk, you don’t and some unit-specific data. Likewise, have to start figuring out where all those buildings consist of a tile group collec- Tiles as Data Structures pointers are pointing. tion and some building-specific data. LEDWARS also needed animations Since a lot of units and buildings in s a real-time strategy game, and tile groups. An “animation” is just the game use the same data, I split up A LEDWARS needed a map with a sequence of tiles, each of which have their information into “static” and 42 objects moving on it. Since the maps different appearances and contain dif- “dynamic” data. Static data never that the game requires are too large to ferent collision information. If a tile is changes for a particular unit type, and dynamic data changes and therefore must be allocated for every unit. By LISTING 1. The structures of game objects. categorizing data in this manner, I could create unit parents containing Tile definition: the static data for every unit and some typedef struct { default dynamic data. A new unit in long ImageIndex ;//Index to a list of images the game copies the data from its par- long Info ;//Bitpacked information like for instance collision information ent, and then fills in the dynamic data //Also contains a bit which indicates if this tile is animated. as needed. The same goes for the //There exists a global array which remaps tiles to an animation(See buildings. Finally, a “map” is a collec- next definition) tion of units, buildings, and tiles (see } TTile ; Figure 3).

Animation definition: typedef struct { Design Goals for LMK long AnimationSize ;//Size of the animation long *AnimationList ;//Contains indices to a global array of Tiles hile LEDWARS was a relatively } TAnimation ; W straightforward game to devel- op, LMK was new territory. In LMK, TileGroup definition: the game world is highly detailed. The typedef struct { player has to be able to interact with long XSize,YSize ;//Dimension of the group every object — books, cupboards, long *TileList ;// Contains indices to a global array of Tiles magical potions, and so on — and } TTileGroup ; every nonplayer character (NPC). Players have to be able to use objects, TileCollection definition: to drop them, to use objects on one typedef struct { another, and to change these objects. long AmountOfGroups ;//How many groups are there in this collection It was therefore important to design long *GroupList ;//Contains indices to a global array of tilegroups the data structure of game objects } TTileCollection ; carefully. Here’s how it was done: • Objects are made up of a series of UnitParent definition: bit-packed information chunks typedef struct { that indicate what a player or NPC //Static data can do with that object. For exam- long TileCollection ;//Index to a global array of TileCollections ple, if a player uses a torch, it Game specific unit data starts burning, but to use a piece Dynamic data of meat, the player eats it. Default values • Objects can contain containers, } TUnitParent ; which in turn may be made up of (Continued on page 44.) other containers. A cupboard, for

GAME DEVELOPER OCTOBER 1997 http://www.gdmag.com DATA STRUCTURING

parties. Thus, the world FIGURE 3. Object relations for LEDWARS. Necessity, the Mother of Efficient has to be synchronized. It isn’t possible to delay Programming these updates until a player switches to a char- hese challenges necessitated an acter near the action, T extremely creative design for my because the updates data structures. First, I needed a smart delay the character- image manager that required minimal switching process, and disk reads and yet kept within memory switching between char- constraints — a system that would acters is a common purge data from memory if it wasn’t aspect of the game. To immediately needed. The game also make matters worse, required smart clipping features — LMK’s game world is very there’s no way the entire game world environmentally diverse could exist in a computer’s memory, (for example, the south yet I couldn’t sacrifice speedy pole and equator don’t around the world. Faced with this con- look alike), necessitating straint, I designed an image manager a great deal of different that determines the popularity of cer- 44 background art. tain images. Popular images are the Characters and monsters hardest to free from memory, while typically require 200-300 those that are seldom needed can be frames of animation, and discarded very easily. Since block reads instance, can contain a chest, the average humanoid is 150 pixels tall. are a lot faster than separate seeks for which in turn can contain a bag, We needed a solution that would solve every block that you need, the image which can contain a pouch, which all of these problems. manager also tries to anticipate what it may contain one gold coin. • Each player’s (or NPC’s) inventory LISTING 1 (CONT.). The structures of game objects. consists of objects or containers, which affect the character’s statis- Unit definition: tics. If there’s part of a mutilated typedef struct { body in the bag you are carrying, TUnitParent *Parent ; then your charisma goes down. //Dynamic data • NPCs can interact with the objects Game specific data and with each other. For instance, } TUnitType ; they can talk to each other or exchange objects. BuildingParent definition: • Players can question NPCs, and typedef struct { depending on the player’s behavior //Static data during the conversation and also long TileCollection ;//Index to a global array of TileCollections outside it (such as when you steal Game specific unit data something from somebody), NPCs Dynamic data will react differently, thanks to high- Default values ly detailed NPC scripts that can } TBuildingParent ; change dynamically. All of these facets wouldn’t have been Building definition: too difficult to deal with from a develop- typedef struct { ment standpoint, but problems arose as TBuildingParent *Parent ; a result of two design decisions made //Dynamic data early on: to construct the game as one Game specific data continuous level and to allow multiplay- } TBuildingType ; er functionality. Developing the game quickly became Map definition: complicated. For instance, if a player typedef struct { drops an object, every player in that unsigned long XSize,YSize ;//Map dimensions game has to be immediately updated unsigned long AmountOfUnits ;//Amount of units in map with that information, no matter how TUnitType *GameUnits ; far from that action they are. The unsigned long AmountOfBuildings ;//Amount of buildings in map nature of the game play is such that TbuildingType *GameBuildings ; players have to rapidly switch between } TMapType ; the several characters belonging to their

GAME DEVELOPER OCTOBER 1997 http://www.gdmag.com will need and when. Based on this take on objects within the game (and all the player is still looking at the same information, it tries to read as many the nice things they can do to one spot in n frames, you will show Clovis images as possible from disk to memory another). Rather than extrapolating the moving towards the door, opening it, in one long (but not too long) block results of certain actions in real time, and entering to kill everybody who is read. The more memory in a player’s LMK calculates what a character is likely inside. So you’d better start loading in machine, the more images the system to do when it approaches an object (for the animation frames for Clovis and get caches. The same goes for the part of instance, eating every single piece of to it. If the situation changes, I’ll tell the map that is in memory. Depending meat in a city), saving a lot of comput- you on a need-to-know basis. And for on the speed and available memory, the ing power. Once again, using abstraction God’s sake, don’t send me a ‘Didn’t system takes as much of the map as it layers is the method. And again, just as receive packet’ message, because I’m can, leaving a lot of the map in com- in LEDWARS, distributing the workload too busy with a bunch of lunatic play- pressed form until it’s needed. over several frames helps a lot. ers who think slaughtering a town is A great deal of data abstraction and Since LMK is a multiplayer game, it fun, and now I’ll also need to tell every- techniques were needed a messaging system like the one body that a door has opened.” Using required to solve problems relating to in LEDWARS, with the difference that this sort of system actually lightens the distances between characters and far- LMK required a client/server architecture network communication load! away objects. LMK’s map system can — at least to a certain degree. LMK’s do operations on objects throughout objects are managed in a peer-to-peer the game world without having to fashion, so that if you move an object, Different Games, Similar Data know much about these objects. For all of the other clients update their view Structures 45 instance, suppose the player thinks of the game world with that movement that it would be a good idea to block information. However, if you kill a mon- t its core, LMK uses three types of the entrance to a house with a table. ster, only the server is updated. In this A images: tiles, objects, and charac- An NPC wants to enter that house, but sense, characters and objects are treated ters. Object and character imagery have can only do so by moving the table. To differently by the system. The server tells bounding-box collision information, enable this maneuver, the system first the clients what characters they see and while tiles have simple 2D bit-encoded needs to know that there is a table what they will do. When an NPC nears collision information. Animations can blocking the NPC, that the NPC is the current window of a local player, the contain any of these three image types. strong enough to move the table (for server sends a packet to the client telling Tiles consist of image and collision which it also needs to know the table’s it that this NPC is coming up along with information. Objects are collections of weight), and where it can safely move information that describes its intentions. animations or images, plus specific the table. If the current window on the For instance, the server can tell a object information. Characters are col- map is far away from the location of client something like, “Listen up. This lections of animations and specific the offending table, that’s a lot of murderous NPC named Clovis is going character information. A map is a col- things the game needs to know. To to open the door you’re staring at. If lection of characters, objects, and tiles. make matters worse, it’s possible that there are items laying on the table that will fall if the NPC moves the table. FIGURE 4. LMK deals with the huge world map using data abstraction layers. LMK addresses this problem by using When parts of the map are read in, the layers are blended with the real game map. several layers of information abstraction and working on these rather than directly on the world data. Once the part of the world where the table stands is read in, these layers are blended with the world again. One such data abstrac- tion layer contains the total weight of a number of objects standing on a partic- ular tile. Based on this compressed data, the system decides whether a NPC should move around an object or just move the object itself. Another layer, which divides the map in regions, remembers which objects should be moved. By doing some calculations using this latter layer, the system can effectively move the table with every- thing on it once that part of the world is loaded into memory (Figure 4). The same goes for the characters; the characters have huge data structures because of all the actions that they can http://www.gdmag.com OCTOBER 1997 GAME DEVELOPER DATA STRUCTURING

Figure 5 shows these relationships. Sound familiar? It should — LMK’s data structures are nearly identical to More Pathfinding Tricks those found in LEDWARS, despite the fact that the two are different types of games. n my previous Game Developer arti- speed will deteriorate quickly. Because of their similarities at the data cle, which talked about pathfinding The idea is to create an extra layer that structure level, I could use virtually the in real time, I talked about the prob- is the same size as the search space in same level editors for both games, and a Ilems that occur when there is no which your search algorithm operates. This significant portion of common code was path. I suggested using the bidirectional A* extra layer divides the map in several shared between the two. One aspect of path. An optimization that I didn’t mention areas, so that every node within that area game development that most novices and that I used in LEDWARS is precalculating is accessible from another node within that underestimate is the amount of work impossible paths. This technique is fairly area. This implies that there is no path necessary to build the application frame- simple and can augment your game speed between two nodes from different areas. A works for a game. You need tools to con- tremendously. The game speed really ben- map with a lot of islands in it, therefore, vert your artwork into a format suitable efits when you have a computer opponent contains a lot of areas, whereas a map that for your game, you need editors to create that also needs to calculate paths. The isn’t complicated contains few areas. The your game worlds, and you need a opponent is more likely to try impossible following algorithm shows how to create whole range of (usually) home-brewed paths, and if he keeps on trying, your game such a layer. utilities to facilitate the filling in of your 46 data structures. The quality of a game Algorithm often depends on the quality of the 1. Take a node that hasn’t been designated to an area yet, and create a new area for it. underlying application framework. For 2. Do a breadth-first search from that node, assigning all nodes that can be reached instance, if you are creating a real-time from the root node to the last created area. strategy game, and you find it difficult to 3. Repeat from Step 1 until there are no more nodes that haven’t been assigned to an change the position of a laser turret, area you’ll be discouraged to do so even if it Once this extra layer has been created, all you need to do to determine whether a will improve game play. path is possible or not is to check whether the start and destination lie in the same The problem with creating application area. Simple isn’t it? frameworks, however, is that it’s one of the more tedious parts of development. (At least I think so. But I’m sure a lot of need to be written back into the com- that block. Since most of the map exists database developers out there just love pressed world. However, there are tens of on disk, and not in memory, I can’t building them.) You can minimize the thousands of objects in LMK, and each move large parts of that block. To solve amount of time that you spend develop- has its own set of variable data. This this problem, I created two maps: a high- ing application frameworks by reusing makes inserting objects into the map ly compressed map of the original world, them across titles, as I did. I developed almost impossible. Insert operations in a and a map that tracks the changes that LEDWARS while I was busy with LMK, block of information such as a map usu- the players make. and if I add up the time I actually ally require that you move a large part of The first map is changed when an worked on LEDWARS, it would come to as little as five months — not bad for a solo FIGURE 5. Object relations for LMK. programmer. But I could never have pulled this off if I hadn’t set myself up to reuse a significant amount of LMK code in LEDWARS.

Problems Posed by LMK

major recurring challenge during A the development of LMK was finding ways to compress data more and more, and access it at increasingly faster rates. There’s an old rule that states that if you spend a lot of time developing the compression scheme, the decompression step typically becomes faster. This rule of thumb proved to be true in the case of LMK. Because LMK’s game world can be modified during a game (for example, players can move objects), these changes

GAME DEVELOPER OCTOBER 1997 http://www.gdmag.com operation doesn’t require insertion or deletion. For instance, lighting a torch The Bug Hunt is simply a matter of setting a bit in the compressed map. Moving a glass is ven with the messaging sys- was defined in a function that wasn’t trickier. A bit it is set in the first map tem in place, the world organi- called on a regular basis. indicating that the entry occupied by zation set up, the structure of LEDWARS’ worst bug had nothing to do the glass is now free. Once the glass is E the AI taken care of, and a way with the game play. After a while in multi- put down again, the system checks if to cope with numerous units, I was still player mode, various players’ games there is a free slot in the highly com- late in delivering LEDWARS to my publish- were getting unsynchronized. Some unit- pressed map. If not, it puts the glass in er. How could that happen? Given the specific data was different on one the second map. This is an adequate explanation of data structures, it all machine than on the other machines. The solution, since the total number of sounds fairly easy. However, in the end, it game was designed in such a way that all objects moved by the players is much was the AI and the multiplayer sections of events were completely deterministic. lower than the number of objects that the game that held up the game. My data There was no function in the entire game they actually use. And as you can see, structure design made it simple to that could affect the game state as a using objects usually changes data change the AI. First it was too easy, then result of a local dependency. I checked to that is easily written back in the origi- it was too hard. Ultimately I just put in a see if any functions could be generating nal map. slider that you could change in real time unpredictable values. They weren’t. The The client/server architecture great- to adjust the difficulty level. moment the game became unsynchro- ly simplified how data is handled. 47 Synchronizing the multiplayer system nized, numerous debug reports were gen- Except for the objects, nothing needs was also a horror. I spent several weeks erated. The desynchronizing problems to be synchronized, since the server trying to establish what was wrong with typically appeared after playing the game handles most of this work. In it. It’s something I’ll share with you so for a long time, but we couldn’t isolate LEDWARS, it was the peer-to-peer unit that you don’t make the same mistakes. the problems. Even replaying the game synchronization that caused a lot of The obvious flaws were a result of ref- using recorded macros couldn’t repro- headaches, and it would have been erences to something the player did on duce the synchronization problem. We even worse in LMK if the characters the local machine that somehow affected were stumped. used a similar system. The only thing I the game flow. If a player clicks on a unit, I’m amazed I actually discovered the needed to bother with was designing a sample audio clip is picked randomly cause of the problem. The game’s options the message structures so that a lot from a series and played. It was coded screen, where players could adjust set- could be said in as little information like this: tings for difficulty, volume, game speed, as possible. My lesson? When given a PlaySample(UnitSamplesList[FIGHTSOUNDS] and so on, was 482 pixels high, instead of choice, opt for a client/server architec- [u->parent][rand()%MAXFIGHTSOUNDS]) 480 as I presumed. Launching this screen ture (see Figures 6 and 7). This desynchronized the random seed. corrupted the heap slightly, which much Games often use random numbers to gen- later generated erratic behavior on that erate random behavior. In a system player’s machine. Object Referencing where it is important to have code that is When two machines in a multiplayer determinant, it’s important that the same game under the peer-to-peer system bjects (for example, tiles and random numbers are generated at the don’t have synchronized game states, O units) reference each other using same time on all machines. Random num- check the following: direct indexing. This is fastest and bers are generated using a formula that • Is there something that is generated most convenient for debugging and depends on a seed. The seed value deter- locally that affects the game states ? reading/writing the structures to disk. mines which will be the next number in The random seed problem is an exam- For instance, in LEDWARS, a tile group the series of random numbers. If you call ple of this. contains a series of indices that refer rand() on one machine and not on the • Are the default values different on dif- to a global array of tiles. A tile collec- other, then both machines cannot be ferent machines? Think of the problem tion has a series of indices that refer to expected to generate the same random that I had with a static variable, but also a global list of tile groups. A unit par- number. think of global variables that aren’t ent references a tile collection using A more serious bug was related to stat- reinitialized each time you start a game. an index that directly references a ic variables. When we tested LEDWARS, • Is the output of your functions global list of tile collections. A unit everything was fine because everybody machine independent? An 8MB references a global list of unit parents copied the game from a server. The static machine has more memory than a again using a direct index. The same variables were all initialized to the same 16MB machine, so the 8MB machine goes for buildings. The problem with value. When someone played a single- might disable some functionality in this referencing system is that some- player game first, and then joined a mul- your game which is available on the times you get the impression that tiplayer game, all hell broke loose. What 16MB machine. your data is far away. It may be a good made this bug tricky to isolate was that If the answer to any of these questions idea to store some redundant data its effects were seen hours after testers is yes, you probably have a situation in (particularly display code) within your had begun playing; the static variable which the memory is corrupted. classes to allow quicker referencing. For instance, if a unit is made up of several http://www.gdmag.com OCTOBER 1997 GAME DEVELOPER DATA STRUCTURING

FIGURE 6. LEDWARS uses peer to peer FIGURE 7. LMK uses client/server time for future projects and communication. communication. provides some other advan- tages as well. You are forced to consider how you struc- ture data; the more complex your data gets, the lower your chances of ever reusing it. Another advantage of reusability is that it makes the task of programming a multiplayer game easier, since a componentized archi- tecture lets you substitute multiplayer modules where necessary. Finally, the num- tiles, every time you need to draw a tile, engines and editors that will be ber of bugs is reduced, since compo- you have to traverse the entire referenc- reusable in future games. Using data- nents can be tested individually. The ing chain, which costs you some speed. base technology wherever possible challenge to the developer becomes was one means to this end. Database one of allowing smooth interaction 48 tools support multi-user environments between the components. Then again, Keep It Simple, Efficient and allow more than one editor to if it all were so easy, everybody would work on the same section of data. be doing it. ■ lthough my team has been work- Database files can also easily be com- Since Swen started coding, the stock price A ing on LMK for quite some time piled into a game format, and it’s easy of Coca Cola went up. You can reach him now, we still have another six months to edit them using available tools. at [email protected]. His company’s web site, of development ahead of us. Through- What it all boils down to is reusabil- which contains more information about out the project, we’ve tried to develop ity. Reusability reduces development LEDWARS and LMK, is at www.larian.com. POSTMORTEM

DARK SUN ONLINE: CRIMSON SANDS

he initial design goals for

DARK SUN ONLINE (also

50 known as DSO) were quite simple.

We were tasked to take the DARK SUN

II single-player code base and turn it

into a large-scale multiplayer online TTgame for AT&T’s now-defunct Interchange network. The game was initially planned

around a client/server architecture

(although it didn’t end up that way) to

protect against hacking, to support thou-

sands of simultaneous players, and to have

plenty of quests and global events to keep

players entertained. However, while

designing the project, we had several con-

siderations to keep in mind:

GAME DEVELOPER OCTOBER 1997 http://www.gdmag.com First, our resources seen the success of were quite limited, NEVERWINTER especially when it NIGHTS on America came to art and OnLine, the compa- audio. We had one ny wished to fund part-time artist avail- the development of able to create the a sequel based on few odd objects that the DARK SUN we absolutely had to engine for its exclu- have; otherwise, we sive online use. had to make do with Our first challenges became apparent in October of that art we could reuse year as the contract was signed and work began. Due to and steal from other some overly aggressive estimates as to the ease of porting internal projects. We DARK SUN II to an online environment, the project was basi- had the same limita- cally underbid from the very beginning. This had many ram- tions with sound ifications, beginning with a lack of art and sound resources and music resources to draw upon, and continuing with difficulties keeping and often had to go external team members’ morale up. to extraordinary Thanks to these resource constraints, we had to go to great lengths to find quali- lengths to get the material needed to create the game. To 51 ty material. begin with, we raided the source code archives and reused

PORTING A STAND-ALONE, DOS-BASED RPG TO A

32-BIT WINDOWS-BASED ONLINE NETWORK CAN

BE...CHALLENGING. HERE’S WHAT HAPPENED

TO SSI ALONG THE WAY. by André Vrignaud

Second, we knew we had to use the existing code base art from both DARK SUN I and DARK SUN II. This turned out to and couldn’t rewrite the game from scratch. This obviously be more difficult than it sounds, since there was a slight per- tied us down with a great deal of baggage, not the least of spective shift from the first game to the second, and much of which was that we were using a dated game engine, both the early art simply didn’t look right in the new DARK SUN II graphically and in terms of the game’s code. Because of perspective. We also borrowed a great this we chose not to focus on the graphical aspects of the deal of art from an SSI title called AL- game, which would have been futile, but dedicated all of QADIM, which had an Arabian Nights our resources toward creating a multiplayer game with theme. Although much of the art was strong game play elements. unusable for the same perspective rea- Finally, we had to coordinate all of our efforts with an sons, some fit perfectly. external programming group and contract art group. As Sand is sand, after all, no you’ll see, there were definite challenges with meshing the matter what angle you internal game design and the external programmers. In view it from! addition, we had to go through many iterations of art cre- For the entire duration ation for some of the new characters and monsters. This of the project, we only proved to be an entertaining experience in its own right. had a half-time artist to do some miscellaneous objects, interim cut- Where It All Began scenes, and cinematics. Since there was always a he origins of DARK SUN ONLINE can be traced back to the huge crunch going on T summer of 1994 when representatives of AT&T’s with other internal pro- Interchange network approached SSI to do a new ADVANCED jects, we also had to deal DUNGEONS AND DRAGONS online game. At that time, AT&T with losing that artist at was in the process of planning its own proprietary online the oddest (and most service, and believed that having a strong game presence frustrating) times — would be of great help in launching the network. Having especially since there http://www.gdmag.com OCTOBER 1997 GAME DEVELOPER POSTMORTEM

were able to draw upon the sound effects from Dark Sun I and II, which pretty much covered most of what we needed. However, we were still a little short in some areas and cast about try- ing to find a few more additional effects. Lo-and-behold, the sound department coincidentally sent out a large archive of .WAV files from the soon-to-be The “gecko-like” Dragon. released THUNDERSCAPE title for use as “Barney,” the Nightmare Beast. Windows event sounds. Much to the chagrin of some on the THUNDERSCAPE was enough work to keep several artists team, those effects quickly found their imagine, this became a bad morale occupied for months. One of the way into DSO. issue for the group. biggest effects that this situation had This morale problem reared its ugly upon the original game’s design was head quite quickly as the external pro- the loss of all of the game’s cinematics, grammers and internal scriptors began apart from the introduction. to interact. Earlier DARK SUN games (Ironically, even this introductory cine- (other than the art work) were created 52 matic was only available for a short as a joint effort between the program- time in the DARK SUN ONLINE 1.0 retail mers and the scriptors (also known as version. Later versions of the game the designers). The programmers were never re-released at the retail would work on the game engine, level, and the introductory cinematic adding features such as spells, new scene was too large to be included in monster effects, and new GPL (Game the downloadable versions.) Programming Language) commands Additional art work that needed to for the scriptors’ use. Meanwhile, the be accomplished for this project scriptors would use GPL to code the included the customization of hun- actual adventure parts of the game — dreds of player icons, some perspective the events, quests, and NPCs (nonplay- tweaks on DARK SUN I monsters, and er characters). The key to this arrange- the creation of several new monsters. ment working harmoniously was that Since we effectively had no internal most of the GPL-interpreting code (in resources to create this art, we turned the engine itself) was already done, to an external art house. allowing the scriptors to work relative- The character portraits went relative- ly autonomously. Unfortunately, this Much of the art from DSO was ly well, with only a few redos on den- wasn’t the case with DSO. reused from earlier games tal-floss bikini bottoms and overly- The big problem with this project endowed female characters. The Dark was that the external programmers Sun I monsters were also tweaked with had to take a code base for a game little problem. Unfortunately, the new Using Contracted Developers that was designed as a single-player monsters turned out to be far more game and make it a multiplayer game. challenging for the external artists. eyond all of the internal resource Unfortunately, the original program- Two monsters in particular — the B issues, DARK SUN ONLINE was also mers (on DARK SUN I AND II) made Dragon and the Nightmare Beast — an interesting project due to its use of assumptions about the way certain were somewhat less than fearsome. As external programming talent for the GPL commands would work, in order you can see from the sample art, the online coding and porting of the game. to save time on coding error-checking Dragon (even after some rework) At the time, SSI had no internal online routines. For example, the original looked like a gecko, and the Nightmare programming talent available to code a programmers never had to deal with Beast… well, the Nightmare Beast just multiplayer version of DSO. So the the possibility of two different people looked like Barney. Perhaps luckily, the online coding was subcontracted out to trying to talk to the same NPC at the Dragon encounter ended up being cut an external programming group. Now, same time; it simply wasn’t possible in from the game, and since we never working with external groups is pretty a single-player game. However, this could get Barney looking right, his common in the industry, and normally situation is extremely common in the appearance was cut, too. (There were isn’t that big of a problem. Unfortunately, online version. The result of this was those who thought keeping Barney in due to some political and financial that the external programming group could be quite a cathartic experience to issues, the contract was finally signed had to recode the way GPL worked — certain twisted people, but fortunately (over a few objections) with the exter- many, many times as the game’s saner minds prevailed.) nal group getting paid on a strict mile- development progressed and we We did much better as far as sound stone basis, with no royalty points or learned more about how the engine effects went. Digging in the archives, we interest in the finished title. As you can would really work.

GAME DEVELOPER OCTOBER 1997 http://www.gdmag.com Rich Donnelly, the lead scriptor for DARK SUN ONLINE says, “Oftentimes, I would write script for the engine, and the engine would change halfway through, in such a manner that the script would no longer function. Even worse, there were times when crucial information was lost in the associating chain, such as new GPL functions or commands. This caused a lot of strife and recoding on everyone’s part.” To sum up, since the external pro- gramming group had no buy-in or incentive to make the project the best it could be, they generally took the easier path whenever possible. The most grievous example of this was the networking change from the planned client/server architecture to a peer-to- peer system. Due to low morale and 53 compensation, the external group insisted on coding the networking architecture as a peer-to-peer network, using the local clients to run most of Sysop tools were added that allowed the DSO world to expand beyond its origi- the game logic. Although we raised nal size and let players discover new challenges. the red flag multiple times about problems inherent with this scheme, subsequent releases, but the internal up for seemingly no reason, and we were our team was overruled in the inter- management at SSI was still a little unable to get the source code for the ests of keeping costs low. To be fair, gun-shy, and asked us to set up a com- protocol stack to try to fix the bug. the peer-to-peer coding was done pletely separate network for our devel- Eventually, we scrapped that effort and competently for what it was. opment work. This in turn meant we ported DSO to a true Windows applica- Unfortunately, though, this type of needed a UNIX box to run the game’s tion. In retrospect, we probably should networking code wasn’t the best for server code, which meant we needed to have bit the bullet early on and moved the game at large, and we had to deal set up and configure a Linux box the game to a Win32 application from with the hacking issues that it raised (Linux is a free variant of UNIX) to act the start. for the life of the project. as the host. To make a long story short, After this initial setback, work pro- configuring a UNIX machine isn’t an gressed for a few months without any easy task, and by the time we got the particular disasters to note. Art from The Debugging Process hardware, built the network, and con- the external group was slowly coming figured the host, we had lost a few together, and we resolved most of our few months passed, and eventual- weeks of development time. sound and music issues. The external A ly the programming group got The greatest hit that our original time- programming group was hitting its the engine to the point where the line took resulted from the initial plan to milestones, and all in all, everything scriptors could do some GPL coding run DARK SUN ONLINE as a DOS applica- was quiet. Yes, as many of you just without having to restart every month. tion in a DOS box, but communicate guessed, too quiet. At this point, the scriptors dug in and with a Windows-based TCP/IP stack. In early November of 1995, I started coding the underlying global AT&T’s Interchange online service was a received a call from the head of routines for the game, and the external Windows 3.1 application and ran over a Interchange’s game group. It turned programmers started modifying the proprietary TCP/IP stack that AT&T had out that AT&T had pulled one of their game engine to work over an IPX net- licensed. Since the original DARK SUN classic turn-arounds and decided that work, which would to allow us to test games were DOS applications, and since it didn’t actually want to be in the and develop internally. Within a few Windows 95 hadn’t yet penetrated the online network business after all. In weeks, we had that IPX-capable version market sufficiently, it was thought best short, AT&T’s Interchange network of the engine to work with — which to keep DARK SUN ONLINE as a DOS appli- was canceled, along with all of the raised new issues. cation. We would depend on a “shim” projects being funded for it — includ- Chronologically, this was soon after of sorts to allow the game to communi- ing DARK SUN ONLINE. DOOM was released, and if you’ll recall, cate with the Windows protocol stack. At first, it didn’t look too bad. the early versions of DOOM had prob- We spent a couple of painful months Although we didn’t have a network to lems with packet flooding, which trying to get this going, and eventually launch the game on, we had gotten a brought down quite a few corporate had something that worked, but not great deal of the project funded, and networks. This was quickly fixed in well. The shim would occasionally lock through a nice quirk in the contract, all http://www.gdmag.com OCTOBER 1997 GAME DEVELOPER POSTMORTEM

ties instead of individuals, or monster reports into our database. In fact, due generation routines for general combat to the kludged nature of our bug-track- encounters that could incorporate sev- ing system, we ended up having each eral different players in the same com- and every bug sent to my office e-mail bat. Suddenly, I found myself with lit- account. I would then log in every tle time to correct these problems. I morning and run a mailbox filter, for- worked heavily for about a month, and warding all of the bugs to my lead managed to finish getting everything tester to sort, compile, and enter into implemented and working.” our internal bug system. I don’t think he’s forgiven me to this day. LESSON THREE. Have a FAQ. Period. Every morn- The Beta Test ing I would spend hours reading and answering hundreds of messages. he extra months added to our Some were suggestions, some were T schedule after AT&T folder their flames, but most were simple ques- service were quite useful, as they gave tions — and we quickly realized that us some extra time to prepare for the we were seeing a great deal of them external beta test. Although we had a over and over. However, once I got the rights to the game reverted back to SSI. core group of internal testers on the FAQ written and published, the flood 54 This allowed us to shop the title project, we knew that we’d need to run relented… a little. Beyond that, around to different networks and possi- a large-scale external test to really though, the FAQ turned out to be a bly negotiate a better royalty deal. shake out all of the bugs. To that end, great promotional and educational Unfortunately, this process took sever- we prepared a web page that gave tool; it even staved off our marketing al months, and since SSI’s internal instructions on how to sign-up for the department a few times by proactively management wasn’t confident that beta test — and were quickly inundat- giving them whatever information they’d be able to find somewhere to ed with responses. they were looking for. Really, now — place the title, the project was placed We originally planned to solicit beta can you ask for a better reason to do a on a back burner. A couple of the scrip- testers and mail out a CD-ROM to FAQ than that? tors and I continued development, everyone who responded. LESSON FOUR. Don’t hype the product along with the external programmers, Unfortunately, so many people until it’s ready. We purposely kept but little other work was done. responded that we couldn’t follow quiet about the title until very late in However, a few months later, it was through and were only able to send out the project and were thus mostly able decided that TEN was the appropriate around 500 discs; however, the rest of to handle peoples’ expectations. (I say network for the title, and work began the testers were able to download a “mostly” because there are some peo- again in earnest in January of 1996 — 30MB PKZipped version of the game. ple you’ll never be able to satisfy.) We with one other little bump. The beta period in particular proved wince now when we see the hype that’s In mid-January, one of the three to be quite an educational experience, been built around ULTIMA ONLINE. internal scriptors decided to move on and we definitely learned some lessons Although UO is likely to be an impres- to new opportunities. This normally from it. In fact, it’s probably worth sive and groundbreaking product once wouldn’t have been that big a deal — taking a bit of space here to list some it’s finished, it’s also unlikely to ever things were moving along well, and of them. satisfy the heightened expectations the two remaining scriptors would sim- LESSON ONE. You can never allocate too that have been built up around it. ply have had to pick up the remaining much time for beta testing and debug- LESSON FIVE. Make it extremely clear work and take care of it in the extra ging an online title. The sheer number that it’s a beta-test. Then do it again. months we’d allocate for them. of bugs found by the external testers And again… and yes, yet again. Even However, the scriptor that left was was absolutely amazing — and the so, I guarantee you people will threat- responsible for a great deal of the glob- potential for each of those bugs to en, flame, and otherwise get extremely al game code upon which the game, cause havoc was greatly magnified by mad at you when changes are made. along with much of the other scriptors’ the interactive nature of the game. As Donnelly says, “Players are not con- work, depended. Sadly enough, it Allocate significantly more time than cerned with the fact that the game turned out that much of that work had you first think for your testing period may not be in its final state — if you either not been done, or had been — and double it. Seriously. change anything, there will be com- done so poorly that the code couldn’t LESSON TWO. Be sure to have robust be depended upon. It fell to Rich facilities to deal with the flood of bugs. Donnelly to pick up the pieces. I highly recommend setting up some “It was quite horrific for me to find method for external testers to enter that the game was missing some seri- their bugs on a web page, and a ous pieces of code. These were pieces method to import those bugs into that were vital to an online environ- whatever bug database you use. We ment, such as global region transfer had the bug submission page, but no code that handled moving entire par- way of automatically moving those

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

plaints, regardless. During our beta Second, a great deal of new sysop in particular was quite powerful and test, we altered the way the environ- tools were added due to beta tester worked out well. ment worked several times and wiped feedback. Those tools, in turn, helped the host quite often to insure that the keep the game viable by allowing staff test was started afresh, with no corrup- members to run hand-made events A Look Back at the Good, Bad, and… tion. Naturally, players screamed at us while the scripted quests were being every time this happened. In addition, fixed. In addition, extra regions were ’d like to highlight a few things that watch what you show the players dur- added to give the players more room, I went particularly well during the ing testing periods, as people aren’t and even more regions were added for development of DARK SUN ONLINE… thinking about what the project will version 1.5. and a few things that didn’t go so well. look like in the future; they care about Some of them have already been what it looks like now. I recall that touched on above, but there are a few ULTIMA ONLINE got quite a negative others also worth mentioning. reputation initially when Origin WHAT WENT RIGHT? showed their alpha, as players immedi- 1. A close feedback loop with the exter- ately assumed that was what the game nal testers proved to be incredibly was going to be like. Beta testing helpful. Other than the obvious ben- includes more marketing than most efit of learning about bugs and inter- people realize.” face problems, we also got a good 56 LESSON SIX. Hackers will exploit the deal of free publicity and goodwill. slightest loophole, and it’s often that That goodwill was particularly useful exploitation that ruins the game for all Third, due to the easily-hackable when we made the inevitable screw- of the other players. DSO was particu- architecture of the game, players were ups. In addition, it was beta-tester larly hackable due to its odd peer-to- able to cheat and escape routines to feedback that spurred development peer architecture — an unfortunate punish character death. Version 1.5 of of the FAQ. legacy of the external programming DSO removed those penalties until we 2. The chat interface turned out to be far group doing things the easier way for could move the game logic to the serv- more intuitive and user-friendly than them. Again, if you’re doing to do a er — hopefully in a future version of we ever thought it might. Rich large-scale RPG on the ‘net, don’t con- the game. Donnelly says it best. “The chat inter- sider building it around anything but a Finally, all cinematics were cut face is probably one of the most client/server architecture — and make except for the introduction for version dynamic and user-friendly chat inter- sure the server is the arbitrator of all 1.0. That introduction cinematic was faces to be seen in any online role- key game logic. also cut in post-1.0 versions, due to its playing game. In almost every case, After a long and painful beta period, being too large to realistically down- there are multiple ways to do the same DARK SUN ONLINE was finally launched load. In addition, since the game was task, something that almost every user live on TEN — and as dictated by never re-released at the retail level after enjoys. As a designer, I have found Murphy, the inevitable bugs popped version 1.0, the Red Book music that players adopt their own style of up. DSO version 1.1 was released a few became unavailable. However, it’s pos- play, regardless of how the interface or months later to address most of those sible that the original DARK SUN I MIDI game environment is designed. bugs, and DSO version 1.5 came along a tracks might be reintroduced in future Having the ability to perform tasks in few months later as a game expansion. versions of the game. a variety of different ways allows the Discussions are underway as to the pos- Despite these changes, however, player to find the method of play that sibility of doing a DSO 2.0 — and as the DARK SUN ONLINE stayed with most of is most comfortable to them. Look at player base continues to grow, I’m sure its original design goals. The game play Windows 95, for example. Some peo- we’ll see the game expand and evolve was our focus, not the graphics. Some ple prefer to work from their Desktop, even more in the future. of this was simply because of the origi- others like it nice and clean and prefer nal art that we were forced to use, but a to use the Start menu and Explorer to great deal of it was due to beta testers’ find the items that they’re seeking. It Modifications Along the Way suggestions during the testing period. is this versatility that people desire, Player interaction and communica- and including it in your product is ARK SUN ONLINE differed from its tion was the focus of the entertain- essential.” D original design goals in a number ment, and not prescripted elements as 3. The reuse of DARK SUN I and II, and of ways. First, the peer-to-peer archi- in the original DARK SUN games. We AL-QADIM art assets proved to be an tecture we ended up with limited us to also reused legacy art to great effect effective decision. Although many hundreds of simultaneous players (albeit cheating like dogs the whole on our team would have liked to instead of the planned thousands. while to steal decent). improve the existing art, or create a That same peer-to-peer architecture Finally, the online interface added a great deal of new art done, we were also made the game extremely hack- great deal of functionality, while able to reuse most of the art from DS able, as much of the game logic was remaining inspired by the original II, some from DS I, and a little from processed on the local machine DARK SUN games and thus familiar to the external project AL-QADIM to instead of the host. players’ of those titles. The chat system good effect.

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

4. Our online role-playing paradigms and turning it into a multiplayer were well thought out, and some game with a peer-to-peer network- are finding their way into other ing system. Game logic then ran games. We learned that you can’t locally on the client, rather than allow a real, permanent character to on the host. Rich Donnelly has a die if a player was paying for it. We little more insight on this, and discouraged and punished people to explains it thusly: keep them from cheating and skip- particular, the external program- “The game environment itself, ping out of combat. DSO also ming group was competent, but not having been converted from a allowed and encouraged player vs. financially-motivated to do the job stand-alone product to an online player combat — an element we see “right.” In addition, the external art product, left the game with most being supported in more and more group needed a great deal of hand- of the logic running on the user online role-playing games. Finally, holding, and at the end of the day side. The host itself merely trans- we implemented the concept of we still didn’t quite get everything fers the information back and forth instant communication across the we wanted. between all the players, keeping online world, no matter where you 3. One of the scriptors left in the mid- everyone in a huge loop of data were. Purists seem to disagree and dle of the project and didn’t do a sets. This causes some serious prob- dislike the lack of reality, but those great deal of the work that was nec- lems with hacking, as people could purists also forget that chatting is essary for the game’s underlying rou- use editors on their local machines 58 the single most important commu- tines. We ended up having the two and change critical data. “Hacking nity support tool you have. remaining scriptors doing the work thus became quite a nightmare for Nothing in your game design of three, with one of them having to DARK SUN. Hacking a stand-alone should ever discourage communica- redo all of the key global routines. product is no big deal — change tion among players. 4. Not enough test time was allocated the game all you like, nobody is 5. Although the basis of the game is for debugging such a large-scale going to complain. In an online player interaction, we found that online game. This forced us to move environment, you are affecting not having a strong random quest gen- extremely quickly which, in turn, only yourself, but also everyone erator helped fill in the gaps. To frustrated players due to the speed else playing the game. It’s kind of quote Rich, “Having a system that and severity of the changes. like a movie theater; you purchase can essentially generate quests on Although many of these issues were a ticket for one seat, but you don’t its own is something that definitely unavoidable, having more time to buy the whole theater. When you increases the entertainment value of prepare and a more flexible deadline begin screaming, the ushers escort the game. The quest generation sys- would have allowed us to be more you out, as you are disturbing oth- tem currently in the game is rudi- accommodating to testers’ issues ers. It’s the same for an online mentary at best, but it’s definitely a and frustrations. environment — it just takes one solid model and a step in the right 5. Probably the biggest issues we had bad apple for everyone else to feel direction for what might be termed during the development of DARK the effects.” a ‘story-telling engine.’ As is the SUN ONLINE were the hacking prob- case with all developers, my only lems. These problems came as a regret is that I didn’t have the time result of taking a stand-alone game And On the Seventh Day . . . to take this quest engine as far as we would have liked. However, the hope this article has given you a few model as it stands is a serious piece Ithings to think about, and helps you of machinery, and something to be in the development of your title. I’m proud of.” always interested in discussing gaming WHAT WENT WRONG? and the online industry in general, so 1. We tried to make a DOS applica- if you have any comments or ques- tion running in a DOS window tions, please feel free to drop me a communicate to a Windows 3.1 note. ■ TCP/IP stack. Instead, we should André Vrignaud has worked in the com- have simply ported DSO to a puter gaming industry since 1990. Most Win32 application and developed recently, he’s worked at SSI and TEN, the game with the Windows 95 where he produced much of their online TCP/IP stack — as ended up being content and direction. He wishes thank done months later. everyone involved with DSO, with special 2. SSI’s internal resources were severely thanks to the Lead Scriptor/Designer limited for the project, which in turn Richard Donnelly, TEN’s RPG Producers made us far too dependent on exter- Alex Beltramo and Don Hupp, and in par- nal resources. On top of that, the ticular, all of the thousands of external contractors should have been better beta-testers. He can be reached at incented to provide quality work. In [email protected].

GAME DEVELOPER OCTOBER 1997 http://www.gdmag.com SOAPBOX by Dave Thielen

Goodbye For Now

hat an interesting industry. I enjoyed creating my last game, ENEMY

NATIONS, more than any other project I’ve ever worked on. The game market is more “alive” than, say, operating systems, where whatever W we (I used to work for Microsoft) released generally succeeded. But the game industry, in spite of 64 having its highest grossing year ever, is in serious trouble. Virtually every com- pany is hemorrhaging money. You can’t make a profit in a market like this. Losing money while chasing mar- ket share is only for companies with extensive cash reserves. Let’s travel down the path of confu- sion, incompetence, ignorance, and greed that has brought the game industry to this point. First, retail is broken. Stores purchase from distribu- tors and distributors purchase from publishers, all of whom have no intention of paying. The effective dis- counts achieved by finally settling accounts for less is a giant tax imposed on publishers, and through them, on developers. Management at most computer store chains is so inept that publishers request letters from the chain's corpo- rate headquarters stating what pro- grams the publisher has paid for. The publishers then send their channel marketing reps to the stores, letter in hand, to get the programs that they paid for implemented. In a word, chains are incapable of implementing the sales programs that they sell to the publishers in their stores. The stores also have no idea how to Media, GTE Interactive, and Phillips Some publishers with which inter- stock titles. I tried to buy DEADLOCK a New Media are just some of the acted had employees who, in my opin- month after it came out, but not a sin- recent companies to be closed down ion, were totally incompetent. I knew a gle store in Boulder, Colo., carried it, after failing to produce, in some test manager who had no idea what a had carried it, or knew that it existed. cases, a single successful title. test plan was. I knew a vice president of It was a top-selling game at the time. Meanwhile, Virgin Interactive development who did not know how No matter how good the games are, if (according to Spelling’s latest 10-K) is her company tested games. I knew a they aren’t on the shelves, people losing more than five million dollars vice president of software who did not won’t buy them. per month. (I do want to note that understand disk I/O optimization Second, many game publishers are there are a few well run game compa- (although he thought he did). grossly incompetent. Viacom New nies out there.) Continued on page 63.

GAME DEVELOPER OCTOBER 1997 http://www.gdmag.com Continued from page 64. filer, when they chew up clock cycles and you’ll have gained a lot more expe- Publishers don’t understand quality reading the joystick eight times per rience. You’ll be capable of creating titles when they are right in front of frame, then they are not capable of much better programs in a much short- them. Viacom New Media dropped writing good, solid code. All they can er time. And most likely, by that time, ENEMY NATIONS after looking at the final aspire to is adequate code. the game industry will be populated game. VNM is a company that received The heads of several game publishers mostly by competently run companies. an average rating of 67% in PC Gamer have told me that they have no interest (As a side note, everyone always com- last year for their games. PC Gamer gave in hiring very experienced people, plains about Microsoft winning new ENEMY NATIONS an 86%. Yet even look- because it’s cheaper to hire program- markets by using some kind of special ing at the final game, VNM couldn’t mers fresh out of college and pay them advantage. It’s a lot simpler than that. determine if it was better than the almost nothing. (And with rare excep- Look at the problems that I’ve listed in dreck they did decide to ship. tions, these are people who are not get- this column. Microsoft doesn’t have When VNM returned ENEMY ting offers from companies such as those problems. Microsoft will come to NATIONS, we took it to every publisher Microsoft and Netscape.) dominate the game industry not we could find. Every single one turned The mass market that we all desper- because of any dirty tricks, but because it down. About four months later, PC ately want to create will not accept ade- that company is run and staffed by Games reviewed it and gave it an A rat- quate programming jobs. They demand competent, intelligent people. That ing. Then we received calls from many the same level of reliability, complete- alone gives them a significant competi- of those same publishers, who were ness, functionality, and ease-of-use that tive advantage over virtually every now suddenly interested. The differ- they get from their productivity appli- other game company out there.) 63 ence was that a single person — the cations. And when they don’t get it I’m really glad I had the chance to magazine reviewer — had looked at the with one game, they stop buying games create ENEMY NATIONS. It was a rare game and liked it. for good. experience to be the producer, design- If publishers can’t even trust their So what are the implications? Very er, tech lead, co-art director, and music own judgment, if they turn down a few developers will get rich in the and sound effects director, as well as be quality game in the hottest genre out game industry over the next couple of responsible for a good chunk of the there, then what are the chances of years. There just isn’t enough profit to programming. There is absolutely their picking up any game brought to spread around. At the same time, with nothing like creating content. Even them? More importantly, if every very rare exceptions, game program- after everything that happened to me publisher turns down a finished game mers who can write excellent code during the course of the game’s devel- with the ratings we received, what are learned their craft in non-game back- opment, I’m glad I did it. I learned a the odds that they are accepting qual- grounds. When gaming does demand great deal and enjoyed it for the most ity titles? (and is willing to pay for) exceptional part. But I’m also glad to be out and The third problem, though, is the programmers, they will be hired from working again in an industry that biggest. And it’s something we all keep non-game companies. demands excellence. quiet about while pretending it doesn’t Programmers are in incredible To those of you that choose to stay exist. Many, many game programmers demand across many different indus- in the game industry, I say “thank are not qualified for the job. I’m not tries. Microsoft has two billion dollars you.” I most certainly want to keep saying they’re stupid (at least not all). allocated to R&D that they can’t spend playing new games over the next cou- I’m saying they’re not qualified. because they can’t find enough quali- ple of years. Most game programmers are self- fied programmers. At the other end of However, I’m sure the industry is taught or come straight from college. the size spectrum, my current employ- going to face some changes in the They work in small groups, usually er, Fusion MicroMedia, is also desperate future. If nothing else, competitive with the same people year after year. for qualified programmers. There are pressure from Microsoft will significant- Because this industry hasn’t demanded tons of jobs out there for those who ly improve the titles coming from those exceptional programming talent, most want them. companies that survive. ■ game programmers get their experi- To anyone who is contemplating ence in small, noncompetitive, inces- working in game development, I offer Dave Thielen is an internationally recog- tuous groups — not an environment the following advice. First, work three nized expert at practically everything. that pushes people to constantly strive or four years for a company outside of When not being flown to Washington, to do their best. It is not an environ- the game industry. Although games are D.C., to provide personal advice to the ment that teaches people new content and therefore more interesting president, he is working with Steven approaches and methods, either. (That than developing, say, Internet applica- Spielberg on his latest film. He has just said, there are numerous exceptions. I tions, working with a group of very completed his latest book, More Accurate have been in both Chris Robert’s and smart and qualified people more than Than God, Quotations from Bill Gates. John Miles’ code, and it contains beau- makes up for it. Besides, coworkers and tifully crafted assembly code.) management in other industries are When developers have to “discover” usually extremely well qualified — they that you can process dwords as fast as have to be to succeed. After that experi- bytes, when they don’t understand the ence, you will be a much better devel- concepts behind basic tools like a pro- oper, you will have made more money, http://www.gdmag.com OCTOBER 1997 GAME DEVELOPER