Please login or register.

Login with username, password and session length
Advanced search  

News:

This forum provides RSS feed. To query recent posts use this url. More...


Author Topic: FPS cap  (Read 6499 times)

0 Members and 1 Guest are viewing this topic.

Tal

  • Lurker
  • *
  • Karma: 0
  • Offline Offline
  • Posts: 17
    • View Profile
FPS cap
« on: October 07, 2008, 01:28:24 AM »

OK, word balloon problem: mostly fixed. It'll pass for the moment, though I'll probably revisit it somewhere down the line.

On to my next (and hopefully last for a good while) major problem: an FPS cap.

On my computer, my game runs on a fairly stable 30-35 frames per second.

However, on my college's computers, the ones I have to demonstrate this on, the game runs at a lovely several thousand fps. I'm not making this up, it runs insanely fast. Is there any way I can create a maximum fps of 33 or so?

I'll try to post screens of it tomorrow if possible. The computers there are insane powerhouses, so I'm not incredibly surprised. -_-
Logged

Mnemonic

  • WME developer
  • Administrator
  • Addicted to WME forum
  • *
  • Karma: 41
  • Offline Offline
  • Gender: Male
  • Posts: 5683
    • View Profile
    • Dead:Code Site
Re: FPS cap
« Reply #1 on: October 07, 2008, 07:20:36 AM »

Why is the high framerate a problem? If the code is done right (i.e. don't rely on a specific framerate, use Sleep() timing to be only reliant on time) it shouldn't matter.
Logged
Yes, I do have a twitter account
Please don't send me technical questions in private messages, use the forum. ::wave

Spellbreaker

  • Supporter
  • Frequent poster
  • *
  • Karma: 4
  • Offline Offline
  • Gender: Male
  • Posts: 376
    • View Profile
    • Apeiron Studios
Re: FPS cap
« Reply #2 on: October 07, 2008, 05:37:54 PM »

OK, word balloon problem: mostly fixed. It'll pass for the moment, though I'll probably revisit it somewhere down the line.

On to my next (and hopefully last for a good while) major problem: an FPS cap.

On my computer, my game runs on a fairly stable 30-35 frames per second.

However, on my college's computers, the ones I have to demonstrate this on, the game runs at a lovely several thousand fps. I'm not making this up, it runs insanely fast. Is there any way I can create a maximum fps of 33 or so?

I'll try to post screens of it tomorrow if possible. The computers there are insane powerhouses, so I'm not incredibly surprised. -_-


thats not necessary, and a bad idea too. Why? Because LCD Displays for example are running on fixed 60 or 75 Hz, newer ones on 100 Hz. So actually, driver dependent, best thing is that the screen updates in synchronization with the Display, which means 60, 75 or 100 Hz ( Full screen I mean of course ).

Never ever use FPS to calculate something game related. Always use sleep() as mnemonic said.

Logged

Tal

  • Lurker
  • *
  • Karma: 0
  • Offline Offline
  • Posts: 17
    • View Profile
Re: FPS cap
« Reply #3 on: October 07, 2008, 07:05:41 PM »

The high framerate is a problem because it essentially negates any movement. You click, and you're there. It's not game-breaking, but it breaks the tone I want for the game. The character's not supposed to be fast.

So how/where would I code this sleep timing?


And again, it's only running maniacally on faster computers. Theoretically, wouldn't using a sleep function on the game make it run too slow on normal computers?

Also, this game is only ever running windowed. It can't be fullscreened.
« Last Edit: October 07, 2008, 07:09:48 PM by Tal »
Logged

Mnemonic

  • WME developer
  • Administrator
  • Addicted to WME forum
  • *
  • Karma: 41
  • Offline Offline
  • Gender: Male
  • Posts: 5683
    • View Profile
    • Dead:Code Site
Re: FPS cap
« Reply #4 on: October 07, 2008, 08:19:56 PM »

So how/where would I code this sleep timing?
How does your code look now?
Logged
Yes, I do have a twitter account
Please don't send me technical questions in private messages, use the forum. ::wave

Spellbreaker

  • Supporter
  • Frequent poster
  • *
  • Karma: 4
  • Offline Offline
  • Gender: Male
  • Posts: 376
    • View Profile
    • Apeiron Studios
Re: FPS cap
« Reply #5 on: October 08, 2008, 08:14:23 PM »

The high framerate is a problem because it essentially negates any movement. You click, and you're there. It's not game-breaking, but it breaks the tone I want for the game. The character's not supposed to be fast.

I don't know what you mean :| I have a laptop which fixed 60FPS, and on my Desktop machine windowed the game runs at 500 FPS. The movementspeed is the same :|
Logged

Tal

  • Lurker
  • *
  • Karma: 0
  • Offline Offline
  • Posts: 17
    • View Profile
Re: FPS cap
« Reply #6 on: October 09, 2008, 02:04:10 AM »

What part of my code are we looking at, specifically?

Spell, I'm talking around 33,000 fps. The dialogue is running at the proper speed; all other animations are insanely fast.
Logged

metamorphium

  • Global Moderator
  • Addicted to WME forum
  • *
  • Karma: 12
  • Offline Offline
  • Gender: Male
  • Posts: 1511
  • Vampires!
    • View Profile
    • CBE  software s.r.o.
Re: FPS cap
« Reply #7 on: October 09, 2008, 08:56:37 AM »

are we talking sprite animations? Script based animations? Are those animations done in sprite editor? If so what's the "delay" parameter there? Or are those 3d animations exported from max, blender, maya?

You really should tell us at least something. WME works and the problem is on your side, we're just trying to help you find out what are you doing wrong. So please provide us as much information as you can otherwise we really can't help you. ;)
Logged
J.U.L.I.A. Enhanced Edition, Vampires!, J.U.L.I.A., J.U.L.I.A. Untold, Ghost in the Sheet

Tal

  • Lurker
  • *
  • Karma: 0
  • Offline Offline
  • Posts: 17
    • View Profile
Re: FPS cap
« Reply #8 on: October 10, 2008, 01:33:46 AM »

Ah. OK. I just needed to know what you wanted to know. ^_^

They're 2D sprite animations done in the Sprite editor. The delay parameter is rather low, which may be the cause.

Now that you mention that, I hadn't tried messing with that. Let me go try it on the high-speed computers tomorrow and I'll get back to you if it had an effect.
Logged

metamorphium

  • Global Moderator
  • Addicted to WME forum
  • *
  • Karma: 12
  • Offline Offline
  • Gender: Male
  • Posts: 1511
  • Vampires!
    • View Profile
    • CBE  software s.r.o.
Re: FPS cap
« Reply #9 on: October 10, 2008, 08:29:56 AM »

It's quite easy to set the Delays or Sleeps to desired framerate. If you are targeting for example your desired animation for 30fps, you know that every frame would take 1/30s so Delay or Sleep would be 33.

WME (unlike some other engines) doesn't limit you to certain fps, it rather lets you choose what suits you the best.

In Sprite editor don't forget to copy the desired Delays to all frames (see http://res.dead-code.org/doku.php/wmebook:ch1_2 )

Hope this helps
Logged
J.U.L.I.A. Enhanced Edition, Vampires!, J.U.L.I.A., J.U.L.I.A. Untold, Ghost in the Sheet
 

Page created in 0.042 seconds with 23 queries.