Nothing entered.
[http://sourceforge.net/p/ufoai/feature-requests/52 Item 52] imported from sourceforge.net tracker on 2013-01-28 20:12:11
Any way you could decrease the CPU usage when it's not
needed?
The CPU temperature is getting pretty hot even if I'm
in the main menu when no complex graphics are rendered.
===== Comments Ported from Sourceforge =====
====== mikonmimuw (2006-06-13 22:17:28) ======
Logged In: YES
user_id=1323456
I don't remember, but you could search the web for quake2
console commands, there is one that limits the framerate ---
perhaps it will help? And please tell us if you succeded...
====== mikonmimuw (2006-06-17 16:19:31) ======
Logged In: YES
user_id=1323456
So, that was cl_maxfps and setting it to 20 indeed limits my
FPS to 20, but cpu is still at 100% and gets very hot. It
seems UFO (Quake2 too?) does some idle loop all the time
(listening to the net? to the mouse? doing nothing?) instead
of taking a break when the frame is already drawn and
nothing happens...
Help!
====== mikonmimuw (2006-06-17 16:32:49) ======
Logged In: YES
user_id=1323456
An attempt at solving this problem is described at
http://www.quakesrc.org/forums/viewtopic.php?p=14427&sid=97f3030d87b607225b9881f24b20945e
It uses an additional console variable cl_sleep, but perhaps
this can be solved in a much simpler way?
====== mikonmimuw (2006-06-17 17:27:30) ======
Logged In: YES
user_id=1323456
An attempt at solving this problem is described at
http://www.quakesrc.org/forums/viewtopic.php?p=14427&sid=97f3030d87b607225b9881f24b20945e
It uses an additional console variable cl_sleep, but perhaps
this can be solved in a much simpler way?
====== mikonmimuw (2006-06-24 15:00:57) ======
Logged In: YES
user_id=1323456
On Linux there is a cpulimit program that limits % of CPU
usage by a process. However it works in quite large time
intervals, causing jerkiness --- 50000 us for the process
and then 50000 us sleep and again 50000 us for the
process... OTOH, with higher granularity task-switches would
cost a lot, as opposed to sleep invoked by ufoai itself.
I tried it with a 50% limit and it appears my FPS goes down
from 130FPS (after tweaking Makefile, originally it was
80FPS) to 65FPS both on the starting screen and the
battlescape (considerable jerkiness in map-rotation and in
text scrolling (the latter is somewhat jerky even at 100%
CPU)). This is regardless of resolution (my graphics card is
a NV FX5900XT --- an overkill for this game) and SDL vs. GLX
rendering. My CPU is an old 2GHz, 1GB of memory. Setting
cl_maxfps even higher did not help, setting it lower
resulted in even lower FPS --- always approximately half of
the cl_maxfps value; strange...
It seems that ufo is considerably CPU-limited. Is it Quake2
engine or some ufo internals? If it's Quake2, are there more
OpenGl-intensive versions of it, so that CPU is less taxed?
Or is it just a greedy idle loop that eats even into proper
rendering if it doesn't get 100% CPU? Anyway, I could get
away with 50% CPU (65FPS is enough), but cpulimit is not the
solution. :<
====== mikonmimuw (2006-06-24 17:05:53) ======
Logged In: YES
user_id=1323456
How strange, FPS is 125 in the main menu and battlescape and
333 during the credits animation (somewhat reduced when
there is lots of text).
====== screamingwns (2006-07-02 14:02:56) ======
Logged In: YES
user_id=1535905
Hello,
This 'problem' is a throwback to the engine's FPS roots.
Basically, there are two ways of doing animation:
1) Set the frame rate and calculate action at regular
slices.
2) Run as many frames as you can and work out the action
based on the time elapsed between frames.
The advantage of 1 is that, if the calculations for the
current frame are complete, the CPU becomes idle until the
refresh is complete. The disadvantage, is that you can
start to skip frames and, depending on the type of game,
you may have to write lots of code to ensure the integrity
of the animation and world.
The advantage of 2 is that it works better at lower frame
rates; the game keeps 'working', but just reduces to a
slideshow. This is much easier to manage in the code (it
happens naturally). Also, if you have VERY high framerates,
the game is more responsive, thus enhancing playability.
The disadvantage, is that it hogs 100% of the CPU.
Quake 2 (and, from what I understand, all FPS) use method
2. Re-writing is a MAJOR task, although probably
appropriate for a turn-based game.
As this counts as optimisation, it has a low priority for
now.
====== mikonmimuw (2006-07-02 15:01:29) ======
Logged In: YES
user_id=1323456
Fair enough for me. I just hoped there is a quick hack... :>
====== tlh2000 (2007-03-08 17:14:21) ======
Logged In: YES
user_id=116930
Originator: NO
this is fixed for the menu view - but not the tactical missions atm