Author Topic: Game freezes even with new hardware  (Read 936 times)

Offline ChaosJunior

  • Newbie
  • *
  • Posts: 6
Game freezes even with new hardware
« on: March 24, 2019, 06:51:35 PM »
Hi,

I've played AI War long ago without any issues.
Recently I've updated my hardware and now I wanted to try AI War once again...

However quite often the game freezes, up to complete hang.

System:
AMD Ryzen5 2600 6-Core (3.4 GHz)
16 GB DDR4-3200
GeForce GTX 1060 6GB

After some playing I get freezes of several seconds when AI launches on a fortified system of mine:
~1200 turrets, superfortress, 2 default fortress, neinzul mod fortress, 2 mini fortress, no ships
--> AI attacks with 1k ships plus carriers with another 1-2k ships.
----> The game freezes even when I'm NOT viewing this system, be it on the map or in another (empty) system.

Now I'm completely stuck on another front... The next system to AI homeworld has a number of carriers with all in all 5k units, plus 500 units free.
--> When I'm attacking with my 3k ships the game freezes completely when not even half of them entered the system.
----> Again it doesn't matter if I'm watching the system or anything else.
--> I'm wondering especially that AI War uses max 12-13% of my CPU and max 800MB RAM, changing CPU priority doesn't change anything.

I've already tried using lowest&highest settings in STATS and Graphic settings.

Do you have any idea what I can do to make this playable?

Thanks
Chaos

Offline x4000

  • Chris Park, Arcen Games Founder and Lead Designer
  • Arcen Staff
  • Zenith Council Member Mark III
  • *****
  • Posts: 31,502
Re: Game freezes even with new hardware
« Reply #1 on: March 25, 2019, 11:39:04 AM »
Hi Chaos,

Sorry to hear about the troubles you're having there.  It sounds like a general limitation of computing power, more than anything else.  Nothing jumps out at me there as being overall immediately off, but the number of units in a battle has an exponential effect on computational requirements.  Splitting that out to no longer be the case and also to work across any number of threads in a multithreaded environment has taken us two years and a ground-up rewrite of the code in order to handle.

This doesn't mean that the original game is unplayable by any stretch of the imagination, but it is likely that you've chosen a more taxing scenario than you previously had, or that you simply accepted the lag spikes before without thinking about it, but now notice it.  It's hard to say for sure.  It could also just be an edge case where the computational requirements are super extra high for some reason (there are many of those sorts of things).  The code itself hasn't been touched since 2014, so I'm not expecting that a change on our end would have made a difference here.

Bear in mind that your current hardware might be something like 2x or 4x more powerful than your prior hardware, but when it comes to one of those situations where the game freezes, you could be seeing a spike in processing requirements that is, quite literally, 1000x or even more.  Processing power being the square (or worse) of the number of units in battle is a giant hurdle we had to overcome, and in general something that had been a focus on an ongoing basis since 2009.  By 2014 we had hit all the improvements we could without just starting over from scratch with an inherently nonlinear approach; when I first started coding this game in 2008, multicore processors weren't a thing yet, and multi-CPU machines were rare.  And multithreading code was a lot less efficient in general.  In the decade since then, the entire computing landscape has changed, hence us needing to start over fresh, given then new ecosystem for that, in 2016.

All of which is to say: I'd try a different setup of units, or lower unit counts, or in general try to have fewer units fighting one another on a single planet.  Or beyond that, the lag spikes are just simply expected because the game has to process hundreds of millions of calculations in a short period of time and it can't proceed until it's done.  The sequel fixes that issue as well, but holy cow it took us like half a year to figure out how to make that really work and that was with the freedom to start from scratch.  It's not something we can back-port.

I wish I had better news on this front, but I figured that at least an explanation of what is happening and why might be helpful.  It's just thinking REALLY hard during those moments, and the reason it's thinking so particularly hard is because it's having to have every unit consider every other unit in the system in question.  It's not a rendering issue or anything like that, but more about autotargeting and AI and tractor beams and all those fun things that "just work" but have to happen synchronously in this particular game (as with most multiplayer-safe games of its era).

Best,
Chris
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 ChaosJunior

  • Newbie
  • *
  • Posts: 6
Re: Game freezes even with new hardware
« Reply #2 on: March 25, 2019, 04:26:00 PM »
Hi Chris,

Thanks for the explanation :)

I've worked through this by using only my Champ + Flagships + Golems instead of my fleet of small ships.

Glad to hear this improves with AI War 2, think I'll give it try rather sooner than later ;)

Cheers
Chaos