Optimizing Your Storyboard Based Application

Choosing the Right Image Format(s)

When creating an application the developer must define the target system screen resolution and color depth.  This color depth information is used internally to decide how to create and render display elements in an efficient manner.  When adding images to the user interface it is always preferable to create them in the desired color depth.  If the application will be running in 16bit color then the most efficient image to render will be a 16bit image.  If alpha blending/transparency is not required when this image is rendered then it is advisable to create images in the application color depth or at least remove the alpha channel in the image.

Frames Per Second

Setting you frames per seconds (fps) very high on a screen transition or animation might seem like a great idea that will make your UI look better. However if your target system can't keep pace with the requested fps the Storyboard Engine will simply drop the frames that is can't display and do extra work to achieve a lower fps that may look even worse. Usually a fps of 14 will work great for most simple animations but it's very dependent on what you are animating, how long the animation is, and what images you are animating over.

Scaling Images

If you are only ever going to load an image once in you application don't scale the image, this is a performance hit at image render time. It's far better to use you favorite image editor and resize the image to exact size you intend to use it and turn the scale flag off.

Turn down the verbosity

Turning up the verbosity on sbengine is insightful when trying to track down issues and get an understanding of the system behavior. However, don't forget to turn off the verbosity when you release since printing out to a console or serial terminal can be costly during an animation on a low powered CPU.

Memory

By default sbengine uses as much memory as it requires to load all the assets that the application requires (images, fonts, scripts,...) but this can be tuned to save memory. Here are some options to help with this.

  • Remove any unused plugins from the plugins directory if you are simply setting a directory for the GRE_PLUGINS environment variable.

  • Set sbengine's resource_mgr options for image and font cache to appropriate values. Remember the caches must be large enough to fit all the images and fonts for your most resource intensive screen.

  • Use load scaled flag in image render extension options if you are loading a scaled version of an image (i.e. an image thumbnails screen). If you are only ever loading the image once you should resize the image.