Author Topic: Performance issues  (Read 2744 times)

Offline SilverStar

  • Newbie
  • *
  • Posts: 7
Performance issues
« on: July 13, 2011, 11:52:06 pm »
Core i7 920 2.67GHz
6GB DDR3 triple-channel
MSI 460GTX
Win7 Ultimate x64
AI War 5.011

Now, with that out of the way there's 2 things I've noticed, one a bug, the other downright a game stopper for me, late-game.

1) The bug: With speed set to +10x, the game actually goes much faster by moving the mouse, compared to sitting idle. Early game, this can be going at an actual 10x speed, while idle is only about 3x it seems.

2) The real issue: In any game I've started, even with the performance setting turned all the way down, even on smaller maps, by late-game it starts to get laggy any time there's battle going on, especially if I'm viewing the system it's in. This often means I can lose hundreds of ships I don't intend to, because it won't allow me to issue an updated command. This happens even if I try to set the game to -10 speed to cut down on calculations.

This happens both with the performance profile turned to extremely low and with the lowest number of ships. By hour 7 or 8 in game time, combat crawls and my only chance is to do FRD-move into new sectors to auto-attack. Outside of combat, it works fairly well, able to get to about 120% speed at best.

While this was going on, I decided to look at my processor and noticed that only one core was being pegged, and all the others were sitting more or less idle, with nothing to do. This seems rather inefficient, particularly for a game like this.

Anyone else seen this, have suggestions, or have any way to help? Or is it just a bug?

(straight from my topic on Steam)

*Edit*

Tried downgrading back to 5.000:
The initial bug where the game speeds up with mouse movement on 10x still exists. Watching the stats screen, it can hit over 3000% just by moving the mouse. In full screen mode it seems to throttle some (sitting idle, it goes down to 13-30 frames per second), while in windowed mode it's reporting up to 250FPS.

I've also tried changing the Performance Profile and haven't seen any difference, except that the boost provided by the first bug goes down, as does the rate when idle (at 10x under minimal system load, it's running at 140%).

It does seem that a major problem is the game is trying to scale it only to a single processing core, instead of using all the ones available to it.

If the game were slowing down progressively as it goes on, having to maintain profiles for tens or hundreds of thousands of ships that'd be one thing, but just watching the stats screen it seems that it very quickly takes a performance hit and keeps slowing down, until getting close to unplayable when first raiding a new planet.
« Last Edit: July 14, 2011, 12:27:42 am by SilverStar »

Offline Nalgas

  • Hero Member
  • *****
  • Posts: 680
Re: Performance issues
« Reply #1 on: July 14, 2011, 12:08:56 am »
Anyone else seen this, have suggestions, or have any way to help? Or is it just a bug?

That's weird.  I usually play on an i5 750, which is pretty comparable to that in terms of performance, and except for when I was deliberately trying to break the game by spawning over a million ships in defender mode, I haven't had it slow down on me like that.  It holds up pretty well on my laptop, too, which is just a 2.2GHz C2D.

Someone else who's run into a similar problem might have a better idea of what would be causing it.  I can definitely say that that's far from normal, though, and I've played with people running it on netbooks acceptably, so something's not right.

Edit: Also, I think turning the performance profile down actually increases the input lag, if I'm remembering right.  It can increase the overall speed the game runs at on a slower computer, but at the cost of it being less responsive, I think.
« Last Edit: July 14, 2011, 12:11:15 am by Nalgas »

Offline arcee

  • Jr. Member
  • **
  • Posts: 54
Re: Performance issues
« Reply #2 on: July 14, 2011, 04:22:13 am »
I was wondering why +10 didn't actually seem very fast... item 1 applies on my machine too.

AMD Phenom II X4 @ 3.4 GHz
N460 GTX (nvidia) graphics card
Windows 7-64 Home
AI War 5.000 (have since updated to 5.011)

Offline x4000

  • Chris McElligott Park, Arcen Founder and Lead Dev
  • Arcen Staff
  • Zenith Council Member Mark III
  • *****
  • Posts: 31,651
Re: Performance issues
« Reply #3 on: July 14, 2011, 09:33:10 am »
Okay, this is likely going to take a couple of back-and-forth questions here, but one thing I'll point you to is this, which has some good stuff even for single player: http://www.arcengames.com/forums/index.php/topic,74.0.html

+10 Speed
First of all, regarding the "bug" with +10 speed, that's not actually a bug, that's just the way the processor gets prioritized by the unity engine when you run it at a faster sim rate than it can handle.  I would expect for +10 speed to be unplayable on most computers, honestly, so the fact that you've just got a bit of mouse lag is a surprise to me.  The reason that +10 exists at all is for people with overclocked power computers, and for those who want to "fast forward" briefly and then slow it back down to something they can play at.

If you're just wanting a generally faster game, then there are better ways of going about it than playing at +10 speed all the time (the higher speed settings in general, even +1, aren't meant to be played on for extended lengths of time, even though you can -- it linearly increases the load on your CPU).  At any rate, it sounds like you might actually prefer a different combat style, which you can choose in the lobby.  Blitz makes ships move much faster, and thus leads to a faster game.  If you're finding that resources are coming in too slowly for your playstyle (which is unusual, but happens), then you can also give yourself and both AIs an equal positive handicap.  As long  as you and the AIs have the same handicap, the game doesn't consider it cheating, and everything (achievements, etc) will happen like normal. 

Both of these are CPU-neutral ways of increasing the speed of the flow of the game, as opposed to running vastly more sim cycles per second, which will eat at even a mega processor.

Only one processor core being pegged
THAT isn't natural, unless your not the host in a multiplayer game.  But if you're playing solo or you're the multiplayer host, you should have two processors in heavy use.  One for the main game sim, and one for the AI thread.  However, what's most likely going on is one of two things:

1. The AI thread just doesn't have to think about that much when you happen to look at it, so it's usage is not as high as the main sim that you're running at +10.

2. The Windows Task Manager is known for being really poor about saying which cores are actually in use; it tends to either average things out between multiple cores when really it's all on one, or combine them into one when really it's on several.  I don't know why that is.

General late-game performance woes (if it's CPU)
That is really a surprise, unless you're playing at a higher speed than baseline.  If you're trying to do battles at +10, or even +1, then I'd expect your performance to be absolutely in the gutter.  As I noted, that speed increase feature is a linear burden on the CPU, and the battles are geometrically more of a burden than the normal game sim.

If you turn the speed of the game down to -10, that's running in slow-mo and it's going to run fewer calculations, but it also makes for more input lag so it will feel laggier even if it's not -- it turns everything down, including input polling.  So that could account for that, I'm not sure.

However, if you're running on a really low performance profile and still having problems, AND you're running into this problem on many games, then that makes me think that this isn't a CPU problem at all, but rather a GPU one.

General late-game performance woes (if it's GPU)
What sort of resolution are you running the game at?  If you're running this on Eyefinity or something, and your GPU can't handle that, then that could be the problem right there.  One way to test this is to get into a big battle that is causing lots of slowdown for you, and then just scroll out to empty space and look at nothing.  How is that affecting your performance?  Is everything suddenly great?  If so, then probably you want to try running the game at a lower screen resolution, and see if that helps.  Personally I'm running an 8800GTS and never seem to have any substantial dips, but traditionally I've been running at 1280x1024.

It's also always possible that you've got a buggy graphics card driver -- it happens.  You might try upgrading to the latest one, or if you're already on the latest one you might see if anyone else has been having any trouble in any other games, and what they downgraded to if there is trouble.  A year and a half ago there was a specific run of nVidia drivers that was causing problems for people in a wide variety of games, and it took them several versions to work through that; that doesn't happen often, but it does happen.  I definitely hope that's not what this is, though, as that's a major pain for everyone (you won't be the last with this problem, if that's what it is).

The other possibility: some sort of in-game bottleneck
It's possible that there's some sort of specific inefficiency in the scenario that you're playing.  That happens from time to time, where players discover some edge case where there's 3k dyson gatlings roaming around or whatever, and that just eats their CPU.  If you have a savegame that is demonstrating your problem that you can post, then we can take a look and see what we can see.  I'm not aware of any such problems in 5.0 or 5.011, but it's a big game and you could be the first to discover something obscure.  The reason I discount this possibility is that you say you've started many different games that all exhibit this problem, and that makes the likelihood of some rare confluence of ships and gamestate go way down.  Unless you're always playing the same unusual scenario or something, but I don't know that that seems too likely.


Anyway, those are my thoughts for now -- hope that helps, and let me know what you find out further.  Thanks!
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 arcee

  • Jr. Member
  • **
  • Posts: 54
Re: Performance issues
« Reply #4 on: July 14, 2011, 03:14:45 pm »
I'm not using +x all the time, just when waiting for ships or resources.
Heh, in my first game I was way too inefficient about using resources, so I was often at max or broke - perhaps I should give both sides a negative handicap.

Offline x4000

  • Chris McElligott Park, Arcen Founder and Lead Dev
  • Arcen Staff
  • Zenith Council Member Mark III
  • *****
  • Posts: 31,651
Re: Performance issues
« Reply #5 on: July 14, 2011, 03:20:25 pm »
Heh, a negative handicap will make you both poorer, just FYI.  Positive makes both sides richer!
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 SilverStar

  • Newbie
  • *
  • Posts: 7
Re: Performance issues
« Reply #6 on: July 15, 2011, 09:23:17 am »
So, I've done some follow-up tests.

After doing both disabling all the other effects (weapons and explosions) AND disabling hyperthreading on my processor, performance improved considerably. Just disabling the effects saw a slight increase in performance, but it wasn't until I disabled the HT that I actually saw the game smooth out (for all but the most insane situations). Watching my cores, the first one(which I'm assuming is the one controlling my own ships) sees steady gain as the number of ships increases, while all 3 other cores start to see actual usage as well.

(Suggestion: If possible, could it be set so the active system for the player runs on one core, all other systems run on another core, and then the AI on a third, for systems where more than 2 processing cores exist? Would help to level out things, when you have multiple fronts going at once).

For the +10 setting, it seems the speed is tied to windowed mode being unlocked so not stuck in V-sync. I have my video card lock all full-screen to V-sync by default, so don't see the kind of increases of up to 3000% when in full screen, early game, but by moving the mouse around the engine forces additional redraws and performance boosts while there's overhead to allow it.

This leads me to a suggestion of having a +10* setting, that forces the game to process as fast as it can, perhaps while a button is held down, in order to speed through some of the early-game wait times, or even later on, without having to run the game at high speed the entire time. Though, I do tend to run it at +10 when possible, because by late-game it's only running at 300%, which is still slow enough to be able to respond to events.

Different screen sizes had no effect on overall performance in my system (running 1080p, latest non-beta nVidia drivers).

And as a final suggestion for now: Any chance of having AI progression scale to the size of the galaxy? The more worlds, the slower the AI increases in threat, but still allows for it to be running at rank 4 late-game?

Right now I'm running a 20-world game and the AI can barely hit level 2 before I'm ready to assault the main worlds.

Offline x4000

  • Chris McElligott Park, Arcen Founder and Lead Dev
  • Arcen Staff
  • Zenith Council Member Mark III
  • *****
  • Posts: 31,651
Re: Performance issues
« Reply #7 on: July 15, 2011, 09:47:10 am »
Very interesting on the hyperthreading -- I thought HT was supposed to be intelligent enough not to do that when it has something that needs more from one core.

In terms of multithreading, the actual game simulation has to be single-threaded only, sorry -- that's been discussed in incredible length at various times in the past:
http://www.arcengames.com/forums/index.php/topic,6722.0.html
http://www.arcengames.com/forums/index.php/topic,8204.0.html
http://www.arcengames.com/forums/index.php/topic,3986.0.html

In terms of the +10 button, etc, I think there's a suggestion in mantis about having a slider for adjusting game speed, but it hasn't been very popular or gotten many votes.  You could revive it, if you want, and see what happens.

Regarding different screen sizes, sure, you're going to see much worse performance running vast screen sizes.  It has to draw a lot more things, so that's troublesome.  The VSync requirement is also likely to slow things somewhat, as the game isn't expecting to be VSync locked, but I'm not positive what you'd really see there.

In terms of the AI Progress scaling to the size of galaxies: sorry.  The game is balanced in such a way that almost nobody has severe performance problems in late game, but so that it's still a very large game.  That was an enormous focus for us for 6+ months last year, with dozens of players and savegames and so on, and yours is the first complaint I've heard along these lines this year that I can recall.  Regarding the AI being a mark 2 or 4 or similar before you hit the late game: most people try to avoid the AI ever getting above mark 2, heh.  If it's hitting mark 4 routinely, that's quite a bit of trouble.  In terms of smaller galaxies, you have much fewer opportunities for knowledge, etc, so it tends to balance out -- though it's a much different game at 20 planets compared to 80.  They aren't really intended to be equivalent.

I would suggest not trying to run at higher speed than +0 all the time: that's kind of like running your car at 3000rpm all the time on the road.  It's just going to perform differently than if you run it at normal speed.  It's trying to run your game at something like 200fps at 1080p with an intensive simulation running at 5ms per cycle where normally it would have 50ms or so by default.  I mean, that's absolutely going to obliterate your performance for obvious reasons, and that's probably why you're seeing a lot of issues that nobody else is.  My suggestion: play at +0 speed except when you want to briefly fast forward.  That should make the vsync issue not a problem since you're no longer telling the game to run at 200fps, and it should cool down the amount of CPU usage enough that disabling hyperthreading isn't important.

I imagine that's not what you really wanted to hear, and I'm sorry about that, but the game is meant to have good performance at +0 speed and anything above that is a bonus.  This game does upwards of ten million calculations per second at +0 speed in the late game, and at +10 speed you're asking for closer to a hundred million calculations per second, while also trying to render lots of graphics at very high resolution at an insanely high framerate.  It just isn't going to work that way, not well anyhow, in this or any other game I can think of.

Hope that helps clear things up, at least!
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 Echo35

  • Master Member Mark II
  • *****
  • Posts: 1,703
  • More turrets! MORE TURRETS!
Re: Performance issues
« Reply #8 on: July 15, 2011, 10:24:45 am »
That is weird. I run with all of my cores (Hyper Threading on and all), and have even disabled core parking, and have no problems with AI War. Even on my old q6600 I never had the game slow down or glitch out.

Offline x4000

  • Chris McElligott Park, Arcen Founder and Lead Dev
  • Arcen Staff
  • Zenith Council Member Mark III
  • *****
  • Posts: 31,651
Re: Performance issues
« Reply #9 on: July 15, 2011, 10:28:51 am »
That's true, I'm running with HT on myself.  I had a Q6600 and it was fine, and then now I've got a sandy bridge i7 that does fine.  Also my laptop is a dual core Mac first-gen i5, and is fine.  So I think it's the +10, etc, speed.
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 Echo35

  • Master Member Mark II
  • *****
  • Posts: 1,703
  • More turrets! MORE TURRETS!
Re: Performance issues
« Reply #10 on: July 15, 2011, 01:56:25 pm »
So I think it's the +10, etc, speed.

The game has changed dramatically since then, but when I was on my q6600, someone from the forums and I played a "turbo" game (We played with the speed up close to +10 with fast and dangerous mode on) and it ran fine. Granted that was back in the pre Unity days, so it very well could be an issue that's popped up since then.

Offline x4000

  • Chris McElligott Park, Arcen Founder and Lead Dev
  • Arcen Staff
  • Zenith Council Member Mark III
  • *****
  • Posts: 31,651
Re: Performance issues
« Reply #11 on: July 15, 2011, 02:06:48 pm »
So I think it's the +10, etc, speed.

The game has changed dramatically since then, but when I was on my q6600, someone from the forums and I played a "turbo" game (We played with the speed up close to +10 with fast and dangerous mode on) and it ran fine. Granted that was back in the pre Unity days, so it very well could be an issue that's popped up since then.

Yeah, the meaning of +10 has changed completely since then.  Unity's system for managing time is a lot more granular and actually far superior (leading to a smoother experience, etc), but it also makes it so that it's less receptive to large amounts of load at that sort of speed.
Have ideas or bug reports for one of our games?  Mantis for Suggestions and Bug Reports. Thanks for helping to make our games better!