Author Topic: Occasions freezes in game and really slow performance with large fleets  (Read 14074 times)

Offline blackied

  • Newbie
  • *
  • Posts: 7
Re: Occasions freezes in game and really slow performance with large fleets
« Reply #15 on: September 06, 2014, 01:39:40 am »
Ok, just had a quick run at the old engine. New campaign, three homeworlds, laser gatlings and minipods. Had an army of 3000+ in 4m, and they all moved fine without lag (compared to ~500 or so on the current engine). Tell them to shoot something though and fps went down the drain, which I suppose is understandable given it's suddenly generating 2k+ rapid fire ships firing at once. CPU usage was averaging 40-60% most of the time, then spiked to 90 in combat.

Overall a much better result.
« Last Edit: September 06, 2014, 01:41:18 am by blackied »

Offline keith.lamothe

  • Arcen Games Staff
  • Arcen Staff
  • Zenith Council Member Mark III
  • *****
  • Posts: 19,505
Re: Occasions freezes in game and really slow performance with large fleets
« Reply #16 on: September 06, 2014, 09:07:30 am »
Yea, it's still gonna tank a bit in heavy combat, but I'm glad to hear it didn't have the critical problems you've been seeing.  I'll try to put together a build with the basics of the new engine but without the new graphics pipeline stuff, not sure if I'll get that today or not.
Have ideas or bug reports for one of our games? Mantis for Suggestions and Bug Reports. Thanks for helping to make our games better!

Offline Bud Backer

  • Full Member
  • ***
  • Posts: 140
Re: Occasions freezes in game and really slow performance with large fleets
« Reply #17 on: September 06, 2014, 11:07:19 am »
Sorry again for hijacking your thread somewhat Bud, hopefully this can solve the issues for both of us.

No worries, seems all related. :)

Offline Bud Backer

  • Full Member
  • ***
  • Posts: 140
Re: Occasions freezes in game and really slow performance with large fleets
« Reply #18 on: September 06, 2014, 07:49:35 pm »
From this: http://stackoverflow.com/questions/1308755/launch-an-app-on-os-x-with-command-line

It looks like this will work:

open -n ./AppName.app --args -AppCommandLineArg

So in our case I think that would be

open -n ./AIWar.app --args -force-gfx-st -force-gfx-direct



Ok, I tried that. It's anecdotal but I *THINK* it may have helped somewhat. Still laggy but not quite as bad. At one point I saw it said game speed 0% and wondered WTF? But it kept going, slowly...



Offline x4000

  • Chris McElligott Park, Arcen Founder and Lead Dev
  • Arcen Staff
  • Zenith Council Member Mark III
  • *****
  • Posts: 31,651
Re: Occasions freezes in game and really slow performance with large fleets
« Reply #19 on: September 07, 2014, 08:03:40 pm »
In looking at this, I am thinking that the problem may not really be rendering-related after all, even though it obviously appears like that is the case.  I think that what is happening is kind of a race condition of sorts, caused by us using FixedUpdate rather than Update in this game.  All our other games except for Tidalis universally use Update, which is a big difference.

FixedUpdate was an easy way for us to handle fixed-set timings, but actually it's something that is problematic on a number of levels in terms of handling the tradeoff between dropped frames and increased CPU load during battles, etc.  Bottom line is that I think that I can rewrite this to use our own form of dynamic framerate limiter, and that may resolve this problem entirely.  If that doesn't work, there are a few other tricks up our sleeves, as well.

Just looking at how much CPU is being used per frame when the game is paused and not really rendering anything, though, I'm really seeing a super egregious amount (like 12x the amount I feel it should be on my machine, and I think that FixedUpdate is the reason.  Even on the freaking main menu, it's ridiculous.  And it's not the renderer, it's the CPU thread.

Anyway, I'll have quite a bit of digging to do tomorrow, but I am pretty confident I can resolve that, and we'll see where we are after that.  Thanks for your patience!
Have ideas or bug reports for one of our games?  Mantis for Suggestions and Bug Reports. Thanks for helping to make our games better!

Offline x4000

  • Chris McElligott Park, Arcen Founder and Lead Dev
  • Arcen Staff
  • Zenith Council Member Mark III
  • *****
  • Posts: 31,651
Re: Occasions freezes in game and really slow performance with large fleets
« Reply #20 on: September 07, 2014, 08:33:29 pm »
Yeah, holy heck this was just an incredible mess of conflicting timings from over the years.  I still have more to do to get it exact, but I've already increased my framerate from something like 40fps to over 100fps in the same scenario.
Have ideas or bug reports for one of our games?  Mantis for Suggestions and Bug Reports. Thanks for helping to make our games better!

Offline Aklyon

  • Core Member
  • *****
  • Posts: 2,089
Re: Occasions freezes in game and really slow performance with large fleets
« Reply #21 on: September 07, 2014, 08:43:53 pm »
That is a lot of extra fpses.

Offline x4000

  • Chris McElligott Park, Arcen Founder and Lead Dev
  • Arcen Staff
  • Zenith Council Member Mark III
  • *****
  • Posts: 31,651
Re: Occasions freezes in game and really slow performance with large fleets
« Reply #22 on: September 07, 2014, 08:48:52 pm »
Yes, quite so.
Have ideas or bug reports for one of our games?  Mantis for Suggestions and Bug Reports. Thanks for helping to make our games better!

Offline x4000

  • Chris McElligott Park, Arcen Founder and Lead Dev
  • Arcen Staff
  • Zenith Council Member Mark III
  • *****
  • Posts: 31,651
Re: Occasions freezes in game and really slow performance with large fleets
« Reply #23 on: September 07, 2014, 10:25:00 pm »
Update: 8.005 official update out to hotfix a performance issue that has been plaguing some players since the unity engine upgrade.  It was actually affecting everyone, but it was only really that noticeable on some machines.
Have ideas or bug reports for one of our games?  Mantis for Suggestions and Bug Reports. Thanks for helping to make our games better!

Offline Bud Backer

  • Full Member
  • ***
  • Posts: 140
Re: Occasions freezes in game and really slow performance with large fleets
« Reply #24 on: September 07, 2014, 10:59:05 pm »
Update: 8.005 official update out to hotfix a performance issue that has been plaguing some players since the unity engine upgrade.  It was actually affecting everyone, but it was only really that noticeable on some machines.

Wow, that was fast! Downloading now!

Offline blackied

  • Newbie
  • *
  • Posts: 7
Re: Occasions freezes in game and really slow performance with large fleets
« Reply #25 on: September 08, 2014, 07:47:04 am »
Given the new build a try, but it doesn't seem to have helped. FPS has gone from hard cap of 40 to 100+ when there's a screen of empty space, but it still crawls just drawing lots of things on the screen.

Pics with debug located here:

https://drive.google.com/folderview?id=0B2GRi3RcNLbZQ2dLbVNxZ2Q3aG8&usp=sharing

Offline x4000

  • Chris McElligott Park, Arcen Founder and Lead Dev
  • Arcen Staff
  • Zenith Council Member Mark III
  • *****
  • Posts: 31,651
Re: Occasions freezes in game and really slow performance with large fleets
« Reply #26 on: September 08, 2014, 10:19:31 am »
Update: 8.006 official update out to hotfix a performance issue that was still affecting some folks.  This returns the rendering pipeline to a state that we are more directly sorting for performance purposes rather than letting the unity engine asynchronously try to handle it on its own.  It seems to help, given the volume of stuff that gets drawn in this game.
Have ideas or bug reports for one of our games?  Mantis for Suggestions and Bug Reports. Thanks for helping to make our games better!

Offline keith.lamothe

  • Arcen Games Staff
  • Arcen Staff
  • Zenith Council Member Mark III
  • *****
  • Posts: 19,505
Re: Occasions freezes in game and really slow performance with large fleets
« Reply #27 on: September 08, 2014, 05:05:59 pm »
blackied and BudBacker (and anyone else with this kind of problem), I think it would help if you could post saves where you're having performance problems.  Specifically cases that don't seem like they're all that heavy (I think one of you mentioned it slogging on 500 moving fighters or something like that), so that profiling doesn't bog down trying to tell the difference between "it's lagging because there's 4k ships fighting here" and "it's lagging because of a rendering bug" :)
Have ideas or bug reports for one of our games? Mantis for Suggestions and Bug Reports. Thanks for helping to make our games better!

Offline Bud Backer

  • Full Member
  • ***
  • Posts: 140
Re: Occasions freezes in game and really slow performance with large fleets
« Reply #28 on: September 09, 2014, 11:20:23 am »
blackied and BudBacker (and anyone else with this kind of problem), I think it would help if you could post saves where you're having performance problems.  Specifically cases that don't seem like they're all that heavy (I think one of you mentioned it slogging on 500 moving fighters or something like that), so that profiling doesn't bog down trying to tell the difference between "it's lagging because there's 4k ships fighting here" and "it's lagging because of a rendering bug" :)

I have yet to get to a numerical quantity where I'd had problems before but I will advise if there is an issue.

What I have had again - with very small forces of <200 - was a total freeze of the game requiring a Force Quit. Weird.

Offline keith.lamothe

  • Arcen Games Staff
  • Arcen Staff
  • Zenith Council Member Mark III
  • *****
  • Posts: 19,505
Re: Occasions freezes in game and really slow performance with large fleets
« Reply #29 on: September 09, 2014, 11:21:54 am »
blackied and BudBacker (and anyone else with this kind of problem), I think it would help if you could post saves where you're having performance problems.  Specifically cases that don't seem like they're all that heavy (I think one of you mentioned it slogging on 500 moving fighters or something like that), so that profiling doesn't bog down trying to tell the difference between "it's lagging because there's 4k ships fighting here" and "it's lagging because of a rendering bug" :)

I have yet to get to a numerical quantity where I'd had problems before but I will advise if there is an issue.

What I have had again - with very small forces of <200 - was a total freeze of the game requiring a Force Quit. Weird.
Sorry it's still doing that.  On 8.006?
Have ideas or bug reports for one of our games? Mantis for Suggestions and Bug Reports. Thanks for helping to make our games better!