Post news Report RSS Improving the AI

While the Soase AI is very good at fleet management there are several areas that it does not perform well.

Posted by on

Sins of the Fallen Logo

Sins of the Fallen: Improving the AI (Part 1)

First I'd like to say I think the Sins AI is really good and can make for some fun games. That said after modding multiple races you begin to see things the AI does not do very well especially when it comes to using advanced features of mods.

Unfortunately, as many of the regular's of Sins modding know, the AI is not very moddable. This of course leaves us with very little tools at our disposal to impact how the AI plays both in the core game and with our mod extensions.

So what is actually moddable that may improve the AI?

  1. How the AI prioritizes ships based on damage percent bonuses
  2. How the AI prioritizes things like ships, research, starbase upgrades, etc
  3. How the AI uses abilities
  4. How the AI performs research (it's worse than you realize) (part 2)
  5. How the AI upgrades star bases (part 2)

* This is running a bit long so I'll split it into two parts.

How the AI prioritizes ships based on damage percent bonuses

This is modded via the Gameplay.constants file as part of the DamagePercentBonus entries. Actually this works pretty well currently with getting the AI to attack the right targets. Might be be some opportunities though. I've considered removing the advantage the Human player has of targetting enemy capital ships by modifying these abilities changing what is anti-capitalship.
How the AI prioritizes things like ships, research, starbase upgrades, etc
This is modded via the Gameplay.constants file as part of the playerAISharedDef entries. I'll admit little is known about these entries. They appear to be a sort of priority to the AI that drives how much it performs of that particular grouping.

playerAISharedDef
options available

  • BuildShip
  • BuildModuleTactical
  • BuildModuleResearch
  • UpgradeResearch
  • UpgradePlanetArtifactLevel
  • UpgardPlanetPopulation
  • UpgradePlanetInfrastructure
  • MaxBountyBidCount
  • UpgradeStarBase
  • BuildMines
  • table-Aggressive - Focuses on ships(10)->bounty(5)->tactical(3)->research(2)-others(1)->mines(0)
  • table-Defensive - Focuses on tactical(6)->ships(5)->bounty(5)->starbase(3)->planet(3)->research(2)->mines(2)
  • table-Research - Focuses on bounty(10)->ship(5)->research(5)->tactical(3)->others(2)->mines(1)
  • table-Economic - Focuses on bounty(15*)->ship(5)->civilian(5)->population(5)->research,planet(2)->others(1)

* others simply means all the other options not listed are at that priority level.

How the AI uses abilities

There are lots of possibilities to improve the AI here in my opinion. Here's a few of the issues that can potentially be resolved with rebalancing or coding changes.

  • Synchronized targeting, specifically single target synchronized abilities like Suppression
  • Default aiUseTimes not taking advantage of new better conditions
  • Default aiUseTargetCondition not taking advantage of new or better conditions
  • Antimatter costs canceling out 2nd or 3rd abilities from being cast
  • Ultimates never executed by the AI (Example Resurrection)
  • Abilities never executed by the AI (Example Resource Focus)

Synchronized targeting, specifically single target synchronized abilities like Suppression
I actually have a fix for this that's already in SotF. To make the AI and by extension the player more effective with this ability I changed it from ApplyTargettedBuffToSelf to ApplyBuffToTarget. The synchronizing still occurs but is cast via a callback from the affected target. I still have some more to change for the custom races in my mod.

Default aiUseTimes not taking advantage of new better conditions
A lot of abilities could be improved for ai casts by tweaking the aiUseTime on abilities. Here's a link to the valid list of aiUseTime's.

Default aiUseTargetCondition not taking advantage of new or better conditions
While not as many options as aiUseTime there are some useful aiUseTargetCondition's that might be put on abilities with the goal of improving the AI. One condition that pops out is the isCapitalShipOrStarbase condition. This might be extremely useful for the AI on abilities like DetonateAntimatter or NanoDissasembler. This condition won't stop a player from manually targetting a frigate, but it will cause the AI to choose to target capitals or starbases. Another possibility for DetonateAntimatter is the AntimatterExceedsAmount condition as this ability only causes damage when there is decent amount of antimatter reserve. The main point will be review each Ability's aiUseTime and aiUseTargetCondition especially for those that are the Any types and see if any potential improvement can be made.

Antimatter costs canceling out 2nd or 3rd abilities from being cast
This one bugs me a bit with the AI as typically AM reserves and cooldowns work out to the same ability being cast over and over when the better ability remains unused. A couple of options present them self to help resolve this.

  • Rebalance AM, ai use/target conditions and cooldowns to ensure both abilities have a change to fire if appropriate. For example the Guass Blast and Flak Burst end up with Flak Burst rarely being cast during extended battles as the AM is chewed up by Guass Blast. In this scenario FlakBurst could be rebalanced to have a lower AM cost than GuassBlast but an aiUseTime of OnlyWhenManyTargetsInRange. This may require some rebalance to effect of the ability but will create a more dynamic AI.
  • Convert an AM using ability to a Passive. Again picking on the Kol..., The AdaptiveShield is a good opportunity for this type of conversion.
  • The onlyAutoCastWhenDamageTakenExceedsPerc could also be coupled with the rebalanced AM ai use/target conditions in the first bullet... For example AdaptiveShield could have a higher priority to fire based on AM, but only when it's exceeded a certain damage threshold.

Ultimates never executed by the AI (Example Resurrection)
While resurrection is the biggest example I'd like the AI to have more opportunity to execute Ultimate abilities.

  • For resurrection I intend to change this into an ability the AI will use. Basically any capital ship will have Resurrection applied to it once. It won't recast on a ship that's already been resurrected so only newly built ships will get the affect. Human players can still control this BAU.
  • For other ultimate abilities I'm thinking about dramatically reducing their AM costs and increasing cooldowns as I want the AI to prioritize using them. As it currently stands the AI will never disable it's other abilities like Radiation Bomb to store AM for Missile Barrage. By decreasing AM below normal abilities all level 6 capitals become dangerous even in extended battles.
  • I'll still look at the previous changes to help the AI make better decisions about when to cast ultimate abilities.

Abilities never executed by the AI (Example Resource Focus)
This bugs me too and considering resource focus isn't that big of an impact I'm considering making it a passive ability and possibly reblancing it some to compensate.I guess I should add one more thing to the mix... Abilities that activate too much. Sorry, but the phase out hull on Vasari structures is going to get changed to an AM based ability. This one just bugs the shit out me trying to take down Vasari structures

Post comment Comments
MrPerson
MrPerson - - 1,801 comments

the zombie race, (forget actual name now :p) they build capital ships like mad, they normally have all their capital ships in one or two fleets. they beat the crap out of the other npc's fleets and are quite a nusance for me because they keep running away, and I only get one or two before they get away.

Reply Good karma Bad karma+1 vote
ZombiesRus5 Author
ZombiesRus5 - - 1,642 comments

The AI is a bitch with the Plague race. It's partially why I wanted to help the AI improve as it actually does a decent job with this race. Which of course made me ask the question why? which prompted all the other things I'm looking at.

I'm sort of thinking about making this an optional Hard AI addon for those that need the additional challenge.

Reply Good karma+1 vote
MrPerson
MrPerson - - 1,801 comments

hmm AI can be strange picking what it wants to be good at. Maybe the plague corrupted the AI making it work better for them but worse for the others >:)

Reply Good karma Bad karma+2 votes
Post a comment

Your comment will be anonymous unless you join the community. Or sign in with your social account: