Arcen Games

Games => AI War II => Topic started by: x4000 on October 12, 2018, 10:56:01 PM

Title: AI War 2 v0.783 Released! "Go Ahead And Shoot Me, Eyebot!"
Post by: x4000 on October 12, 2018, 10:56:01 PM
Release notes here.

The name of this release comes from a pair of contradictory bugs fixed in this build.  They're best summed up by a fun savegame that HeartEater7 provided:

Longwinded Storytime

So... what was causing the problem?

The fix was fairly simple: I have the ships track their literal incoming shots now, not a cache of the incoming damage from them, and so they immediately notice when a shot has been blocked without hitting them.  If we later add some other mechanic that clears shots without them hitting a ship, this will also still work.  If the Guardian had managed to warp out of the planet via a wormhole right before incoming shots hit it, this also handles that sort of case.  So that problem was fixed, and your ships won't ever be shy about murdering the enemy anymore.

So what happened next?  Well, this particular savegame then fell prey to another oft-reported (in the last month) bug.  Lucky for me, since it had been hard to repro otherwise.  Here's what went down:

I had overkill-prevention logic in the targeting code, where ships would avoid targeting things that they knew were going to be targeted.  But that's part of making a target list, which then the ships choose viable targets from for the next partial second.  Once they have the list, they have at least part of a second for some of that data to get stale (such as, in this case, one ship firing a shot that now means it will be overkilled -- as soon as that first shot is fired, it's time to stop any further firing at it.  If this was a larger battle, it would be time to shoot something else).

The solution to that was pretty easy: just add the overkill-check logic in the "get ready to fire at a target in our list" part of the code.  Then they say "he's already about to die within 1-2 seconds, what else can I shoot?"  The answer in this limited scenario is "nothing," so they just sit there.

In the case of a bunch of Ambush Turrets waiting at a wormhole, the situation was much different, though.  Puffin had a savegame where they would frustratingly overkill just a single ship in a volley, wasting tons of ammo while more ships poured in.  Why shoot that one guy so much!?  After this fix, the Ambush Turrets immediately and efficiently murder everything, like they were always designed to do.  Expect your turrets to be far more valuable now, along with... well, everything really.  But that goes for the AI, too.

So that fixed everything, right?  Not quite.  Now here's what happened:

But this was actually great news for me, because this meant that this was that other big bug and I could repro it 100% of the time.  Turns out that the problem here was kinda stupid, since I was able to instrument the code and see what was happening.  200 ships v 1 was absolutely ideal for that scenario.  Here's what was happening under the hood:

So... the solution was pretty easy.  First, have it not set HasBeenRemovedFromSim to false until an object comes back OUT of the pool.  Secondly, just to be on the safe side, set the health lost to an obscenely high amount so that everyone thinks the ship is dead no matter what.  Don't set that back to 0 until, again, the ship comes back out of the pool.  Either one of these conditions should be sufficient for every reference to this ship to say "this thing isn't valid anymore," but having both in there just makes me feel a little more comfortable.

And now all that stuff works perfectly.  Yay!

So, What Else?

Mmm, lots of good stuff:

More to come soon!  My hope is to focus on the view/edit controls screen, and the lobby, as probably my last main pre-EA-launch things.  Then we start EA and get working on whatever seems most pressing to people.  Only a few more days, now!

Problem With The Latest Build?

If you right-click the game in Steam and choose properties, then go to the Betas tab of the window that pops up, you'll see a variety of options.  You can always choose most_recent_stable from that build to get what is essentially one-build-back.  Or two builds back if the last build had a known problem, etc.  Essentially it's a way to keep yourself off the very bleeding edge of updates, if you so desire.

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.

Enjoy!

Chris