Not logged in, Join Here! or Log In Below:  
News Articles Search    

 Home / Game Design & Programming / Sprite animation (data driven design) Account Manager
Archive Notice: This thread is old and no longer active. It is here for reference purposes. This thread was created on an older version of the flipcode forums, before the site closed in 2005. Please keep that in mind as you view this thread, as many of the topics and opinions may be outdated.

December 02, 2004, 01:51 AM

I'm just exploring options. Say we have to animate a sprite for a fighting game (KOF like) that has combos etc.

Just to give a brief idea of the design. Suppose the design contains the following components

ImageSet contains a list of surfaces/images.
AnimSet a named sequence of frames like

  1. struct anim_frame
  2. {
  3.     uint  surfaceid;
  4.     rect  bound;
  5.     uint  ttl; // not sure if this should be here
  6. }

Animation contains a list of AnimSets
AnimPlayer plays/animates an active anim set.

What various data driven possibilities exist for controlling the motion of the sprite during a move? One of the possibilities is to have the motion data embedded within the frame information, e.g.

  1. struct anim_frame
  2. {
  3.     ...
  4.     int    offsetX, offsetY;
  5. }

the idea is that as every frame advances we add the x,y offsets to the current position of the sprite. But that would in effect reduce the possibility of using the same frame in multiple animation sequences/combos.

Another possibility is to keep the motion data separate from the anim data. So you effectively define a path and move the sprite over the path while animating it. Although this seems to be much logical but this approach requires special tools to define motion (motion editor).

Moreover there are some moves like jumping and hitting the ground that do not contain a discrete number of steps, its just like you keep on falling until you hit the ground. How do you capture that information ?

Maybe this all seems so confusing, but thats coz i'm cinfused now as well and need input, I'm eager to provide more information and accept critical remarks and suggestions :)

This thread contains 1 message.
Hosting by Solid Eight Studios, maker of PhotoTangler Collage Maker.