Game Engine Architecture

(Ben Green) #1
395

running. This data might be tabular, as shown in Figure 9.15, or graphical as
shown in Figure 9.16.
In addition, when low-memory or out-of-memory conditions arise, a good
engine will provide this information in as helpful a way as possible. When PC
games are developed, the game team usually works on high-powered PCs
with more RAM than the min-spec machine being targeted. Likewise, console
games are developed on special development kits which have more memory
than a retail console. So in both cases, the game can continue to run even when
it technically has run out of memory (i.e., would no longer fi t on a retail con-
sole or min-spec PC). When this kind of out-of-memory condition arises, the
game engine can display a message saying something like, “Out of memory—
this level will not run on a retail system.”
There are lots of other ways in which a game engine’s memory tracking
system can aid developers in pinpointing problems as early and as conve-
niently as possible. Here are just a few examples:


z If a model fails to load, a bright red text string could be displayed in 3D
hovering in the game world where that object would have been.
z If a texture fails to load, the object could be drawn with an ugly pink
texture that is very obviously not part of the fi nal game.
z If an animation fails to load, the character could assume a special (pos-
sibly humorous) pose that indicates a missing animation, and the name
of the missing asset could hover over the character’s head.

The key to providing good memory analysis tools is (a) to provide accurate
information, (b) to present the data in a way that is convenient and that makes
problems obvious, and (c) to provide contextual information to aid the team
in tracking down the root cause of problems when they occur.


Figure 9.16. A graphical memory usage display, also from Uncharted 2.


9.9. In-Game Memory Stats and Leak Detection

Free download pdf