Bay 12 Games Forum

Please login or register.

Login with username, password and session length
Advanced search  

Author Topic: Restrict CPU usage  (Read 1052 times)

imsabbel

  • Bay Watcher
    • View Profile
Restrict CPU usage
« on: August 22, 2006, 02:05:00 am »

It seems dwarf fortress using opengl opens a bit of a problem:

There is no limitation on how much to render, so it seeems it is running at 1000+fps, as it uses 100% cpu and GPU power even when paused.

While this isnt that big a problem on a desktop (but still unneeded, as i seriously hope that the engine doesnt need a A64 and a gefore 7600 on full power just to run), it seriously kills runtime on a laptop.

Any way to cap the rendering code at 60fps/screen refresh rate or something compareable (like for example google earth does: as soon as the globe stops moving, cpu load drops down to zero)?

Logged

Toady One

  • The Great
    • View Profile
    • http://www.bay12games.com
Re: Restrict CPU usage
« Reply #1 on: August 22, 2006, 02:08:00 am »

The caps are in, dunno why they aren't working.  My FPS caps around 100 and my cpu is never really higher than the 20s except during intense parts of world gen and a few other such patches (0% at pause).  I know I don't have an FPS counter yet, but any other in-play CPU %s would help out here.

What are you running it on?  I don't know specifically how to do CPU caps, but my windows loop is correct so far as I know.  The OpenGL won't be much more intense that a screen refresh most of the time, but even that can be bad if you have nothing helping out, if I remember.

[ August 22, 2006: Message edited by: Toady One ]

Logged
The Toad, a Natural Resource:  Preserve yours today!

imsabbel

  • Bay Watcher
    • View Profile
Re: Restrict CPU usage
« Reply #2 on: August 22, 2006, 03:41:00 am »

Strange, i tested it again, with the newest version, in fullscreen and windowed mode.

80-90% cpu load even when only sitting in the main menue.

Its running on a a64-3000, winxp sp2, geforce 7600gt with newest drivers.

Logged

ghor

  • Bay Watcher
    • View Profile
Re: Restrict CPU usage
« Reply #3 on: August 22, 2006, 05:46:00 am »

I too have an a64 CPU, but it seems to work fine for me. Could it, strangely enough, be a graphics card issue (I have an ATI X800)?

When in a menu, Fraps tells me it runs in 64 fps and uses 0% CPU load. When in the game, my current fortress runs in 50ish fps and uses about 20% cpu load.

Logged

Fourth Triad

  • Bay Watcher
    • View Profile
    • http://www.bay12games.com
Re: Restrict CPU usage
« Reply #4 on: August 22, 2006, 02:18:00 pm »

38-42% cpu usage while sitting in town in adventure mode. 2200mhz cpu 32bit. geforce 9600  or something like that.
Logged

Toady One

  • The Great
    • View Profile
    • http://www.bay12games.com
Re: Restrict CPU usage
« Reply #5 on: August 22, 2006, 02:22:00 pm »

Also, I can't remember exactly what software it was, but when some kind of "Jukebox" thing was in my task manager, the dwarves CPU numbers started going up very high for some reason.  Dunno if that's an FMOD compatibility issue or something else.  Any information like this would also be helpful.
Logged
The Toad, a Natural Resource:  Preserve yours today!

imsabbel

  • Bay Watcher
    • View Profile
Re: Restrict CPU usage
« Reply #6 on: August 22, 2006, 03:09:00 pm »

I used sysinternals task viewer and the fmod thread didnt show much cpu load. it was all in the main one.

It also happens with sound completeley disabled all the same (70-80% cpu load)

Logged

Gronut

  • Bay Watcher
    • View Profile
Re: Restrict CPU usage
« Reply #7 on: August 23, 2006, 01:07:00 pm »

I have a Sempron 3000 or some such (1.8GHGz) and a GeForce 5900; sometimes it runs at 30-40% load, and sometimes at 55-65% load, and I'm not sure what affects that (I checked with the same 100+ dwarf fortress). Pausing has no effect on load.
Logged