Game Development Reference
In-Depth Information
tune them deeply. The great advantage of this application is the ability to convert de-
fault PNGs into their analogs with a premultiplied alpha channel.
Alternatively, sheets can be developed in standard graphics editors, such as Adobe
Illustrator. The only point to note is that some routine operations are performed
manually. According to my experience, it is better to draw and export the sprites (or
tiles) one-by-one, and then collect the exported images in the sheet file. In other
words,youneedtohavesomefilesonlyfordrawingsprites(let'scallthem canvases
) and one file to organize the final illustration in the sheet (let's call it a sprite col-
lector ). First of all, this speeds up the exporting routine: if the source file for the
sprite sheet consisted not of linked raster files but real vector illustrations, it would
make exporting the final file a much longer process. Secondly, it offers protection
from shadow artifacts : images are the sprite sheets that stay tight, so some elements
of one illustration would overlap the illustration nearby a little bit for sure. Usually, the
edges of soft shadows lean out of the sprite's frames; as a result, some sprites or
tiles get unnecessary dark lines. In the sprite collector, there won't be such a prob-
lem, because each sprite is already an exported image and has appropriate dimen-
sions.
The dimensions and position of tiles inside sprite sheets should be chosen properly;
otherwise, there is some risk of visual artifacts such as thin faded lines at edges
caused by compression. They look ugly and are easy noticeable even on Retina
displays. Remember that OpenGL likes fours—sizes of texture elements should be
multiples of four to achieve better results (this is because, at the time of encoding,
an image is split into blocks of 4 x 4 pixels). Some examples of the sizes of texture
elements are 64, 128, 256, and so on. It is obligatory to have a grid system in the
sheet file. It will help you to determine the exact position and borders of each sprite.
The grid should be made of translucent rectangles arranged in chess-board order.
This is a much more precise way than a grid based on guides. The rectangles must
be placed on a separate layer; this lets you to switch them on and off. One of the
advantages of this type of grid is an opportunity to export it with the sprites for test-
ing purposes; for example, to check how the game engine cuts out the sprites from
the sprite sheet or how the graphic proportions work in the application. Tools such as
Texture Packer successfully automate such procedures.
The basic design rules of good sprites are simple: the illustration should be contrast-
ing and perceptible, and its details should express the element's functions in an un-
ambiguous manner. The player should not have to conjecture what is in front of him.
If an element has few states—for example, it is a switch—that means that each state
Search WWH ::




Custom Search