AI TweaksDownload v2.0.3Also available on
GITHUB REPO.
DescriptionAI Tweaks provides various improvements focused on ship AI and AI-assisted player support.
The key features of AI Tweaks are
autofire AI written from scratch,
custom ship AI created mostly from scratch,
automatic omni shields and aim assist for the player’s ship, and various upgrades to vanilla AI. AI Tweaks also allows players to configure the personality of automated ships in their fleet. A full description of all features is available at the bottom of the post.
ShowcasePD beams with improved aiming AI:
https://vimeo.com/1026930513Balance notesThe AI changes may disrupt the game balance to some extent, as the ship defense AI is not adjusted to counter improved weapon usage. There's a
forum thread featuring insights from Starsector developer Alex on certain aspects of AI modding and their effects on game balance.
Additionally, Vanilla AI is designed so its actions resemble those of a human. Certain AI limitations, such as reaction delays, are intentionally implemented. You can read more about this in this
forum thread. AI Tweaks does not share this design goal, so you may notice some uncanny, machine-like behavior.
InstallationRequires
LazyLib and
LunaLib. The mod can be safely added to existing saves.
To install AI Tweaks, just unzip the downloaded archive into Starsector mods folder.
UninstallationAI Tweaks can be safely uninstalled without affecting existing save games.
NOTE: Uninstalling AI Tweaks from a save that also uses
Starship Legends may result in save game corruption.
Otherwise, AI Tweaks and Starship Legends are fully compatible.
CreditsI took a lot of inspiration on how to code AI Tweaks from DesperatePeter's
AdvancedGunneryControl mod. Especially the method of attaching AutofireAIPlugins to existing ships and preserving the underlying vanilla logic. If you want even more customizable weapon behavior, AdvancedGunneryControl has it!
Ships rotate to aim hardpoints and correctly handle broadside builds
With AI Tweaks, ships can finally aim hardpoints. Just imagine how powerful an LP Brawler becomes when it can consistently hit its target! This change is enabled for all ships, whether or not they are equipped with the Custom AI hullmod.
https://vimeo.com/1030111629The upgrade also allows the AI to handle all types of broadside builds, such as the symmetrical Conquest or broadsiding
Onslaught:
https://vimeo.com/1050582068In addition, this improvement fixes the bug mentioned in this
forum thread, where broadside ships revert to front-facing behavior when issued an escort order.
The fix applies to ballistic and beam weapons, but not missiles.
Fixed Invictus and Lidar Array AI
"Cuz my problem with ai invictus is it just wastes it’s system 9/10 times" - niceman121454 on Discord.
With AI Tweaks, not anymore.
Vanilla Lidar AI has several deficiencies. Most notably, switching target in the middle of Lidar burst, described in
Uniquifying the Factions blog post: "For example, the lidar array AI might decide to activate it, while the “main” AI decides that it’s a good time to turn the ship away its current target and attack a different ship." The blog post describes a solution employed in vanilla, which doesn't seem to work.
Other deficiencies are backing off too far from the attacked target and loosing it from weapons range and poor flux management.
AI Tweaks fixes all of the above and turns Invictus into a truly overpowered - unbalanced even - brick of a ship.
Invictus aiming hardpoint weapons with the entire ship, note the aim is not centered at the target:

Improved High Energy Focus ship system AI
This mod changes the way AI controlled ships use their High Energy Focus system. AI will no longer be tempted to activate HEF just because there's a fighter or missile in range of PD beams or because an enemy ship can barely be reached by a Graviton Beam. The precious HEF charges will be preserved for big guns instead. Best use case is of course the mighty Executor. With two linked Gigacannons and officer with System Expertise almost every salvo will be spiced up by High Energy Focus!
Shield assist for player ship
Vanilla AI is notoriously good at controlling omni shields, often better than the player himself.
Now, with AI Tweaks it's possible to pilot ship manually while leaving shield in AI control. Be warned though. According to playtesters the feature may be a bit too powerful. Still, "it's not so OP that it's unusable" as playtester snark said. The assist works for both omni and front shields.
Shield assist can be toggled with `]` (right bracket) key by default. Keybinding can be configured via LunaLib settings. When AI is in control, a circular indicator is displayed around the ship. The player can override AI and force the shields to drop with right mouse button.

Aim Assist
Aim Assist helps the player by automating target leading. With Aim Assist, you can simply point the mouse at an enemy ship and fire without worrying about projectile travel time. The AI automatically offsets manually controlled weapons to account for both target and projectile velocity, significantly improving accuracy.
Aim Assist also enhances hardpoint aiming by adjusting the player ship’s rotation in "auto-turn to cursor", or STRAFE LOCK mode. This works with all non-guided weapons, even those not facing forward. And yes, Aim Assist can make the Venture Mk. II fly backwards. You can disable this ship-rotation feature in LunaLib settings.
Manually piloted Nova in STRAFE LOCK mode rotating to aim selected weapons at the enemy ship:
https://vimeo.com/1041836748Aim Assist is toggled using the `[` (left bracket) key by default.
When active, an AIM ASSIST status icon is displayed:

Changing the personality of automated ships
Vanilla AI forces reckless behavior on all automated ships in the player's fleet, with AI core captains and without, presumably to maintain game balance. This results in automated ships rushing headlong into enemy deathball and getting themselves killed in the most frustrating manner.
AI Tweaks allows to configure the personality of automated ships. The configuration is made via the LunaLib settings and is global, affecting all automated ship in the player's fleet. If no specific personality is configured, the automated ships will default to aggressive behavior, instead of the vanilla reckless.
Finisher Beam Protocol hull mod
A hull mod that changes how ship AI uses several beam weapons:

"A set of software modifications and officer training routines designed to modify the firing behavior of certain beam weapons. Under the Protocol, the modified weapons are inhibited from firing at shields. This allows to reliably hit exposed hull surfaces the moment the shields drop and to conserve flux capacity. Affected weapons are burst beams like Tachyon Lance and Phase Lance, as well as High Explosive beams like High Intensity Laser. The Protocol is active only for weapons in autofire mode and does not affect point defense beams."
DetailsThe hull mod prevents selected beam weapons from firing at shields by adding USE_LESS_VS_SHIELDS tag. Additionally, the weapons are prevented from shooting at fighters.
For a weapon to be subject to Finisher Beam Protocol, it needs to have FINISHER_BEAM aiTweaksTag in
its /data/weapons/weaponId.ait file. And, of course, it needs to be a beam weapon:
{
"aiTag": [
"FINISHER_BEAM"
]
}