Optimizing Game Performance
 
There are several things that can be done to improve the performance of games built with Power Game Factory. The following considerations should be addressed throughout the game design process to ensure that a finished game will have a high frame rate on the widest possible variety of computers:

Limiting Spatial Tolerances

Since maintaining the state of level objects requires a lot of processing power, only objects that are close to being on the screen are updated during gameplay. This causes objects that are not on the screen to remain frozen in time. The game's spatial tolerance properties determine exactly how far off-screen each type of object may be while still being updated in real time. For increased performance, object spatial tolerances should be set to as low a number as is possible without causing gameplay problems. Typically these values range from 100 to 500, with larger values resulting in more persistent game environments and reduced performance. More information on changing spatial tolerances is available in the Level Parameter Editing section.

Limiting Object Quantities

The presence of large numbers of level objects on the screen at the same time can reduce game performance. Although all types of objects affect performance, objects with large graphics and rapidly changing animation sequences cause the most severe reduction in performance. Such objects should be reduced in number or spread out so that there are not too many on the screen at any given time.

Limiting Parallax Layer Quantities

Because large parallax background layers reduce game performance, the number of parallax layers should be kept to a minimum.

In certain situations, it is possible to maintain a larger number of parallax layers than might be expected without seeing a decrease in game performance. For example, if a number of very small layers are used to represent background scenery at various distances from the viewer, performance may be maintained. More information on parallax background design techniques is available in the Parallax Background Design Techniques part of the Level Background Design section.

Since less powerful computers may be accommodated by disabling parallax scrolling in the game's preferences, it is usually unnecessary to limit the number of parallax layers to the extent that the game's graphical quality is compromised.

An additional note: tiled backgrounds should be used for extremely large levels, because any large non-tiled background would take much longer to load.

Limiting Available Screen Sizes

Screen resolution affects game performance to some extent. Although many displays now support very high resolutions, any game that took full advantage of such resolutions would be likely to have a reduced frame rate (and it would require a far larger commitment to the creation of graphical assets.) The screen size options should be restricted to a selection of resolutions that are both appropriate for the game and tolerant of performance considerations. Note that by increasing the Pixel Scale of a screen setting, a low resolution game can be scaled to fill a high resolution display.

Information on how to establish a selection of screen resolutions is available in the Customizing Screen Settings part of the Editing the Default Preferences section.

Harnessing the Compiler

When a game is built using the Standard or Compact Building types, as defined in the Advanced section of the Preferences Window, the Power Game Factory compiler automatically detects and merges duplicate animation frames and sounds. Thus, two character sets containing one or more identical animation sequences load more quickly, occupy less memory, and demand smaller amounts of disk space than two character sets with nothing in common. In order to benefit from this compiler feature, any common animation frames and sound effects must be absolutely identical.

There is one limitation to this space saving feature: sounds in the System 7 Sound format (bearing the file name extension .sfil) cannot be merged. Therefore, sounds that are used by multiple game object types may be created in a different format, such as AIFF or WAV, to reduce memory and disk space requirements. More information on the benefits and disadvantages of various audio file formats is available in the Editing Sound Collections part of the Common Production Tasks section.

Optimizing Graphics

The amount of graphical content in a game affects how much disk space is required, how long the game takes to load, and how well it performs while running. For these reasons, the number of animation frames in a game and the size of each frame should be limited wherever possible. It is also crucial to remove unused projectile types, contrail types, and other graphically intensive objects.

The Sequence Detail of character sets should be set to Simplified or Standard wherever possible, and player sets that do not utilize vertical and diagonal attack angles should likewise have the appropriate "Can Attack" checkboxes unchecked.

Limiting the available screen sizes as described earlier will inevitably necessitate smaller frames of animation, and will ensure that game graphics do not consume too much memory.

Optimizing Character A. I.

Each time a character uses his artificial intelligence to make a strategic decision, game performance is reduced marginally. When several characters are making strategic decisions during each frame of gameplay, the performance decrease may become noticeable. This problem can be avoided by increasing the value of a character type's Delay Between Strategic Decisions property. For example, if a character type's Delay Between Strategic Decisions property is set to 15, the character will reevaluate what he wants to do once every 15 ticks, or once every half second.

Although increasing this value improves performance, it is important not to set it too high, or else the lack of frequency with which characters make strategic decisions will result in slower response times and inappropriate behavior. For example, if a character must jump over a chasm to avoid falling to his death, he will only realize that he should jump if he is permitted to make the decision to do so shortly before reaching the edge of the cliff.

More information on editing character A. I. is available in the Editing Character Type Additional Properties section.

Optimizing Lighting Effects

Lighting effects may be layered on top of one another, with each semitransparent layer of lighting contributing partially to the overall appearance of affected objects. For example, overlapping red and yellow lights would cause objects to be tinted orange, as shown below.



When several lighting effects overlap, more processing power is required to display affected objects. Since very large lighting effects are capible of illuminating many objects at once, it is best to avoid the excessive layering of large lighting effects. More information on editing lighting effects is available in the Lighting Effects part of the Level Object Manipulation section.