Author Topic: Framerate limiter?  (Read 3165 times)

0 Members and 1 Guest are viewing this topic.

Offline Downsider

  • LV1 Newcomer (Next: 20)
  • *
  • Posts: 12
  • Rating: +0/-0
    • View Profile
Framerate limiter?
« on: January 30, 2011, 02:47:55 am »
I'd prefer my game run at a constant framerate rather than jumping around, so I'm willing to lower it to a constant 20 FPS to prevent that. Does anybody konw how to set up a framerate limiter in Axe?

Offline Builderboy

  • Physics Guru
  • CoT Emeritus
  • LV13 Extreme Addict (Next: 9001)
  • *
  • Posts: 5673
  • Rating: +613/-9
  • Would you kindly?
    • View Profile
Re: Framerate limiter?
« Reply #1 on: January 30, 2011, 02:52:03 am »
Are you familiar with interupts?  Try putting a Stop statement, and set the interrupt for a specific frequency.

If you are looking for the non-interrupt method, might I know why your code runs at so many different speeds?  If we can figure out that, it will most likely work a lot better than the interrupt method.

Offline Downsider

  • LV1 Newcomer (Next: 20)
  • *
  • Posts: 12
  • Rating: +0/-0
    • View Profile
Re: Framerate limiter?
« Reply #2 on: February 03, 2011, 12:33:58 am »
Are you familiar with interupts?  Try putting a Stop statement, and set the interrupt for a specific frequency.

If you are looking for the non-interrupt method, might I know why your code runs at so many different speeds?  If we can figure out that, it will most likely work a lot better than the interrupt method.

Well, some scenes in the game are more intensive than others. That's all. And when you stand still, since the map isn't scrolling, it runs significantly faster, and I'd prefer that the enemies, bullets, etc around you didn't also move faster, so to combat that, I want to lock the framerate.

Offline Builderboy

  • Physics Guru
  • CoT Emeritus
  • LV13 Extreme Addict (Next: 9001)
  • *
  • Posts: 5673
  • Rating: +613/-9
  • Would you kindly?
    • View Profile
Re: Framerate limiter?
« Reply #3 on: February 03, 2011, 12:55:12 am »
Ah gotcha.  Hmmmm thats a tricky one, i've really never dealt too much with this, maybe someone else can shed some light?

Offline Downsider

  • LV1 Newcomer (Next: 20)
  • *
  • Posts: 12
  • Rating: +0/-0
    • View Profile
Re: Framerate limiter?
« Reply #4 on: February 03, 2011, 01:14:12 am »
I could easily write one myself if Axe has an accurate clock function, does it have one that returns a time value accurately?
« Last Edit: February 03, 2011, 01:14:41 am by Downsider »

Offline Builderboy

  • Physics Guru
  • CoT Emeritus
  • LV13 Extreme Addict (Next: 9001)
  • *
  • Posts: 5673
  • Rating: +613/-9
  • Would you kindly?
    • View Profile
Re: Framerate limiter?
« Reply #5 on: February 03, 2011, 01:21:34 am »
Well interrupts trigger at regular time, no matter what else is executing, so you could use those to your advantage