AuthorTopic: Questions about Timing/Frame Rate  (Read 1970 times)

Offline KonamiCode

  • 0001
  • *
  • Posts: 3
  • Karma: +0/-0
    • View Profile

Questions about Timing/Frame Rate

on: December 02, 2005, 01:15:34 am
A question about how timing/frame rate is setup in most 2d games, or 2d games that utilize a 3d api such as OpenGL.  I'm coming from a more traditional animation background, where you're typically working with a standard of 24 frames a second.  However, in games typically the framerate can be variable, depending on hardware and so on, correct?  How does this typically affect planning out how to time a sprite, or how long to have the frame of an animation play for.  For example, if you've heard of the term "Shooting on two's" which means to have a drawing display for two frames (instead of one), how can you plan for this in a game, when the frame rate could be variable? Or, am I just making this too difficult, and you plan to have a steady framerate of 24 or 30?
"No excuses, get started and finish something, or face the reality that you will live with this frustration for the rest of your life" - Doug TenNapel

Offline Gil

  • 0100
  • ***
  • Posts: 1543
  • Karma: +1/-0
  • Too square to be hip
    • http://pixeljoint.com/p/475.htm
    • View Profile
    • My Portfolio

Re: Questions about Timing/Frame Rate

Reply #1 on: December 02, 2005, 01:37:07 am
Basically, most animations in pixel art are given delays. This means that each frame gets a delay in hundreds of a second. An animation with a steady delay of 20 means that it runs at 5fps. Games run at 60 frames per second for 2D mostly. This means you're going to redraw each frame 12 times for a delay 20 animation.

20/100 s delays are good for 6 to 8 frame walks
10/100 s delays are good for 6 to 8 frame runs

These are personal experience numbers.

Offline KonamiCode

  • 0001
  • *
  • Posts: 3
  • Karma: +0/-0
    • View Profile

Re: Questions about Timing/Frame Rate

Reply #2 on: December 03, 2005, 12:19:04 am
That makes some sense, I suppose it would allow you to have variable timing on different actions.  I'm guessing the delay data could be stored in some sort of index file along with information about what commands/actions relate to which set of sprite frames?
"No excuses, get started and finish something, or face the reality that you will live with this frustration for the rest of your life" - Doug TenNapel

Offline Gil

  • 0100
  • ***
  • Posts: 1543
  • Karma: +1/-0
  • Too square to be hip
    • http://pixeljoint.com/p/475.htm
    • View Profile
    • My Portfolio

Re: Questions about Timing/Frame Rate

Reply #3 on: December 04, 2005, 04:43:04 pm
Yes, that's one way to do it. I've seen several implementations, up to even engines that just take animated .gif files and read the delays straight out of the file. That's the reason most pixel artists work with delays btw, because the very popular gif format uses it...