In Game Framerate

OK, this should be a really simple thing to answer, but it’s been winding me up for a while now.

There’s a framerate that appears in the ‘Stats’ tab in the editor. When there’s little or nothing going on in whatever I happen to be making, this framerate is usually 2000fps or more. However, if I use a script to calculate it for me and write it to a GUI text thingy it gives me something close to 60fps, even whilst the 2000fps are showing in the background.

I got confused by the discrepancy between the two framerates, and the following seemed like the most logical explanation, so…

Would I be correct in saying that, when a game is running the framerate in the stats tab isn’t actually the correct value, but instead represents the best framerate my computer could do if it had some godlike screen which would refresh that fast? On that note, is it also the case that any game I create will limit itself automatically to the best framerate it’s monitor can manage (unless the cpu can’t keep up with that), as drawing additional frames would just ‘fall between the gaps’ so to speak? If all this is the case, how can I make the same kind of framerate counter seen in the stats tab, and then stick it in my game?

Cheers guys!

No, it’s how long it takes to actually draw the frame. This doesn’t have much to do with the framerate of your game, since drawing graphics is only part of what games do. (I knew, I just knew, when UT added this to the stats, that it was going to be constantly misunderstood…) Also, unless you have vsync on, a game running at, say, 200fps will still output 200fps regardless of whether your monitor can actually refresh that fast or not.

–Eric

Ah, that’s still kinda confusing, but at least it’s less confusing. Thanks for the quick reply too.