Advertisement

FPS?

Started by April 22, 2002 08:10 PM
86 comments, last by Wachar 22 years, 7 months ago
Wow, thanks! I didn''t know you could do that to calculate FPS. I can''t believe I didn''t think of that!

I think a frame is one screen picture. Example: In a game such as pong, say you took a snapshot. This would be 1 frame. If you take many pictures very quickly and then play it back, it look like it''s moving. I know they do this in movies. They take one frame and then quickly move to the next and again and again. This makes the eye believe it''s actually moving. I also understand that, you don''t MAKE the fps. I understand it''s a unit of measurement. But, I want to know, why even use fps?

----------
Take it to the Xtreme!
----------
Wachar's Eternity <-<-<-<-<- Me own site!
The answer lies in this thread. Read it again. And read it SLOWLY !
-------------Ban KalvinB !
Advertisement
Why would you calculate anything? Take Miles Per Hour (MPH) as an example. Why would you want to calculate a distance based on a time? To see how long it will take you to get somewhere. Why would you measure anything? The idea behind measuring FPS is to determine how many times the game is going through the main loop. In other words, how long it took to get from point a to point b. Now, if you make a game, and you are getting a very low FPS, then that may indicate a problem that would need to be looked at within the code somewhere.
Ok good so you totally know what a frame is, i thought so but just wanted to make sure.

anyway. now each frame of your game will take a certain amount of time to render. each frame is drawn in one iteration of your main while(1) loop.

ok

so now I want to know whether many people will be able to play my game and see things move smoothly. i also want to make sure that most people won''t see jerky motions. (2 sides of the same coin).

FPS is a measure of how FAST my engine is. that is, how long does it take for each loop of the game to run on average on each machine i try it on. (remember not all computers are the same speed so i want to run my program there and see if it''s still fast). so i run the program on several different computers and see how "fast" it is. my measure for fastness is FPS.

as an example of a use for FPS. i am building a first person shooter game. when i was starting out i drew 3 triangles to the screen and could move around them in all directions. only i was getting only 20FPS on my 2nd machine. 20 is a really horrible number b/c things look super jerky. also, i was only displaying 3 triangles. so i knew that something was wrong. FPS was a measure that i used to figure out my game was running waaaaay to slow. it pointed out to me in a clear way that something was fucked with my program so i knew to look for problems even though the program ran without crashing or throwing errors. now i get like 120FPS and FPS is a measurement that i use to make myself feel happy b/c i am on the right track to make things run faster.

Higher and higher FPS counts mean smoother and smoother motion for anyone playing my game. a really big FPS means you also have processing room to squeeze in more AI or higher resolution graphics or other things that i wasn''t sure i would be able to include in my game.

FPS is a good tool when your program is already running fast enough that your eyes can''t tell you the difference between a little bit faster and a little bit slower.

ok?

-me
and one more thing. FPS doesn''t make your game go. if you don''t calculate FPS your game won''t change for the better or for the worse.

it is a tool that you use as a developer to see if your current program is running fast or slow. when you release it you can either throw out all the FPS code or leave it in there so users can see how many FPS they get with your game.

for instance people use Unreal Tournament FPS to tell which graphics card is better. a better graphics card gives you a higher FPS.

-me
So, how would you be able to input how fast a game is going onto the screen?

----------
Take it to the Xtreme!
----------
Wachar's Eternity <-<-<-<-<- Me own site!
Advertisement
Hmm....OK.

[edited by - CobraMantis on April 27, 2002 8:37:52 PM]

C''mon...context clues. He meant "output."

[twitter]warrenm[/twitter]

quote: Original post by Wachar
So, how would you be able to input how fast a game is going onto the screen?

----------
Take it to the Xtreme!
----------


Depends on what you''re using. You use GDI functions with GDI, DirectX functions with DirectX, OpenGL functions with OpenGL, etc. If you are able to print numbers on the screen somehow then you can show the FPS on the screen.

I will not make a list of links... I will not make a list of links... I will not make a list of links...
Invader''s Realm
Think of it like this. You've got two people, DirectX and GDI. DirectX is really fast at drawing, while GDI can do it a bit slower.

You can't tell either person to speed up or slow down, but you can try to lessen the amount of stuff they draw.

Say you give them the assignment, of draw a line on a piece of paper. DirectX might do it in a second, GDI might take two.

Now, tell them to draw a tank, and DirectX might take an hour, while GDI might take two hours.

We can measure how fast each person works, by dividing 1 (1 frame, 1 picture) by the number of seconds it took to draw. So, you could say DirectX drew the line in 1 frame per second (1/1), and GDI drew it in 0.5 frames per second (1/2). For the tank, it would be 0.016 frames per second (1/60), and 0.0083 frames per second (1/120).

From this, we can conclude that to make things run faster, we need to give them less work to do, that more complex things things take longer to draw than less complex ones.

Now think if the artist also had to do some math and some other tasks while also drawing the tank. The more complex the math tasks, the longer it takes to draw the tank, because he has to do the math, then stop in the middle, work on the tank, then continue with the math, then stop again and work on the tank, so it'll take longer.

This is basically how it works with a computer. The computer can draw much faster than a human, so that is why frames per second for things drawn by computer is much higher than a human could ever achieve. Since you can't tell a human to speed up or slow down drawing, you can't do it with the computer either. This gives you the only option, reducing what the computer needs to do (just like the human), or even showing the human/computer how to do a certain thing faster (optimizing) so he spends less time on that and more time on drawing the tank, thus finishing it earlier.

Yes, I realize this topic is old, but I thought that someone might have some use for my analogy.

[edited by - UBC_Wiskatos on April 27, 2002 12:57:16 PM]
[email=ubc_wiskatos@hotmail.com" target="_blank" style="width: 10px; height: 10px; background: #fe7a21; overflow: hidden; display: block; margin-bottom: 2px;][/email]Wiskatosxp

This topic is closed to new replies.

Advertisement