View Issue Details

IDProjectCategoryLast Update
0003008AI War 1 / ClassicGameplay IssueMar 23, 2011 11:59 pm
Reporterrustayne Assigned ToChris_McElligottPark  
Severitymajor 
Status resolvedResolutionfixed 
Product Version5.002 
Fixed in Version5.007 
Summary0003008: Performance woes
DescriptionThe latest game we started bout 20 hours ago or so. We have done quite a bit, own 45 planets, and are quite stable in the game. We have the fallen spire on, and are about to finish it. Sadly though, every time the AI launches a wave at us, it brings both our computers to it's knees. The last 2 or 3 waves we have recieved have brought both my computers down to 3-4 fps, with it being very laggy. Our bottleneck does have a bit in it, but should not be the reason for this kind of performance. An hour earlier my friend had his fleet out attacking an arm, and was great til the wave hit. Lag until the turrets and my ships could finish it off. We aren't overly sure what the problem is, but I imagine it might have something to do with either the snipers or the fortress's as they are the only things that have full range of the gates, aside from the fallen spire cruisers etc. I attached a save in hopes you can find what is wrong here.
TagsNo tags attached.
Internal Weight

Activities

rustayne

Mar 7, 2011 8:12 pm

reporter  

TechSY730

Mar 7, 2011 9:05 pm

reporter   ~0010956

How many ships are coming in? Even with a single system, my 800 ships vs. a 800 ship arriving wave causes noticeable lag on my machine. And that is with no networking overhead.

rustayne

Mar 7, 2011 10:36 pm

reporter   ~0010959

about 2000 to 3k. Thing is that earlier in the game, we had no issues with that amount. Also, on my single player game on the same computer with 4-5k ship coming in didn't create nearly as much lag. It is fine if it is running 15-20 fps, but 2-5 is really bad. We moved our fleet up to a new bottleneck with no defenses aside from our fleets and we are still getting the same issues. So i don't think it is the snipers/fort's like I originally thought.

Chris_McElligottPark

Mar 23, 2011 10:58 pm

administrator   ~0011406

This is about 2k to 3k AI ships, against well over 7600 human allied units. I don't think I've ever seen a battle quite that large -- that's 3000 x 7600 = 22.8 million checks PER TARGETING CYCLE. And there are thousands of calculations per check, which means that this is having to run billions of calculations for the fight.

800x800 ships, by contrast, is 640k checks per targeting cycle, by contrast, and so it is an incredibly different sort of scale. Even on my brand new quad core sandybridge, I'm getting like 3fps in this simulation, which I thought must be wrong, but I wasn't sure.

In general, clustering so much stuff on one planet (it looks like a full cap of.. well, everything, pretty much) is something the game tries to discourage as much as possible, because it's both strategically uninteresting in most cases as well as being a real performance hog.

That said, I'm looking at it to see where the performance woes actually are, but my hopes are not abundantly high at the moment, let's just say. ;)

Chris_McElligottPark

Mar 23, 2011 11:01 pm

administrator   ~0011407

Interestingly, though, what I'm finding is that the targeting throttles are actually holding their own even under this load -- evidently. When I took out all ability for the ships to target seek or to attack, it was still just as slow. So there's something else that isn't being throttled well enough, evidently.

TechSY730

Mar 23, 2011 11:04 pm

reporter   ~0011409

Hey, you should release that "no attack" version of the game. It should appeal to the "non-violence" crowd out there. :P

(Seriously though, did you remember to turn it back on. I'm pretty sure you don't want that change leaking into the next release. :D)

Chris_McElligottPark

Mar 23, 2011 11:06 pm

administrator   ~0011410

I haven't turned it back on YET, I'm still turning stuff off to see where the woes are. That's a critical part of woe-finding, and we do it every few releases, we just generally aren't in the habit of mentioning it. Occasionally some testing something slips through, but that's incredibly rare compared to how often we instrument some part of the code temporarily.

Chris_McElligottPark

Mar 23, 2011 11:09 pm

administrator   ~0011412

Well, it's something in the ship movement routines. I have a sneaking suspicion that I might know what this is...

Chris_McElligottPark

Mar 23, 2011 11:15 pm

administrator   ~0011415

Okay, it's actually all because of gravity drains that the AI is using. THAT I can actually fix in some manner, although this sort of scale of battle is still pushing things (but with the gravity effects disabled I'm getting 50fps, so it's certainly workable if you have the hardware, which it sounds like you do).

TechSY730

Mar 23, 2011 11:17 pm

reporter   ~0011416

Last edited: Mar 23, 2011 11:17 pm

Grr. Gravity units. Slow down the checks too much, and you get units that can quite some distance before the gravity "catches" them. Speed up the checks too much, and you get massive lag. Sounds tricky find a good balance. :\

Chris_McElligottPark

Mar 23, 2011 11:19 pm

administrator   ~0011417

Yeah. I found a few things I can improve that seem like oversights, though, so we'll see. It looks like it is applying to immobile objects, which it can obviously skip. And it also looks like it is applying to objects not currently moving, which I can also skip. That should skip most ships in this particular battle, so that might be all that's needed here, without affecting performance. Should have had those checks in there before, but somehow they seem to have been missed.

Of course, if then a significant number of human ships DO move, this could still dip a lot, but even then it would be vastly better than it was, I'm guessing.

rustayne

Mar 23, 2011 11:22 pm

reporter   ~0011418

Well I moved the battle up 3 jumps north of that bottleneck position with just my fleet, and the other player was off cleaning a few worlds, and we were still having the same lag issues. It only happened on waves though mostly. The spirecraft waves that kept hitting us would be really fast for the first 3 or 4 seconds, and then come to a halt as it picked up the speed difference due to logistics, and then it would bog down really bad. I moved half my fleet out into another system in a effort to cut down the lag, but to no avail sadly. I understand that our play style is...well unusual, and we do expect a degree of lag and slow gameplay this far in, but 2-3 fps when waves hit, and as soon as they are dead back to normal seems a bit odd. I'm glad your hunting it down though, and I hope you find what the problem is.

Chris_McElligottPark

Mar 23, 2011 11:36 pm

administrator   ~0011419

Actually, having the massive battles be exponentially slower than any other part of gameplay is perfectly normal in the extreme unit cases, that's what I was trying to say (it's a multiplicative issue), but in this case it looks to be simply the gravity rippers are ripping apart the framerate.

Just messing with that some, I've more than doubled the working framerate during that battle. That's still pretty laggy when there's a ton of gravity drains, but it's waaaay more playable.

There's one other idea I'm toying with that might make it even better, but we'll see how that goes.

Chris_McElligottPark

Mar 23, 2011 11:59 pm

administrator   ~0011420

Okay, for me this is as solved as it looks to be. I've managed to triple the framerate to around 10fps on average on my machine, and then it quickly jumps up even further once the gravity drains are dead.

* The efficiency of gravitational slowing (gravity drains, gravity turrets) has been greatly improved, such that big battles that previously would grind to a halt because of them can now be played at 3x their prior framerate in one test case in particular.
** One major improvement was to exclude checking of gravitational slowing for ships that can't move or aren't moving at the moment (since they don't need to be slowed!), and the other was to skip redundant gravitational slowing checks for gravitational sources that are the same and which are too close together. This last is very similar to how the speed improvements on the range data display (from way back pre-2.0 days) works.

Issue History

Date Modified Username Field Change
Mar 7, 2011 8:12 pm rustayne New Issue
Mar 7, 2011 8:12 pm rustayne File Added: Performance Issues 5.002.sav
Mar 7, 2011 9:05 pm TechSY730 Note Added: 0010956
Mar 7, 2011 10:36 pm rustayne Note Added: 0010959
Mar 23, 2011 10:58 pm Chris_McElligottPark Note Added: 0011406
Mar 23, 2011 10:58 pm Chris_McElligottPark Assigned To => Chris_McElligottPark
Mar 23, 2011 10:58 pm Chris_McElligottPark Status new => confirmed
Mar 23, 2011 11:01 pm Chris_McElligottPark Note Added: 0011407
Mar 23, 2011 11:04 pm TechSY730 Note Added: 0011409
Mar 23, 2011 11:06 pm Chris_McElligottPark Note Added: 0011410
Mar 23, 2011 11:09 pm Chris_McElligottPark Note Added: 0011412
Mar 23, 2011 11:15 pm Chris_McElligottPark Note Added: 0011415
Mar 23, 2011 11:17 pm TechSY730 Note Added: 0011416
Mar 23, 2011 11:17 pm TechSY730 Note Edited: 0011416
Mar 23, 2011 11:19 pm Chris_McElligottPark Note Added: 0011417
Mar 23, 2011 11:22 pm rustayne Note Added: 0011418
Mar 23, 2011 11:36 pm Chris_McElligottPark Note Added: 0011419
Mar 23, 2011 11:59 pm Chris_McElligottPark Note Added: 0011420
Mar 23, 2011 11:59 pm Chris_McElligottPark Status confirmed => resolved
Mar 23, 2011 11:59 pm Chris_McElligottPark Fixed in Version => 5.007
Mar 23, 2011 11:59 pm Chris_McElligottPark Resolution open => fixed
Apr 14, 2014 9:28 am Chris_McElligottPark Category Gameplay - General Complaint => Gameplay Issue