Game Development Community

CPU usage on OSX

by Joshua "RegularX" Birk · in Torque Game Builder · 05/08/2005 (12:47 pm) · 4 replies

Hey, I've finally gotten into trying to integrate some things into actual game code, but now I'm running into a rather problematic situation with OSX and 1.0.2 ... even when using the binary from the DMG file and the example torquescript, I'm getting CPU utilization constant in the 90% range. I tried replacing it with the 1.0.1 binary I had compiled, and it didn't fair much better.

This isn't expected, right? Unfortunately I've probably got some CPU taxing to do myself and right now it doesn't seem like T2D will give up the overhead I need.

#1
05/08/2005 (1:02 pm)
This is expected, actually, because Torque is going to run as fast as it can without giving other threads more time. All is not lost, though, the Torque Show Tool behaves very nicely with other apps. I'm not sure the changes that Dave made, but chances are, at the very least, you could make the Torque thread sleep for ~10 ms every time through the main loop, and that would help a lot.
#2
05/08/2005 (2:55 pm)
Thanks. Yup, when I actually get into using it and monitoring it seems to work as expected. I've been trying to hunt down some problems to see if it's mem leaking or CPU spiking and it turns out to be ... neither :)

Ah well :)

Any hints to keeping the processor cool might be helpful though. I may have some interapp communication going on, so T2D might not get all the attention it's used to.
#3
05/08/2005 (10:25 pm)
Yeah this is by design, since it's a game engine that tries to run at max fps, not a target processor %.

I would say, don't worry about this until you actually need to. Might not even get any problems. Torque doesn't try to horde CPU time really, so if you need to give other threads attention, it should work fine. In fact, if you make Torque / Torque 2D a background process, it very willingly gives up a lot of CPU time and goes in much larger sim steps.
#4
05/09/2005 (6:55 am)
Yeah, the more I poke ... the more I completely agree. I think I had an initial alarm at doing some very, very basic math on processes I was doing - but T2D itself isn't behaving in any strange ways once I actually pound on it. And yesterday I was pounding on it fairly intensely and it the T2D CPU usage was certainly not the problem.