Bay 12 Games Forum

Please login or register.

Login with username, password and session length
Advanced search  
Pages: [1] 2

Author Topic: [40d] Severe processor taxing  (Read 2147 times)

nirodragon

  • Bay Watcher
  • Nirodragon cancels sleep: Interrupted by DF.
    • View Profile
[40d] Severe processor taxing
« on: September 07, 2008, 12:42:28 pm »

When I started my computer (Macbook, OS X 10.5.4, 2 GHz Intel Core 2 Duo, 4GB 667MHz DDR2 SDRAM), followed by starting the Activity monitor, I found that my processor use is at roughly 2%/0%.

When I start Dwarf Fortress, however, it spikes to about 25%/60%.  This is just with the game sitting at the title screen.  Also, after about a minute of running the game, regardless of whether or not I actually do anything, my computer is forced to run its cooling fan at maximum, while also scaling back my processor capabilities to prevent overheating.

I read in another post somewhere that DF isn't designed to take advantage of multiple processors/cores, so I don't know why it's hitting both cores so hard, and I'm wondering if there's a way to reduce its strain on my system.
Logged
Urist McMiner cancels Mine: Taking a dump
Urist McMiner was disgusted by a miasma lately

I can't believe I just went there...

Exponent

  • Bay Watcher
    • View Profile
Re: [40d] Severe processor taxing
« Reply #1 on: September 07, 2008, 12:46:23 pm »

Over in the 40c announcement thread (near the end), there seems to be some progress on discovering some inefficiencies in the drawing code that might eventually fixed in future releases.  I wouldn't be surprised if what you're experiencing is caused largely by these inefficiencies.

For the time being, you might try playing with the PARTIAL_PRINT option in init.txt.  It can cut down on how much the CPU is used for rendering.  You might need to play around with the number to avoid flickering, but some people have no problems whatsoever even with small numbers.
Logged

nirodragon

  • Bay Watcher
  • Nirodragon cancels sleep: Interrupted by DF.
    • View Profile
Re: [40d] Severe processor taxing
« Reply #2 on: September 07, 2008, 01:50:07 pm »

Is the game really rendering that much stuff in the title screen?
Logged
Urist McMiner cancels Mine: Taking a dump
Urist McMiner was disgusted by a miasma lately

I can't believe I just went there...

Exponent

  • Bay Watcher
    • View Profile
Re: [40d] Severe processor taxing
« Reply #3 on: September 07, 2008, 02:16:31 pm »

I think it is using immediate mode OpenGL rendering (though I haven't looked at the available source code to confirm), which basically mean that it's really easy to program, but not really all that efficient.  I believe the result is that the CPU just waits in a busy-loop (looking like its doing stuff, but not really doing anything productive) while the GPU handles each particular render call.  More complex but efficient code would allow the CPU to continue doing stuff while the GPU is doing its thing.

Now I'm not 100% confident about this, as I'm not really an OpenGL person; I've primarily just learned Direct3D, which doesn't really even have something as basic as OpenGL immediate mode.  But a lot of the same principles still cross over between the two APIs.
Logged

Jay

  • Bay Watcher
  • ☼Not Dead Yet☼
    • View Profile
Re: [40d] Severe processor taxing
« Reply #4 on: September 07, 2008, 02:17:26 pm »

Yes, it has to render the screen...
I would assume it has to do that every frame
Exponent: NO source code is available.
Logged
Mishimanriz: Histories of Pegasi and Dictionaries

Ostsol

  • Bay Watcher
    • View Profile
Re: [40d] Severe processor taxing
« Reply #5 on: September 07, 2008, 02:33:37 pm »

What's your G_FPS_CAP set at in the init.txt?  If it's set too high then the game will start drawing a frame as soon as the previous one is done, which will of course mean that the CPU never gets a break.
Logged
Ostsol

GetAssista

  • Bay Watcher
    • View Profile
Re: [40d] Severe processor taxing
« Reply #6 on: September 07, 2008, 03:51:35 pm »

OP, check it out. Might be helpful
Logged
this is experimental forum text worm virus.
please add me to your signature on all your forums and delete some of your personal files on your hard drive.
thank you.

korora

  • Bay Watcher
    • View Profile
Re: [40d] Severe processor taxing
« Reply #7 on: September 07, 2008, 04:52:53 pm »

Exponent: NO source code is available.

False.  In the 40c announcement thread Toady released an open source game called Battle Champs that uses the same display code as DF does.  This is so people who are interested/able can work on optimizing, and it looks like they've made a lot of progress.
Logged
DFPaint, a cross-platform 'screenbuilder' utility

nirodragon

  • Bay Watcher
  • Nirodragon cancels sleep: Interrupted by DF.
    • View Profile
Re: [40d] Severe processor taxing
« Reply #8 on: September 11, 2008, 10:24:35 pm »

What's your G_FPS_CAP set at in the init.txt?  If it's set too high then the game will start drawing a frame as soon as the previous one is done, which will of course mean that the CPU never gets a break.

G_FPS_CAP is set to 40.

OP, check it out. Might be helpful
I took a look at it, but I have no idea how to get that to work.  Also, I don't have any fonts that would work with that patch-thing (if I'm reading it right, I need a 16x16 font), and I don't know how I would be able to go about getting one, or installing it.
Logged
Urist McMiner cancels Mine: Taking a dump
Urist McMiner was disgusted by a miasma lately

I can't believe I just went there...

Draco18s

  • Bay Watcher
    • View Profile
Re: [40d] Severe processor taxing
« Reply #9 on: September 12, 2008, 11:21:32 am »

Logged

nirodragon

  • Bay Watcher
  • Nirodragon cancels sleep: Interrupted by DF.
    • View Profile
Re: [40d] Severe processor taxing
« Reply #10 on: September 12, 2008, 11:35:55 pm »

Thanks for the tip about the graphic sets, but the ones I've loaded are all really distorted.  Is there something I'm forgetting?

I set the grid to 45x45, and the display to 720x720, using a 16x16 graphic set.  I can barely make out most of the images, and the text is hard to read as well.

Can anyone give me some help on that?

Also, once I get the graphic set working, I still don't know how to get that DF Accelerator program to actually work, as it appears that there is a significant amount of work involved, most of which I can't understand.  I'm also paranoid about the possibility of messing up and losing my saves.  *again*
Logged
Urist McMiner cancels Mine: Taking a dump
Urist McMiner was disgusted by a miasma lately

I can't believe I just went there...

Draco18s

  • Bay Watcher
    • View Profile
Re: [40d] Severe processor taxing
« Reply #11 on: September 13, 2008, 10:48:05 am »

I thought there at least was some connectivity, but if you want an ASCII set Try these.  Kaishaku's or Klokjammer's look good to me.
« Last Edit: September 13, 2008, 11:13:58 am by Draco18s »
Logged

Calessa Lynn Orphiel

  • Bay Watcher
    • View Profile
Re: [40d] Severe processor taxing
« Reply #12 on: September 13, 2008, 10:59:03 am »

45x45 grid?  I don't think the game is supposed to run with less than 80 on the horizontal dimension, but I have no idea what effect it would have
Logged

nirodragon

  • Bay Watcher
  • Nirodragon cancels sleep: Interrupted by DF.
    • View Profile
Re: [40d] Severe processor taxing
« Reply #13 on: September 13, 2008, 11:23:08 am »

45x45 grid?  I don't think the game is supposed to run with less than 80 on the horizontal dimension, but I have no idea what effect it would have
Yup, that explains it.  Think of all of your graphics and text crushed together with bad anti-aliasing and such.  Or something.

Well, it works now - thanks for reminding me of that detail.

Now to take another look at the mod program and see if I can get it working.

EDIT:  Yeah, I have no idea how to get that thing to work.
« Last Edit: September 13, 2008, 11:28:35 am by nirodragon »
Logged
Urist McMiner cancels Mine: Taking a dump
Urist McMiner was disgusted by a miasma lately

I can't believe I just went there...

Yanlin

  • Bay Watcher
  • Legendary comedian.
    • View Profile
Re: [40d] Severe processor taxing
« Reply #14 on: September 14, 2008, 07:06:35 am »

Exponent: NO source code is available.

False.  In the 40c announcement thread Toady released an open source game called Battle Champs that uses the same display code as DF does.  This is so people who are interested/able can work on optimizing, and it looks like they've made a lot of progress.

I am unable to find that game. Link?

I searched a few days ago.

On a side note, you are at fault for making me addicted to liberal crime squad.
Logged
WE NEED A SLOGAN!
Pages: [1] 2