Username or E-mail
Password (Forgot?)
New? Sign Up
Join or Sign In
Forums Stencylpedia Stencyl TV Translations Go Pro - Plans & Pricing Download Stencyl


Switch to Book Layout

1: Getting Started

  • Getting Started
  • Crash Course
  • Crash Course 2
  • StencylForge

2: Building Logic

  • What is a Behavior?
  • Creating a Behavior
  • Attributes
  • Game Attributes
  • Attribute Types
  • Events
  • Our Behaviors

3: Actors

  • What are Actors?
  • Animations
  • Motion & Forces
  • Physics
  • Controls
  • Collisions & Groups
  • Killing vs. Recycling
  • Tweening
  • Effects
  • Chapter 3 Challenge

4: Scenes

  • Scene Basics
  • The Camera
  • Tilesets
  • Regions
  • Drawing Text & HUDs
  • Changing Scenes
  • Music, Sounds & Channels
  • Backgrounds
  • Customizing Actors
  • Chapter 4 Challenge

5: Game Mechanics

  • Saving
  • Pausing
  • 3rd Party Services
  • Web Requests

6: Advanced Topics

  • Get/Set Attributes
  • Custom Events
  • Blending Modes
  • Lists
  • Custom Blocks
  • Continuous Collisions

7: Testing & Tuning

  • Testing Games
  • Optimizing Performance 1
  • Optimizing Performance 2

8: The Last 10%

  • Flash Publishing
  • Standalone Apps
  • iOS App Store
  • Chrome Store
  • Making Money

M1: Mobile - Intro

  • Getting Started
  • Testing on your Device
  • Flash -> iOS Guide

M2: Mobile - Basics

  • Atlases
  • Drawing Text
  • Retina Display
  • Accelerometer
  • Joystick
  • Universal Games

M3: Mobile - Services

  • iAds
  • Game Center
  • In-App Purchases

M4: Mobile - Publishing

  • Debugging
  • Publishing to the App Store
  • Optimizing Performance
  • Promoting your Game

A: Troubleshooting

  • Showstoppers
  • General FAQ
  • iOS FAQ
  • The 90% Memory Warning
  • Recovering Broken Games
  • Can't Export to SWF
  • Reloading Documents
  • Generating Logs
  • Flash Security Settings
  • How to Report Bugs

B: How-To Guides

  • Importing Assets
  • Scene Designer
  • Code Mode
  • Font Editor
  • Pencyl (Image Editor)
  • Tile Editor (Shapes)
  • Game Cleaner

C: Reference

  • Glossary
  • Block Reference
  • Useful Shortcuts
  • Stencyl API

D: Resources

  • Stencyl TV
  • Abigayl's Guides
  • Giving Critiques
  • Creating Extensions
  • Translating Stencyl
  • Credits

3.0 Drafts (In Progress)

  • What's New in Stencyl 3.0?
  • Setup (Android)
  • Setup (Desktop)
  • Setup (iOS) - Concepts
  • Setup (iOS) - Mac
  • Setup (iOS) - Windows
  • Testing iOS on Windows
  • iOS Troubleshooter

  • Mobile App Scaling
  • Full Screen Mode
  • Simple Physics
  • Backgrounding an App

  • iOS App Store
  • Mac App Store
  • Windows Store
  • Google Play
  • HTML5

  • Android Ads
  • Android Purchases (WIP)
  • 4" Form Factor (iPhone 5)
  • Mobile Input
  • Mobile Features

  • Extending the Engine
  • iOS / Android Extensions
  • Developing the Official Extensions
  • Developing the Engine

  • iAds (Revised)
  • Game Center (Revised)
  • iOS Purchases (Revised)
  • Atlases (Revised)
  • Drawing Text (Revised)
  • Joystick (Revised)
  • Accelerometer (Revised)
  • Sounds (Revised, WIP)
  • Debugging (Revised, WIP)
  • iOS Performance (Revised)
Level: Beginner

Optimizing Performance (for iOS Games)

Contents

  • Introduction
  • 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.

 

Introduction

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.

Note: 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!
0 Comments
Be the first to make a comment!



Commenting Guidelines

Sign In to Comment

Make Games

  • What is Stencyl?
  • Roadmap
  • Pricing

Play

  • Arcade
  • Showcase

Community

  • Forums
  • Chat
  • Translations

Help

  • Stencylpedia
  • Stencyl TV

About Us

  • Blog
  • Contact Us
  • Press
  • Privacy
Follow Stencyl on Twitter



© 2013 Stencyl, LLC.