Optimizing Performance (for iOS Games)
Tip #1 - Drawing Text.
Tip #2 - Use Lightweight Actors (or Simple Physics).
Tip #3 - Load in just the atlases you need.
Tip #4 - Performance only matters on the actual device.
Tip #5 - Don't draw excessively.
Performance is an important consideration for your game. It dictates how smoothly the graphics display on the actual device. This directly affects a user’s perception of your game.
You should always strive to hit 60 frames per second (FPS) with your game. A well-implemented game can hit 60 FPS, even on the oldest of devices (for example a 2nd generation iPod Touch).
Although mobile devices are much more powerful than in years past, they are still more sensitive to factors that affect performance than PCs are. For this reason, you need to monitor game performance carefully throughout the development process.
The following guide lists 5 ways to boost your game’s framerate.
Tip #1 - Use Labels instead of Drawing Text Directly
Note: This tip only applies to Stencyl 2.2 and below. For Stencyl 3.0+, you may draw text directly without consequence.
Labels are special actors that can render text. Because they are persistent, and the engine doesn’t have to re-generate labels every frame, they can lead to dramatic performance improvements (100% or more) over drawing text directly using blocks.
View our Labels Article for more details
Tip #2 - Use Lightweight Actors when possible
Lightweight Actors are actors that do not make use of the physics engine, which improves performance. They’re typically non-interactive objects and decorations. Switching over to lightweight actors can increase performance on games with many of these decorative actors, or in games with high actor counts but no physics-requirements, such as puzzle games.
To designate an actor as lightweight, visit its Physics > Advanced page and flip the Disable Physics setting to Yes.
: Alternatively, in Stencyl 3.0+, setting the game to use Simple Physics
is equivalent to telling every actor to be lightweight.
Tip #3 - Don’t load in all atlases at once - use only what you need
Stencyl stores its graphics inside atlases, composite images that combine many graphics into a single image.
By default, Stencyl loads every atlas at the start of the game. If you don’t need all of those graphics right away, this can be wasteful since those graphics sit in memory, and high memory usage can degrade performance.
Instead, it’s better to only load what you need and load graphics only when they are required.
Read our Atlases article for more details
Tip #4 - Performance only matters on the actual iOS device
Although the iOS Simulator is an effective and efficient way to test your game, when testing for performance, you should frequently test it on an actual device.
Like its name suggests, the iOS Simulator is simply a simulation of what happens in the game. Your computer is likely to provide significantly better performance than your device, though, so it will usually run the game faster than the real thing.
Note: The one exception is running games as iPad games can often run slower, but the same principle still applies: test on the real thing, and you don't run into surprises.
Tip #5 - Don’t draw excessively
Although the iPhone and iPad have decent graphics capabilities, they tend to falter when drawing over the entire screen a few too many times.
We’ve seen some games draw 5 different layers of backgrounds on top of everything else the game was drawing. Consequently, the framerate suffered.
You can make visually pleasing games, but you have to be mindful of the platform you’re developing the game for and focus first and foremost on making the base of your game work before making it pretty.
Last Updated: 2013-04-11 by Jon
5288 have read this article
Disclaimer: The Stencyl Team does not actively monitor comments on articles. If you're seeking help for your game,
please ask a question on the forums. Thanks!
Sign In to Comment