Sorry your browser is not supported!

You are using an outdated browser that does not support modern web technologies, in order to use this site please update to a new browser.

Browsers supported include Chrome, FireFox, Safari, Opera, Internet Explorer 10+ or Microsoft Edge.

Newcomers DBPro Corner / Frames per second problem

Author
Message
Gil Galvanti
19
Years of Service
User Offline
Joined: 22nd Dec 2004
Location: Texas, United States
Posted: 4th Feb 2005 10:53 Edited at: 4th Feb 2005 11:03
hi all,
when i get my fps its at about 60fps in my program until i turn and when i am turning and moving forward its only about 40fps. Why?

EDIT: and another question:
how can i keep my fps consistant it makes my game seem to jump to different speeds jumping from as high as 108 to as low as 28fps.

Video games…they can take you places unreachable, impossible, unfeasible. They put you in the book...they put you in the movie...they put you in a world, a world that before could only be imagined.
Lost in Thought
20
Years of Service
User Offline
Joined: 4th Feb 2004
Location: U.S.A. : Douglas, Georgia
Posted: 4th Feb 2005 14:52
The answer to both questions are the same. There are 2 ways to make sure your game has a pretty constant FPS. You can build your levels where no matter which way you look it will always have around the same number of polys on screen (Like building for quake1 sort of) and you need to optimize your program so it scans about the same amount each loop (harder than the building fix). When you are not putting any keypresses or such usually the program only scans minimal parts as when it gets to the if statements it skips everything past the check for input. When you press a key is when it actually scans most of the program usually. Another fix for this is to add a physics system so your objects are always being checked and adjusted so the only think a key press will change may be a variable value.

Even if you get a constant fps you will still want to time sync your program to run the same speed on all pcs.

Gil Galvanti
19
Years of Service
User Offline
Joined: 22nd Dec 2004
Location: Texas, United States
Posted: 5th Feb 2005 00:47
k, thanks

Video games…they can take you places unreachable, impossible, unfeasible. They put you in the book...they put you in the movie...they put you in a world, a world that before could only be imagined.
Medusa
21
Years of Service
User Offline
Joined: 7th Sep 2003
Location:
Posted: 6th Feb 2005 08:37
Full motion video simulating real life movement is 30fps.
Any game need only be 30 fps to look natural.
The reason you need to check your fps as you build is to warn you if the game starts to fall below 30 fps as it then looks jerky.
As the frame rate is dependent on how many polygons you are trying to display compared to the speed of your computer it then follows that a minimum of 30 fps tells you that your game can run successfully on a similar computer, processor, graphics card etc.
Then all you need do is set 'frame rate 30' at the start of your program and your game is set to run on any similar machine at normal speed.
Increased frame rates apart from yielding more crisp displays can wreak havoc e.g. an early Quake3 demo where the enemy moved like athletes while the players movement was almost frame by frame.
Hope this helps.

mpc
Gil Galvanti
19
Years of Service
User Offline
Joined: 22nd Dec 2004
Location: Texas, United States
Posted: 6th Feb 2005 09:42
ok, thanks, whats the command to set the frame rate 30 though?

Video games…they can take you places unreachable, impossible, unfeasible. They put you in the book...they put you in the movie...they put you in a world, a world that before could only be imagined.
Gil Galvanti
19
Years of Service
User Offline
Joined: 22nd Dec 2004
Location: Texas, United States
Posted: 11th Feb 2005 12:21
anyone?
and i have another problem, i only have 4 buildings out of a ton more and an island and people and many other things to be added, and the framerate drops to about 35 from 115, this will be a big problem in the future, how can i fix it?

Video games…they can take you places unreachable, impossible, unfeasible. They put you in the book...they put you in the movie...they put you in a world, a world that before could only be imagined.
RiiDii
19
Years of Service
User Offline
Joined: 20th Jan 2005
Location: Inatincan
Posted: 11th Feb 2005 15:08 Edited at: 11th Feb 2005 15:13
Sync Rate 30

Edit: Another interesting side effect of setting the frame rate is that it seems to stablalize the frame rate and reduce the variation. In other words, you are experiencing a frame rate of 35 to 120. But if you set the Sync Rate at, let's say 60, you might only experience a range from 45 to 60. It's odd, but I believe from what I've read on some other posts, it's due to Direct X, which is calculating the next positions before it finishes drawing the previous positions. By setting the Sync Rate low, you aren't forcing Direct X to overlap nearly as much, so it doesn't get so far behind.

"Droids don't rip your arms off when they lose." -H. Solo

REALITY II
Gil Galvanti
19
Years of Service
User Offline
Joined: 22nd Dec 2004
Location: Texas, United States
Posted: 11th Feb 2005 22:39
cool, it works, i set it at 100 and it stays within about 45-55, cause at 30 it was only running at 16fps .

Video games…they can take you places unreachable, impossible, unfeasible. They put you in the book...they put you in the movie...they put you in a world, a world that before could only be imagined.
Emperor Baal
20
Years of Service
User Offline
Joined: 1st Dec 2003
Location: The Netherlands - Oudenbosch
Posted: 11th Feb 2005 23:53 Edited at: 11th Feb 2005 23:59
The reason your program's FPS is jumping all over the place is because it sometimes has to process more instructions and sometimes allmost nothing.

I usually just let the FPS go sky high by using:
Sync rate 0

Then I just use timer based movement to allow objects to move at the correct speed.



Now, when moving objects, you only need to use:
* Speed_modifier#

When the FPS changes, the amount of time needed to process the do loop has changed too. Thanks to the calculation at the bottom the movement speed of the objects is modified.

When the FPS is 60, the average the time the computer needs to process the do loop is around 16.666.
As you can see, that's the same as Normal_FPS#.

Now:

Normal_FPS# / time used to process
16.666 / 16.666 = 1.0

1.0 / 1.0 = 1.0

The modifier is 1.0 when the FPS is 60.0.
This means the objects will move at their normal speed.

Again, when the FPS is 90:

Normal_FPS# / time used to process
16.666 / 11.111 = 1.49

1.0 / 1.49 = 0.67

Now the objects will move slower, but the move object commands will be
called more often. This will compensate and all will be well

Turoid
21
Years of Service
User Offline
Joined: 1st Nov 2003
Location: The Netherlands
Posted: 12th Feb 2005 00:05
The math king speaks

Gil Galvanti
19
Years of Service
User Offline
Joined: 22nd Dec 2004
Location: Texas, United States
Posted: 12th Feb 2005 06:55
ok, i kinda get what ur saying, but not completely, ill look into it though, thanks

Video games…they can take you places unreachable, impossible, unfeasible. They put you in the book...they put you in the movie...they put you in a world, a world that before could only be imagined.

Login to post a reply

Server time is: 2024-11-27 21:34:29
Your offset time is: 2024-11-27 21:34:29