Cogmind > Support

High CPU Use

(1/2) > >>

nsg21:
Cogmind is eating CPU cycles like peanuts. My laptop overheats to the point that it is uncomfortable to hold on my laps and the battery lasts for less than 40 minutes. As an added bonus, I cannot see the battery meter in fullscreen mode so that when it suddenly quits on me it is a surprise.

I think it just needs an idle() call in the mainloop while waiting for keyboard to help this. What is so important that a turn-based based game just has to calculate at max processor speed in between user inputs?

Kyzrati:
It sounds like you have a pretty old laptop? Cogmind is not too demanding (when I play it uses literally 3% of my CPU, which is about 3 years old), but it is run entirely on your CPU (no GPU processing). The game idles as long as it's hitting 60 FPS, because the game is capped at that speed by default. If it's eating up cycles then you must be getting under 60 FPS on your machine.

Aside from the obvious running in windowed mode and/or making the view smaller by using a smaller font and/or map, one way to reduce the load is to cap the FPS at something below 60 to give your CPU a breather.

This option is available directly in /user/cogmind.cfg towards the bottom:

--- Code: ---fpsCap=60
--- End code ---
Try some different values like 50, 40, or 30 if you it doesn't bother you,

Although Cogmind is turn-based, it still has to render the UI and anything that might be animated, and it does that at 60 FPS.

Let me know if that helps!

(I'm moving this thread to the Support board.)

infectedm:
I have a fairly new laptop (Samsung NP870Z5E) and even for me the CPU usage seems a little bit high.

Playing the game: 10-14% cpu usage
Game in background (windowed mode): 10-14% cpu usage
Minimized (windowed mode): 8% cpu usage
Alt-tabbed out of fullscreen mode: 8% cpu usage

Hyperthreading is disabled to get better measures.
I have also tried assigning the game to the dedicated graphics card just to be sure - no effect on cpu usage.

Kyzrati:
10-14% for while playing isn't too bad considering it's run 100% by your CPU (both logic and software graphics)--the engine doesn't care about the video card. It will naturally be higher than pretty much any other major indie game out there because they all do their heavy lifting on the GPU.

Based on what you say I can consider the possibility of completely pausing the game while not in focus. Do you guys think that makes sense?

infectedm:
While I have no knowledge about the game engine, I would think that if there is nothing happening (no user input), the cpu usage should drop to near 0%. Except for the occasional flickering, the output doesn't need to be redrawn at all when the user isn't pressing any keys or moving the mouse.
Maybe there is an easy way to determine if a redraw is really necessary and simply reuse the last rendered frame if not?

Navigation

[0] Message Index

[#] Next page

Go to full version