Author Topic: Limit FPS: better performance without loss of quality  (Read 1605 times)

Xayton

  • Traveller
  • *
  • Posts: 11
    • View Profile
Limit FPS: better performance without loss of quality
« on: July 21, 2005, 04:00:42 pm »
I\'ve searched in the whis-list but I\'ve not found any thread on  limiting fps (frame per second) and why it should be implemented in the game, so I posted this thread (I think it\'s in the right place).
The point is that I\'ve noticed that the game has no fps limiter and if the CS engine has not much to draw the fps may be very high (200 or more); this is not a good thing since it\'s only wasting cpu power. If your monitor RR (refresh rate) is, for example, 85Hz, any fps greater than that value is a waste of cpu because you can\'t actually see what has been drawn by the graphic engine.
If rr is 85hz the image on the monitor will be refreshed by the graphic card approximately every 11 milliseconds (1sec/85 = 0.011sec), but if in the same moment the fps is 200 the engine will redraw the scene every 5 milliseconds and about half computed images will be never shown (a big waste!).
I think this should be fixed since it\'s annoying to have the cpu getting very hot while the fps is 200 or more. Of course this is not the only thing that can be improved to save cpu time, another problem is that when the game is not the active window (in windows you can switch using ALT+TAB) the cpu is still completely active, at least when the game window it\'s not visible, the game should skip drawing.

I don\'t know how it\'s structured the game drawing loop (I\'ve not looked at the sources yet) but I think a simple check can handle the fps problem. The real problem may be getting current rr for the system (the CS has a function that does it?).
I don\'t know if this may be usefull, but I know an easy way to fix the high fps problem using directx graphic libraries: the structure D3DPRESENT_PARAMETERS used with the intialization function CreateDevice() has a member called \"PresentationInterval\" that can be set to avoid drawing too many times.
If any part of this post is not clear... I\'m here.


Wired_Crawler

  • Hydlaa Citizen
  • *
  • Posts: 429
    • View Profile
(No subject)
« Reply #1 on: July 21, 2005, 04:29:42 pm »
Look here: http://www.planeshift3d.com/wbboard/thread.php?threadid=17327&boardid=17, especially at Androgos reply:
Quote
Originally posted by Androgos
If a hard FPS limit is a feature you want, create a Feature Request on the tracker and assign it to me.

there already is a limit on the login screen / char creation, so it shouldn\'t be any problem mkaing it apply ingame to

Cheers

The magic words were: fps cpu heat
"Close the world, txEn eht nepO."

ramlambmoo

  • Hydlaa Notable
  • *
  • Posts: 567
    • View Profile
(No subject)
« Reply #2 on: July 21, 2005, 04:44:59 pm »
Quote
I don\'t know if this may be usefull, but I know an easy way to fix the high fps problem using directx graphic libraries: the structure D3DPRESENT_PARAMETERS used with the intialization function CreateDevice() has a member called \"PresentationInterval\" that can be set to avoid drawing too many times.
If any part of this post is not clear... I\'m here.  


Im pretty sure CS uses openGL, so you wouldnt be able to use a directX function.

Anyway, with so many people complaining about low fps, i dont think this is too much of a problem.. if your FPS is over 100 or so, then you must have a pretty damn good computer.. just compile the source code in the background or de-fragment your hard drive at the same time, and problem solved.

Verrliit

  • Hydlaa Citizen
  • *
  • Posts: 244
    • View Profile
(No subject)
« Reply #3 on: July 21, 2005, 07:22:50 pm »
Again, as I triied to say in the post Wired_Crawler quoted above:

To be able to limit the maximum framerate is a basic function.

A huge number of people have marginal cooling, especially on  their video cards, and long-term, this could damage their hardware.

I am also intensely curious to know what is sucking up so much memory and so many cpu cycles.

No other program I have seen, maxes my machine for more than a moment.

Except, of course, Burn-in Test.
The Devs have invited us to play in their sandbox. The GMs keep us from spoiling each other's fun.  Be respectful, and thank them often.



Courtesy cannot be imposed by force.  Lead by example.  Be elegant.  - Dr. H. Lecter

Verrliit

  • Hydlaa Citizen
  • *
  • Posts: 244
    • View Profile
(No subject)
« Reply #4 on: July 21, 2005, 07:34:54 pm »
P.S.

I have attempted to reach the sourceforge tracker without success, and have actually seen a post saying it had not been functional for a while.

Where is the dialog with the Devs located?

Is wish list all there is?
The Devs have invited us to play in their sandbox. The GMs keep us from spoiling each other's fun.  Be respectful, and thank them often.



Courtesy cannot be imposed by force.  Lead by example.  Be elegant.  - Dr. H. Lecter

Nilrem

  • Hydlaa Notable
  • *
  • Posts: 881
    • View Profile
(No subject)
« Reply #5 on: July 21, 2005, 08:06:12 pm »
Androgos was referring to this page http://planeshift.oodlz.com/bugtracker/
here you can submit bugs or, as stated \"feature request\" and you can even assign it to Androgos, as he told.

I too agree that, limiting fps can be a workaround considering that the code isn\'t optimized at all; after all, who wants 333 fps? (the human eye works at 25fps or so, or i remember wrong?)
Are there any MoonSeekers left?

Easton

  • Hydlaa Citizen
  • *
  • Posts: 341
    • View Profile
(No subject)
« Reply #6 on: July 21, 2005, 08:29:55 pm »
*whispers to nilrem*
\"the human eyes works at 30fps.. 30\"

-Easton
"Thats pretending, not RPing"
-Hadfael

Ralas

  • Hydlaa Citizen
  • *
  • Posts: 255
  • Explorers Guild
    • View Profile
    • Reincrownation :D
(No subject)
« Reply #7 on: July 21, 2005, 09:06:16 pm »
The fact that it uses 100% of the CPU 100% of the time is, I think, a somewhat related but seperate issue.  Anyway, i have been told that they are working on this.  As for the FPS issue, it sounds like Androgos will get to this, as long as someone does the bug-tracky thing.
Yliakum, a really big crystal. These are the voyages of the Explorers Guild.  Its ongoing mission: to explore strange new maps, to seek out new life and new NPCs.  To boldly glitch where no one has glitched before.

www.reincrownation.com :D

Wired_Crawler

  • Hydlaa Citizen
  • *
  • Posts: 429
    • View Profile
(No subject)
« Reply #8 on: July 21, 2005, 09:09:18 pm »
Mmmm... I can\'t leave it alone. At least we all will learn something new.
Quote
Originally posted by Nilrem
(the human eye works at 25fps or so, or i remember wrong?)
Quote
Originally posted by Easton
*whispers to nilrem*
\"the human eyes works at 30fps.. 30\"
Nononono. Human eye is not a digital camera. It is analog \"device\". We do not see the world frame by frame, the picture is continuous. Read this: Human Eye Frames Per Second, and this: Human Eye Frames Per Second 2, and also this: 100fps.com
Well, 333 fps is too much, but 30 fps and 60 fps do makes difference (I can see the difference, really).
(BTW: use search button in google too ;) . I pasted here first three results of searching for \"human eye fps\" words)
« Last Edit: July 21, 2005, 09:12:22 pm by Wired_Crawler »
"Close the world, txEn eht nepO."

Xayton

  • Traveller
  • *
  • Posts: 11
    • View Profile
(No subject)
« Reply #9 on: July 21, 2005, 09:17:39 pm »
Quote
Well, 333 fps is too much, but 30 fps and 60 fps do makes difference (I can see the difference, really).


That is true, even if the human eye perceive 30fps as a continuos moving image, I\'ve tryed, you can easly notice the difference between 30 and 60 fps.

Anyway I still remain on the point that having fps greater than refresh rate is a waste (and of course is not noticeable).

aarobber

  • Traveller
  • *
  • Posts: 12
    • View Profile
(No subject)
« Reply #10 on: July 21, 2005, 09:26:41 pm »
Quote
Originally posted by Xayton
 Of course this is not the only thing that can be improved to save cpu time, another problem is that when the game is not the active window (in windows you can switch using ALT+TAB) the cpu is still completely active, at least when the game window it\'s not visible, the game should skip drawing.


Are you sure it\'s doing this?  If the canvas is not visible then rendering will not occur.  Try minimizing the window and seeing if there\'s a difference, but it should stop as long as the entire window is covered.

Xayton

  • Traveller
  • *
  • Posts: 11
    • View Profile
(No subject)
« Reply #11 on: July 21, 2005, 09:47:54 pm »
Quote
Originally posted by aarobber
Quote
Originally posted by Xayton
 Of course this is not the only thing that can be improved to save cpu time, another problem is that when the game is not the active window (in windows you can switch using ALT+TAB) the cpu is still completely active, at least when the game window it\'s not visible, the game should skip drawing.


Are you sure it\'s doing this?  If the canvas is not visible then rendering will not occur.  Try minimizing the window and seeing if there\'s a difference, but it should stop as long as the entire window is covered.


Unluckily now the server is down :( so I can try only the login screen (window version of ps), you\'re right, if the window is minimized it doesn\'t use any cpu, but if it\'s only hidden behind another window (and no part of it is visible) it still use 100% of cpu.

Anyway it\'s absurd that the login window, that doesn\'t have any advanced graphic, uses 100% of cpu (still the problem of limiting fps).

Nilrem

  • Hydlaa Notable
  • *
  • Posts: 881
    • View Profile
(No subject)
« Reply #12 on: July 22, 2005, 12:05:42 am »
Quote
Originally posted by Wired_Crawler

Nononono. Human eye is not a digital camera. It is analog \"device\". We do not see the world frame by frame, the picture is continuous.


I\'ll for sure take a look at that, but, unfortunately we don\'t process information in an analogic way, we, for sure work with frames, internally.
For instance, we don\'t notice things that are faster than our processing capacity or we see them but in a wrong way.
This conversation is getting a little of topic, but, as the server is out, we all can have some laughs.
As an example for the first, i can say:
there\'s a bird (name in english unknown for me) that moves its wings really fast, it\'s a little bird, and, when you see it, you only notice its body. You don\'t see wings, but they are there; using a camera capturing lots of frames per second allows us to view that detail when the movie is played at low motion.
Another thing is the monitor, we don\'t see it blink, but, again, use a camera and play the tape, you\'ll see how the image of the monitor refreshes.
As an example of the second, our \"eyes lying to us\", that the sentence says, i\'ll say the wheels. Yes, the wheels of the cars, given a certain speed, we can see how actually those wheels seem to twist backwards, but the car advances. The explanation comes again with the fact that we, indeed, interpret the sorrounding world with discrete variables, not analogical ones.
If we capture images every 30ms, then imagine the wheel makes a complete turn in 30ms, we won\'t see the wheel move!
Now let\'s imagine that wheel in 4 steps, guided by a known mark. The first one is label at the top, second at the right, 3d at the bottom, and 4 at the left.
Let\'s say that our capturing speed (30ms) is equal to 3/4 of the weel speed, so the wheel makes a circle every 40 ms.  First capture, label is up. Second one, the wheel has covered 3/4 of the way, so we capture left. 3rd capture the wheel has covered 3/4 more so we capture down... etc. We see the wheel going backwards.

So, to sum up, i don\'t know if it\'s right at the eyes, but, what is for sure, is that at a certain step, we work with discrete signals and not continuous.

Sorry for that long post.

Edit: Used bottom two times at the wheel :P
« Last Edit: July 22, 2005, 12:18:53 am by Nilrem »
Are there any MoonSeekers left?

dragonfire999

  • Hydlaa Notable
  • *
  • Posts: 938
    • View Profile
(No subject)
« Reply #13 on: July 22, 2005, 12:56:54 am »
the bird is called a humming bird.
I also did take a video of my comp screen once with a digital camera. it is wierd how it looks....

Quote
= <3

DeviantArt

Verrliit

  • Hydlaa Citizen
  • *
  • Posts: 244
    • View Profile
(No subject)
« Reply #14 on: July 22, 2005, 06:27:05 am »
Yes aarobber,
the windows client maxes the CPU, and the Vid card, and uses almost a gig of ram if running, no matter what.  No variations for load, being minimised or context, and not an interaction with any other program.  

This is more than a lack of optimization, and you can forget the usual suspects, too.  The network load is very low, and the hard drives aren\'t thrashing, either.

WinXP SP2 32bit, on AMD64, dual channel PC500, raid.

Thank you for responding.

The Dark Lady
Verrliit
« Last Edit: July 22, 2005, 06:29:34 am by Verrliit »
The Devs have invited us to play in their sandbox. The GMs keep us from spoiling each other's fun.  Be respectful, and thank them often.



Courtesy cannot be imposed by force.  Lead by example.  Be elegant.  - Dr. H. Lecter