Fractal Softworks Forum

Please login or register.

Login with username, password and session length
Advanced search  

News:

Starsector 0.97a is out! (02/02/24); New blog post: Simulator Enhancements (03/13/24)

Author Topic: Rapid Closure AI Change  (Read 3347 times)

JDCollie

  • Captain
  • ****
  • Posts: 261
    • View Profile
    • My Youtube Channel
Rapid Closure AI Change
« on: May 09, 2014, 12:58:15 AM »

Would it be possible to make the AI attempt to move out of enemy weapons' range in the event that an enemy vessel rapidly closes on the AI ship? (I.E., like burn drive or multiple teleport jumps)  Right now, the AI has a really tough time against massive alpha strikes, and ships which can suddenly close on them, be it anti-matter Medusas or burn-driving Dominators, can really really ruin the AI's day. Rather than trying to identify the means of movement, just measuring the relative distance and the speed with which a ship is covering it seems an effective strategy.  Perhaps the likelyhood of the AI retreating temporarily in such a fashion could be determined by the flux level of the approaching ship? Like, the higher the flux, the less likely the AI will back off, as the attacker probably doesn't have the flux reserve to land an effective alpha strike.

Anyway, just a thought.
Logged

xenoargh

  • Admiral
  • *****
  • Posts: 5078
  • naively breaking things!
    • View Profile
Re: Rapid Closure AI Change
« Reply #1 on: May 09, 2014, 12:21:31 PM »

But there is nothing that a (conventional) ship can do to avoid those things.  That's kind of the point to those Systems.  Ideally, you'd want the AI to "know" that's possible and to conserve Flux for the moment, but frankly, that's asking a lot from an AI (because all of the times it guesses wrong it's being really inefficient).

The only way that a ship can avoid an Onslaught using Burn Drive is to stay out of the Burn Drive's range + weapon ranges; that basically means avoiding combat with that ship entirely, ever, other the LRMs, at least in Vanilla.  With Phase Skimmer, etc., the problem is even harder, since the ships with those Systems don't necessarily need to move in straight lines. 

So, basically, this is a very, very difficult thing to make AI rules for; at best, you can get them to keep away from certain ships, but that starts getting pretty difficult pretty fast.

It'd be quicker and easier to simply make alpha-strike less attractive, balance-wise.
Logged
Please check out my SS projects :)
Xeno's Mod Pack

JDCollie

  • Captain
  • ****
  • Posts: 261
    • View Profile
    • My Youtube Channel
Re: Rapid Closure AI Change
« Reply #2 on: May 10, 2014, 07:20:23 PM »

But there is nothing that a (conventional) ship can do to avoid those things.  That's kind of the point to those Systems.  Ideally, you'd want the AI to "know" that's possible and to conserve Flux for the moment, but frankly, that's asking a lot from an AI (because all of the times it guesses wrong it's being really inefficient).

The only way that a ship can avoid an Onslaught using Burn Drive is to stay out of the Burn Drive's range + weapon ranges; that basically means avoiding combat with that ship entirely, ever, other the LRMs, at least in Vanilla.  With Phase Skimmer, etc., the problem is even harder, since the ships with those Systems don't necessarily need to move in straight lines. 

So, basically, this is a very, very difficult thing to make AI rules for; at best, you can get them to keep away from certain ships, but that starts getting pretty difficult pretty fast.

It'd be quicker and easier to simply make alpha-strike less attractive, balance-wise.

I recognize a predictive AI algorithm would be pretty darn difficult to write - what I'm thinking of is just something that gets a ship retreating before it gets overloaded, rather than because it is getting overloaded. I.E., a way for the AI to potentially realize that it is about to get blitzed. Granted my idea might not save them from something like an Onslaught, but to be fair, what would?

Also, to clarify, this isn't to keep a ship eternally outside the range of an enemy ship's movement ability (this change wouldn't even take the presence of such a device into consideration), but rather it is to try to keep a ship from suddenly being within alpha strike range. I dunno, maybe it would be totally ineffective; it just feels like the AI is ridiculously vulnerable to blitzkrieg maneuvers right now.
Logged

Dark.Revenant

  • Admiral
  • *****
  • Posts: 2806
    • View Profile
    • Sc2Mafia
Re: Rapid Closure AI Change
« Reply #3 on: May 11, 2014, 02:45:19 PM »

Perhaps certain ships or systems can be flagged with a STRIKE flag, symbolizing that the ship focuses on alpha strikes.  If defending without the intention to press attack against such ships, keep as much distance as possible.  If attacking said ships, relentlessly flank and pursue them (don't back off ever).  It's not a terribly hard change on the AI side but it does involve some more defined data.
Logged

dmaiski

  • Captain
  • ****
  • Posts: 422
  • resistance is futile
    • View Profile
Re: Rapid Closure AI Change
« Reply #4 on: May 11, 2014, 03:19:05 PM »

:P well you can allways track the delta flux, and if delta flux exceeds threshold make the ship play defencively

:P and making an array of enemy ships and tracking "main gun" ranges, and distance to ship can be used to determine what you wan't

ultra rough off the top of my head pseudocode :P
Spoiler
Code: java
list.ships
array shipstats[][]
for(i=1; i<=ships.size; i++;){

if(shipstats[i][1] = null){
shipstats[i][1] = AnalyseMainGuns(ships(i).getWeapons); //gets a "danger range" for the ship
}

DisDelt = GetDistatnce(self, ships(i));

if (shipstats[i][2] > 50+DisDelt && DisDelt < shipstats[i][1]){
retreat = true;
}

shipstats[i][2] = GetDistatnce(self, ships(i))
}
ect...
kinda thing
[close]
« Last Edit: May 11, 2014, 03:29:20 PM by dmaiski »
Logged
BISO
(WIP) lots of shiny new weapons ( :-[ i have more weapons then sprites :-[ )

i got a cat pad
its like a mouse pad but better!

xenoargh

  • Admiral
  • *****
  • Posts: 5078
  • naively breaking things!
    • View Profile
Re: Rapid Closure AI Change
« Reply #5 on: May 11, 2014, 03:41:03 PM »

It'd be hard to define STRIKE other than arbitrarily, though.  For example, is a Medusa armed with a pair of Heavy Maulers and a bunch of Vulcans STRIKE or is it a kiting ship that can absorb a lot of missiles?  It can do both.  Do we want a Destroyer to attempt to face-hug an Onslaught, or keep well away on general principles?

Doing it by System might be most-helpful, but there are issues there as well.  

An Onslaught with Burn Drive recharging is a sitting duck and a tail-chase might be very helpful, if the ship can do that, but a Medusa is just a few seconds away from being able to warp behind you and a Hyperion is probably about to do something very nasty to your engines and then it will avoid being face-hugged in turn quite easily.

It's probably easier to simply balance those Systems a bit better, tbh; if they're a little too useful for alpha-strike behaviors, to the point where ships are worth far more than anything else in their class, they probably need a nerf.  

Medusas would lose quite a bit of alpha-strike if Skimmer took a couple more seconds to charge; Onslaughts, imo at least, aren't terribly OP, Hyperions largely just needed their teleporter's recharge increased quite a bit, so that they could get in... but not get out so easily.  Then again, I remember when they were like evil pogo sticks and could get another teleport going about when their shots landed, lol; it's a little better now, but that's probably the best way to balance ships that are almost entirely about that concept.

That said, almost all of the alpha-strike "abuse" is player-driven, and has more to do with the AI not quite mobbing the player as well as it might.
Logged
Please check out my SS projects :)
Xeno's Mod Pack

Megas

  • Admiral
  • *****
  • Posts: 12118
    • View Profile
Re: Rapid Closure AI Change
« Reply #6 on: May 11, 2014, 04:53:06 PM »

Quote
Medusas would lose quite a bit of alpha-strike if Skimmer took a couple more seconds to charge;
For a player, not really.  I usually save a charge or two for escape purposes.  When I need to escape, I use Skimmer, drift until all three charges are back, then resume twitch-shmup action.  Medusa should rely on normal mobility and/or its strong shield for defense, and save the Skimmer until it is really needed.

It would make an AI Medusa a bit more vulnerable, though, since it is all too eager to waste charges for trivial uses.
Logged

JDCollie

  • Captain
  • ****
  • Posts: 261
    • View Profile
    • My Youtube Channel
Re: Rapid Closure AI Change
« Reply #7 on: May 12, 2014, 07:15:11 AM »

Perhaps certain ships or systems can be flagged with a STRIKE flag, symbolizing that the ship focuses on alpha strikes.  If defending without the intention to press attack against such ships, keep as much distance as possible.  If attacking said ships, relentlessly flank and pursue them (don't back off ever).  It's not a terribly hard change on the AI side but it does involve some more defined data.
This is largely why I was thinking the behavior should be triggered by enemy ship movement, rather than be an identifier on the enemy ship. Additionally, it would allow the AI to respond a little to the player who's movement, loadout, and overall behavior are potentially far more difficult to predict by ship class.
Logged

Dark.Revenant

  • Admiral
  • *****
  • Posts: 2806
    • View Profile
    • Sc2Mafia
Re: Rapid Closure AI Change
« Reply #8 on: May 12, 2014, 12:19:13 PM »

Being triggered by enemy ship movement would cause the decision to be made too late to matter.  Unless you're using a learning AI, which comes with its own set of problems.

@Xeno The method I listed works better than you'd think.  Suppose the AI is trying to attack a "STRIKE" ship like the Onslaught; it will try to rush and flank it.  When it inevitably burn drives, the attacking ship will sidestep and press from the rear.  If it's defending, it will just back off as long as it can since really that's all you can hope to do against an Onslaught.

Against a Medusa or Hyperion, the only offensive measure is trying to run at the ship in question, because the original system is so OP.  There's basically no defense, but running away prevents some damage and generally ties up the "STRIKE" ship for as long as possible.  Either way, my simple procedure works for this case as well.
Logged

JDCollie

  • Captain
  • ****
  • Posts: 261
    • View Profile
    • My Youtube Channel
Re: Rapid Closure AI Change
« Reply #9 on: May 12, 2014, 02:07:52 PM »

Being triggered by enemy ship movement would cause the decision to be made too late to matter.  Unless you're using a learning AI, which comes with its own set of problems.
I'm hoping for more of a dynamic and contextual solution, but you bring up a compelling point. Basically, you're smaller, faster ships would be baiting so called "strike" vessels into wasting their movement systems, yes? And then exploiting the usual caveats of those systems.

It wouldn't work against the drive systems on something like a BRDY Nevermore (as the system gives maneuverability as well as speed, but it would certainly help against heavy nasties like Dominators and Onslaughts.
Logged

dmaiski

  • Captain
  • ****
  • Posts: 422
  • resistance is futile
    • View Profile
Re: Rapid Closure AI Change
« Reply #10 on: May 12, 2014, 02:10:35 PM »

heres the issue with that :P

just using the "strike" tag requires that all stuff be tagged with "strike" or it wont be recognized

then how do you solve issues where a ship is armed with both strike, and non-strike weaps

also strike has a verry limited scope, and is an artificial means of making an AI adapt to situation, it would be verry easy to abuse

if you are tracking aproching ships, this can give concrete values, they can also be used even for non-"strike" tracking components of the AI(making it faster).
Logged
BISO
(WIP) lots of shiny new weapons ( :-[ i have more weapons then sprites :-[ )

i got a cat pad
its like a mouse pad but better!

Dark.Revenant

  • Admiral
  • *****
  • Posts: 2806
    • View Profile
    • Sc2Mafia
Re: Rapid Closure AI Change
« Reply #11 on: May 12, 2014, 03:09:39 PM »

The STRIKE tag would be created procedurally by the ship AI that would be labeled as a STRIKE ship.  So if the AI knows it will use those tactics it will flag itself as STRIKE.  A little unrealistic but it works.
Logged

JDCollie

  • Captain
  • ****
  • Posts: 261
    • View Profile
    • My Youtube Channel
Re: Rapid Closure AI Change
« Reply #12 on: May 12, 2014, 07:57:14 PM »

The STRIKE tag would be created procedurally by the ship AI that would be labeled as a STRIKE ship.  So if the AI knows it will use those tactics it will flag itself as STRIKE.  A little unrealistic but it works.
That . . . actually makes a lot of sense.
Logged