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: How do I keep the framerate within a range  (Read 4809 times)

0 Members and 1 Guest are viewing this topic.

SBOVIS

  • Frequent poster
  • ****
  • Karma: 0
  • Offline Offline
  • Gender: Male
  • Posts: 404
  • FORGET REALITY SURRENDER TO YOUR DARKEST DREAMS
    • View Profile
    • LIMBO of the LOST
How do I keep the framerate within a range
« on: December 08, 2004, 01:59:40 PM »

Hi all,
        Does anyone know how I can cap the frame rate so that it does not go over a given figure.
I ask this as my project runs differently on different systems (obviously), but I am not worried about the slow systems more the very fast ones, as ACTOR animation speeds up etc and I want the game to hold at a specific frame rate if the machine that it runs on is able to run it faster than the desired level.

Does this make sense??



Many thanks
Logged
kind Regards
Steve Bovis
MAJESTIC STUDIOS

Jerrot

  • Global Moderator
  • Addicted to WME forum
  • *
  • Karma: 0
  • Offline Offline
  • Gender: Male
  • Posts: 690
    • View Profile
Re: How do I keep the framerate within a range
« Reply #1 on: December 08, 2004, 02:15:06 PM »

Does anyone know how I can cap the frame rate so that it does not go over a given figure.
I ask this as my project runs differently on different systems (obviously), but I am not worried about the slow systems more the very fast ones, as ACTOR animation speeds up etc and I want the game to hold at a specific frame rate if the machine that it runs on is able to run it faster than the desired level.

Since the sleep-command, which is used in loops at the end of every iteration, is using milliseconds as parameter, this should not happen. Seconds should be the same on every computer. ;) If you test it once on a rather quick computer, you should not get in trouble at all.
Logged
Mooh!

SBOVIS

  • Frequent poster
  • ****
  • Karma: 0
  • Offline Offline
  • Gender: Male
  • Posts: 404
  • FORGET REALITY SURRENDER TO YOUR DARKEST DREAMS
    • View Profile
    • LIMBO of the LOST
Re: How do I keep the framerate within a range
« Reply #2 on: December 08, 2004, 02:20:18 PM »

Well it is happening to me. hahahahaha

I run it on a machine with 64mb of ram and it is slow say 30 -40 FPS, I run it on 256mb and I get 40 -50 FPS, I run it omn 512mb and I get 50-60 fps etc etc etc

I want it NOT to go over 60FPS which it can do on a PC with 1gb of RAM and a fast 3D card.

It is mainly the ACTOR WALKING AND ACTIONS

Regards

Steve
Logged
kind Regards
Steve Bovis
MAJESTIC STUDIOS

Mnemonic

  • WME developer
  • Administrator
  • Addicted to WME forum
  • *
  • Karma: 41
  • Offline Offline
  • Gender: Male
  • Posts: 5683
    • View Profile
    • Dead:Code Site
Re: How do I keep the framerate within a range
« Reply #3 on: December 08, 2004, 02:35:18 PM »

Jerrot is right. All the timing in WME is time-based, not framerate-based. It means it can get slower on a slow machine, but never gets faster then the times you specified in your sprites and in the Sleep() command.
Logged
Yes, I do have a twitter account
Please don't send me technical questions in private messages, use the forum. ::wave

SBOVIS

  • Frequent poster
  • ****
  • Karma: 0
  • Offline Offline
  • Gender: Male
  • Posts: 404
  • FORGET REALITY SURRENDER TO YOUR DARKEST DREAMS
    • View Profile
    • LIMBO of the LOST
Re: How do I keep the framerate within a range
« Reply #4 on: December 08, 2004, 02:43:50 PM »

I understand what Jerrot and yourself is saying, But for example my ACTOR walks at 90ms per frame if the framerate is fast the actions of the actor move quickly, if the framerate is slow the actions move slow or are non fluid the ACTOR stops and then starts etc

I know that 90ms is 90ms but depending on framerate depends when that 90ms is called from the sprite file.

For example if I change the running to 32BIT fullscreen and NO force 16bit textures it runs at 20fps -30fps but not fluid. If I run the project in 16BIT FULLSCREEN and NO force 16bit textures it runs 50fps up.
If I run the project windowed, forced 16 bit textures I get 50-60 fps.

If I run the project windowed, forced 16 bit textures I get 50-60 fps. but have 1gb of memory it runs very fast, ACTOR WALKS quickly near on comical.


I want to cap this speed.
Logged
kind Regards
Steve Bovis
MAJESTIC STUDIOS

Mnemonic

  • WME developer
  • Administrator
  • Addicted to WME forum
  • *
  • Karma: 41
  • Offline Offline
  • Gender: Male
  • Posts: 5683
    • View Profile
    • Dead:Code Site
Re: How do I keep the framerate within a range
« Reply #5 on: December 08, 2004, 03:13:55 PM »

Well, the speed defined in your sprites _should_ be the optimal one, i.e. use the sprite timing to cap the speed. I think your main problem is that the game runs slowly on most configurations. What's the reason? Does it use such large quantities of graphics? Perhaps there's a way to optimize it. Reducing framerate is not the way to go, IMHO.
Logged
Yes, I do have a twitter account
Please don't send me technical questions in private messages, use the forum. ::wave

SBOVIS

  • Frequent poster
  • ****
  • Karma: 0
  • Offline Offline
  • Gender: Male
  • Posts: 404
  • FORGET REALITY SURRENDER TO YOUR DARKEST DREAMS
    • View Profile
    • LIMBO of the LOST
Re: How do I keep the framerate within a range
« Reply #6 on: December 08, 2004, 03:18:37 PM »

The project has got a large amount of graphics and animated sprites, I am using TGA and JPEG and no BMPS because of their size.

How would you optimise? make the sprites 256 cols? would that help as at the moment they are 16 bit not 8


Logged
kind Regards
Steve Bovis
MAJESTIC STUDIOS

Mnemonic

  • WME developer
  • Administrator
  • Addicted to WME forum
  • *
  • Karma: 41
  • Offline Offline
  • Gender: Male
  • Posts: 5683
    • View Profile
    • Dead:Code Site
Re: How do I keep the framerate within a range
« Reply #7 on: December 08, 2004, 03:24:04 PM »

No that wouldn't help. I was thinking more about needless graphics being stored in memory all the time. Such as background images for windows, animations which are rarely used, etc.
Logged
Yes, I do have a twitter account
Please don't send me technical questions in private messages, use the forum. ::wave

SBOVIS

  • Frequent poster
  • ****
  • Karma: 0
  • Offline Offline
  • Gender: Male
  • Posts: 404
  • FORGET REALITY SURRENDER TO YOUR DARKEST DREAMS
    • View Profile
    • LIMBO of the LOST
Re: How do I keep the framerate within a range
« Reply #8 on: December 08, 2004, 03:29:07 PM »

oh I see, no there are none, the only graphics on display are the ones needed for the scene etc.

I still think it is to do with a combination of system RAM and FRAMERATE.
What is the optimum frame rate for a standard point and click adventure? 40-50FPS?
If so then I am getting 60 up with the ACTOR sprite walking much faster on a much faster machine, even though the sprite frames are set to 90 he walks like they are on 50ms

There must be some correlation to RAM surely.
Logged
kind Regards
Steve Bovis
MAJESTIC STUDIOS
 

Page created in 0.041 seconds with 24 queries.