Those not versed in the lingo of the gaming industry might think that a sprite animation refers to a video of a winged woodland fairy frolicking in a forest. However, that’s not entirely correct. A sprite also refers to a computer graphic that may be moved on-screen and otherwise manipulated as a single entity. Basically, a sprite is a 2D image, large or small, such as the icons on your desktop or the arrow of your mouse cursor.
Sprites are very useful when it comes to making computer games. Compared to rendering 3D models in real time, sprites require very little processing power. Sprites have been used in 2D games for decades! For example, in Super Mario Bros, every character, brick, item and monster is a sprite or a sprite animation. Mario has a sprite sequence for running, jumping, ducking, and every action he performs.
Even in modern 3D games, sprites have not been completely replaced by 3D models. Menu items, buttons that light up, and particle effects such as a smoke, fire or sparkles, are usually done with sprites to save on processing power.
Often, the .png file format is used to store sprite images, due to its high quality to low file size ratio, but more importantly because it can store an alpha channel. In simple terms, alpha channel means transparency. Therefore, a .png file can have a transparent background rather than always appearing as a solid rectangle.
Sprites can be used as still images or as an animated image sequence. A sprite animation is essentially a sequence of .png (or similar) images played once, or looping continuously.
In the above image, five sprite images represent every possible lever location of a power-up panel in the game “Earthlings Go Home”, created at Pathways Inc. When the lever reaches the top position, a blue light indicator turns on to let the player know that they can use a special power-up ability.
Also from the same game, the image sequence above shows a few frames of an asteroid rotating. This image sequence contains an alpha channel so that the background of the asteroid is transparent. When set to loop, the image sequence gives the impression of a spinning asteroid flying through space. Using a sprite sequence in this case saves on CPU resources, which is important when targeting the mobile device market. Smart phones and tablets today still lack the processing power required by intensive 3D games, and sprite animations reduce the load significantly.
Sprites are essentially a 2D animation, however, they can create the illusion of a 3D animation. The examples shown in this article were created in 3D, and rendered to a 2D image sequence. They can include such 3D properties as lighting/shadows, specular highlights, reflections, caustics and HDRI. However, these properties are “baked into” the images, and are therefore not dynamic as true 3D properties would be. The image sequence of the moon, for example, has a shadow in the bottom left and a highlight in the top right. This is how the image is rendered, and the lighting will not change dynamically according to scene lighting of the game. Therefore, some careful planning must be done to ensure that multiple sprites in a scene are not lit from inconsistent angles, or the whole scene will look wrong. For this particular game, it was decided that light would always come from the top right corner.
Sprite sequences are also useful to display the player character (and all other characters in the game), especially if the game is a platformer, top-down or orthographic. In 3D games, sprites can be used to reduce the poly count of assets difficult to model in low-poly. Such assets include trees and bushes, which would require thousands of polys to model, but can be “faked” with a few intersecting planes mapped with a leafy texture. This method saves a significant amount of processing, while yielding a believable effect with only a few intersecting polygons.
In summary, sprites and sprite animations continue to have a strong presence even in the modern world of 3D games and powerful computers with lightning-fast video cards. Sprites are especially useful in mobile games, where graphic processing and CPU power is restricted. There is much that can be done with sprite animations to give the illusion of 3D, and even traditional 2D gaming continues to maintain a strong player base.
If you would like to see more examples of sprite animations and games we are creating our company, please feel free to explore our website: http://www.pathwaystrainingandelearning.com/ . We always look for fresh ways to engage the audience and to make the experience as fun as possible!