Author Topic: 90% cpu usage at the start of a game??  (Read 3955 times)

Offline sparkler

  • Newbie
  • *
  • Posts: 9
90% cpu usage at the start of a game??
« on: November 27, 2009, 07:15:22 am »
i think i broke it as its using way more cpu power than usual the first few mins in the game save game below

Offline Fiskbit

  • Arcen Games Contractor
  • Master Member Mark III
  • *****
  • Posts: 1,752
Re: 90% cpu usage at the start of a game??
« Reply #1 on: November 27, 2009, 07:48:14 am »
Got a saved game you could post?

Also, I suspect that the number of ships the AI has is really high. You can confirm this by checking the galaxy totals button on the galaxy map. A large number of enemy ships (70,000ish, in my machine) can cause the start of the game to be slow and demanding because of a high number of required calculations, but it should be okay after a short amount of time.
Have ideas or bug reports for one of our games?  Click here to get started with Mantis for Suggestions and Bug Reports.  Thanks for helping to make our games better!

Offline sparkler

  • Newbie
  • *
  • Posts: 9
Re: 90% cpu usage at the start of a game??
« Reply #2 on: November 27, 2009, 08:08:35 am »
thats it i got 48,840 ships on the map compared to the normal none laggy maps that have 15-20k on them

Offline Fiskbit

  • Arcen Games Contractor
  • Master Member Mark III
  • *****
  • Posts: 1,752
Re: 90% cpu usage at the start of a game??
« Reply #3 on: November 27, 2009, 08:50:32 am »
that may be responsible for it. Does it clear up after a short period of time? Also, what sort of CPU do you have?
Have ideas or bug reports for one of our games?  Click here to get started with Mantis for Suggestions and Bug Reports.  Thanks for helping to make our games better!

Offline sparkler

  • Newbie
  • *
  • Posts: 9
Re: 90% cpu usage at the start of a game??
« Reply #4 on: November 27, 2009, 08:25:19 pm »
yes it clears up after a while and I've got an duel core amd processor running at 2.8ghz

Offline x4000

  • Chris McElligott Park, Arcen Founder and Lead Dev
  • Arcen Staff
  • Zenith Council Member Mark III
  • *****
  • Posts: 31,651
Re: 90% cpu usage at the start of a game??
« Reply #5 on: November 27, 2009, 10:25:13 pm »
That is the host syncing with the ai thread -- the more ships that are present in the galaxy, the longer it takes. Most of the time it will last 10 seconds or less, if that, but sometimes a bit more depending on hardware, etc.

On a dual core machine, having the game use 90% or even more processor is not entirely unexpected, though. The main simulation thread has the potential to use all or nearly all of one core, depending on what is going on, and the ai thread can use all or nearly all of the second CPU. With more cores you would never see much more usage than those first two, but those first two can be used quite heavily depending on the campaign.

But, with that sort if usage, that does not have to correspond to lag -- most pc games use near 100% of one core for normal operation. If lots of lag is happening at the start, you can pause to let it catch up. I am surprised that it would be lagging at the start on a 2.8ghz dual core at that low a number of ships, but it might be slower ram or a particularly busy simulation (big battle at the time of the ai sync) or something like that.

Version 2.001m introduces some performance improvements in general, so that might help if the lag is caused by a too-busy sim at the same time as the ai sync.
Have ideas or bug reports for one of our games?  Mantis for Suggestions and Bug Reports. Thanks for helping to make our games better!