Jump to content


Photo

Measuring FPS


  • Please log in to reply
3 replies to this topic

#1 Diabloist337

Diabloist337

    GMC Member

  • GMC Member
  • 73 posts

Posted 23 May 2012 - 07:38 AM

I've been using GMS Beta for now, and trying to measure fps by using the built in global var - fps. It just returns 0.
in Draw Event i have a simple code

...
draw_text('FPS' + string(fps));
...

and it just shows

FPS : 0

What went wrong? Can anyone explain?

Note : The line is NOT the only code in draw event, there's other code too. :P
  • 0

#2 gregm

gregm

    GMC Member

  • New Member
  • 66 posts
  • Version:Mac

Posted 28 May 2012 - 01:15 PM

I've been using GMS Beta for now, and trying to measure fps by using the built in global var - fps. It just returns 0.
in Draw Event i have a simple code

...
draw_text('FPS' + string(fps));
...

and it just shows

FPS : 0

What went wrong? Can anyone explain?

Note : The line is NOT the only code in draw event, there's other code too. :P


Not sure what's wrong with the this piece of code. But I've read that you should fix your game to use 30 or 60 fps only for iOS applications.
  • 0

#3 Hugo_Peters

Hugo_Peters

    herp derp

  • GMC Member
  • 447 posts
  • Version:GM:Studio

Posted 28 May 2012 - 01:49 PM


I've been using GMS Beta for now, and trying to measure fps by using the built in global var - fps. It just returns 0.
in Draw Event i have a simple code

...
draw_text('FPS' + string(fps));
...

and it just shows

FPS : 0

What went wrong? Can anyone explain?

Note : The line is NOT the only code in draw event, there's other code too. :P


Not sure what's wrong with the this piece of code. But I've read that you should fix your game to use 30 or 60 fps only for iOS applications.

There is something wrong with that code. In Studio, you should you use a high resoultion timer instead.
  • 0

#4 NeutralD

NeutralD

    GMC Member

  • GMC Member
  • 22 posts
  • Version:Unknown

Posted 31 May 2012 - 10:08 PM

I'm using my own script to measure FPS on iDevices:

lastTime = 0;
frames = 0;
timeNow = 0;

frames += 1;
timeNow = current_second;

       if (timeNow > lastTime) 
       {
       fps_str = string(frames);
       frames = 0;
       lastTime = timeNow;
       }

draw_text(10, 20, 'FPS: '+fps_str);

  • 0




0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users