Demo:Sprite Animation

From Theora Playback Library
Jump to: navigation, search
screenshot from the demo

This demo shows how you can use this library to do sprite animation.

This is particularly useful as you can have many high resolution frames per second with very little RAM cost compared to regular sprite animation.

Copyright

The animations have been borrowed with authors permission from the game: Game: Kaptain Brawe: A Brawe New World

Author: Petar Ivancek

Developer: Cateia Games

These animations ARE NOT ALLOWED to be used in any manner other then for the purpose of this demo program.

Dependencies

Controls

  • Mouse - The character will face the mouse pointer

Sprite Animation

a sprite in a video frame

The character has 20 sprites for each direction, 250x300 pixels, which is 160 frames at about 300KB per image (RGBA data).

Which totals to 45 MB of RAM required for it's storage. If you have to store it in the Display card's RAM, it's even more because textures have to have power of two dimensions.

By using this library, you have 8 video clips loaded into RAM, each 500x300 in size (double the width because you have to pack the alpha channel as well)

The clips altogether are 1.7MB in size, let's say each videoclip object has 2 precached frames, which is 6.8MB and another 512x512 texture that goes into the Display Card's RAM.

The benefit is that you can have a lot of frames per second at very little cost to the filesize.

The downside is that you have to use the CPU to decode the video. This demo uses about 10% CPU on a single-core system. However, since most modern systems have at least two CPU cores, the job is given to the other core while the first one is fully at your disposal.

Forum

Forum discussion: link