organizing animated images

Monkey Forums/Monkey Programming/organizing animated images

slenkar(Posted 2011) [#1]
how do you organize your animated images?

there are different characters that all have walk cycles and attack anims

I was thinking of using a 3 dimensional array.
One dimension for character-type one for animation-name (walk or attack) and one for frame.


Gerry Quinn(Posted 2011) [#2]
Unless you have squillions of similat character types, you might find it easier to use an instance of a MonsterGraphics class for each, with a 2D array or a collection of 1D arrays attached to each instance. That will allow you to document and easily access special features, e.g. if one monster has a special set of animations, or if some of them lack certain types of animation. And it may also make your game easier to develop as you add one monster at a time independently of the rest.

If the game got huge it would also help you to load only necessary graphics into RAM.


slenkar(Posted 2011) [#3]
true that is a more flexible approach


matty(Posted 2011) [#4]
I have an "Animation" class that holds in an array within it an "ImageFrame" class that holds a pointer to the images and relevant scale/offsets for that image.

Each creature template or sprite can be linked to an animation sequence by populating a field of type "Animation" in the sprite with the relevant animation sequence.

I can then simply set the animation sequence of any sprite by choosing a different animation sequence.

The animation sequences are held in a list object.

The animation class also has methods for loading sequences and updating the frame count etc..


slenkar(Posted 2011) [#5]
interesting approach

Im using the px5 exporter too ;)

it exports frames of 256x256 so i have to use autocrop in gimp
then i end up with images of different sizes,
i then use an imagepacking program, to put them into one big image


slenkar(Posted 2011) [#6]
did you make the px5 images?

I want to use the goblin but its too dark,


matty(Posted 2011) [#7]
Hi slenkar - yes I created the images in a number of different 3d apps (mainly Poser 4 and a little of Softimage XSI 5.0)

Some of these images were done quite a long time ago though (2006) so I would have to render them again to fix up some of the brightness issues.


slenkar(Posted 2011) [#8]
oh its ok, ill just adjust the brightness on the final image
thanks for the images, they are quite useful