Game Development Reference
In-Depth Information
Figure 2.3
The free code editor FlashDevelop.
memory and CPU allocation of a given application. Unfortunately,
there
s no real way of getting the exact CPU usage of a Flash game
because most ways of testing it involve running it inside another
program, such as Flash CS5 or a Web browser. These programs
can be running other tasks that consume system resources, and
it
'
ends and the game begins.
That said, sometimes a simpler approach to this problem is more
effective. Flash content is set to run at a predefined frame rate. If
the player gets too bogged down with either code or whatever it
'
s hard to know where the
container
s
trying to render to the screen, it will bring the frame rate down. It
is very easy to use a small component in your games to monitor
theframerateaparticularmachineisgetting.Youcanthenuse
this information during testing to determine the minimum level of
machine required to play your game. Simply set a tolerance level
(usually 85% or higher of a game
'
s designed frame rate is accepta-
ble) and then note which machines fall below this tolerance. Mem-
ory is a little more exposed in Flash, and there are ways of
determining choke points in your game where memory usage gets
out of hand, though it does require writing your own utility. This
is done using the Sampler package, and we will discuss the
'
Search Nedrilad ::




Custom Search