Arcen Games

Games => AI War II => Topic started by: x4000 on September 24, 2018, 08:50:31 PM

Title: AI War 2 v0.774 Released! "Five Thousand Days"
Post by: x4000 on September 24, 2018, 08:50:31 PM
Release notes here (

Holy guacamole am I excited about this one.  Buckle up, because this is going to be a long post.  I'm going to post a video in a separate update later tonight, too.


Let's start with the "boring" but important: looooads of bugs have been squashed in this one.  Most if not all of the carnage wrought by the performance overhauls of the last few versions has been smoothed out.  Plus a variety of longstanding issues.  There are still bugs to hunt for sure, but it's finally a net-positive compared to the last two weeks.  I'm really excited about that.

AI Defenses

Badger spent a lot of time reworking both how the AI initially defends its planets, and how it chooses to do reinforcements... and a few things relating to offensive waves, as well.  The net result is that the AI planets really feel a lot more like they did in Classic, which makes me very happy.

Oh, quasi-related, the AI targeting (your units and theirs) is better yet again.  They won't get caught up with metal harvesters forever anymore, etc.  And so many bugs fixed that were causing them to go the wrong place or chase the wrong thing, etc.

Map Generation Stuff!

Badger also made several new map variants for clusters, and made it so that you can finally choose how many planets your galaxy contains.  The default is still 80 at the moment... but in general I'm leaning towards raising that in the future, and making the minimum planet count and maximum planet count higher than they were in the first game.

More planets does not equal more CPU load for us, most of the time; assuming the same number of units in both scenarios, having twice the planets would actually be a quarter of the load in a lot of cases (many bits of work have a squared cost to them based on unit counts at a single planet).  Given that we'd of course have more units if we had more planets, we could still do something like 50% more units in the galaxy but at only half the cost of what a smaller galaxy would be; something to that effect.  Anyhow, that's all just xml data at this point, so it's easy to change later.

Quality of Life Improvements!

You no longer need to build hackers or science labs to deal with those resources on your own planets -- your command stations now gather those resources, too.  You still need those units if you want to gather resources on planets you don't control, and to do hacks on AI planets.  But you no longer need to shuffle around those guys in the basic areas.

Similarly, ALL of the objectives are finally actually showing up on the sidebar.  It was previously not telling you about data centers, or Advanced Research Stations (ARSes), etc.  There are also some additions to the tutorial, and to the beginner objectives, which also help out a lot.  There's nothing on the galaxy map that you need to pore over the map to find anymore; it's all right there on your objectives tab of the sidebar, waiting to be clicked to take you straight to the planet in question.

Oh right, and you can also see the number of squads per category in the ships tab of the sidebar; I've already gotten so used to that that I forgot it was new in this release!

Lots and Lots of Ship Renames

A lot of names for things in AIWC, or early-AIW2, have been changed.  But it's not just cosmetic; their functions are different, and we didn't want folks to be confused by something working differently but having the same name.

There are also some units that were just generic, like "Laser Turrets" and similar... what did those do again?  Just... basic damage, I guess?  (Yes).  Those now have distinct roles instead, and took up new names in order to reflect those roles: Laser Turrets are now Nucleophilic Turrets, for instance, meaning that they do more damage against targets with higher energy usage.  They still do great as general damage dealers, but now they have a specific niche bonus.

Advanced Research Stations (ARSes) have been renamed and split into a trio of units, too.  They are now Fleetship, Starship, and Turret Schematic Servers.  It's kind of a lot to explain if you're a fan of the first game and want to know what's different, so here's a link to the details (  But the short of it is that there's more to capture now, and the capturing starts earlier in the game.  This gives you more units to command, and gives you more choices in what to capture versus just having to take what you find.


Balance Tweaks!

Hoo boy has RocketAssistedPuffin been busy.  He's been really fleshing out all of the units so that they fit better into the world.  The nanocaust is a lot more threatening to starships now, for one thing.  Armored Golems got a bonus tesla coil.  The Cursed Golem got a buff.  Plasma weapons got a bit of a redefine, and split into two groups (burst area damage ones, and single-target ones).  Lots of really good stuff.  Oh, and the Botnet Golem now fires 50 shots per salvo instead of 16.  GOOD GRIEF, PUFFIN! ;)

One that I snuck in there, which Keith suggested a week or two ago, is the return of brownouts.  They work just like in AIWC: if your energy balance goes negative, then all your forcefields shut off.  Note that the actual shield health doesn't go down on anything, just the projected bubble goes away.  So the survivability of the shield generators themselves isn't affected... but they won't protect anything anymore.  Some of the most exciting wins that the AI would get against players in AIWC involved last-minute brownouts, and it was a big thing for players to juggle when being invaded (in a good way, not a micro way), so I'm definitely pleased to have that back.

Icon Overhaul

Part of the reason why this release took so darn long (6 days!) is that I redid almost all the icons in the game.  Well, we kept 56 of them, and added 105 new ones, and took out... I don't know, 50?  So "almost all" is a stretch, but in practice that's what it feels like.  The icons for most of the units beyond the basics have either been reworked to be more legible, or have been made unique for the first time; a huge number of units previously just reused icons temporarily, but now none do.

This makes the galaxy map AND the planet view AND the sidebar a lot more legible.  One thing that was often pointed out was that Turrets were basically illegible before, but frankly I found guardians and starships equally unintelligible.  I guess they only seemed clear by comparison to the turrets.

We actually upgraded our icon system a fair bit in order to accommodate this, now including a third "overlay" layer that can go onto your two-tone team-color icons.  The overlay is just colored however it's colored, and goes over any part of the icon that we want it to as we design them.  The result is that now "starships" all share a same backplate, and then little sub-images make it clear what KIND of starship it is.  You don't need to be able to see the details of the little sub-images, even, because their vague shape and color is enough to differentiate them.  But they all have sensible details if you get up close.

Here, let me just show you:

<img class="aligncenter size-full wp-image-6479" src="" alt="" width="1582" height="749" /> (

One of the coolest things about the icon overlays is that I can do things like what you see with the Military Orbital Command Station you see there: it has a colored shield icon inside it, rather than some sort of little flair or whatever off to the side.  But then if you look at the turrets on the sidebar, or the starships also there, you can also see the icon background is the same, but the little marker is different.

The bump to usability this has caused is just crazy, and I'm super stoked about that.

Shot Visuals Overhaul

Basically, almost all the shots in the game got a rework, and they look better both up close and far away, AND perform better.  It's about time these felt like a proper space battle!

<img class="aligncenter size-full wp-image-6480" src="" alt="" width="1161" height="634" /> (

One of the nice things about this change is that it actually helps with the ability to read the battlefield.  You can tell quite a bit about who is shooting, and what kind of shots they have, based on the colors and shapes you see going past during battle.  This was my major project over the weekend, and it really makes things feel so much better.  The nature of shots is something I came up with for this game, too, and they're insanely performant.  I've had 30k shots onscreen at once (plus 10k ships) at 120fps on a GTX 1070.  Our shots are done in a way that their deformation is on the GPU and yet we're still able to make use of GPU Instancing, so the CPU load of them is comparably low.  That code isn't new, but we're making much better use of it now.


The last of the pre-Early-Access ships have now been added to the game.  Auto-Bombs have been added as a player-only ship, thanks to Puffin.  The Warbird Starship and Parasites are in, making a return from the first game also thanks to Puffin.  SuperTerminals and Co-Processors have been added in thanks to Badger, leading to yet more targets out in the galaxy to go for.


Yep, we made even more strides on that front.  There ARE, however, still some savegames that are frankly intractable performance-wise.  They're late-game situations with huge AIP counts, and basically should be losing situations.  But rather than just getting it over with, the simulation slows down and the targeting loops take up to 50 seconds at the moment on my machine.  Normally a targeting loop takes under a third of a second.

So what to do?  Well, I'd hoped to get this in this release, but I wound up just getting the framework in.  Tomorrow's release will hopefully have them: Unit Stacks.  Basically, there will ALWAYS be a point at which a galaxy is able to become intractable if players push things far enough.  That's just a given, since hardware isn't infinitely powerful.  We had players spawn 30 million ships into a campaign in the original game using cheats, for instance, and that gives you a framerate of 1 frame per 20 minutes in that game, roughly (I'm not kidding).

So anyway, there has to be a "pressure release" valve somewhere.  People will always exceed what we have planned since there aren't strict unit caps.  In the first game, we mostly got around that by having AI Barracks and AI Carriers, and what we called "cold storage" for AI units that were on idle planets.  The new game is a lot more efficient in general and hopefully won't need those sort of measures.  But something a bit more elegant has occurred to me, and is my focus for tomorrow: as I said, Unit Stacks.

Basically when there are too many ships on a planet, the game will go through and combine like with like, bringing it down into realms where your computer can do the math in a timely fashion.  Each stack of units that gets combined will have a little multiplier number right on its icon in the main view, and on the side view won't show differently at all.  There are a few more nuances there, but mainly it will just keep the performance from ever getting runaway bogged down and the game from having an over-abundance of icons in a meaningless way.  Basically I was thinking about Civ IV as an inspiration.

But more on that tomorrow!

So What's That "5000 Days" Title Mean?

It's a bit of a lame joke on my part, relating to the fact that I changed some of our 64bit integers into 32bit integers.  If you want some technical junk, read on.  Otherwise, feel free to skip this section.

Basically, Keith and I both come from business software backgrounds.  In such an environment, we're familiar with situations where the limitations of a 32bit integer have been hit (that's about 2.2 billion).  So basically, if Amazon used a 32bit integer to track orders, then after 2.2 billion orders their system would break.  Evidently in 2015, they shipped about 5 billion orders via Amazon Prime, so that gives you some sense of scale of what we're talking about.

Well, we were tracking ships, and shots --and even the number of fifths-of-a-second a campaign has lasted -- all as 64bit integers in order to avoid that sort of problem.  I don't know the name of this number, but this is the largest a 64bit integer can store: 9,223,372,036,854,775,807.  Is that quintillions?  I think that's what that is.  Anyway, that's an unimaginably huge number, as if 2 billion were somehow comprehensible in a meaningful sense to us.

64bit math, even comparison operators and addition, take a lot longer compared to int32.   In this table, it's showing the nanosecond costs of various operations of ints (32bit) versus longs (64bit) in C#:

<img class="size-full wp-image-6484 aligncenter" src="" alt="" width="297" height="606" /> (


As you might notice, the mere addition of a long is 5.6 times slower than the addition of an int.  To check time, there are lots of situations where we have to do things like "if ( Now &gt; LastShotTime + 5 )."   So the shift to an integer is a nontrivial amount of speed boost when spread across the literally millions of operations that we do of that sort in one second during gameplay.

The downside, however, is... bum bum bum... there's now a time limit on campaigns in AI War 2.  I'm sorry to tell you this, but you cannot run a given campaign of the game for more than about 5000 straight days (24/7/365) before it will break.  (Note that this is NOT something to be concerned about, it's a joke I almost regret sharing, probably most games have a similar limitation, it doesn't limit things across campaigns, etc, etc).

To put this into perspective: 5000 days is 13.69 years.  Of continuous running, just one campaign ever, never turning off the power or adjusting anything.  Arcen isn't that old.  I didn't start coding the original AI War until just under 10 years ago, and it didn't release until almost exactly 9 years ago.  I will go out on a limb here: if you can't win your campaign in one hundred and twenty thousand hours, I think you need to choose a lower difficulty for your next campaign.  Also: do drop me a line, since it's now the 2030s.

The joke, as it is, is basically at Keith's and my expense.  We both somehow felt quite concerned about the limitations of a regular int, as if we'd hit the cap on that and the game would die.  (As it stands, even in the new version I have it cycle back around if it passes 2 billion shots or ships created in one campaign, so that it can't break on that; yes I'm that paranoid).  The idea that we'd ever approach those sorts of numbers really shows that even the gut feel of math-inclined programmers can really be way off when it comes to what a billion means.

Well, I've thoroughly derailed these release notes now...

The End!

That's it!  There's lots more to read in these release notes, but I don't have anything more to say about them here.  There should be another release tomorrow.  Lots more to come in the next few weeks.

Thanks for reading!

The Usual Reminders

Quick reminder of our new Steam Developer Page (  If you follow us there, you'll be notified about any game releases we do.

Also: Would you mind leaving a Steam review ( for some/any of our games?  It doesn't have to be much more detailed than a thumbs up, but if you like a game we made and want more people to find it, that's how you make it happen.  Reviews make a material difference, and like most indies, we could really use the support.


Title: Re: AI War 2 v0.774 Released! "Five Thousand Days"
Post by: MaxAstro on September 25, 2018, 03:30:16 AM
You know, if you ever want to be really devious - maybe as an optional toggle or maybe not - it occurs to me that a truly nasty thing to do would be to have a brownout state also prevent the player from pausing the game.  XD  "Sorry, general, the temporal manipulators are offline!"
Title: Re: AI War 2 v0.774 Released! "Five Thousand Days"
Post by: x4000 on September 25, 2018, 12:34:12 PM
Holy cow that would be evil! ;)
Title: Re: AI War 2 v0.774 Released! "Five Thousand Days"
Post by: etheric42 on September 25, 2018, 02:25:13 PM
Yeah, if you don't want micro headache you would need to do something like that.  Because otherwise if I get a brownout and I need shields up ASAP, I just pause the game and scrap some stuff, and that sounds tedious and not engaging gameplay.

So... either turning off pause if you just want to induce rage in people, or some kind of timer before you can "reset" the power system even if you scrap stuff.  Or make the brownouts percentage-based (90% of power needs means shields are at 90% radius, etc).
Title: Re: AI War 2 v0.774 Released! "Five Thousand Days"
Post by: BadgerBadger on September 25, 2018, 02:34:57 PM
I don't really mind the brownout mechanic; having to choose what to scrap can make for some agonizing decisions, and I think of that as a good thing.
Title: Re: AI War 2 v0.774 Released! "Five Thousand Days"
Post by: tadrinth on September 25, 2018, 03:11:57 PM
This seems like a better fit for an 'Ironman' campaign mode style option - No pause (you can go to the game menu but you can't issue orders there), possibly also no reduced speed.  Combine with Ironman mode for a serious challenge. 
Title: Re: AI War 2 v0.774 Released! "Five Thousand Days"
Post by: BadgerBadger on September 25, 2018, 03:24:57 PM
Well, you can still duplicate Pause by Save/Quit. So I think it would mostly be a difficulty-through-inconvenience; noone wants to lose a game to a phone call or needing to answer the door.
Title: Re: AI War 2 v0.774 Released! "Five Thousand Days"
Post by: tadrinth on September 25, 2018, 05:48:31 PM
Ah, but you can't issue orders from the Save/quit menu, or look around the galaxy map.  You're right in that it's mostly difficulty through inconvenience, but it does significantly limit your ability to have superhuman micro.
Title: Re: AI War 2 v0.774 Released! "Five Thousand Days"
Post by: Draco18s on September 25, 2018, 05:49:45 PM
You could reduce  pause mode to "paused and non-interactive."
Title: Re: AI War 2 v0.774 Released! "Five Thousand Days"
Post by: x4000 on September 25, 2018, 05:57:34 PM
This is a very strange discussion.  Definitely not on the radar anytime soon, haha.  What masochists!

Would you also like a mode where every time you lose a command station that you control, it deletes a random file from your machine? ;)
Title: Re: AI War 2 v0.774 Released! "Five Thousand Days"
Post by: RocketAssistedPuffin on September 25, 2018, 06:04:39 PM
*AI destroys Command Station*

*Random file is deleted*

*File is AI_Structures.xml*

*AI Overlord poofs*

*For The Fallen!*

Title: Re: AI War 2 v0.774 Released! "Five Thousand Days"
Post by: x4000 on September 25, 2018, 06:07:29 PM
Nice.  8)
Title: Re: AI War 2 v0.774 Released! "Five Thousand Days"
Post by: tadrinth on September 25, 2018, 07:44:53 PM
I mean, I'm pretty sure I'd finish Ironman No-pause No-slowdown campaigns a heck of a lot faster than my usual 10x ratio of real time to in-game clock time. 

I don't think I'm masochistic enough for that though.
Title: Re: AI War 2 v0.774 Released! "Five Thousand Days"
Post by: HeartHunter on September 26, 2018, 05:32:27 PM
+for challange "no pause, no save"
Title: Re: AI War 2 v0.774 Released! "Five Thousand Days"
Post by: zeusalmighty on September 26, 2018, 08:16:01 PM
Advanced Research Stations (ARSes) have been renamed and split into a trio of units, too.  They are now Fleetship, Starship, and Turret Schematic Servers.

I really like this switch. It builds in a safety net that the player gets diverse and accessible schematics. Obviously have a limited pool but there's a foundation of base ship types (e.g. ___ corvette) that is pairing neatly with the "ship variants" (e.g. "pike," "concussion," "MLRS," etc.). Mixing and matching these traits around and have adding these to the pool is seemingly straightforward in terms of using base ships as templates to change around.

One thing on my mind is that three may not be sufficient. What about schematics for special mines? Fortresses? Zoning-Tools? Having a catchall "special servos" seems like something to have just in case. (I have some neat ideas for a special "Beachhead" fortress that would be fun  ;D)

Another thing came to mind--are these planned to be hackable like ARS's (i.e. getting three different choices)? Hacking should be a thing with these things, but perhaps in a reimagined capacity
Title: Re: AI War 2 v0.774 Released! "Five Thousand Days"
Post by: x4000 on September 28, 2018, 11:15:44 PM
I think that they are hackable, but I can't swear to it.  They are supposed to be, but I didn't test that.

I'm glad you like that change -- and I agree that having a fourth category, later on, will be really helpful.  I'm not going to put in the schematic server for that just yet, but once we have content in that area I will. :)
Title: Re: AI War 2 v0.774 Released! "Five Thousand Days"
Post by: BadgerBadger on September 28, 2018, 11:44:18 PM
Schematic servers are not eligible for any hacks. Would you like them to be? If you give me a function I can call that says "Get new Tech for Schematic Server" then I'll give you a hack that lets you swap the Tech.
Title: Re: AI War 2 v0.774 Released! "Five Thousand Days"
Post by: x4000 on September 29, 2018, 03:52:31 PM
Sounds good, thanks!

-You can now call RandomlyAssignGrantsShipLineOnClaimDrawBag() to have it generate a new option for a schematic server when hacking.  It won't assign to anything that is already assigned elsewhere, so right now with turrets and starships hacking will likely always just assign the thing back to what it already was.
--you can call GetCountOfPossibleShipTypesForClaimDrawBag() in order to find out how many possibilities there are to choose from, and can tell the player that number when they are going to hack.  If the number is 0, then they should probably not be allowed to hack, heh.