Author
Topic: Multi-core (Read 1686 times)

Is there a setting I need to change to get the game to run multi-core/multi-thread? Larger battles will hang the system nearly completely for up to 5 minutes while it tries to figure out the next step. I've got three sleeping threads and one cpu maxxed off.

Nope, the main game logic is single-core only. The AI thread already runs on a second core without your having to do anything (as do other secondary things like sound, background image loading, etc). Having it hang for 5 minutes is not remotely normal, though; I'm not sure what sort of scale you're talking about of battle, but that sort of timing doesn't tend to happen until you get into several million units and they have to be combined into carriers, general.

Logged

Have ideas or bug reports for one of our games? Mantis for Suggestions and Bug Reports. Thanks for helping to make our games better!

Yea, that kind of slowdown is abnormal. If you post a save I may be able to see if there's some bug causing a bottleneck, or if there's something particular nasty about your scenario. 4000 fighters vs 4000 fighters isn't so bad, for instance, but 4000 zenith beam frigates vs 4000 zenith beam frigates is an awful lot of line-intersect-with-circle checks, etc.

Logged

Have ideas or bug reports for one of our games? Mantis for Suggestions and Bug Reports. Thanks for helping to make our games better!

Majority of ships are mirrors, youngling commandos, and Missile Frigs from the AI. My lot is a mixed mess of spawners, snipers, a ton of turret, 60 or so riot starships, standard triangle, parasites, and a few other mixed additional ships.

If I can find a good way to drop a save file off and attach here I will.

Slowdowns are variable. If I do *nothing* it'll stop for ~20 seconds, then start up again, and freeze again say 15-20 seconds later. This will happen until fleet mass gets down to around 8000 across all parties. If I try to do anything it can nearly perma-freeze (I've been trying to figure out what the primary causes are), particularly if I get rambunctious.

This game is from .020, but had the problems described above. Whipping boy is back at "Kiss", which when the waves hit are the primary issue for lag. Exos running down the 'pipe' don't cause as much of an issue, but combined with the wave hits it gets pretty bad.

Side note: I lost this game, so anyone hoping to use it as a reference can for strategical purposes but I spent too long trying to protect the southern colonies and got tied up trying to bring AIP down heavily via the SuperTerminal on the eastern wall. I believe it does have 3 Hubs going though at this point though, and a sickening amount of Spire Flagships. IE: I was using groups of 40 frigates as local 'meh, whatever' defenders. It didn't work as well as I'd hoped. It's an AI9/9 game.

This has been a good reminder to me of why not to encourage players to play 8 homeworlds. The savegames make my computer die in fire.

And this was with low caps.

Ok, I used some manual profiling (which is the best we can do in Unity; it has an automatic per-method profiler but that almost immediately dies when run with AIW due to the complexity of the app).

Before the 5000-ship collection of waves hit, the frames averaged from 100ms to 140ms long with spikes of about 240ms (that's probably the DoRecalculations frames). That's slow, but it was on the high performance profile and there's some overhead from the profiling too. The main culprits here were MovePlayerUnit (5-15% of total load) and CheckForTargetListUpdate and TryAttack (currently in the same profile group, may split them up) occasionally jumping in over it. But those are basically the functions in which the... well, game, happens. So nothing too alarming given the scale.

After the waves spawned, the normal frames were 260ms to 280ms long with the recalc spikes at about 440ms. Here MovePlayerUnit continued to be pretty bulky and the targeting/attacking functions jumped up a lot, but another part popped up that surprised me; I need to split out exactly which functions in that part were responsible for what.

And then there was a 1335 ms frame that was 2/3rds targeting and attacking, heh. And later a 9423ms frame that was 97% targeting and attacking, wow. And a bit later another 5000ms+ frame mostly the same thing.

So there's some room for further investigation and I'm grateful for the test case. In the meantime I suggest fewer homeworlds

Logged

Have ideas or bug reports for one of our games? Mantis for Suggestions and Bug Reports. Thanks for helping to make our games better!

This has been a good reminder to me of why not to encourage players to play 8 homeworlds. The savegames make my computer die in fire.

And this was with low caps.

Ayuuuup. Glad it wasn't just me then. Did you like the Spire Fleet Armada?

Quote

Before the 5000-ship collection of waves hit, the frames averaged from 100ms to 140ms long with spikes of about 240ms (that's probably the DoRecalculations frames). That's slow, but it was on the high performance profile and there's some overhead from the profiling too. The main culprits here were MovePlayerUnit (5-15% of total load) and CheckForTargetListUpdate and TryAttack (currently in the same profile group, may split them up) occasionally jumping in over it. But those are basically the functions in which the... well, game, happens. So nothing too alarming given the scale.

Yeah, it's bascially fine until the waves land.

Quote

After the waves spawned, the normal frames were 260ms to 280ms long with the recalc spikes at about 440ms. Here MovePlayerUnit continued to be pretty bulky and the targeting/attacking functions jumped up a lot, but another part popped up that surprised me; I need to split out exactly which functions in that part were responsible for what.

And then there was a 1335 ms frame that was 2/3rds targeting and attacking, heh. And later a 9423ms frame that was 97% targeting and attacking, wow. And a bit later another 5000ms+ frame mostly the same thing.

Seems fast to me, but I might not have an equivalent graphics card to handle some of that lifting.

Quote

So there's some room for further investigation and I'm grateful for the test case. In the meantime I suggest fewer homeworlds

Haha, yea, that thing had more firepower than hitting something with a moon at 90% of lightspeed.

My first guess is that it was just all those photon lances (the spire capital ship main-gun continuous beam weapons) because those are basically the most performance-demanding weapons in the game. But simply watching it visually those were going off in tremendous quantity (blurring the line between vector-aoe and radial-aoe) before things actually got bad. They may still have been the problem, dunno, but it didn't seem so thus far.

But fwiw, the performance cost of those is such that you're not supposed to have 500 of them (whatever it was) going off at once

Quote

Seems fast to me, but I might not have an equivalent graphics card to handle some of that lifting.

I'm on an integrated graphics card, actually, but I was also running the profiling while looking at the galaxy map to avoid graphics load. In any event, the graphics load would not cause 10+ second lag, or spikes of lag, it just generally slows stuff down if you get into something with too much going on. This was a genuine case of "even modern machines cannot perform that much arithmetic that fast".

Logged

Have ideas or bug reports for one of our games? Mantis for Suggestions and Bug Reports. Thanks for helping to make our games better!