-
[F8] Actual Frame Rate
Hi!
Is there an easy way to monitor the actual frame rate of the game? Of course, when it drops badly, it's obvious, but I want to be able to make quantitative comparisons. I want my baddies to animate, slightly, but not if it messes up the frame rate too much. ( Do you reccon it does?)
-
Hype over content...
Here's my as3 one ( Not sure what language you're developing in )
http://blog.gamingyourway.com/PermaL...b269bbe2e.aspx
My as2 one has been floating around the board for ages now, I'm sure a search will bring it up ( I think it may be in my template.fla ).
Squize.
-
Cute solution
Thanx Squize, but I code AS2, so I couldn't open that.
Anyways, I thought about it, and it turned out to be easy to make my own minimalistic one. Like this:
Create a text field in your game with the name fpsBox. (Since I think trace() might ruin fps itself)
declare these globals
Code:
var frameCounter:Number = 0;
var my_date:Date = new Date ();
var my_time = my_date.getTime ();
paste this function:
Code:
function fpsTester() {
frameCounter++;
if (frameCounter%10 == 0) {
var my_date2:Date = new Date ();
fpsBox.text= (Math.round(1000000/(my_date2.getTime () - my_time))/100);
my_date= new Date ();
my_time = my_date.getTime ();
}
}
and call it with fpsTester(); from within a this.onEnterFrame function.
This will keep you posted about the fps every 10 frames. You get a more accurate number if increasing this, but the result less often. The million I divide with time is for 1000 miliseconds, 10 frames and 100 for 2 decimals.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|