Fractal Softworks Forum

Starsector => Mods => Topic started by: xenoargh on April 16, 2016, 11:34:51 PM

Title: [0.81a] StarSector AI Overhaul, Alpha 0.91a
Post by: xenoargh on April 16, 2016, 11:34:51 PM
This is the Alpha release of a public-code, fairly feature-complete AI that works with Vanilla.  It largely replaces all of Vanilla's AI systems under the hood at this point, including some support for System AIs that call Vanilla's System AIs.  While this AI isn't perfect, it substantially improves the performance of Starsector in large battles.

It's Alpha, and there are a few bells-and-whistles that don't work or are in need of improvement, but I think it's finally ready for some public testing and comment.

If you hate TL:DNR:
Download Link Here (http://www.wolfegames.com/TA_Section/xeno_mod_pack.zip)
Requires LazyLib, if you don't have it already. (http://fractalsoftworks.com/forum/index.php?topic=5444.0)

This mod is part of my Mod Pack.

Historically, this AI is an extension of and refinement of the AI I originally wrote for Vacuum (http://fractalsoftworks.com/forum/index.php?topic=4292.0), with a lot of improvements and support for Vanilla features I didn't have in Vacuum (in particular, friendly fire being a thing).

This mod provides:

1.  A common framework for developing new mods for StarSector that is mainly public code, except where StarSector's API is utilized.
I.E.: the code comes with the mod and yes, you can feel free to modify it and redistribute it, so long as you're using it within StarSector.  You may also include specialized builds for specific modded ships, in your mods, etc., if you're that ambitious.  
Feel free to study how it works if you want to develop practical game AIs, too, but please don't just copy-pasta the core of it into a commercial game, thanks.
2.  A fairly well-documented codebase for building new AIs to handle various behaviors in Vanilla without having to reinvent too many wheels.
3.  An AI that, while imperfect (see Caveats, below) will give most players a reasonably-good game challenge and better performance in large battles.
4.  Very fast performance; the AI and its sub-components are fairly well-optimized, if not perfectly so.
5.  AI support for auto-fire weapons that is pretty lean and mean, using the structural optimizations in the base AI.
6.  AI support for most, but not all, Missiles (see Caveats), using the structural optimizations in the base AI.
7.  AI support for most, but not all, Drones (see Caveats), using the structural optimizations in the base AI.
8.  AI support for all of the Vanilla Systems, using the structural optimizations in the base AI.
9.  Supports modded Systems that have an AI script defined in the .system file.
10.  Unless Alex does something radical to how ModPlugins work or how fundamental calls to Global work, it's pretty future-proof, so we can use this as a base for future work on this area of SS modding.
11.  Now supports "blacklisting" of specific hull ids; hulls blacklisted will not use the AI for the ship, the ship's weapons or Systems.

Structure

Each weapon on Autofire, ship on Auto-Pilot and guided missiles / drones (with a few exceptions, see Caveats, below) is assigned an AI via data.scripts.SS_AI_ModPlugin.  This is fairly well-documented code, explaining how and why different AIs get assigned to different things, etc.

Once the AIs are assigned, depending on the AI, different things happen, obviously, but:

The AIs all use a common data system; this is part of what makes the AI very fast, by reducing search scopes, etc.  This is located in data.scripts.plugins.ShipThreatPlugin.

The AIs call some common methods that are useful and that I (gradually) have cut out duplicates of, etc. to de-clutter the source.

Each ship AI instance calls a number of methods in various classes outside the main class.  This was done mainly to de-clutter the main ship AI class so that it's easier to read.

Auto-fire AIs operate completely independently of Ship AIs; this is by design.

System AIs operate completely independently of Ship AIs; this is by design.



Caveats / Mea Culpa

1.  The AI doesn't currently support the Avoid command and is, in general, a little weaker in terms of supporting Command Point commands than it should be.  You'll see that this is somewhat less-necessary than it is in Vanilla, however; the current (crude) threat-management system does a pretty good job of keeping Frigates from attacking far-more-powerful enemies, for example.
2.  The AI's support for Omni Shields is pretty basic atm, and rather easily exploited.
3.  MIRV missiles aren't supported at all atm, due to being unable to get the data I needed from the SS engine atm.  Alex says there will be a fix for that, probably not until the next major SS update, though.
4.  Drones that use a strict formation aren't supported at all because of other engine-side info I need but can't get (easily / quickly).
5.  The Phase Cloak AI is pretty lame right now.  I think it'll have to wait until I re-write my threat system.
6.  There are probably a bunch of other little problems, goofs, extraneous / inelegant code sections and areas where my documentation fell a little short of ideal.  The threat system is very inefficient and inelegant atm and there are some ugly kludges in places where we'll almost certainly have some proper JSON support later on, like missile engine-ignition timers, etc., where I couldn't be bothered this round.  Please don't hate on me, I've been Rather Busy for the last year and a half and have only just now had a period of something like free time to get this thing finally ported out of Vacuum, fixed up and moderately polished so that it's something moderately like Ready.
7.  If you think X sucks, fix it, document how the fix works... and send me a fix.  Eventually you'll be able to just fork this, when I think it's ready for Git access, but until then, treat this work in the spirit it was given to you.
8.  The AI probably has some major ways to exploit it that I don't know about, because I couldn't test every possible squirrel case or weird tactic that could break it.  That's OK; we can learn from these things.  Just let me know how you exploited it, so that we can all discuss fixes.
9.  If you want to write a System AI that makes use of the structural improvements that make the base AI fast, that's non-trivial; we can talk about that later on, if this proves to be a popular project and we all want to use this.  Right now, just leave your System AIs alone and they'll Just Work, so long as they don't need AI Flags set.

Lastly... I don't think there are any crash bugs left, but if there's anything I've learned from SS modding, it's that a public release inevitably means that Nature will provide the millionth monkey, hah.
Title: Re: (0.7.2a) StarSector AI Overhaul, Alpha 1
Post by: Morrokain on April 16, 2016, 11:58:54 PM
 ;D Pretty excited to break into this at a later date to see if I can write a few AIs for a couple things I want to bring to my mod! At the very least I want to test the difference that this AI has over vanilla! Cool stuff Xenoargh!

Title: Re: (0.7.2a) StarSector AI Overhaul, Alpha 1
Post by: Dark.Revenant on April 17, 2016, 12:17:02 AM
Quote
System AIs operate completely independently of Ship AIs; this is by design.  Alex's system of AI Flags is not currently supported; modded System AIs that depend on Flags will fail or will operate in weird ways.  Perhaps later I'll support this, as it's a reasonably-good method to communicate efficiently and it'd make modded AIs that expect that work, but very few do atm.

Note that this will break some II/SS+/Templar/THI/Exigency system AIs and degrade most of them.  AI flags are a good forward-facing way to cheaply add checks for things that are generally quite difficult to calculate, and ultimately match what the AI is already doing.  It is absolutely worth supporting.

You might want to amend your statement from "few" to "most".

Also, if you haven't done this already, I SERIOUSLY suggest implementing this mod as two parts; one, a vanilla AI replacer; two, a library.  Being able to use your AI as a framework for specific AIs to put on exceptional ships, is valuable to many developers who would rather NOT replace the vanilla AI on most ships.
Title: Re: (0.7.2a) StarSector AI Overhaul, Alpha 1
Post by: xenoargh on April 17, 2016, 11:25:54 AM
I'll see about the AI Flags when I'm done rewriting the threat code, add support for Avoid, add a few more methods to move things out of the main state machine, etc.  These are higher priorities atm.

I wasn't aware that AI Flags had finally started to get used- the last time I looked at that, hardly anybody was bothering.  Supporting them in a reasonably-good fashion is non-trivial but it's probably not too much work and won't slow the code down much if it's done sensibly.

It's already basically ready as a library; see how it's broken down into method toolsets.  The ship AI basically calls methods for most of the heavy stuff at this point and will probably become entirely based on that model, so that it's really clean and generating new behavior for <specific activity> is largely just writing / altering the method for <specific activity>, rather than digging through the entire state machine. 

There are a few things where it's not doing that yet (for example the Command interpreter) but it's the direction it's going.

It'd need some minor structural changes so that it'd be efficient in that use case, however; the baseline is primarily designed to replace the Vanilla AI wholesale and that's my primary interest, frankly.
Title: Re: (0.7.2a) StarSector AI Overhaul, Alpha 2
Post by: xenoargh on April 17, 2016, 10:53:24 PM
Alpha 2; improved threat-management system for better speed and possible future improvements; Omni shield management is a little more solid.  Please let me know how well it's playing atm.

Next step is to make the core of the ShipThreatPlugin work for mods that merely want to run a single AI instance but keep the core efficiency of the AI and not have to reinvent wheels, rather than replacing the entire Vanilla AI; I'll set up a way to do that that is convenient to coders who just want to work on specific AI behaviors, etc.

Then I'll work on the Command interpretation a bit more, so that that is reasonably tight before looking at AI Flags.  I will probably take a brief break before I get to that, however, to get another prototype project to the point of alpha, as it's something that rather needs doing.
Title: Re: (0.7.2a) StarSector AI Overhaul, Alpha 2
Post by: Wyvern on April 18, 2016, 02:53:01 PM
Ooh, shiny.  This goes on my "Must play with this next weekend" list.

Interestingly, the only interesting ship system AI I wrote - the AI for the Shadowyards Tartarus - does support AI flags, mostly because the vanilla ship AI got really confused when it didn't.
Title: Re: (0.7.2a) StarSector AI Overhaul, Alpha 3
Post by: xenoargh on April 20, 2016, 09:50:44 PM
Alpha 3; vastly-improved threat-management and targeting system; major speedup in the ship AI sub-system responsible for targeting. 

The load on the ship AI pretty much disappeared and we're back to PDAI being the "cpu hog" of the collection, at < 1% of total cycles used on average during combat.  Still looking at what should be done to facilitate individual AIs; probably the best method's the simplest, an instanceof check that prevents data collection and all of the distance checks if a root ship isn't an instance of StandardShipAI or a class that implements it.  Same with weapon AIs, etc., since they're dependent on that data to function.  There may be some order-of-operations issues there; will have to check it out.

I'm pausing before working on that problem (and then getting on to AI Flags support, Command interpretation, etc.) to get another project done; it's something that should be pretty quick to get to an alpha state, though. 

I'm aware that the current AI has some obvious flaws, but I think it'll do for some testing and feedback (i.e., let me know where it's still horribly bad, etc.).
Title: Re: (0.7.2a) StarSector AI Overhaul, Alpha 3
Post by: Cycerin on April 21, 2016, 07:40:55 AM
This would be very useful as a library.
Title: Re: (0.7.2a) StarSector AI Overhaul, Alpha 3
Post by: xenoargh on April 21, 2016, 06:40:28 PM
It's fairly close to working that way now; I'll probably split it into two packages soonish, but little bits of the core need to be prepared for that use case, so that it's efficient in that scenario.
Title: Re: (0.7.2a) StarSector AI Overhaul, Alpha 3
Post by: Deshara on April 23, 2016, 12:36:19 PM
Oh my goood I've been waiting for this. The way that fights and escort groups prioritize remaining in formation over everything else and won't, if their escort target is harassing an enemy target because it's a close support ship and its target is an assault/strike vessel they just sit there next to it uselessly until the enemy is within range to target the close support ship instead of recognizing that the enemy is within engaging-distance of the ship they're supposed to be escorting and essentially being switched to engage the enemy until the ship they're escorting disengages, and now there's hope of that being fixed and I can stop bugging Alex about stuff that would probably require a massive reworking of the entire combat system!
Title: Re: (0.7.2a) StarSector AI Overhaul, Alpha 3
Post by: xenoargh on April 25, 2016, 03:03:47 PM
The behavior you've just described doesn't happen with this AI, generally speaking; at worst, your escorts will hang back from heavy engagements because they're scared of the enemy's total strength in an area. 

I'm still working on my other little project atm, so I'm still not done splitting this out into a library / utility mod and the active part yet.  I'd like to get more feedback about how it's working for people before I do that, too, to make sure there aren't any really major issues remaining.
Title: Re: (0.7.2a) StarSector AI Overhaul, Alpha 3
Post by: gofastskatkat on May 03, 2016, 01:06:33 PM
hey, im not sure but i think that this error is because of the ai mod, i havent had time to mess around with it but if you could look into it http://pastebin.com/PVbVmgfg
Title: Re: (0.7.2a) StarSector AI Overhaul, Alpha 3
Post by: xenoargh on May 03, 2016, 07:01:58 PM
If you're running other mods, there's a possibility that something might bork, if a mod replaced the Burn Drive system file. 

Can you run with just Vanilla, LazyLib and the AI mod and confirm this crash is specific to the AI Mod?  Works here.
Title: Re: (0.7.2a) StarSector AI Overhaul, Alpha 3
Post by: Surge on May 15, 2016, 10:01:29 PM
Does this also fix the issue of where 12 ships chase a lone frigate around and BOTH sides are scared to commit to an actual thrust? I lose so many supplies to that nonsense.
Title: Re: (0.7.2a) StarSector AI Overhaul, Alpha 3
Post by: xenoargh on May 15, 2016, 11:42:13 PM
That doesn't happen with this AI, no, although right now it certainly still has some unsolved problems :)

Among other things, after getting detailed feedback from a local SS player here who was kind enough to test:

1.  Escort command is fixed; ships will now actually perform Escort more-or-less correctly and will do a better job when given specific attack orders.
2.  The bug reported with Burn Drive is fixed.
3.  Autofire AI no longer wastes shots on Hulks.

When I'm sure that Escort works well-enough to be considered a real improvement, I'll release Alpha 4.

Future Plans:

I still need to do some work on the Threat Assessment part of the AI; among other issues, the AI's still having some problems with deciding which enemy / missile to point shields at a little too often and it's having some specific issues with being a missile-boat, and I am going to try and get it to correctly weight ships that have targeted it, vs. ships that are merely close.

I also need to get the AI to raise shields if it thinks it's going to collide with a friendly ship (mainly this is causing some issues during early parts of a battle / mission) and I need to work on certain types of missile-launcher AI situations; basically, when to Harpoon-spam, when to use Reapers.  Right now both things are pretty bare-bones; if the AI thinks it can hit, it fires; it's not very picky about it.  I'd also like to work on having the AI attempt to do some deliberate alpha-strike and Soft Flux management stuff.

I have written a "broadside" AI, too, although it's still basically bare-bones functional; it can be activated via a Hull Mod.  It essentially gives the AI a different movement pattern, where it attempts to circle its main target at maximum range, rather than getting close.  It works pretty well for ships designed for that pattern.  Eventually I'll also have some Hull Mods that tell the base AI to do some other things, like avoid combat where possible (for LRM boats and carriers) and other stuff like that, where the default behaviors aren't ideal.



I'd like to hear more detailed feedback about the current issues with Alpha 3, though; my objective is to get this fixed up to a "good enough" stage reasonably quickly, so that I can get to breaking the mod up into the library-code-side (for modders) and the player-code-side (i.e., a good base AI with some cool behaviors / tweakable behaviors).
Title: Re: (0.7.2a) StarSector AI Overhaul, Alpha 3
Post by: Nanao-kun on May 16, 2016, 11:48:37 AM
I'd try this out, but... Stellaris.
Title: Re: (0.7.2a) StarSector AI Overhaul, Alpha 3
Post by: NightKev on May 16, 2016, 11:59:45 PM
I'd try this out, but... Stellaris.
Eh, you should really wait for at least 1.1 if not 1.2, the game isn't very polished yet (and there are some major bugs).
Title: Re: (0.7.2a) StarSector AI Overhaul, Alpha 3
Post by: Nanao-kun on May 17, 2016, 12:10:56 AM
I'd try this out, but... Stellaris.
Eh, you should really wait for at least 1.1 if not 1.2, the game isn't very polished yet (and there are some major bugs).

Despite what problems it may have now, it's still a lot of fun.
Title: Re: (0.7.2a) StarSector AI Overhaul, Alpha 3
Post by: SierraTangoDelta on June 06, 2016, 08:00:29 PM
Hey, I believe your mod is causing this crash, any input on this?

164943 [Thread-4] INFO  com.fs.starfarer.loading.LoadingUtils  - Loading JSON from [data/shipsystems/burndrive.system]
164960 [Thread-4] ERROR data.scripts.SS_Al_ModPlugin  - burndrive couldn't find aiScript for this System
org.json.JSONException: JSONObject["aiScript"] not found.
   at org.json.JSONObject.get(JSONObject.java:406)
   at org.json.JSONObject.getString(JSONObject.java:577)
   at data.scripts.SS_Al_ModPlugin.pickSystemAIScript(SS_Al_ModPlugin.java:96)
   at data.scripts.SS_Al_ModPlugin.pickShipAI(SS_Al_ModPlugin.java:201)
   at com.fs.starfarer.launcher.ModManager$4.o00000(Unknown Source)
   at com.fs.starfarer.launcher.ModManager.getPriorityPlugin(Unknown Source)
   at com.fs.starfarer.launcher.ModManager.pickShipAIPlugin(Unknown Source)
   at com.fs.starfarer.title.oOOO.Ò00000(Unknown Source)
   at com.fs.starfarer.title.oOOO.Ô00000(Unknown Source)
   at com.fs.starfarer.title.oOOO.Õ00000(Unknown Source)
   at com.fs.starfarer.title.oOOO.o00000(Unknown Source)
   at com.fs.starfarer.combat.A.B.o00000(Unknown Source)
   at com.fs.starfarer.combat.CombatEngine.advanceInner(Unknown Source)
   at com.fs.starfarer.combat.CombatEngine.advance(Unknown Source)
   at com.fs.starfarer.title.TitleScreenState.advance(Unknown Source)
   at com.fs.starfarer.BaseGameState.traverse(Unknown Source)
   at com.fs.state.AppDriver.begin(Unknown Source)
   at com.fs.starfarer.combat.CombatMain.main(Unknown Source)
   at com.fs.starfarer.StarfarerLauncher$1.run(Unknown Source)
   at java.lang.Thread.run(Unknown Source)
164987 [Thread-8] INFO  sound.O  - Cleaning up music with id [miscallenous_main_menu.ogg]
165252 [Thread-4] ERROR com.fs.starfarer.combat.CombatMain  - java.lang.NoSuchMethodError: data.scripts.plugins.ShipThreatPlugin.getCloseThreatsIncludeFighters(Lcom/fs/starfarer/api/combat/ShipAPI;)Ljava/util/List;
java.lang.NoSuchMethodError: data.scripts.plugins.ShipThreatPlugin.getCloseThreatsIncludeFighters(Lcom/fs/starfarer/api/combat/ShipAPI;)Ljava/util/List;
   at data.scripts.shipai.TargetManager.TargetManager(TargetManager.java:34)
   at data.scripts.shipai.StandardShipAI.advance(StandardShipAI.java:140)
   at com.fs.starfarer.combat.entities.Ship$ShipAIWrapper.advance(Unknown Source)
   at com.fs.starfarer.combat.CombatEngine.advanceInner(Unknown Source)
   at com.fs.starfarer.combat.CombatEngine.advance(Unknown Source)
   at com.fs.starfarer.title.TitleScreenState.advance(Unknown Source)
   at com.fs.starfarer.BaseGameState.traverse(Unknown Source)
   at com.fs.state.AppDriver.begin(Unknown Source)
   at com.fs.starfarer.combat.CombatMain.main(Unknown Source)
   at com.fs.starfarer.StarfarerLauncher$1.run(Unknown Source)
   at java.lang.Thread.run(Unknown Source)
165368 [Thread-10] INFO  sound.O  - Creating streaming player for music with id [miscallenous_main_menu.ogg]
165369 [Thread-10] INFO  sound.H  - Playing music with id [miscallenous_main_menu.ogg]
Title: Re: (0.7.2a) StarSector AI Overhaul, Alpha 3
Post by: Orikson on June 06, 2016, 08:04:26 PM
Hey, I believe your mod is causing this crash, any input on this?

164943 [Thread-4] INFO  com.fs.starfarer.loading.LoadingUtils  - Loading JSON from [data/shipsystems/burndrive.system]
164960 [Thread-4] ERROR data.scripts.SS_Al_ModPlugin  - burndrive couldn't find aiScript for this System
org.json.JSONException: JSONObject["aiScript"] not found.
   at org.json.JSONObject.get(JSONObject.java:406)
   at org.json.JSONObject.getString(JSONObject.java:577)
   at data.scripts.SS_Al_ModPlugin.pickSystemAIScript(SS_Al_ModPlugin.java:96)
   at data.scripts.SS_Al_ModPlugin.pickShipAI(SS_Al_ModPlugin.java:201)
   at com.fs.starfarer.launcher.ModManager$4.o00000(Unknown Source)
   at com.fs.starfarer.launcher.ModManager.getPriorityPlugin(Unknown Source)
   at com.fs.starfarer.launcher.ModManager.pickShipAIPlugin(Unknown Source)
   at com.fs.starfarer.title.oOOO.Ò00000(Unknown Source)
   at com.fs.starfarer.title.oOOO.Ô00000(Unknown Source)
   at com.fs.starfarer.title.oOOO.Õ00000(Unknown Source)
   at com.fs.starfarer.title.oOOO.o00000(Unknown Source)
   at com.fs.starfarer.combat.A.B.o00000(Unknown Source)
   at com.fs.starfarer.combat.CombatEngine.advanceInner(Unknown Source)
   at com.fs.starfarer.combat.CombatEngine.advance(Unknown Source)
   at com.fs.starfarer.title.TitleScreenState.advance(Unknown Source)
   at com.fs.starfarer.BaseGameState.traverse(Unknown Source)
   at com.fs.state.AppDriver.begin(Unknown Source)
   at com.fs.starfarer.combat.CombatMain.main(Unknown Source)
   at com.fs.starfarer.StarfarerLauncher$1.run(Unknown Source)
   at java.lang.Thread.run(Unknown Source)
164987 [Thread-8] INFO  sound.O  - Cleaning up music with id [miscallenous_main_menu.ogg]
165252 [Thread-4] ERROR com.fs.starfarer.combat.CombatMain  - java.lang.NoSuchMethodError: data.scripts.plugins.ShipThreatPlugin.getCloseThreatsIncludeFighters(Lcom/fs/starfarer/api/combat/ShipAPI;)Ljava/util/List;
java.lang.NoSuchMethodError: data.scripts.plugins.ShipThreatPlugin.getCloseThreatsIncludeFighters(Lcom/fs/starfarer/api/combat/ShipAPI;)Ljava/util/List;
   at data.scripts.shipai.TargetManager.TargetManager(TargetManager.java:34)
   at data.scripts.shipai.StandardShipAI.advance(StandardShipAI.java:140)
   at com.fs.starfarer.combat.entities.Ship$ShipAIWrapper.advance(Unknown Source)
   at com.fs.starfarer.combat.CombatEngine.advanceInner(Unknown Source)
   at com.fs.starfarer.combat.CombatEngine.advance(Unknown Source)
   at com.fs.starfarer.title.TitleScreenState.advance(Unknown Source)
   at com.fs.starfarer.BaseGameState.traverse(Unknown Source)
   at com.fs.state.AppDriver.begin(Unknown Source)
   at com.fs.starfarer.combat.CombatMain.main(Unknown Source)
   at com.fs.starfarer.StarfarerLauncher$1.run(Unknown Source)
   at java.lang.Thread.run(Unknown Source)
165368 [Thread-10] INFO  sound.O  - Creating streaming player for music with id [miscallenous_main_menu.ogg]
165369 [Thread-10] INFO  sound.H  - Playing music with id [miscallenous_main_menu.ogg]


Are you running it wit other faction mods? Its current state is only best (or less chance of crashing) with the core game/Vanilla only.
Title: Re: (0.7.2a) StarSector AI Overhaul, Alpha 3
Post by: SierraTangoDelta on June 14, 2016, 11:01:04 PM
Gotcha, I am running it with a lot of faction mods, so that makes sense then.
Title: Re: (0.7.2a) StarSector AI Overhaul, Alpha 3
Post by: xenoargh on June 16, 2016, 08:03:27 AM
I will probably fix that issue in the next release.  Sorry I've been rather busy lately :)
Title: Re: (0.7.2a) StarSector AI Overhaul, Alpha 3
Post by: Requal on September 08, 2016, 09:42:42 PM
Does this mod make your own ship when used by AI more aggresive?
Cause sometimes all ships just look like they are being piloted by coward cry babies.
Instead of just engaging they just dance around each other for minutes with a few rare shots fired.

So I hope this mode changes that coward behaviour
Title: Re: (0.7.2a) StarSector AI Overhaul, Alpha 3
Post by: DownTheDrain on September 08, 2016, 11:44:17 PM
Does this mod make your own ship when used by AI more aggresive?

Why would you ever let the AI control your own ship?
Title: Re: (0.7.2a) StarSector AI Overhaul, Alpha 3
Post by: Requal on September 11, 2016, 02:46:04 PM
Does this mod make your own ship when used by AI more aggresive?

Why would you ever let the AI control your own ship?

Why not?
Everyone has their own play style.
I like to play it that way.
Upgrading my pilot and see how he does in combat.
Title: Re: (0.7.2a) StarSector AI Overhaul, Alpha 3
Post by: BHunterSEAL on September 18, 2016, 06:22:38 PM
I figured I'd give this a whirl (on the off-chance the Thumper will finally live up to its flavor-text and shoot at missiles) but one thing I noticed right away--the version as linked in the OP appears to be Alpha 1, not Alpha 3 (per the info file). Normally I'd assume it's a typo, but the datestamp is from 4/17, when the thread was first posted, not 4/21 when you posted about Alpha 3.
Title: Re: (0.7.2a) StarSector AI Overhaul, Alpha 3
Post by: Midnight Kitsune on September 18, 2016, 07:00:53 PM
I figured I'd give this a whirl (on the off-chance the Thumper will finally live up to its flavor-text and shoot at missiles) but one thing I noticed right away--the version as linked in the OP appears to be Alpha 1, not Alpha 3 (per the info file). Normally I'd assume it's a typo, but the datestamp is from 4/17, when the thread was first posted, not 4/21 when you posted about Alpha 3.
If you are planning or already using mods such as SS+ or Dynasector, I wouldn't bother with this mod as it clashes and crashes with certain popular mods enabled
Title: Re: [0.81a] StarSector AI Overhaul, Alpha 4
Post by: xenoargh on June 22, 2017, 06:17:21 PM
Alpha 4 is now available.

Highlights:

1.  Should largely be compatible with other mods, I think.  There may be issues with mods that don't follow Alex's template for where their System AIs are; I'll probably address that later.

2.  Some performance enhancements.

3.  Better overall handling of the player vs. the AI- the enemy will focus more on the player now and respond to the player most of the time.

Still not perfect, but it's definitely progress :)
Title: Re: [0.81a] StarSector AI Overhaul, Alpha 4
Post by: peperoni_playboy on June 22, 2017, 06:47:04 PM
I'm getting this crash as soon as the game finishes loading up and gets to the main menu
Spoiler
445154 [Thread-4] ERROR com.fs.starfarer.combat.CombatMain  - java.lang.ClassCastException: com.fs.starfarer.combat.systems.oO0OOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOO OOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOO OOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOO OOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOO cannot be cast to com.fs.starfarer.api.combat.DroneLauncherShipSystemAPI
java.lang.ClassCastException: com.fs.starfarer.combat.systems.oO0OOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOO OOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOO OOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOO OOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOO cannot be cast to com.fs.starfarer.api.combat.DroneLauncherShipSystemAPI
   at data.shipsystems.scripts.ai.DroneOrdersAI.advance(DroneOrdersAI.java:44)
   at data.scripts.shipai.StandardShipAI.advance(StandardShipAI.java:188)
   at com.fs.starfarer.combat.entities.Ship$ShipAIWrapper.advance(Unknown Source)
   at com.fs.starfarer.combat.CombatEngine.advanceInner(Unknown Source)
   at com.fs.starfarer.combat.CombatEngine.advance(Unknown Source)
   at com.fs.starfarer.title.TitleScreenState.advance(Unknown Source)
   at com.fs.starfarer.BaseGameState.traverse(Unknown Source)
   at com.fs.state.AppDriver.begin(Unknown Source)
   at com.fs.starfarer.combat.CombatMain.main(Unknown Source)
   at com.fs.starfarer.StarfarerLauncher$1.run(Unknown Source)
   at java.lang.Thread.run(Unknown Source)
[close]
Title: Re: [0.81a] StarSector AI Overhaul, Alpha 4
Post by: xenoargh on June 22, 2017, 06:48:20 PM
Does this happen when this and LazyLib are the only mods operating?

If not, what other mod(s) are you running?
Title: Re: [0.81a] StarSector AI Overhaul, Alpha 4
Post by: xenoargh on June 22, 2017, 06:56:12 PM
I've uploaded a new version that will address that problem for now; but it appears there's something weird going on.  A Cast error there is, well, strange, and my code doesn't care whether the DroneLauncherShipSystemAPI is valid or not; it just cares about the ShipAPI.  

I'll take a look at that when you can give me a list of the mods you're running.
Title: Re: [0.81a] StarSector AI Overhaul, Alpha 4
Post by: peperoni_playboy on June 22, 2017, 07:05:53 PM
I tried the new version, and I still get the same crash. here's the modlist, it's a lot I know. I'm going to try to figure out which mod is conflicting with it now.

[attachment deleted by admin]
Title: Re: [0.81a] StarSector AI Overhaul, Alpha 4
Post by: peperoni_playboy on June 22, 2017, 07:16:59 PM
alright, troubleshooting over: for whatever reason, BRDY isn't playing nicely with your AI overhaul. the crash isn't present when I disable BRDY, everything else seems to be compatible(or at least not crashing).
Title: Re: [0.81a] StarSector AI Overhaul, Alpha 4
Post by: xenoargh on June 22, 2017, 07:27:32 PM
I'll take a look.
Title: Re: [0.81a] StarSector AI Overhaul, Alpha 4
Post by: xenoargh on June 22, 2017, 07:59:52 PM
OK, I think that's fixed for now.  BRDY doesn't crash over here.  Uploaded a new build.
Title: Re: [0.81a] StarSector AI Overhaul, Alpha 4
Post by: peperoni_playboy on June 22, 2017, 08:11:37 PM
you updated the link in the OP, right? I redownloaded it and I'm still getting the same crash.
Title: Re: [0.81a] StarSector AI Overhaul, Alpha 4
Post by: xenoargh on June 22, 2017, 08:30:30 PM
Whoops, the link's to the old build  ::)

Fixed.  Let me know if you're still having problems.  I'll be updating the issue with the Drones tomorrow when I'm sure that's good for cases like BRDY where it's still using legacy stuff.
Title: Re: [0.81a] StarSector AI Overhaul, Alpha 4
Post by: peperoni_playboy on June 22, 2017, 09:04:42 PM
yeah the crash is gone, seems like you got it man. I'll let you know if I run into anything else.
Title: Re: [0.81a] StarSector AI Overhaul, Alpha 4
Post by: xenoargh on June 23, 2017, 06:59:37 PM
Please do.  I'll be working on the various bits that are still aren't playing well, too :)
Title: Re: [0.81a] StarSector AI Overhaul, Alpha 5
Post by: xenoargh on June 27, 2017, 06:35:01 PM
Alpha 5 is now available.

Fixes:

Crash bug that occasionally can happen when a Fighter doesn't have a WingRole.

Improves:

Targeting of player in general, and some improvements to AI aggression when given specific orders.
Title: Re: [0.81a] StarSector AI Overhaul, Alpha 5
Post by: peperoni_playboy on June 27, 2017, 09:15:21 PM
getting this shadowyards related crash when attempting to load the game up with AI overhaul and shadowyards together, I wasn't getting the crash in the previous version. here's the log:

Spoiler
406194 [Thread-4] ERROR com.fs.starfarer.combat.CombatMain  - java.lang.NullPointerException
java.lang.NullPointerException
   at data.shipsystems.scripts.ai.MS_siegemodeAI.advance(MS_siegemodeAI.java:72)
   at data.scripts.shipai.StandardShipAI.advance(StandardShipAI.java:196)
   at com.fs.starfarer.combat.entities.Ship$ShipAIWrapper.advance(Unknown Source)
   at com.fs.starfarer.combat.CombatEngine.advanceInner(Unknown Source)
   at com.fs.starfarer.combat.CombatEngine.advance(Unknown Source)
   at com.fs.starfarer.title.TitleScreenState.advance(Unknown Source)
   at com.fs.starfarer.BaseGameState.traverse(Unknown Source)
   at com.fs.state.AppDriver.begin(Unknown Source)
   at com.fs.starfarer.combat.CombatMain.main(Unknown Source)
   at com.fs.starfarer.StarfarerLauncher$1.run(Unknown Source)
   at java.lang.Thread.run(Unknown Source)
[close]
Title: Re: [0.81a] StarSector AI Overhaul, Alpha 5
Post by: xenoargh on June 27, 2017, 10:34:36 PM
Hmm.  I'll look at that.  Probably looking for an AI variable that's not set or something like that.
Title: Re: [0.81a] StarSector AI Overhaul, Alpha 5
Post by: xenoargh on June 28, 2017, 10:11:12 AM
Alpha 6 has been released.  Should resolve issues with System AIs that require AI Flags to be set; does not (yet) set / unset AI Flags in a Vanilla-like fashion (that'll take a little more work doing data-entry and I'll probably get to that tonight).
Title: Re: [0.81a] StarSector AI Overhaul, Alpha 6
Post by: faram45 on June 28, 2017, 05:06:39 PM
Optimization mods for any game are always the best! You're doing good work with this update speed!

Also got a crash.
577100 [Thread-4] ERROR com.fs.starfarer.combat.CombatMain  - java.lang.NullPointerException
java.lang.NullPointerException
   at data.scripts.shipsystems.ai.SWP_PunisherJetsAI.advance(SWP_PunisherJetsAI.java:71)
   at data.scripts.shipai.StandardShipAI.advance(StandardShipAI.java:196)
   at com.fs.starfarer.combat.entities.Ship$ShipAIWrapper.advance(Unknown Source)
   at com.fs.starfarer.combat.CombatEngine.advanceInner(Unknown Source)
   at com.fs.starfarer.combat.CombatEngine.advance(Unknown Source)
   at com.fs.starfarer.combat.CombatState.traverse(Unknown Source)
   at com.fs.state.AppDriver.begin(Unknown Source)
   at com.fs.starfarer.combat.CombatMain.main(Unknown Source)
   at com.fs.starfarer.StarfarerLauncher$1.run(Unknown Source)
   at java.lang.Thread.run(Unknown Source)


I have every 8.1 mod installed, crashes only when entering battle.
Title: Re: [0.81a] StarSector AI Overhaul, Alpha 6
Post by: xenoargh on June 28, 2017, 06:38:27 PM
Not sure what mod the SWP Punisherjets thing is from.  Oh, duh, I'll bet it's Ship/Weapon Pack.  I'll take a look.
Title: Re: [0.81a] StarSector AI Overhaul, Alpha 6
Post by: xenoargh on June 28, 2017, 07:15:59 PM
Alpha 7 is now released.  I think this resolves all of the mods that require AIFlags to be set (there's an engine bug I've inadvertently exposed and worked around  ::)).

Tested with Ship / Weapon Pack and no crashes here.
Title: Re: [0.81a] StarSector AI Overhaul, Alpha 6
Post by: faram45 on June 28, 2017, 07:17:34 PM
Alpha 7 is now released.  I think this resolves all of the mods that require AIFlags to be set (there's an engine bug I've inadvertently exposed and worked around  ::)).

Tested with Ship / Weapon Pack and no crashes here.

I shall test. The Starcrasher might not have given up yet.
Title: Re: [0.81a] StarSector AI Overhaul, Alpha 7
Post by: xenoargh on June 28, 2017, 07:21:24 PM
Hope this got that issue dealt with; the next step is to address issues where I want certain AIFlags set explicitly so that System AIs work a bit like in Vanilla.
Title: Re: [0.81a] StarSector AI Overhaul, Alpha 7
Post by: faram45 on June 28, 2017, 07:26:09 PM
Still got it.

322677 [Thread-4] ERROR com.fs.starfarer.combat.CombatMain  - java.lang.NullPointerException
java.lang.NullPointerException
   at data.scripts.shipsystems.ai.SWP_PunisherJetsAI.advance(SWP_PunisherJetsAI.java:71)
   at data.scripts.shipai.StandardShipAI.advance(StandardShipAI.java:201)
   at com.fs.starfarer.combat.entities.Ship$ShipAIWrapper.advance(Unknown Source)
   at com.fs.starfarer.combat.CombatEngine.advanceInner(Unknown Source)
   at com.fs.starfarer.combat.CombatEngine.advance(Unknown Source)
   at com.fs.starfarer.combat.CombatState.traverse(Unknown Source)
   at com.fs.state.AppDriver.begin(Unknown Source)
   at com.fs.starfarer.combat.CombatMain.main(Unknown Source)
   at com.fs.starfarer.StarfarerLauncher$1.run(Unknown Source)
   at java.lang.Thread.run(Unknown Source)


Used a Hedgemony ship against a Blackrock Hawkmoth Tanker.
Crashes after I unpause.
Title: Re: [0.81a] StarSector AI Overhaul, Alpha 7
Post by: xenoargh on June 28, 2017, 07:31:42 PM
You've updated this mod, right?  I'll take a look at this and see if I can reproduce...
Title: Re: [0.81a] StarSector AI Overhaul, Alpha 7
Post by: xenoargh on June 28, 2017, 07:48:48 PM
OK, I replicated this.  I put the initialization of the AIFlags in the wrong place and it got to hit the NPE before it got set properly.  I'll be uploading a new build shortly once I'm absolutely sure it's not going to crash due to this again.
Title: Re: [0.81a] StarSector AI Overhaul, Alpha 7
Post by: faram45 on June 28, 2017, 07:56:13 PM
Crashsector is a scary place.
Title: Re: [0.81a] StarSector AI Overhaul, Alpha 8
Post by: xenoargh on June 28, 2017, 08:05:54 PM
Ok, I finally figured out the NPE issue with the System AIs.  Should be resolved now.  Not all System AIs will play nicely with this project yet, but I also included a few basic states so that most of them will work.
Title: Re: [0.81a] StarSector AI Overhaul, Alpha 8
Post by: Arkar1234 on June 29, 2017, 06:02:47 AM
Ok, I finally figured out the NPE issue with the System AIs.  Should be resolved now.  Not all System AIs will play nicely with this project yet, but I also included a few basic states so that most of them will work.

<3
Title: Re: [0.81a] StarSector AI Overhaul, Alpha 8
Post by: xenoargh on June 29, 2017, 07:47:09 AM
Tonight I've got some real free time, for once. I'll try and work on missile-launcher logic, and make the AI use Harpoons wisely, etc.
Title: Re: [0.81a] StarSector AI Overhaul, Alpha 8
Post by: Darloth on June 30, 2017, 04:50:47 AM
Looking forward to seeing where this goes, please keep it up :)

Thanks also especially for the documentation and explanations of how it's working as well, they are interesting to read through and look at.
Title: Re: [0.81a] StarSector AI Overhaul, Alpha 8
Post by: faram45 on June 30, 2017, 12:15:14 PM
One thing I noticed is that some ships just go brain dead in the corners are times.

And sometimes the two sides won't even attempt fighting, even with one much larger than the other.

Title: Re: [0.81a] StarSector AI Overhaul, Alpha 8
Post by: xenoargh on June 30, 2017, 04:39:04 PM
On the first issue, I probably need to drive them out of corners if they aren't fighting the player's ship.

On the second, the AI's generally pretty cautious in certain situations, and it weighs ships "danger" values in ways that can sometimes create that phenomenon.  It's up to players to intervene and break the deadlock.
Title: Re: [0.81a] StarSector AI Overhaul, Alpha 8
Post by: OzarMidrashim on July 19, 2017, 02:44:05 PM
Is there a way to lower AI priority to focus on Player ship?
I did had few battles where it was a little to drastic...most enemy ships just ignored my allies and focus on me whetever i go, so matter ship class. Its was so dumb they ware leaving alone almost dead ships just to focus on ship like frigate i just transfered to. It maked AI reletless but stupid like Cal Of Duty Modern Warfare on top difficulty. I wonder how is that computed, maybe ships of this faction i played was balanced wierd way around.
Title: Re: [0.81a] StarSector AI Overhaul, Alpha 8
Post by: Arkar1234 on July 19, 2017, 11:01:51 PM
Is there a way to lower AI priority to focus on Player ship?
I did had few battles where it was a little to drastic...most enemy ships just ignored my allies and focus on me whetever i go, so matter ship class. Its was so dumb they ware leaving alone almost dead ships just to focus on ship like frigate i just transfered to. It maked AI reletless but stupid like Cal Of Duty Modern Warfare on top difficulty. I wonder how is that computed, maybe ships of this faction i played was balanced wierd way around.

Yup, had about the same problem for me as well.

The ships tend to ignore flankers and bombers just to focus solely on their chosen target. Same scenario for my allied ships as well.
Title: Re: [0.81a] StarSector AI Overhaul, Alpha 8
Post by: OzarMidrashim on July 20, 2017, 03:16:39 AM
Its Alpha...obvious its not anything other than WIP. As alwys there are two arpoaches to subject, either mod Developers decide to expand base AI to take more variables to account, or decided to build one from ground up with new options for future modders to use...with succes to the point new system could find its way to the core game like few mods already had.

For now i must disable it, as in this state its unplayable. I am happy thou this mod lives, last time i checked, it was unplayable spitting crashes in 0.7.2a.
But pottential could be obscene.

Vengence commandors taking suicide squads or their own ship to ram you in next battle if you just fought one and continue to harras their fleets.
Hunter killer prism/void dimention subs going around main battle to assassin your carriers.
Small frigates only going in to cripple your engines, and providing defensive support for main fleet otherwise (they pop to quickly).
Depending fleet composition whole AI would play diffirently.
Rathe than spread in default line, AI could split to two flanking groups caching player in betwean, or form a wage of cappitals dont giving a damn and copletly pussh into your ranks spreading chaos (how many times AI has clear advantage yout loose simply because they are to conservative with their push?).
More overall betwean-ships cooperation, like task-squads, or so much needed save-move for AI ship that otherwise without  a backup going to be torn apart.

Base AI do a good job, but its almost the same every time around. It just spread in line of ships, when each of them behave like roman legionair attacking and backing up when flux build up. Logic and effective, but boring...and also very predictible for player to counter by playing long range, thus more than half weaponry is less "safe" yelding more losses than slow sniping. There is nothing more entertaining than AI making absurd unpredictible crazy decisions, like in "Jagged Alliance 2", "Flat-out" or "SCAR Squadra Corse Alfa Romeo".
Title: Re: [0.81a] StarSector AI Overhaul, Alpha 8
Post by: Owl on July 26, 2017, 07:31:28 PM
It is funny you mentioned JA2 the only other game that has got me as hooked as this one ;D
One thing that is driving me insane with the vanilla AI is when I send a ship to capture a nav node in combat, it will disobey and drift off to fight rather than secure the position and allow an enemy ship to backdoor the point.
Title: Re: [0.81a] StarSector AI Overhaul, Alpha 8
Post by: OzarMidrashim on July 27, 2017, 11:37:06 AM
It is funny you mentioned JA2 the only other game that has got me as hooked as this one ;D
One thing that is driving me insane with the vanilla AI is when I send a ship to capture a nav node in combat, it will disobey and drift off to fight rather than secure the position and allow an enemy ship to backdoor the point.

JA 2, newest 1.13 from:
https://onedrive.live.com/?id=13A6926EAC52083%21202&cid=013A6926EAC52083
...some custom .ini tweaks and music mod ( i can give you my made from Crysis 2 OST ...fits)
and youre golden xD

As for Starsector ...whole Officer thing need to be upgraded at one point to. For now they are buff placeholders, there is no additional functions or tasks as i recall ...you can edit ships behaviour by Officer attitude, but thats also limited. They don't panic and flee or have rage bursts, dont go to berserk or risk going in for rewarding kill. They always obey, and how thay obey is not diffirent from base AI as i saw.
This is something to work on as its core mechanic, but still end up as polish refine section of development. Then we end up in game with either lobotomized or omnipotential-prodigy AI's. I want to see an AI who gets *** being sniped and loose its patiance and just rage-charge, or AI that makes terrible terrible mistakes, not stupid, but sometimes take risk and kill both ships by ramming etc.
Sometimes i see such behaviours, like AI ship flying betwean me and tyrget into line of fire saving it...or make stupid suicide attack, but its hard to tell how much of it is random, and how much is driven by code.
Title: Re: [0.81a] StarSector AI Overhaul, Alpha 8
Post by: xenoargh on July 27, 2017, 02:30:24 PM
First off, there's no "improving the base AI"... it's not available to "improve".  Alex was kind enough to write a method whereby we could write our own AIs from the ground up, but that's it.  So yes, this was written completely from scratch, which was a lot of work ;)

Second off, the emphasis on the Player's ship was pretty intentional, but it's pretty apparent that:

A.  The weighting on the player over other enemies is a bit too heavy.
B.  The weighting of the AI causing it to stay out of combat in general might be a bit too heavy.
C.  There are lots of little issues remaining to get worked on, like smarter missile use, etc., that make the enemy AI a bit weaker than I'd like.

I haven't felt like any of that was game-breaking, per se; I can see how it might make things easier if you have a lot of ships, but frankly, by the time you have a big fleet and lots of Officers, the game's not hard at all vs. Vanilla's AI, either.

Fixing both of these things is fairly straightforward, but requires a lot of playtesting.  I've been (slowly) working on this here, but I haven't released anything in public to update it for a while, until I'm a little happier with it :)
Title: Re: [0.81a] StarSector AI Overhaul, Alpha 8
Post by: OzarMidrashim on July 28, 2017, 12:33:36 AM
So... indeed a lot of work if you can't plug in under base AI the way i though. It was not so obvious from OP. I remember i did mod for Cortex Command expanding base AI fixing all stupid glitches, bypassing hardcoded crap and adding a ton of new interesting behaviours, but writing whole thing is diffirent story altogether. I'm not sure i would ever try this without strong reasons.
Didn't wanted to sound like i don't apriciate and critique too harshly.
I always wach anything concerning AI's in games, there ware so little good ones, every time one gives me fair fight i'm in havens of entertainment ;-) Like this section in most games...opponent...doesnt get enough love and attention from devs. I hope you continue your projects, as i find them impressive, and saving grace or at least usefull in sections not yet touched by most.
If you by any chance have little update of AI with ajustments mentioned, and don't predict new release for some time, i would apriciate a link to test it out. No pressure thou =) ...if not i would like to know is there a factor to modify concerning "The weighting on the player over other enemies..." as i find it to be more than "...a bit too heavy." =P like 80% of enemy fleet fallowing me when i tested it xD
Title: Re: [0.81a] StarSector AI Overhaul, Alpha 8
Post by: xenoargh on July 28, 2017, 08:07:45 AM
Alpha 8.5 has been released.

Features:

More-aggressive AI.

Enemy AI is much less fixated on the Player.

Improvements to a few sub-AI features, including a fix for a rare NPE in some auto-aim systems and some System AIs. 
Title: Re: [0.81a] StarSector AI Overhaul, Alpha 8.5
Post by: yamadaeclipse on August 01, 2017, 04:02:36 PM
um...

the ai ships seem to be blocked by the map border in combat, and unable to retreat
Title: Re: [0.81a] StarSector AI Overhaul, Alpha 8.5
Post by: xenoargh on August 01, 2017, 05:47:07 PM
Hmm.  I haven't observed that happening here; can you tell me under what circumstances that's happening for you?  Like, is it a certain battle type, Mission, etc?
Title: Re: [0.81a] StarSector AI Overhaul, Alpha 8.5
Post by: Death_Silence_66 on August 03, 2017, 09:33:02 PM
There seems to be an issue with ship system launched drones. With torn up plenty's Talus, the drones just scatter towards the edges of the battlefield no matter what mode they are it (Free Roam, Recall, Ect.). Additionally, Warthogs hang back and launch flares rather than moving in and using their weapons.
Title: Re: [0.81a] StarSector AI Overhaul, Alpha 8.5
Post by: xenoargh on August 04, 2017, 08:14:11 AM
I'll take a look at the drones.  The Warthogs shouldn't be avoiding combat ranges; other fighters like Broadswords are working over here.  I'll check that out.
Title: Re: [0.81a] StarSector AI Overhaul, Alpha 8.6
Post by: xenoargh on August 13, 2017, 05:54:04 PM
Version 0.86a has been released.

Mainly a bugfix / tweak build; I resolved the problems with Vanilla Drones with fancy behaviors and tweaked AI aggressiveness to work a little better.
Title: Re: [0.81a] StarSector AI Overhaul, Alpha 8.6
Post by: RazorTS on August 23, 2017, 03:17:34 PM
Few issues with the mod
 *sometimes weapons stop firing for no apparent reason;
 *Ships bunch up, ram and block each other, spin around instead of siting at comfortable range firing weapons;

those two points make game unplayable, especially in your face attitude. 

Title: Re: [0.81a] StarSector AI Overhaul, Alpha 8.6
Post by: Sooner535 on August 23, 2017, 03:27:40 PM
interestingly enough that is how I play >.< especially if I am fighting something with side mounted missiles (as they tend to go past me unless they have very high tracking) close-medium range flak brawlers mess things up
Title: Re: [0.81a] StarSector AI Overhaul, Alpha 8.6
Post by: xenoargh on August 23, 2017, 10:08:43 PM
Few issues with the mod
 *sometimes weapons stop firing for no apparent reason;
 *Ships bunch up, ram and block each other, spin around instead of siting at comfortable range firing weapons;

those two points make game unplayable, especially in your face attitude. 
I think I've gotten the ship-range issues fixed in the next build.  The last build was a little too aggro for its own good; worked for some things, not so hot for others.

Weapons stopping firing has to do with Flux levels; that's more-or-less by design.  Probably need to allow PD to fire if it has a max-priority target in that situation and turn it off completely on player-piloted ships.
Title: Re: [0.81a] StarSector AI Overhaul, Alpha 8.6
Post by: xenoargh on August 24, 2017, 09:05:22 AM
Ok, I've gotten most of that fixed well; ships now use an averaged range weighted towards non-PD, with some specific support for Strike weapons with short ranges like the AM Blaster.  That part worked well in testing last night; ships got into a good range.  I also addressed the Flux issues somewhat; ships will still occasionally get Flux-locked, but less often, with an exit condition to let them lower their shields sometimes when they can't lower Flux by retreating (sometimes a bad option is the only option).

I want to finally finish "smarter" missile-launcher AI before I release this; it's probably the biggest single gripe I have with the AI right now.  I'll get that done tonight and release a build :)
Title: Re: [0.81a] StarSector AI Overhaul, Alpha 8.6
Post by: RazorTS on August 24, 2017, 11:48:09 AM
looking forward to test it
Title: Re: [0.81a] StarSector AI Overhaul, Alpha 8.6
Post by: xenoargh on August 24, 2017, 11:51:29 AM
Thanks!  I know it's a little rough in spots, but it's gradually getting good and last night's test looked very promising :)
Title: Re: [0.81a] StarSector AI Overhaul, Alpha 8.7
Post by: xenoargh on August 24, 2017, 10:33:32 PM
Version 0.87a has been released.

Features:


1.  Warning code to catch people not installing LazyLib, etc.

2.  Revamped Autofire control systems: better range-detection algorithm and improvements to performance and Flux usage.

3.  Missile Launcher AIs (finally).  Warning; due to some stuff with how this had to be designed under the hood (essentially, the game isn't letting me look at MissileAPIs directly from WeaponAPIs without tortuous, probably-buggy workarounds) this won't work completely transparently with Vanilla... yet.  But it works well with the Rebal Mod.

4.  Burn Drive sub-AI is no longer quite so inclined to insane charges.

5.  Reckless Captains aren't quite so crazy about diving into fights.

The AI feels quite a bit smarter, this time; I think the next build I'll take another look at working on a Phase Cloak AI that doesn't completely suck.
Title: Re: [0.81a] StarSector AI Overhaul, Alpha 8.7
Post by: Death_Silence_66 on September 07, 2017, 05:16:31 PM
Issue with carriers, fighters completely ignore regroup orders and do not attack targeted ships. Instead they seem to pick their own targets at will. Additionally, bombers and missile armed fighters have weird missile launching AI. Sometimes they just fly straight at the target and don't launch while other times the fire at the first ship in range.

All tested with vanilla ships and fighters. Just loaded up coral nebula.
Title: Re: [0.81a] StarSector AI Overhaul, Alpha 8.7
Post by: xenoargh on September 07, 2017, 07:59:39 PM
Hmm.  Two different issues there; I know exactly what's wrong with the missile-launching and that's easy to fix, but the Fighter AI situation's a little complicated, because Fighters apparently aren't getting Orders passed to them any more, so they'll need to get orders from their Carrier. 

I'll take a look and see what can be done.
Title: Re: [0.81a] StarSector AI Overhaul, Alpha 8.7
Post by: Death_Silence_66 on September 07, 2017, 08:44:04 PM
I don't know how clear this was, Im refering to the Regroup/Engage function all carriers have rather than actual orders.
Title: Re: [0.81a] StarSector AI Overhaul, Alpha 8.8
Post by: xenoargh on September 21, 2017, 08:27:03 AM
Alpha 8.8 is now available.

Supports "blacklisting" of hull ids, to allow modders to selectively:

1.  Not use the ship AI.
2.  Also not use the weapon / System AIs.

An example is in the mod of how to do this- see data/ai_config/blacklist.json to see how to blacklist a specific hull id.  See the example in the release, where the Hyperion has been blacklisted (it won't stay that way forever, but I figured it was a pretty safe ship to remove from the AI for now).

This should resolve the bugs reported here (http://fractalsoftworks.com/forum/index.php?topic=5492.msg219686#msg219686), once that mod has been updated with the blacklist properly.

Modders, please be aware that blacklisting a hull has performance implications, especially if there are a large number of ships involved.  Don't do this willy-nilly, basically; just for really weird cases where you've implemented a very specific AI yourselves.  Generally speaking, if you're having problems with a System AI or other behavior issues when this mod interacts with yours, you should report them here for a fix, not blacklist the ships; in this case it was the best way to resolve the issues, because of the odd way the "shield" stuff was done.



I'm still working on the fighter / carrier AI issues.  Don't worry, this hasn't been forgotten; I've worked on some of the issues.  It's just not polished yet.
Title: Re: [0.81a] StarSector AI Overhaul, Alpha 0.9a
Post by: xenoargh on September 24, 2017, 09:09:05 AM
Alpha 0.9a is now available.

Features:

Fighters of certain types (BOMBER, ASSAULT, SUPPORT) will now obey explicit orders to attack a ship's current target.  INTERCEPTOR and FIGHTER types will still pick their targets independently like they've been doing.

Fighters can now be ordered to guard their Carrier.  AI Carriers don't bother using this command at this time, but may in the future if they're being threatened.  I tried an early version of this out and wasn't terribly happy with how it yanked fighters away from doing damage to the collective enemy fleet, so I will think about this problem a little more.

This should resolve most of the, "I can't give my fighters orders" issues without subordinating the independent fighters that need to stay free to intercept things; if you want to coordinate a bomber strike, this certainly works and the AI occasionally uses this to devastating effect now ;)
Title: Re: [0.81a] StarSector AI Overhaul, Alpha 0.9a
Post by: Death_Silence_66 on September 25, 2017, 05:47:20 PM
The issue with carriers seems partially fixed. While bombers don't wander off the instant they have a target, when you select one as a carrier they disregard the regroup command. Additionally, the AI of fighters as a whole seems strange.

Spoiler
Bombers not launching despite having a clear shot at the side of a dominator(https://i.imgur.com/Kk4f4eR.png)
[close]

Spoiler
Bombers not launching despite having a perfectly clear shot and a perfect approach(https://i.imgur.com/Rjxq2ZK.png)
[close]

Spoiler
More of the same(https://i.imgur.com/Uiz4nqQ.png)
[close]

Spoiler
AAAAAAAA(https://i.imgur.com/K4nrnbs.png)
[close]

Bombers sometimes do a strange dance, flying over their target and firing when they clear the opposite side. This is very common with torpedo bombers, but happens to a lesser degree with others. They seem to have a large emphasis on flanking or circling their target as well. They also don't use all their weapons at once, wasting their huge alpha strike and instead firing at seemingly random times.

While testing I also saw some less than ideal missile behavior

Spoiler
Dominator launching harpoons the instant they reload against talons...(https://i.imgur.com/bAdfjk5.png)
[close]
Title: Re: [0.81a] StarSector AI Overhaul, Alpha 0.9a
Post by: xenoargh on September 26, 2017, 09:34:30 AM
Yeah, that's not ideal, I'll check it out :)
Title: Re: [0.81a] StarSector AI Overhaul, Alpha 0.9a
Post by: RazorTS on September 30, 2017, 03:49:34 AM
At last had time to check new version out,


Ship movement is kinda better, just need to fix cowardly captain AI and autofire issues
Title: Re: [0.81a] StarSector AI Overhaul, Alpha 0.9a
Post by: xenoargh on October 02, 2017, 12:50:23 AM
I'll look into the autofire issues.  I don't really see the weapons not engaging when testing, though; can you give me a specific example using a Vanilla ship where I can replicate this?  About the only thing I can think of that might look strange, off-hand, is the behavior with the Dominator's fixed-forward guns, which is, admittedly, wonky; I think I need to write a specific solution for fixed-forward weapons at some point soon, they're kind of a special case.

The friendly ships are being cowardly because they're hugely out-numbered, in most cases; I'll adjust the aggressiveness up a little more, but it's a fine line between "too little" and "too much".

The ramming-by-movement stuff is pretty intentional; Burn Drive, for example, is powerful when the AI uses it to close and kill you.  But if there are some specific situations where it shouldn't be running, let me know and I'll see if I can make it smarter :)

The issues with missiles in general still need another look; essentially, if you're not using the Rebalance Pack, it's not behaving as intended.  I need to write a more generalized approach to missiles that doesn't need specific AI flags to determine behaviors; that's in the plan for the next build.



Title: Re: [0.81a] StarSector AI Overhaul, Alpha 0.91a
Post by: xenoargh on January 26, 2018, 07:18:25 AM
Version 0.91a released.

Addressed the issues with Fighters people pointed out, albeit in a different way than Vanilla handles it.  Your bombers / torpedo craft will engage properly, etc.

Missile use is a little smarter.

Auto-fire issues have been checked out; I couldn't identify any serious issues with that code.
Title: Re: [0.81a] StarSector AI Overhaul, Alpha 0.91a
Post by: Protoman on February 04, 2018, 12:31:18 AM
At last had time to check new version out,

  • Autofire AI seems to be broken, weapons very reluctant to shoot at anything, missiles target wrong targets;
  • Friendly ships hover just out of range and do not engage, enemies seem to engage but are hampered by autofire bugs;
  • Then they come in close and ram you, if they have movement abilities they will use it to ram you ;D
  • Shooting dumb torpedoes at you seems fine to AI;

Ship movement is kinda better, just need to fix cowardly captain AI and autofire issues
I am having the exact same issues.
Mods Used:
AutoSave
Blackrock Drive Yards
Combat Chatter
DIABLEAVIONICS
GLib
LazyLib
JunkPirates
Nexerelin
Shadowyards
*This Mod*
Steiner Foundation
Version checker

Drones also do this as well, looks like they get into range and just dont pull the trigger.
Title: Re: [0.81a] StarSector AI Overhaul, Alpha 0.91a
Post by: xenoargh on February 08, 2018, 08:46:45 AM
Hmm.  Dunno why it's not working for you with those mods enabled; I'll have to see if I can replicate.  Probably one of those mods is interfering with it somehow.
Title: Re: [0.81a] StarSector AI Overhaul, Alpha 0.91a
Post by: zeraphiel on January 19, 2020, 05:23:31 PM
I'm not sure if I'm doing something wrong but I only have your mod pack and my AI is just absurdly bad, like the last 2 posts are talking about.
Ships are just sitting around, taking shields down with a barrage coming at them, going in the middle of a group and aiming a spot with no shield at an enemy ship.
I was doing the first pirate fight in the tutorial and lost my primary ship(I had selected the fast start merc setup, so I'm pretty sure that fight should be over like its nothing)
Have you played the tutorial with your mod active? Not sure if the tutorial could be causing a problem or if its just broken in general.
Something is def wrong though. Hope you get it worked out because this sounds like an amazing mod.
Thanks!
Title: Re: [0.81a] StarSector AI Overhaul, Alpha 0.91a
Post by: Justinx931 on January 19, 2020, 08:46:43 PM
i'm not sure if you know but the last posts were early 2018, and this thread has been dead since those last 2 post, this mod hasn't made the jump to 0.9.1(or it did? alpha 0.91a on the title) and i fear all development has stopped.

wouldn't put much hope to the current bugs being amended.
Title: Re: [0.81a] StarSector AI Overhaul, Alpha 0.91a
Post by: zeraphiel on January 20, 2020, 12:23:27 PM
Thanks, I did see that the post was dead but seemed like the mod was still going because of the .91a title, NexusMods mod page talking about .91a and the latest update was Oct 2019
Might not get an answer but doesn't hurt to post :)
Title: Re: [0.81a] StarSector AI Overhaul, Alpha 0.91a
Post by: morriganj on January 22, 2020, 05:30:31 AM
I look forward to testing this out!
Title: Re: [0.81a] StarSector AI Overhaul, Alpha 0.91a
Post by: morriganj on January 22, 2020, 05:47:55 AM
Oh boo. Crash to desktop. I guess this has been abandoned.
Title: Re: [0.81a] StarSector AI Overhaul, Alpha 0.91a
Post by: ebolamorph on June 17, 2020, 12:04:15 AM
 im getting an error using this mod, something about fighter thruster sm. lemme fetch the file. this forum will not lemme post that image in this post
Title: Re: [0.81a] StarSector AI Overhaul, Alpha 0.91a
Post by: ebolamorph on June 17, 2020, 12:05:01 AM
the error i get trying to use your ai rebal

[attachment deleted by admin]
Title: Re: [0.81a] StarSector AI Overhaul, Alpha 0.91a
Post by: n1Z0 on June 17, 2020, 06:34:15 PM
the error i get trying to use your ai rebal

Disable all your mods and re-enable one by one to find the culprit.
Title: Re: [0.81a] StarSector AI Overhaul, Alpha 0.91a
Post by: connortron7 on June 17, 2020, 06:50:45 PM
the error i get trying to use your ai rebal

Uh bud, as it says in the title of the post, this is for 0.8.1a. its out of date and wont work
Title: Re: [0.81a] StarSector AI Overhaul, Alpha 0.91a
Post by: ebolamorph on June 17, 2020, 08:25:13 PM
the error i get trying to use your ai rebal

Disable all your mods and re-enable one by one to find the culprit.

i did. This was the culprit
Title: Re: [0.81a] StarSector AI Overhaul, Alpha 0.91a
Post by: n1Z0 on June 18, 2020, 01:05:45 AM
the error i get trying to use your ai rebal

Disable all your mods and re-enable one by one to find the culprit.

i did. This was the culprit
Strange, because I had this mod running fine on its own (in v0.9.1a BTW). There were definitely certain mods that I had do disable due to an abrasive relationship with it though.
Title: Re: [0.81a] StarSector AI Overhaul, Alpha 0.91a
Post by: ebolamorph on June 18, 2020, 01:43:14 AM
the error i get trying to use your ai rebal

Disable all your mods and re-enable one by one to find the culprit.

i did. This was the culprit
Strange, because I had this mod running fine on its own (in v0.9.1a BTW). There were definitely certain mods that I had do disable due to an abrasive relationship with it though.
what mods interfered with it?