Asking again ... dont direct me to the code archieve
Blitz3D Forums/Blitz3D Beginners Area/Asking again ... dont direct me to the code archieve
| ||
@all Measuring the FrameRate ... whats the best/optimal method ... don't direct me to the code archieves .. there are just as many versions as there are different types of games! |
| ||
There is no best method. Here's the method I use: At the start of a frame go: oldtime = newtime newtime = millisecs() After updateworld, but before renderworld do one of the following to calculate the framerate: framerate = 1000.0 / float(newtime-oldtime) And, for a framerate which doesn't update so fast you can additionalyl go: FPS = ((FPS * 9) + Framerate) / 10 That averages the fps over several frames. Sure there might be slightly more accurate alternative methods, but generally one does not need the framerate accurate to thousanths of a second. :-) |
| ||
Forgot to mention that i'm using BlitzPlus only ... |
| ||
How does that apply? Is there no millisecs command in Blitzplus? I find that hard to believe. :-) |
| ||
Try this hansie. I use this for all my stuff. Updates every second.Graphics 800,600 SetBuffer BackBuffer() Global frame Global timer Global fps While Not KeyHit(1) Cls If MilliSecs()<timer+1000 Then frame=frame+1 Else fps=frame frame=0 timer=MilliSecs() End If Text 0,0,"fps="+fps Flip 0 Wend |
| ||
@Ross C Thanks a million! just what I needed! running a fullscreen 800x600x16 I have about 59-60 FPS ... |
| ||
remember thatflip 0 gives you the true FPS flip gives you the FPS synced to the monitors refresh rate :) |
| ||
yes, I use FLIP FALSE but it seems to give me the same FPS no matter resolution I try ... hmmm ... |
| ||
320x240 ? :P |
| ||
same bloody FPS! between 58-60! |
| ||
hmm... are drawing the same aount of stuff to the screen each time? If you are, you won't notice any difference, unless the images are smaller when the res is smaller :) |
| ||
But it really sounds like monitor v-sync is on.... |
| ||
VWait Flip False text 0,0 "..." + fps Wend |
| ||
Or check that the variables used for the code, don't get used or changed else where... Anyway, signing off for the night. Ta ta! |
| ||
removing the VWAIT command drastically increased the FPS .. dont get it .. |
| ||
Get rid of Vwait! That stops the computer till the monitor refreshes. Good for using in game, but with this on, it's not a true indiction of your games true speed :) |
| ||
SInce your monitor is probably at 60 hz, 60 refreshes per second. You get 60-ish fps :) With it off, the gfx card redraws the screen as quickly as it can, completely ignoring the monitor refresh rate. |
| ||
OK. VWAIT removed ... read somewhere else on this forum that I should use VWAIT every time ... |
| ||
Well, you don't really need it. Just use flip or flip false. Or use flip flase, and create your own timing code, to update the game at what ever FPS you like :) Anyhow, signing off this time ;) See ya! |
| ||
Thanks mate |