[In this Intel-sponsored feature, part of the Visual Computing subsite, Ghostbusters game creators Terminal Reality discuss using Intel Graphics Performance Analyzers to optimize the rendering and effects for the PC version of the game.]
Admit it. For the past 25 years, you ain't been afraid of no ghosts. Thanks to a certain movie about four intrepid heroes, we all know a well-aimed proton stream and a handy trap can bag any ghoul within range. The venerable Ghostbusters franchise has spun out at least eight different video games since 1984, each taking advantage of the movie's supernatural feel and sci-fi effects. The newest version Ghostbusters: The Video Game has received good reviews since its release earlier in 2009, thanks in no small part to its updated effects.
As Mark Randel, president and chief technology officer of Terminal Reality, Inc. described it in his blog at http://software.intel.com/en-us/blogs/author/mark-randel/, "The results of having a massively parallel game engine were stunning. When we finally got rendering and simulation of the game in parallel in the last weeks of Ghostbusters, the game became solely render-bound. Jobs were totally asynchronous, and we were able to fully utilize three to four cores. When there wasn't any action in the game, the game was waiting on the vertical blank. With a lot of action, the job model allowed the heavy lifting to be absorbed over as many processors as the system had."
The game is published by Atari, who wanted a great mainstream game to reach the largest possible target market. Atari pushed the team to make sure the game was optimized for integrated graphics systems, in order to maximize their investment and ensure good performance.
The developers at Terminal Velocity took extensive advantage of Intel Graphics Performance Analyzers (Intel GPA) and their membership in the Intel Software Partner Program to bring out the best special effects required to chase down vapors, slimers, and poltergeists. Intel's tools helped identify a performance bottleneck so the game could be optimized for desktops and laptops that use Intel Graphics processors. And once performance problems are solved for the Intel Graphics world, they are essentially solved for the rest of the graphics universe.
Thanks to fine-tuning for multi-core and extensive testing for bottlenecks, Ghostbusters: The Video Game really shines, especially on the newest Intel-based systems. What follows is a step-by-step analysis performed on an exceptionally low-performing scene in Ghostbusters: The Video Game by a team consisting of both Intel and Terminal Reality developers. The team's comprehensive work is a model for anyone who wants to troubleshoot similar game-performance issues.
Jeff LaFlam and Shankar Swamy, application engineers with the Intel Visual Computing Enabling Team, worked with Mark Randel, president and chief technology officer of Terminal Reality, Inc., to detect and analyze a serious bottleneck in a specific scene in Ghostbusters. This scene was running so slowly, and with a barely acceptable frame rate, that the game play was visually stuttering. This scene had stymied progress in optimizing the game's overall performance.
The troublesome scene contains about 200,000 books in a library where two human characters and a "ghost" character might interact. When the characters are fully outside the library they cannot see the books; hence, there is no need for the game to render the books. However, as a character enters the library, the books are gradually exposed to the viewer and displayed in the game play scene. The team of LaFlam, Swamy, and Randel analyzed this scene to determine solutions for increasing the frame rate.
The team of LaFlam, Swamy, and Randel analyzed this scene to determine solutions for increasing the frame rate.
Step 1: Visually Analyze the Scene
The team began by visually analyzing the entire scene sequence in order to determine a direction for further investigation.
The team observed that when a character was staring at the wall and the books were partially exposed, the frame rate was very low and the scene stuttered (Fig. 1). When they then advanced the scene and moved a character closer to the wall but with no books visible in the scene, the frame rate did not change noticeably. This indicated to the team that the books were being rendered in the scene even when they were not visible.
Step 2: Render with Z-Test Disabled
The goal of the second step in the analysis was to determine how many occluded objects were being rendered in the library scene. This was done by rendering all the objects in the scene with the Z-test disabled.
In Figure 2, notice that the character is standing very close to the wall and staring directly at it. Prior to optimizing this scene, during normal game play (with the Z-test enabled), the books shown would not be visible because of the direction the character is looking. However, because the team disabled the Z-test for Figure 2, all the books being rendered by the game are also now visible.
This confirmed that books are being rendered all the time-even when they are completely occluded during normal game play. Of course, only the books that are visible to the characters at any point in the game play need to be rendered.