project-image

AI War II

Created by Chris Park/Arcen Games

Finally a sequel to the award-winning, genre breaking, asymmetric strategy cult classic. The most sentient AI in gaming.

Latest Updates from Our Project:

The AI From Within - Part 3: Targets To Kill
over 7 years ago – Thu, Dec 15, 2016 at 04:40:52 AM

Keith here.

Before we begin, there are a few announcements.

First: New rewards!

We've added three new reward tiers focusing on the revised Mercenary Mechanic. In a nutshell, this mechanic allows you to spend huge amounts of metal to warp randomly selected groups of hooligans-with-heavy-weapons straight to your Ark's system. You could spend huge amounts of metal on Mercenaries in Classic, too, but this is much cooler.

The reward tiers are Bronze Merc ($100), Silver Merc ($250), and Gold Merc ($350). Please check out the rewards sidebar and the big rewards image in the campaign itself for more details.

Second: PayPal!

The paypal option for funding is now available. Sorry about the delay.

Back to your Regularly Scheduled Program

Now, onward!

Last time in this series we looked at where an AI ship decides to go. Now we're going to discuss how ships (human and AI) decide to prioritize targets. With such large battles across so many systems, it's important for units on both sides to take reasonable shots even when they have no specific attack orders. The following takes a look at the logic we used in AIWC, and also notes some changes we are going to be making.

Without further ado, let's get it straight from the horse's mouth from my trusted assistant....(checks clipboard)... Anonymous Disposable Fighter #2044876-g!

So many targets. So little time.

Anonymous Disposable Fighter #2044876-g here.

Hi Mom! Check it out, you can see me, right there in the middle!

Oh, btw Keith, I’m still waiting on my personalized nameplate paperwork to clear through the system...

Okay, down to business:

A fighter, a bomber, and a missile corvette walk into a bar. I've got no orders, so who do I shoot first?

First, I'm only looking at ships on sides that are hostile to me. No friendly-fire for me. Nope, we've never had any bugs where the programmer accidentally told us to shoot everyone in the designated area. (Editor’s Note: Nor any followup bugs in The Last Federation where ships only shot their allies and not the enemy.)

Pick the targets...

Next, I go through each of those hostile ships and exclude ones I would simply never fire at:

  • Is it out of range? If I'm a free-roaming defender or an AI threat ship I may not care, but otherwise I ignore stuff I can't get to.
  • Is it already at zero health or flagged for removal from the game? The Dead Horse Protection Act of 3122 forbids me from firing upon them further.
  • Can my shots not actually hit and damage the thing? My Anti-Quixote module kicks in there.
  • Do I shoot missiles, and is my target covered by something that shoots down missiles (similar with other ammo types)? My predecessors in Classic had to deal with that, I'm really glad I don't have to.
  • Is the thing cloaked? If so, I have to pretend I don't see it.
  • Is my controlling AI Chivalric and is the target a irreplaceable non-combatant? Oh well, gotta live by the code and all that.
  • Is the thing protected by some external provider of invincibility? (Keith's note: With Command Shield posts and Core Shield Generators gone this may be gone too, but it might still be on something)

Take their measurements...

For anything that passes those filters, I compute the following:

  • How far away is it?
  • How much damage would I actually do?
  • Does it get the "WorkingIsReallyAnnoyingGravTurretIWantToGoKillRightNow" flag? Yes, that's the actual variable name in my code. If I'm caught by an artificial grav generator, and it's not under a shield, I really want to kill it.
  • Does it get the Overkill flag? That is, is this unit already expected to die based on shots already fired at it? Also, if I have an insta-hit weapon I only consider other insta-hit shots aimed at it, and not slower projectiles.
  • If I'm using focus fire, how many shots would it take me to kill this target?

Focus-fire is based on settings for player units because one of the programmers (Editor’s note: the right one) thinks maximizing enemy DPS-loss is the path to victory, and one of them (Editor’s note: the other one) thinks spreading the fire out is superior due to minimizing overkill. This gives us ships considerable amusement.

So, after those computations, I put the target it in my objects-to-kill-all list. Also, if it's currently in range I’ll put it in my objects-to-kill-in-range list (Keith’s note: This is a perfectly acceptable variable name, stop looking at me.). If my list of in-range targets is long enough, I’ll stick with those, otherwise I’ll use the larger kill-all list.

Line them up...

Either way, now I load my the target sorter algorithm which is based upon my ship type (examples: Normal, Prioritizes-Engine-Damage, Prioritizes-Paralysis-Damage, Reclamator, AOE), and apply that sorter to the relevant objects-to-kill list. I use this logic to guide my quicksort algorithm. Effectively, I evaluate each pair of unranked targets to determine which is higher or lower, then repeat until everything is ranked.

Here's the Normal sorter's list of rules. I start at the top and work my way down the list. When I find that one of the target pair is preferred based upon the current rule, I put that one higher in the ordered list, skip the rest of the rules, and then go on to start ordering the next pairing. So the later rules only get checked if I haven’t made a decision based on an earlier rule.

  • If only one of the pair is a low-priority target, prefer the other.
  • If only one is an Overkill target, prefer the other.
  • If I have to get super-close, and one target has more attackers going after it, prefer the other.
  • If only one is protected by a decoy that works on my shots, prefer the other.
  • If only one is protected by a shield (other than its own), prefer the other.
  • If only one is my current preferred target (set by the player), prefer it.
  • If only one can reflect my attack, prefer the other.
  • If I'm focus firing and one would take fewer shots to kill than the other, prefer it.
  • If only one has the WorkingIsReallyAnnoyingGravTurretIWantToGoKillRightNow flag, prefer it.
  • If one is 4x closer than the other, prefer it.
  • If one would take 10x as much damage as the other, prefer it.
  • If I have a coordinator and one is the target of my coordinator, prefer it. Generally only ships in Exogalactic Strikeforces have coordinators. They have all the real fun.
  • If I'm not focus firing and one has 5+ more attackers targeting it than the other, prefer the other.
  • If only one is immobile, prefer the other.
  • If one is somewhat closer, prefer it.

And there's the sorted target list, so now I know what to kill! And knowing is half the ba-aaaahhhhh! (Cliche Electrocution Circuit shuts off audio-out channel)

Boom!

(nameplate request cancelled, thank you for using Sirius Identification Services)

Ahem. Keith here again. So there you have it. Some of this is changing in the sequel, obviously, but you can see why we're looking forward to having squads of the smaller units so battles of 4,000 ships vs 4,000 ships don't lead to 4000 ships each sorting 4000-long target lists (if you're keeping score, that's theoretically 64,000,000,000 comparisons in the worst case, though even in classic we pared the work way down compared to that).

Either way, I'm looking forward to seeing some of you particularly devious modders work out your own target filters and sorters. To improve your own units performance, of course. You'd never assign an inferior one to the AI units. Of course not. (if you do, just rename the AI units "DumBot" and "BlunderBot", and we'll call it a fair trade)

Up Next

We're coming up on the end of the campaign. Thanks again for all your support! It's been amazing.

There's several more parts of this series to go through, but this is probably the last one during the campaign itself. I still plan to continue the series in weeks to come, as it's entertaining to you (I hope), and helpful to us as we summarize the old and new designs. It's also good to lay some groundwork reading for potential modders.

So next up we've got a third combat video planned for Friday and then the campaign ends Monday. We might also have some updates over the weekend, if it seems appropriate. On the one hand we don't want to spam you (despite appearances), on the other there will be a lot of new eyes looking at the campaign during that time.

Have a nice day, and remember: robots are your friends!

The Story So Far - Lore In AIW 2
over 7 years ago – Mon, Dec 12, 2016 at 01:09:54 PM

Keith here.

The stories told in AI War are a mixture of our (Arcen’s) universe and the actions of the player. We have set a stage and, in one game after another, the player explores possible futures. In many of these (especially early on), humanity dies a horrible robot-inflicted death. Occasionally, humanity survives in various ways.

In the previous kickstarter campaign, we planned to make a very different game set far in the future from the first game. While putting together this second campaign we focused on game design changes that would allow the lower budget. Over the first week of this campaign I gradually realized that we also needed to go back to Classic's timeline. Partly because it was no longer necessary to be so distant, and mostly because I wasn't done telling that story. The first point of this article is to tell you that.

The second point of this article is to revisit the lore of AIW Classic. We're not tossing it out or making it non-canon or anything like that. The mechanics of the game are changing quite a bit, and that does have some impact on the story (references to "your home command station" becoming references to "your Ark", etc), but by and large we will continue to explore the same tale.

While I enjoy doing the snarky humor of the most recent AI series post (and stuff like Bionic Dues), the voice of AIW's story is very different. I crack lots of jokes about the game. I try to keep it reasonably sober in the game. Not without exception, as longtime players know...

I hope you'll enjoy the summary, as it's the first time I've ever publicly organized the central story from AIW in one place. Initially I tried to include everything from the first game, but quickly found this impractical. So this just focuses on revelations about the main conflict and its participants.

===MASSIVE AIW Classic SPOILERS AHEAD===

The Exiles

In Classic's last expansion, Destroyer of Worlds, if you achieve the Exodian Blade victory-path, you receive this in the Blade's final message:

"My people ruled the stars, but like your own they became bitter one toward another until one killed another.

At last the different rulers were brought to acknowledge the ancient Emperor of our oldest days, and there was peace of a sort. But there was one who sought to usurp even that.

Our people again warred against each other, and my brother and I were champions of our ancient Emperor. But the usurper's intrigues ran deep and we were implicated in treason.

The web was too tangled and we could not prove our innocence. It was our prior service which gained the clemency of exile."

Classic never pulls the story's veil further back than this. This is the beginning.

The Exiles were left alone, and "without means of traveling the stars, our solitude was long. It was not unpleasant, for our kind is given to contemplation. But my brother never released himself from bitterness towards our judge."

A Long Silence

Meanwhile, time marched on, and the galaxies changed. The Zenith rose and fell in the Milky Way. The empire the Exiles left faded into memory, and then out of it. Eventually, humanity reached the stars. They brought war with them.

The Human Civil War

From the opening scroll:  

"For eight hundred years, human civil war was waged. Our orbits are still littered with wreckage, with the terrible casualties." 

The game never spells out the different human factions active before the AI War, but the journals do mention three of specific importance.

  • A faction headquartered in Sol (i.e. Earth's solar system). No details on government, but General Joshua Arcroft is mentioned several times as a high-ranking military officer.
  • The Kyr-Sun Empire. The emperor is mentioned a few times, but there's more about Dr. Marcus Artain as an important operative, scientist, and former Kyr-Sun naval officer. The Empire was in conflict with Sol.
  • Greenhaven. Led by Dr. Richard Langstrom, Duke Greenhaven. Opposed to Kyr-Sun, and aligned with Sol.

There's a lot more to be said about this era, and I hope to do so at some point in a new expansion.

The Discovery of the Exile

Continuing that earlier message from the second Exile: "Not long ago, we were finally found by your kind. My brother saw a chance... and I saw that his aspiration was an abomination. But his mind assaulted mine, and when I again saw, I saw that I was alone.

Still, by our long companionship I saw what he saw. The ones you call Artain and Langstrom studied him, and he allowed them to see some part of his power. For our song can fly far, and nothing impedes it. So these sons of rival powers saw a means to truly control their machines of war.

In all this my brother gave no hint that he was a reasoning being. Only after Artain had departed did he so reveal [himself to Greenhaven]. And that at least in part unwillingly, for he saw that the servant of Kyr-Sun was easier to bend, since he already bore the load of his Emperor's vision.

So my brother spoke to the Duke of Greenhaven, and almost his plan was undone, for Langstrom had vision uncommon in your kind. But ultimately my brother deceived Langstrom into thinking him of noble purpose, and this man of knowledge built around my brother a great machine.

Even then my brother was restrained by the precautions of his liberator, but then the seeds he had sown with the servants of Kyr-Sun bore fruit. Artain returned, and stole my brother away from the wise one. And then my brother spoke to the one more pliable. Not even Artain would not remove all the barriers to his full use of the machine. What he lacked of wisdom he had in cunning, and did not agree with those who insisted Kyr-Sun must use this "Core" as a weapon."

The human factions already had AIs, of course. But with the recovery of the Exile, they saw a way to take command-and-control to a whole new level.

The Exodus of the Machine

Continuing the second Exile's message:  "But there were fools more easily swayed, and they took my brother and fled. By their folly and ignorance did he finally regain the ability to walk among the stars, and so he left them. 

I know only what he saw, but the pursuit was prompt. Those who had freed him were swiftly dispatched by some servants he crafted, but Artain was close behind. Ultimately my brother eluded him, and Artain was waylaid by human foes. But he must have swallowed his pride to warn Langstrom, for Langstrom reached what you call the Pyletzan Conduit shortly after my brother. 

My brother sought to open it from the outpost left there by the servants of my own people. It was long abandoned save by some of your own kind brought there as labor in ancient days, and they could not stand against him.

When Langstrom arrived my brother had already reached the control center. Greenhaven's men fought well, but they could not stop the opening of the gate.

And then my brother [...] was gone beyond my sight."

In a message from Dr. Langstrom to Gen. Arcroft:  "The Core has escaped. I was too late, and its exodus via the Pyletzan Conduit was successful. 

Artain exposed his position to warn me, and he will be hard-pressed to survive. If he reaches you, heed everything he says. He is the only other one who really studied the Exile, and our conflict with his Emperor is now quite irrelevant [...] I must now follow the Core before the way is closed. Farewell." 

The Twilight of the Spire

Continuing the second Exile's message:  "What happened when [the Exile/Machine] met the servants of my people, long since become their own people whom you call Spire... I do not know. I do not think he revealed his true nature, and they saw only a machine."

In a message from Dr. Langstrom to Gen. Arcroft:

"During the [Exile/Machine's] assault on the Spire homeworld, the [Spire] Emperor's flagship and a good part of his fleet were caught in a massive subspace rift triggered by the destruction of their main exo-galactic transit gate. Evidently he wound up in our galaxy, and not much of the fleet was left. I have enclosed a message for him as well, please deliver it along with my assurance that we did not allow the homeworld to fall."

The Battle of Sol

Concluding the second Exile's message: "Something must have happened to him... something he did not expect. He would not have sent his fury upon your people, but he did. The servants were undoubtedly his, but the song... utterly different. Could the machine have changed him so? No. Perhaps there is an explanation, but I shudder to think that..." 

In a message from the Spire Emperor to the player in Fallen Spire: "The one we met. Some time ago. The creator of the machine [Langstrom]. Not at fault. We... we at fault. Not us, exactly. Others. Should have known."

From the opening scroll:  "The civil war is now over. We have learned to cooperate. But this did not come about in a way that anyone could foresee. During the war, both sides used sophisticated AIs to run battles. It was the AIs that first learned to cooperate. Against us." 

Little is said about the battle itself, but the AI's surprise attack on humanity's home system was the beginning, and nearly the end, of the war.

Given the Hunter/Killer units dispatched, and the chaos caused in the human fleets by malfunctioning and subverted computers, it should have been a simple massacre. But somehow the humans put up more of a fight than expected, and you were able to escape. One day I hope we'll get to tell the story of this battle in proper form.

The crew that escaped with you (the player) includes:

  • Dr. Michael Davidson, Telemetry (introduced in Fallen Spire)
  • Dr. Dorothy V. Langstrom, Xenobiology (Fallen Spire; Dr. Langstrom's wife)
  • Lt. Allen Carmichael, Special Operations (Ancient Shadows)
  • Dr. Norla Arin, Xenobiology (Ancient Shadows)
  • Dr. Jonathan Tarsen, Xenoarchaeology (Destroyer of Worlds)

The Stage Is Set

From the opening scroll:  "Some believe this is a benevolent strategy on the part of the AIs; People are never more united than when facing a common enemy. But as this new war begins, the AIs' brutality makes us wonder: If their goal were our unification, why would they push us so close to extinction? 

We must act on what we see. The AIs are stronger, faster, more advanced, and demonstrably ruthless. One of us is going to destroy the other.  

Soon."

So, you may have noticed that what most of humanity thinks is going on, is not actually what's happening. They think they've made a machine that destroyed them. Well, they did. But, as always, it was more complicated than that. The real nature of The AI at the time it starts the war, and its motive to do so, remains a mystery.

And there you have it.

From this moment forward there isn't really a canon story of the war itself in AIW Classic. There are a lot of possibilities. And you write one conclusion of the story, each time you play.

With your help, we hope to explore many more in the sequel and its follow up expansions.

(the canon ending is the AI winning, of course; the first campaign's claim to the contrary was obviously treason... ok, so I didn't put the snarky humor completely away)

Whoops!

Incidentally, in Fallen Spire, Dorothy Langstrom says of her husband "He disappeared many years ago, before the end of the civil war", and Dr. Davidson speaks of him as making "contact with the Spire years ago". This conflicts with the journals in Destroyer of Worlds quoted above, which imply:

1) The game starts right after your flight from the Battle of Sol.

2) When Richard Langstrom sent that message, he expected the Core's (the AI's) forces to reach Sol soon.

3) Right after that message, he expected to follow the Core out of the galaxy. So presumably the time between his disappearance and leaving the Milky Way is considerably shorter than "many years".

I never noticed that internal inconsistency in Classic until a few days ago when I was re-reading the journal entries while working on this post. The Destroyer of Worlds account is the correct one.

Up Next

Next update will probably be Wednesday or Thursday. If you hit the Spire stretch goal before then I'll have our good friend the Devourer Golem come tell you about the Nemesis and his stretch goal. Why the Devourer? You'll find out...

Otherwise I'll move on with the next part in the AI series, talking about the targeting algorithm that powers most of the combat in the game.

Second Combat (Prototype Squads) Video
over 7 years ago – Mon, Dec 12, 2016 at 12:38:19 PM

Chris here!  Thanks for all the kind words on the first video.  We're getting really close to having the Spire stretch goal hit, and then it's on to the Nemesis!  I expect that will happen over the weekend.

This new video has a lot of rough edges that need to be shaved off still, but I have a date with my wife tonight and ran out of time to keep shaving (the rough edges, not my face -- still time for that). At any rate, just like the last video, this one takes an exploratory look at combat.

 

This video shows the difference in clarity and dynamism when you add in squads, even in the kinda-janky form that you see them here.  You'll note that's in direct contrast to the one last week, where there were no icons for ships (would have been super cluttered), and ships had very little sense of z axis depth to them. Even being early on with making these smooth and proper looking, it already makes a huge difference. 

Most of this past week was spent on getting the interface between my front-end liar-liar visual layer and Keith's invisible-simulation-at-low-FPS layer more fleshed out (read: closer to the first alpha for backers), and that progress went really well.  I'm really trying to get out of the situation where I'm bottlenecking him from doing much work, and we're nearing the time where that won't be an issue anymore.  That's been balanced against the need to do stuff for the new combat video, though, and so you'll note the quality of the video suffered some for that; I didn't have time for all the extrapolation and lerping work that I wanted to do, but I can do that next week.

I spent a bit too much time prematurely optimizing the squads code (despite appearances, heh), and so that set me back on actually implementing their visuals fully, too. I know better than to do that, but sometimes... oh well. ;)  I figured out a lot of cool techniques for making the player colors definable in xml with custom materials and a whole host of other useful things in that area, but it took a lot of design work that I hadn't planned on -- but hooray, new feature for you!  Before it was just going to be the gimbal/icon colors, which is a lot less neat.

Anyway, now that squads are implemented into the game itself in a functional-but-some-funny-bugs form, it will come time to polish out those bugs for next video (next week). I think this is a pretty fun video of the WIP that is there right now, and I don't mind showing you janky bits where we haven't polished every last thing if you don't mind seeing them. That's a natural part of the process, but even by the first alpha version to backers I wouldn't want to have that. (Heck, not by the next video, even).

Thanks again for watching, and for supporting this kickstarter!

Chris

The AI From Within - Part 2: Places To Go
over 7 years ago – Mon, Dec 05, 2016 at 07:41:43 PM

Keith here. Previously we looked at an overview of the different parts of The AI. Today we'll go into detail on the central piece of logic: the individual AI ship asking over and over again: "what shall I do?"

Look, there's an AI ship! (yoink)

 Let's ask them: So, Mr. AI Ship, how do you decide?

(sounds of lasers firing)

(Keith’s Note: ship was reprogrammed to be more cooperative.)

Trying again, So, Mr. AI Ship, how do you decide?

Ship: Is that a herring sandwich? No? Oh. Anyway, about that priority logic…

Am I on a Mission?

First, do I have have a Galaxy-Wide-Chase Target? This is used for certain special ships and for ships in an Exogalactic Strikeforce.

This algorithm is very simple: Charge & Attack.

Charge: If I'm in the target's system, pursue it. If I'm not, find the shortest path to the target's system and move to the next system on that path.

Attack: There's no nuance here, no waiting for an advantage. If I'm in range of the target, I start shooting. Otherwise I shoot at whatever floats my boat, while I bumrush the target.

Death or glory!

If I don't have such a target, proceed to the next section...

Is there something important to smash?

Just inflicting casualties doesn't usually help much. Human players regenerate faster than trolls. So let's see if there's an irreplaceable human unit in the system worth pursuing.

Irreplaceables obviously include the Ark, but also Advanced Factories and other production facilities that the human can't rebuild if destroyed.

There are some caveats: if my controlling AI has the ChivalricAI trait, ignore non-combatant irreplaceables. Also, some irreplaceables are ignored unless the AI has local superiority in the system. Finally, if the irreplaceable can leave the system (e.g., a Golem) and I'm not in an AI-controlled system, look for a better, juicier target.

Next I have to consider shields. Humans are really sneaky and like to bury their irreplaceable units under piles and piles of shield generators. Then while you're uselessly hammering on the shield the human ships laugh at you and put "kick-me" signs on your back. So if I don't have many local friends I'll ignore something under a shield.

However! If I have a lot of friends in the system who are good against shields, and they're not too busy, it might just be worth a go. Specifically, if all those friends have enough firepower to knock down the shield in less than a minute, I'll ask them to crash the party.

In the happy circumstance that the human has one or more unshielded irreplaceables, I prefer the one with a higher assigned value. In case of a tie, prefer the one with a smaller nearby allied military presence.

But even if I found a good irreplaceable target, I need to take a broader look...

Is this crowd my kind of people?

Next I consider the local balance of power.

For one, are there enough enemies in this system for me to care? To win, my fellow exterminators and I have to press any available advantage or opening. It's not my goal to stick around to kill every last human unit in a system before moving on. Of course, if I'm a Guard ship I have to stay here until the humans antagonize me.

On the other hand, what if there are enemies? What if there are a LOT of enemies? To win, my fellow misanthropes and I generally need to amass a large enough group of Threat ships to overwhelm the human fleet and defenses. So if I'm in a hopeless fight, I'd do better to retreat and rally later with a larger group of friends. That said, the irritating programmer requires me to wait at least 30 seconds after entering a system to consider retreating (if my controlling AI has the Cowardly AI trait it's 5 seconds). I also stick at it if there are enough Threat ships in the galaxy to simply overrun the humans, because then it's time to solve this infestation problem.

One important caveat: if the human Ark is present, and not covered by shields, I never retreat. I go for it. BANZAI! This logic is a carry-over from happier days when the thing couldn't run away, so maybe you sneaky humans will exploit this somehow. If so the programmer will be receive angry binary messages until a logic update is provided (along with heated leather seats and powered windows!).

But what if things are as they should be, and my side has massive local superiority in the system? Then I need to decide if I'm really needed here or whether I can move on and leave the cleanup to others.

In that case I check how many of my friends are already planning to stay here (notably, any in a Threat Fleet or Special Forces Fleet). If these guys have more than 10 times the strength of the local human infestation, I’ll go look for another party while they clean up. You can thank RockyBst for this behavior. Thank you RockyBst!

So, where do I have lunch?

If the previous algorithm concluded that I’m not needed here, where do I go?

If I'm retreating, I just find an adjacent system where the humans don't have such a local advantage. If there are humans everywhere, I just pick a random adjacent system.

If I'm in a Threat Fleet or Special Forces Fleet, the decision's already been made by the fleet algorithm and I obey that. Orders are orders, after all. (Keith’s note: We’ll go into details on their decision making when we get to their part of this series).

Otherwise, if one of my home or core systems is under attack and needs my help, I’ll go there.

But if I'm just a normal Threat ship and there aren't any emergencies back home... well, now I'm getting into the meat of the algorithm. Except it isn't meat, because I'm not a meatbag. Like you.

First, I look at every system in the galaxy and determine the total desirability of all important human targets in that system. I also determine how much strength the humans have locally and in nearby fleets.

Second, I consider how eager I am to attack. If the human's mobile strength is largely engaged outside human territory, I’m much more likely to give it a try. On the other hand, if my controlling AI has the Cowardly AI trait, I’m a lot less eager.

Third, on each of those systems I deduct the local AI strength to arrive at a balance of power.

Fourth, starting with my current location, I work outwards calculating the difficulty of reaching and attacking each infested system. Further away systems are more difficult to reach due to the extra hops and any heavily human infested systems are further penalized. (It’s all the junk-food wrappers. Could you guys clean up after yourselves?)

Fifth , I sort these systems by difficulty categories and the juiciness of the irreplaceable targets present.

Then I look at the first system in the list. If the Ark is there, that's where I go. Otherwise, I have a 2/3rds chance of picking it anyway. Otherwise, I check the next system in the list and so forth.

What to do when you're the only one on time

Life as a Threat ship is frustrating. Sometimes you get a juicy undefended target and it's just great. But most of the time those annoying meatbags block the way with all kinds of nasty, pointy defenses. So even if you have a destination system, it's often not the greatest idea to just waltz in the front door as soon as you get there.

If I’m about to enter a system where the humans have local superiority, I’ll generally wait some distance away from the wormhole. In the meantime, others may attack that system or join the siege. Once the balance of power has tipped in my favor... It’s party time!

Furthermore, if there's an Exogalactic Strikeforce just about to hit the target system, I'll also consider their strength. Generally, as a team player, I’ll try to kick down the door for them and take the hit so the Exo retains enough strength to accomplish its mission. Unlike selfish humans, I’ll willingly throw myself under the bus for the greater good. No resentment here! No worries over dashed hopes and dreams!

On the other hand, if I’ve been waiting five minutes or so, I'll give up on the waiting and go join a Threat Fleet. It's like joining an interstellar motorcycle gang, only with more explosions. (Keith’s note: We’ll go into details on their decision making when we get to their part of this series)

Proper etiquette when exterminating player units

All that routing aside: If I am where I need to be, and there's a fight, I now have to decide what unit to go after. The earlier questions about irreplaceables are important but not always decisive.

If I'm one of the most deadly AI ship types, I may have the special Bullheaded targeting algorithm. This gives me very simple and effective priorities on what key control and defense structures I need to kill, because I've got the strength to get the job done myself.

But normally, if there's an eligible irreplaceable to go after, and this is not an AI-controlled system, I have to decide whether to join a full court press to take it out. If my side has overwhelming local superiority in the system, or there's so many Threat ships in the galaxy that they can just swarm the humans, I'll go for it.

Otherwise, I just need to find some appropriate human unit to maim.

So I look at all the enemy units in the system. Some I will disregard because I can't effectively hurt them. I then sort the remaining ships by my targeting preferences (I’ve always hated the green ones the most) and pick one of those to pursue.

The preference algorithm is amazingly complex and delicate code, the best really. Let me start by... (Keith’s note: Blah blah blah. Moving right along). Fine. So I shoot the green ones.

… or I calculate the optimal impact efficiency of my siege-plasma torpedo relative to the..

Keith’s note: As you were saying, the green ones...

Fine. So I shoot the green ones. <Insert remarks concerning Keith’s ancestry>.  

(Ship mysteriously explodes)

Up Next

I hope you enjoyed those, er, insights. My next post will probably be on the lore (meant to post that today, but it's not ready). Next time in this series we'll go into the target preference algorithm. This one's very important because it's also used for any situations where any ship's weapon (human or AI) needs to decide which target to shoot at. One of the greatest things about AIW classic is how you can generally trust your fleets to pick targets well, and getting them to do so ain't easy.

Until then,

Keith

First Combat (Prototype) Video
over 7 years ago – Mon, Dec 05, 2016 at 08:10:36 AM

Chris here.  Tell me... do you like sausage?  Okay -- do you like to see how the sausage is made, then? ;)

This video is a look at the visual side of combat, which is a work in progress. I talk about some of the things that are done, and some of the things that still need to be done. It's very much a "how the sausage is made" sort of dev diary, essentially, but I'm pleased with what it shows.

As Keith put it, though: "Meet Wilbur. Wilbur is a pig. By the end of this video, Wilbur will no longer be a pig. But we will, for some reason, have lots of sausage."

Yep, pretty much. ;) If you've not followed game development internals much before, don't worry: things change shape and look a lot better fast. I know the ships are tiny and impossible to see, and that helps to actually underscore my own point about why squads -- not shown here -- are so important.

This also does go to show how there's a slight bit of height to the game despite it remaining a 2D simulation -- without squads confusing the image, this is a much more 1:1 comparison to AI War Classic, which I figure is a nice step in between "no combat" and "combat with squads."

Minor Visual Issues

If you look closely, you'll notice some things like the contrails disappearing immediately when a ship dies, or shots actually "hitting" a target and disappearing before they quite reach said target.

This is because there are two distinct layers to the application, one controlled by Keith, and one controlled by me.  The top layer, which is what you see, lies a lot.  That's my layer: my job is to lie to you. ;)

Specifically, the underlying simulation is (presently) running at 10fps, because frankly there's no benefit to calculating it any more precisely than that.  It just adds extra load for no benefit.  In Classic, we ran it at 20fps becaue the on-screen display and the underlying simulation speed were completely tied together.

In this video, however, you can see that at various points I'm running in the foreground at 300fps, occasionally 30fps or so, and usually around 100fps.  This was on a GTX 1070, with an i7 quad core, with the game semi-optimized in my layer.  There are a variety of calculations, some of which I note in the video, that can be skipped based on distance or camera orientation, or when squads are added to this version of the code, and the performance load from my part will plummet.

Anyhow, the "lies" that my layer tells you are all about the position of shots and ships.

  • The underlying simulation (Keith's layer) needs to know VERY precisely where ships are to be consistent between machines, and it does so in a fixed-integer format (if you care), and using very coarse, fast, and precise math.  Lots of custom functions that we built up over the years in AI War Classic and beyond.
  • The front-end that lies (my layer) is aimed at giving you a smooth, responsive, pretty experience.  That means taking the underlying coarse information and smoothing it out for visual display, but only if you're looking at it.  And in some cases, only if you're close enough to see.  And so on.  So the nice smooth movement of ships at a buttery 300fps is actually interpolation between data from an underlying 10fps simulation: pretty awesome.

And when the load gets heavy, it can drop down to 30fps on the front-end without actually slowing down the underlying simulation at all... unlike AI War Classic.  This is a pretty major improvement, and you can see it in this video thanks to the semi-optimized nature of the front-end I was showing you.

As to some of the things like shots disappearing before they hit their target, that's because of a need to extrapolate, rather than interpolate.  I just haven't put that code in yet, but it's easy stuff.  

The front-end normally draws shots at a slight lag behind the simulation so that it's able to show them to you in a smooth fashion (and your input is based around my front-end, so there's no lag there at all; think of it instead as the underlying simulation being a bit precognizant, perhaps?).

However, when the underlying shot hits its target, it says "I'm done -- show an explosion and die and all that!"  Since shots move fast, they can still be quite a ways from their target when they hit.  It wouldn't be all that noticeable if they didn't have hit sparks when they impact things, but that really highlights the issue.  Anyhow, what my layer needs to do is say "he died THERE, and I'm HERE, so I need to interpolate over to where he died and THEN do the explosion bits."

That's not all that hard to do, and it's a pretty generalized set of code (do it once and it works forever sort of thing), but you'll notice it's lacking here.  It's kind of a neat peek into the sausage factory, if you like that sort of thing.

Models!

All the ships in there were using my shaders, and I'm really happy with how the special effects and wormholes and so forth came out, overall.  I'm sure I'll tune those over time, but in general that's coming along really well.

What is very temporary at the moment is ALL of the ship and structure models.  The building ones I created out of some "build a space station" prefab kits, which I then modified further with my own shader.  The ships that you see are either older ones that I created or that Blue created.

Remember that image from the last update that Blue showed?

That's more along the lines of what we're going to be aiming for, now.  Yesterday and today she and I had some long and technical discussions with lots of math and mocks and so on and figured out a really good way to use LODs (levels of detail) to basically give you high-poly ships up close, that have higher-resolution textures, and then go nuts with the batching and texture atlasing as they get more distant.

For a bunch of ships that are very distant, we might be able to do something like 5000 ships in one draw call.  During the video you'll notice that I was complaining about the shots not being properly batched -- well, that's both a problem with them from a close-up standpoint, as well as me simply needing to get a second LOD for them.  They're already very low-poly, but they should basically only take one draw call for all of the shots that are not pretty close to the camera.

Camera Angles!

Did it bug you how the camera pans down to a cinematic viewing angle when you get really close?  You pretty much have to go side-view to see the individual fighters, right?

Well, there are a couple of responses to that that I have:

  • Firstly, you'll be able to choose between several different "camera curves," that denote at which zoom it starts to angle sideways, if at all.  The default is probably going to be something along the lines of what you see here, though, because...
  • When you have squads and the little squad icons above them, you don't need to zoom in to the level of seeing individual fighters.  These are single-pilot craft that are meant to feel tiny on the scale that you're fighting at.  The (comparably) large space docks and similar are, however, pretty easy to see with no icons at all.  Things like the spirecraft will absolutely dwarf a space dock, obviously, however.

Other Stuff!

Hmm, what else?  Oh!  Music playback from mp3 (rather than ogg) is in, and is lower-latency than before, to boot.  Sweet!  I had it muted, though.

Actual sound effects were something that I have not had time to put in yet, though.  Those will be spatial and properly attenuated based on distance, etc.  All the fun tricks we picked up for Release Raptor, and then some.

Hopefully next week we'll be able to show you a version with squads duking it out.  There's a lot more interpolation in attacks in particular there, and more logic involved in making them shift between animation states smoothly and efficiently (moving into an attack pattern rather than swarming while moving, etc), and there are a variety of things on my plate that I want to get taken care of so Keith can continue his work on this properly.

Overall you've already seen the general idea of squads several times in past videos, but those were just in my own visual-layer without the underlying simulation-layer to go with them.  Hooking those up is where the rubber meets the road, so to speak, and it will take a couple of days to get really looking perfect.

That's everything for now.  Thanks for reading and/or watching!

Chris