The Daily Click ::. Forums ::. Klik Coding Help ::. CPU usage problem... help!
 

Post Reply  Post Oekaki 
 

Posted By Message

Dave S.



Registered
  26/09/2003
Points
  924
8th September, 2006 at 17:36:32 -

I have found out that my new game is taking up silly amounts of processing power... around 85% on my 1.3 Ghz machine and up to 50% on my bothers super dooper machine.

There are 40 large active objects on each level (20 of these are ivisible), each one being 96 x 128 pixels on average. Pieces basically move in steps of 48 pixels when the mouse button is held down and the mouse moved (drag and drop). There is no animation.

Should I look through the code to look for anything that might be causing this drain of CPU power? The game is basically finished so I'd rather not scrap it... any ideas?

 
n/a

defenestrator

Old

Registered
  12/07/2003
Points
  724
8th September, 2006 at 17:44:12 -

Does it run slow?
If not, I wouldn't even worry about it. I just tested something very simple that I'm working on and the CPU usage was steadily over 90%.

 
n/a

Silveraura

God's God

Registered
  08/08/2002
Points
  6747

Game of the Week WinnerKlikCast StarAlien In Training!VIP Member360 OwnerWii OwnerSonic SpeedThe Cake is a LieComputerChristmas Tree!
I am an April Fool
8th September, 2006 at 18:49:11 -

Games are suppost to take a good bit of the process power, that means they are taking full advantage of every drop it can get and lower chances of framerate drops because of the processor (this doesn't include videocard causes for frame loss though). This is why most games recommend that you close everything else before you try to play games, because the game will try to suck every drop out of the processor to assure it plays at it's best. This is completely normal.

Note however that because MMF2 can do applications as well as games, MMF2 will try to keep CPU usage as low as it can at points where it's idle, the obvious reason is because when it comes to CPU usage, applications should do the exact opposite, they should do as much as they can while using the minimum of the CPU because they need to be prepared to work with a bunch of other applications open and sharing the same core CPU. Games though, it's completely normal for CPU to drain even as much as a full 100%

 
http://www.facebook.com/truediamondgame

Werbad



Registered
  18/09/2002
Points
  235
9th September, 2006 at 10:42:20 -

MMF/TGF will always take as much CPU as they can... This could be solved with the Sleep object or Task priority, though you might loose framerates

 
n/a

David Newton (DavidN)

Invisible

Registered
  27/10/2002
Points
  8322

Honored Admin Alumnus
9th September, 2006 at 11:21:29 -

I wouldn't worry about it at all - like Werbad and BrandonC said, anything before MMF2 takes up as much of the processor as it can possibly manage.

 
http://www.davidn.co.nr - Games, music, living in America

Dave S.



Registered
  26/09/2003
Points
  924
9th September, 2006 at 17:29:29 -

Thanks for the feedback but why my program should be using nearly 100% of my CPU processing power when it's sitting there doing sweet F. A. on the intro screen baffles me... must be my crap programming I suppose... oh and Phizzy, your last comment meant no sense to me.

 
n/a

axel

Crazy?

Registered
  05/02/2005
Points
  4766

Game of the Week WinnerYou've Been Circy'd!
9th September, 2006 at 17:40:31 -

I was making this small crappy breakout game in C++ (Allegro), and I had set it to run at 60 FPS, but if I had any larger programs, like MSN, running in the background, the framerate dropped greatly. But then again, I'm a noob

 
n/a

Dave S.



Registered
  26/09/2003
Points
  924
9th September, 2006 at 18:02:18 -

... what will that command do exactly Phizzy?

 
n/a

axel

Crazy?

Registered
  05/02/2005
Points
  4766

Game of the Week WinnerYou've Been Circy'd!
9th September, 2006 at 18:10:16 -

It'll set the task priority to 50%, I think. =/

Image Edited by the Author.

 
n/a

David Newton (DavidN)

Invisible

Registered
  27/10/2002
Points
  8322

Honored Admin Alumnus
9th September, 2006 at 20:05:32 -

That's right.

 
http://www.davidn.co.nr - Games, music, living in America

Dave S.



Registered
  26/09/2003
Points
  924
10th September, 2006 at 05:13:46 -

Well I tried appending the target like you said but I get an error message alerting me that it is a non valid file...

 
n/a

Dave S.



Registered
  26/09/2003
Points
  924
10th September, 2006 at 14:22:54 -

Crikey... it worked!... but only after I left a space between the *.exe and the slash.

So if I were to enter say "/S25" in the target box would it then use only a quarter of the processing power?

 
n/a
   

Post Reply



 



Advertisement

Worth A Click