Post

 Resources 

Console

Home | Profile | Active Topics | Members | Search | FAQ
Username:
Password:
Save Password
Forgot your Password?

 All Forums
 VBGamer
 VBGamer
 Getting FPS in .net?

Note: You must be registered in order to post a reply.

Screensize:
UserName:
Password:
Format Mode:
Format: BoldItalicizedUnderlineStrikethrough Align LeftCenteredAlign Right Horizontal Rule Insert HyperlinkInsert EmailInsert Image Insert CodeInsert QuoteInsert List Spell Checker
   
Message:

* HTML is OFF
* Forum Code is ON
Smilies
Smile [:)] Big Smile [:D] Cool [8D] Blush [:I]
Tongue [:P] Evil [):] Wink [;)] Clown [:o)]
Black Eye [B)] Eight Ball [8] Frown [:(] Shy [8)]
Shocked [:0] Angry [:(!] Dead [xx(] Sleepy [|)]
Kisses [:X] Approve [^] Disapprove [V] Question [?]

   Insert an File
Check here to include your profile signature.
Check here to subscribe to this topic.
    

T O P I C    R E V I E W
Krisc Posted - Nov 16 2004 : 12:42:41 PM
Hey I am currently writing my game in .net...although I am using C# I do know VB...anyways, I was wondering how to get the current FPS...? (I have forgotten the algorithm...)

Thanks!



p.s. this is like my 20th time trying to finish this game and i finally drew out everything on a big poster-board and set a schedule with weekly checkpoints (roughly) that i have to make. it is keeping me interested so far and i haven't gotten confused. i'm ahead of schedule a little bit but whatever...
5   L A T E S T    R E P L I E S    (Newest First)
Lachlan87 Posted - Nov 16 2004 : 3:33:40 PM
You cheater! I wanted to learn some Esdeedoublian!
sdw Posted - Nov 16 2004 : 3:16:12 PM
Even though Eric wants you to figure it out on your own and Bryk told you how to do it in language neautral terms, I'm going to tell you in Esdeedoublian which is my own language:

Three static or global variables:

  • FPS 'Holds the number of frames counted since the last second

  • LastTime 'Holds the time when we last started the count

  • Count 'Holds the number of frames we've gone through since the last second



Next is the function we call each frame
  
Sub CountFPS()  
  If CurrentTime() - LastTime >= 1000 Then 'Has it been 1 second since we last counted?  
    FPS = Count  'Store the number of frames counted in the last second  
    Count = 1  'Reset the count.  This can be 0 or 1, depending one where in your game loop it's called.  
    LastTime = CurrentTime()  'Use this to determine when 1000 ms (1 second) has passed (like above)  
  Else 'It hasn't been 1 second yet, continue counting  
    Count = Count + 1 'Since this function is called each frame, this is increased by 1 each frame  
  End If
End Sub
  

Looking back now that actually looks like VB, not Esdeedoublian :\
Eric Coleman Posted - Nov 16 2004 : 2:56:18 PM
I had a college professor that taught us how to do what he called "Fermi" problems, named after Enrico Fermi. I remember on one test he gave us the population of the state and asked how many dentists there are in the state. It pretty much amounts to dimensional analysis, which is the point of the problems.
Brykovian Posted - Nov 16 2004 : 1:06:54 PM
I had an physics prof back in my college days that liked to go on a soap-boxy rant every once in a while -- usually intending it as entertainment for his students. One time he went off on a student who was having problems figuring out how to work out the calculation for something. He went off on this long series of things like "I wonder how you figure out meters-per-second ... hmmm ... let's see, I know how many miles the thing went ... and I know how long it took to get there ... but I just can't seem to put it all together."

Sorry ... but Krisc's question gave me the old flash-back ...

So, we have FPS, which stands for frames-per-second ... if only I knew how many frames I was able to generate, over a known amount of time ... hmmmm ...

Or, in language-neutral terms ...
1> Count frames (FrameCount) for a specified period of time (T)
2> Do the math: FrameCount / T
3> Don't forget to reset your FrameCount to 0 for the next counting cycle

-Bryk
Eric Coleman Posted - Nov 16 2004 : 12:54:24 PM
Calculating the frames per second shouldn't be that difficult to figure out.

How do you think it should be calculated?

VBGamer © Go To Top Of Page
This page was generated in 0.08 seconds. Snitz Forums 2000

Copyright © 2002 - 2004 Eric Coleman, Peter Kuchnio , et. al.