Author Topic: Switch back to old Unity version?  (Read 2861 times)

Offline Draco18s

  • Resident Velociraptor
  • Core Member Mark V
  • *****
  • Posts: 4,251
Re: Switch back to old Unity version?
« Reply #15 on: September 08, 2014, 10:28:36 am »
Just out of curiosity, what was the change (code-wise)?

Yep, pretty much.  Although it turns out that I was actually wrong and we were already not using FixedUpdate.  But we were still using unity's timings in kind of a halfway way.  So it was something that there was just a mess of outdated code that had to be stripped and redone.  The short of it is that previously it could run into problems where it was trying to time its frames one way but instead actually messing up the timings if the Update intervals were too long.  Basically a clash of multiple timing systems, given that this game has gone through four general engines now, sheesh. :)

Heh.  That'd do it.
« Last Edit: September 08, 2014, 10:41:28 am by Draco18s »

Offline x4000

  • Chris McElligott Park, Arcen Founder and Lead Dev
  • Arcen Staff
  • Zenith Council Member Mark III
  • *****
  • Posts: 31,651
Re: Switch back to old Unity version?
« Reply #16 on: September 08, 2014, 10:37:38 am »
Indeed.  It was one of those things that had been buried in there for so long and that "just worked" (supposedly) that we hadn't reviewed it in years.

For all our later games other than Tidalis (which is laughably light on the CPU, which is the bottleneck in the case of this, believe it or not, since it's a graphics-prepping issue), they all use a framerate-independent style of movement and whatnot.  So basically multiplying by the float of Time.deltaTime or similar.  But that doesn't work at all for AI War, which needs to be able to have extremely precise deterministic results in order to avoid desyncs in multiplayer.

The other games constantly desync and reconcile and it's fine, because they are either action games (which are ALL based on that model -- FPS games, MOBAs, MMOs, etc), or they are turn-based.  Action games have to do this for timing reasons, and it works because there are few enough actors.  Turn-based games can be incredibly lazy on networking because even with a lot of actors if there is an extra 100ms of lag for sending extra data between two turns, that is not noticeable.  An extra 10ms of lag per cycle in AI War multiplayer, on the other hand, is very noticeable.

So basically:
1. Turn-based games are easy to network, relatively speaking.
2. Realtime action games are super hard to network for reasons of syncing them and doing client-side prediction and resolving disputes between clients that come up with slightly different results, etc.
3. Realtime strategy games are super hard to network because they have to work in lock-step with no desyncs at all, because there is vastly too much data to do resync checks on in any reasonable interval (or even at all, really).  Particularly so with AI War.

That means that the nature of a "cycle" with AI War is a granular, indivisible sort of a thing, while the later games have cycles which are variable in length and number.  If you have a strong PC and I have a weak one, you might have 120 cycles per second while I have 20 cycles per second, but we both come out with approximately similar results.  AI War and other strategy games require that we have the same number of cycles per second, although that doesn't affect non-sim-affecting stuff like draw calls, the HUD, zoom, unit selection, etc.
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 MarioFanaticXV

  • Newbie Mark II
  • *
  • Posts: 20
Re: Switch back to old Unity version?
« Reply #17 on: September 08, 2014, 10:42:43 am »
Alright, I'll be sure to give more feedback once I try it with 8.006.

EDIT: I still seem to be having the same problems as before. Managed to get through the wave, but when waves like this keep coming, the slowdown makes it nigh unplayable... Which is really a pity, because I love how the Spire campaign is giving me the opportunities and firepower to do large scale battles like this. I've tried lightning warheads on large waves, and as effective as they've proved when it works, it often causes my computer to freeze up so that I can't even access Task Manager.

Here's what it typically looks like when I get large battles, only I usually see lots of white squares where... Stuff is supposed to be. Shots, ships, planets, it all just looks like a bunch of white squares when it gets even worse than this: http://i.imgur.com/UxwiEuO.png
« Last Edit: September 08, 2014, 03:24:08 pm by MarioFanaticXV »

Offline MarioFanaticXV

  • Newbie Mark II
  • *
  • Posts: 20
Re: Switch back to old Unity version?
« Reply #18 on: September 08, 2014, 04:06:33 pm »
It may well have nothing to do with the engine, it might just be that I'm fighting with too many ships. I have over 3000 military vessels in the game now, and the AI just sent a wave of about 40k Younglings at me... And I had the same sort of problems again. Nienzul waves seem to be the worst, as they always have so many ships in them because they don't use much strength individually.

Maybe it'd help if the AI used less small vessels and more starships?

Offline keith.lamothe

  • Arcen Games Staff
  • Arcen Staff
  • Zenith Council Member Mark III
  • *****
  • Posts: 19,505
Re: Switch back to old Unity version?
« Reply #19 on: September 08, 2014, 04:08:33 pm »
To be fair, slowdown with spire fleets vs huge swarms is something that's been around for a long time.  It's a problem that tends to get burnt down pretty fast, though ;)

Lightning warheads are relatively intense CPU-wise, but before the engine-switch they didn't lead to hanging behavior (at least not more than a few seconds, if even that.

Anyway, to my knowledge nothing about the engine-switch should have made the CPU cost of pure game logic any worse, so I think it's probably ganging up with the rendering stuff there.
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 TechSY730

  • Core Member Mark V
  • *****
  • Posts: 4,570
Re: Switch back to old Unity version?
« Reply #20 on: September 08, 2014, 04:13:11 pm »
It may well have nothing to do with the engine, it might just be that I'm fighting with too many ships. I have over 3000 military vessels in the game now, and the AI just sent a wave of about 40k Younglings at me... And I had the same sort of problems again. Nienzul waves seem to be the worst, as they always have so many ships in them because they don't use much strength individually.

Maybe it'd help if the AI used less small vessels and more starships?

The low FPS and lag is normal for a huge fight (even if the magnitude of lag you experiencing is not). White squares showing up in place of during "sprites" is not normal, and seems to point to a deeper issue. Maybe the new version of Unity has a glitch with your graphics card? IDK, Chris (x4000) is the authority on that kind of stuff, but this does seem to point to something more than "regular" performance issues.


Anyways, what ship cap scale are you playing on? If you are planning on "large scale" games (where you get lots of planets, or modifiers that add to AI aggressiveness, or whatever), then it is probably worthwhile to use low ship caps or even very low ship caps.

I guess a good argument can be made, though, to "deprecate" high ship caps, and make low ship caps the default. You aren't the first to be bitten by lag inducing waves in the late game due to having a somewhat aggressive strategy. EDIT: Doubly true when Fallen Spire gets involved.

EDIT:
It is worth noting that the individual ships do not exist while in carriers, so the AI already does some "consolidation" of strength. Those 40k younglings should be packed into 399 carriers, and 2000 younglings (or something like that) meaning the engine has to process "only" 2399 ships coming in from that wave (excluding starships).
It might be worth looking into pushing the "% of wave strength put towards starships" back up a bit, especially as wave sizes get high (is it possible to make this percentage vary over total wave size/strength?).
« Last Edit: September 08, 2014, 04:17:05 pm by TechSY730 »

Offline MarioFanaticXV

  • Newbie Mark II
  • *
  • Posts: 20
Re: Switch back to old Unity version?
« Reply #21 on: September 08, 2014, 04:19:36 pm »
But Nienzul carriers seem to deploy their cargo as soon as they get their first scratch (it happened to me both with a wave of Tigers and this wave of Youngligns)... Which leads to tons of lag. Other carriers don't seem to do this from what I've seen though.

As for the ship cap, I just went with the default. Standard fighters are capped at 96, etc. I hate to restart after putting so much time into this campaign, but at this point I'm really tempted to do low ship caps, 1/1 difficult, and finish Spire that way...

Offline TechSY730

  • Core Member Mark V
  • *****
  • Posts: 4,570
Re: Switch back to old Unity version?
« Reply #22 on: September 08, 2014, 04:26:24 pm »
But Nienzul carriers seem to deploy their cargo as soon as they get their first scratch (it happened to me both with a wave of Tigers and this wave of Youngligns)... Which leads to tons of lag. Other carriers don't seem to do this from what I've seen though.

Then that is a legit, performance hurting that needs to be fixed. (EDIT: A new bug that is. It is likely not alone responsible for your excessive lag and the "white squares" rending issues). Carriers are supposed to "suppress" their normal deploy logic if the number on ships on that system is still too high.

Quote
As for the ship cap, I just went with the default. Standard fighters are capped at 96, etc. I hate to restart after putting so much time into this campaign, but at this point I'm really tempted to do low ship caps, 1/1 difficult, and finish Spire that way...

Yea, which is why I am wondering if switching the default ship cap to low would be a good idea. It's actually pretty easy these days to get to "CPU killing" fleet sizes on normal ship caps in ways that new players, and even veteran players, could not reasonably see coming until it is too late.

Offline keith.lamothe

  • Arcen Games Staff
  • Arcen Staff
  • Zenith Council Member Mark III
  • *****
  • Posts: 19,505
Re: Switch back to old Unity version?
« Reply #23 on: September 08, 2014, 04:34:48 pm »
When you say "neinzul carrier" do you mean a normal carrier that contains neinzul units, or neinzul roaming enclaves or preservation wardens (which also deploy neinzul ships)?
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 TechSY730

  • Core Member Mark V
  • *****
  • Posts: 4,570
Re: Switch back to old Unity version?
« Reply #24 on: September 08, 2014, 04:41:55 pm »
Oh, slightly behind on this statement, but I personally not experiencing any performance issues. It's working great for me. I posted this thread for the sake of the several users posting about this topic I have seen.

Offline MarioFanaticXV

  • Newbie Mark II
  • *
  • Posts: 20
Re: Switch back to old Unity version?
« Reply #25 on: September 08, 2014, 04:53:54 pm »
When you say "neinzul carrier" do you mean a normal carrier that contains neinzul units, or neinzul roaming enclaves or preservation wardens (which also deploy neinzul ships)?

The former; it's carriers that contain Neinzul units, and I've seen this behavior both when they hold Younglings and Tigers, but not when they contain, say, standard Fighters or Zenith Beam Frigates.

Offline keith.lamothe

  • Arcen Games Staff
  • Arcen Staff
  • Zenith Council Member Mark III
  • *****
  • Posts: 19,505
Re: Switch back to old Unity version?
« Reply #26 on: September 08, 2014, 05:03:27 pm »
When you say "neinzul carrier" do you mean a normal carrier that contains neinzul units, or neinzul roaming enclaves or preservation wardens (which also deploy neinzul ships)?

The former; it's carriers that contain Neinzul units, and I've seen this behavior both when they hold Younglings and Tigers, but not when they contain, say, standard Fighters or Zenith Beam Frigates.
That's very odd, and I don't know why it would more readily deploy those.  In fact, damaging a carrier, even destroying it, is not something which triggers deployment as of some months ago.  The damage is passed straight to the contents, and the carrier is destroyed with the last of the contents.

Anyway, I don't think that particular behavior could be related to the engine-switch, so fixing that up should wait until we've figured out what's devouring performance for some folks when they have as little as 500 moving ships on the screen.
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 TechSY730

  • Core Member Mark V
  • *****
  • Posts: 4,570
Re: Switch back to old Unity version?
« Reply #27 on: September 08, 2014, 05:33:41 pm »
When you say "neinzul carrier" do you mean a normal carrier that contains neinzul units, or neinzul roaming enclaves or preservation wardens (which also deploy neinzul ships)?

The former; it's carriers that contain Neinzul units, and I've seen this behavior both when they hold Younglings and Tigers, but not when they contain, say, standard Fighters or Zenith Beam Frigates.
That's very odd, and I don't know why it would more readily deploy those.  In fact, damaging a carrier, even destroying it, is not something which triggers deployment as of some months ago.  The damage is passed straight to the contents, and the carrier is destroyed with the last of the contents.

Anyway, I don't think that particular behavior could be related to the engine-switch, so fixing that up should wait until we've figured out what's devouring performance for some folks when they have as little as 500 moving ships on the screen.

Probably worth tossing up a bug report on the bug tracker (www.arcengames.com/mantisbt) so it doesn't get forgotten in the shuffle (speaking of which, I need to post my AI Superfortress one...). Would be helpful to provide save files if at all possible.