Results 1 to 6 of 6

Thread: 2D Animation Patterns

  1. #1
    Legendary Member cairnswm's Avatar
    Join Date
    Nov 2002
    Location
    Randburg, South Africa
    Posts
    1,537

    2D Animation Patterns

    How do most of the 2D graphic systems (or 2D in 3D) do animation? I only use DelphiX (Dont have time to try anything else) so thats all I know.

    DelphiX uses multiple images in a single image. Each image is then displayed at the right time. And after a certain interval the next image is displayed.

    How do other systems do it?
    William Cairns
    My Games: http://www.cairnsgames.co.za (Currently very inactive)
    MyOnline Games: http://TheGameDeveloper.co.za (Currently very inactive)

  2. #2

    2D Animation Patterns

    Not sure if it's the most used way, but I've seen programs that use a large image where all sprites are inside a grid. After that it's a bit of a guess as to wether the seperate images are first loaded into memory or drawn directly from the large image. I believe both options could work.

    It's almost the same as using a dximagelist though, only the images would not get inserted inside the exe. And I have learned that not including images in the exe speeds up the game, depending on the number of images, quite a bit.

  3. #3

    2D Animation Patterns

    The "many images on one bitmap" is the most obvious and natural way to do it. Whether the images are split up into an array at load-time or kept as one big bitmap depends on the API. With 3d acceleration, state changes (e.g. binding textures) are expensive, so you want to minimize them. So, with 3d APIs you'd probably keep the image as a whole and copy individual frames out using texture coordinates (no mipmaps, of course, and probably no filtering, plus the usual 2d-in-3d requirements). It doesn't matter too much what you do with software APIs though, so you could choose either method (keep as whole or split into array).

    Deciding when to change between frames is simply a matter of logic (and preference). If using frame rate-dependent timing, you could use a integer counter and increase it. Once to a certain level, change to the next frame and reset. With delta time you'd keep a real number for the time passed, and add the frame's delta to the time passed. Once it got past a certain amount of time you'd swap over. Having different rates of animation for different frames is simply a matter of perseverence. You can code any sort of frame changing logic if you take enough care to use variables instead of constants for everything, and if you have enough patience.
    "All paid jobs absorb and degrade the mind."
    <br />-- Aristotle

  4. #4
    Legendary Member cairnswm's Avatar
    Join Date
    Nov 2002
    Location
    Randburg, South Africa
    Posts
    1,537

    2D Animation Patterns

    If the multi-images in one is the normal way of doping it why arn't there more tools for creating these multi image maps.....?

    I've created my own ImageTiler program that does this for me but its very badly written at the moment.

    Can anyone suggest a nice drag and drop interface that would assist me in creating these images.
    William Cairns
    My Games: http://www.cairnsgames.co.za (Currently very inactive)
    MyOnline Games: http://TheGameDeveloper.co.za (Currently very inactive)

  5. #5

    2D Animation Patterns

    I'll have a dig around the 'Net to see if I can find suitable programs. I'm sure I've seen one or two that do this task (heck, I was busy writing one myself until I got sidetracked with other stuff!).
    "All paid jobs absorb and degrade the mind."
    <br />-- Aristotle

  6. #6
    Legendary Member cairnswm's Avatar
    Join Date
    Nov 2002
    Location
    Randburg, South Africa
    Posts
    1,537

    2D Animation Patterns

    Well why dont we as a DGDev community make a decent one for our own games? Like I say I've got a partially written one but its very very buggy and sometimes I even do things wrong on it

    I'll try put the program and source on the web later today.
    William Cairns
    My Games: http://www.cairnsgames.co.za (Currently very inactive)
    MyOnline Games: http://TheGameDeveloper.co.za (Currently very inactive)

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •