Issue 168 in starflighttlc: High CPU usage

Skip to first unread message

Jan 10, 2010, 4:00:55 PM1/10/10
Status: New
Owner: ----
Labels: Type-Defect Priority-Medium

New issue 168 by nicolaperotto: High CPU usage

My CPU was always near 100% too when in the config page!

You received this message because you are listed in the owner
or CC fields of this issue, or because you starred this issue.
You may adjust your issue notification preferences at:

Jan 27, 2010, 11:27:24 PM1/27/10

Comment #1 on issue 168 by swirsz: High CPU usage

Unable to duplicate this problem over here.

Athlon X2 2.80 GHz, 2 GB ram, ATI Radeon x1200. Running the game in
windowed mode
spikes the CPU up to 65% at most. Anyone else experience this problem?
What hardware?

Jan 28, 2010, 6:14:59 AM1/28/10

Comment #2 on issue 168 by nicolaperotto: High CPU usage

oh dear... how big your machine...
For example, I'm at the "Profession Selection" screen and there's no
animation at
all, only background music and the processor (Athlon X2 4200+) is running
at more
than 50%.
Why??? It's only waiting for input...
In my experience this signify that there are something strange around!

Jan 28, 2010, 1:22:38 PM1/28/10

Comment #3 on issue 168 by jsharbour: High CPU usage

There's no processor throttling in the game engine, so a dual-core CPU will
peg at
50% when TLC is running. Throttling the code is doable. In the core loop, a
check against 1-ms should cause a sleep(1) call, otherwise the regular
engine update
should occur. This is a good request, especially for laptop users running
on a battery.

Mar 14, 2010, 7:55:55 AM3/14/10

Comment #4 on issue 168 by bmaparicio: High CPU usage

My CPU is ALWAYS running close to 100% when TLC (BETA 4)is running in
window mode or
full screen.
The only workaround I've found was to set Processor Affinity to 1 core.

My specs:
Core2DUO E6850 @ 3.00 GHz
4 GB RAM DDR3 @ 1333 MHz
GeForce 8800 GTS
Windows Vista Ultimate 64

Aug 13, 2010, 10:38:48 PM8/13/10
Status: Accepted
Labels: -Priority-Medium Priority-High

Comment #5 on issue 168 by jsharbour: High CPU usage

I'm working on this now. I never noticed it with a 4-core CPU. ;) Easy to

Aug 13, 2010, 10:43:02 PM8/13/10
Owner: jsharbour

Comment #6 on issue 168 by jsharbour: High CPU usage

(No comment was entered for this change.)

Sep 16, 2010, 9:29:21 PM9/16/10
Labels: -Priority-High Priority-Medium

Comment #7 on issue 168 by jsharbour: High CPU usage

Good grief what a pain this issue has been.. I have only partial success to
report now. The cpu doesn't peg at 100%, but it also doesn't get freed up
very often, as the % seems to vary wildly, but the game is running smoothly
and at 300 fps on my system. I am not sure what's causing this erratic cpu
usage. I went line by line through the core game loop, selectively
commenting out portions of the game, and nothing had an effect.

I gave it this little bit of stability by adding a timer to limit the
OpenGL rendering a bit, which is what dropped the cpu usage slightly, but
certainly not to an idle level. Something funky is going on with Allegro or
OpenGL that seems to be beyond our control at this point. Will keep working
on it.. At least this partial update will help a bit.

Note: on a multi-core system, this shouldn't be noticeable.

Sep 26, 2010, 12:18:15 AM9/26/10

Comment #8 on issue 168 by syntaxerror.unknown: High CPU usage

I am using a 4 year old, dual core system and this game runs without a
hitch. I have noticed that the CPU usage is normally around 50% regardless
of what I am doing in the game. But it is like this with every allegro
based game that I have made/played. I think it has something to do with the
main loop in WinMain(), which is implemented in the allegro library. The
newest version of the allegro library (4.4 I believe) allows you to define
a new WinMain() and WinProc() callback functions and use those instead.
However I think the allegro defaults are fine, performance wise.

Sep 26, 2010, 4:34:19 PM9/26/10

Comment #9 on issue 168 by jsharbour: High CPU usage

Thank you, syntax, that's incredibly helpful to know! We were just going
back and forth on the issue yesterday, not sure what to do about it, and I
was beginning to suspect it was happening in another allegro thread that
was beyond our control. Your comment reinforces that idea. This isnt a bug
so much as a request because Allegro tends to eat laptop batteries for

Dave, how about we just restore the 60 fps timed code, put everything
inside it, and close this issue? It's beyond our control.

Reply all
Reply to author
This conversation is locked
You cannot reply and perform actions on locked conversations.
0 new messages