So I've finally tackled what I think is a good foundation for modding pacts, while maybe not ideal support the goals of my mod they are within the limitations of the game's moddability.
Another goal of mine has been to improve the AI as much as possible.
What we know is the AI is not very moddable, so we have to look at this from the constraints that are available.
So what areas do I see as potentially AI improving options...
Gameplay.constants:
DamagePercentBonus - Actually 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.
playerAISharedDef - Something I haven't really invested any actual time in. I'm hopeful some tweaks here might prove fruitful.
playerAISharedDef
- 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)
* is 15 the highest value?
options available
- BuildShip
- BuildModuleTactical
- BuildModuleResearch
- UpgradeResearch
- UpgradePlanetArtifactLevel
- UpgardPlanetPopulation
- UpgradePlanetInfrastructure
- MaxBountyBidCount
- UpgradeStarBase
- BuildMines
I'm wonder if these can be turned into Difficulty levels as one option. Another option may be to slide these values up or down to adjust how the AI behaves.
It would be curious to see how the AI behaved if all the values excluding mines and bounty were set to 15.
I may also try some variations that slide values up or down based on AI behavior. For example, I dislike seeing un-upgraded starbases.
aiRetreatThreshold - from what I've gathered reading other posts this is a strength test with lower values resulting in longer battles and higher values resulting in a quicker retreat.
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)
Single Target Synchronized abilities
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.
So far I've changed Suppression, DisableImmune, TransferAntiMatter, DesignateTarget
Default aiUseTimes
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
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
Star Bases
The AI never does anything cool with these!
Why? Because it put's all it's upgrade points into Weapons/Toughness/Strikecraft before it even thinks about a different upgrade type.
This results in fairly boring usage of Star bases by the AI...
Solutions?
- Decrease the amount of upgrades available for Weapons/Toughness/Strikecraft
- Increase the amount of upgrades allowed for a Star Base from 8 to ?
- Add instant low level access for all star base upgrades
Decrease the amount of upgrades available for Weapons/Toughness/Strikecraft
In essence this would simply make additional upgrades available for Trade, Block Colonize or other special abilities
Increase the amount of upgrades allowed for a Star Base from 8 to ?
Simple enough increase from 8 to whatever. Downside is a lot more resources are needed to upgrade the starbase.
Add instant low level access for all star base upgrades
This one is intriguing. Essentially you could make up for the lack of dynamic behavior on the AI by forcing it to have upgrades that a human would most likely get anyway. Downside is the human gets these as well.
Generic Stuff
Spamming of mines by Advent drone hosts
Ok, I actually fixed this in my mod by removing mines from the carrier and creating a separate mine host similar to the Vasari mine layer.
m_weaponIndexForRange
I can't recall on this one but if I change the m_weaponIndexForRange to 1 for the Vasari Starbase will that prevent the other weapons from firing until it's in range of the antimodule weapons. I want the Vasari starbase to engage all it's weapons instead of staying out of range with it's anti-module. If this does cause issues I'm going to rework weapon ranges to ships and star bases with multiple weapons to be more effective.
maybe some other stuff I haven't considered yet...