Fractal Softworks Forum

Starsector => Suggestions => Topic started by: xenoargh on September 19, 2012, 10:46:33 PM

Title: Problems with broadside logic
Post by: xenoargh on September 19, 2012, 10:46:33 PM
Basically, the ship AI isn't handling long, skinny ships well, and I think it needs a rule change.  If the majority of the weapons are restricted to an arc that's pointed to either + / - 60 to + / - 120 degrees, or if the largest total DPS lies into those areas, the ship needs to use the broadside logic (i.e., attempt to circle the target or cross the T, instead of using strafe).  If both sides are even, it needs to pick a direction to circle and stick with it, probably for the rest of the battle, as if it picks randomly each time the AI picks a new target, it tends to do more harm than good.

That this isn't working right atm was revealed pretty massively when I built this guy:

(http://www.wolfegames.com/TA_Section/glaug_battleship.png)
All those side-arc weapons were Medium Ballistic, with a combined DPS that far-outweighed anything in the forward arc.  The ship didn't perform adequately until I allowed all those turrets to face fully forwards, however, and tried to face forwards regardless.  This problem also plagues the un-modded Conquerer.
Title: Re: Problems with broadside logic
Post by: Ghoti on September 20, 2012, 03:20:31 AM
I'm not seeing this behavior. Certainly I've seen times where the AI didn't pick the best angle of overlapping arcs on some broadside ships. I've never seen an outright focus on only front facing weapons except in cases where the AI isn't happy about its position.

If you're testing AI vs AI fights, the problem is that the AI in starfarer plays a very nasty game on the player (and tries to play it on other AI). It will always retreat, it never takes the initiative. Why don't you add your ship to the sim_opponents.csv and see if it still exhibits that behavior when you are flying at it.
Title: Re: Problems with broadside logic
Post by: Alex on September 20, 2012, 08:26:33 AM
The broadside AI isn't meant to handle broadside arcs that are less than what's on the current Conquest. Sounds like the ones on this ship are too narrow. So, not a bug - merely not a supported feature :)
Title: Re: Problems with broadside logic
Post by: FlashFrozen on September 20, 2012, 10:41:16 AM
Means we just have to wait until ai modding for being able to set such broadside angles for the ai :P

Problem only really shows up when you have really narrow broadside angles, and your ship turns as much as a conquest to "try" and broadside,
Title: Re: Problems with broadside logic
Post by: Sproginator on September 20, 2012, 01:30:09 PM
I don't understand why we don't just have a small option within the ship.csv file to be able to assign a specific ship behaviour? It would be a lot more easy
Title: Re: Problems with broadside logic
Post by: GUNINANRUNIN on September 20, 2012, 01:32:56 PM
I don't understand why we don't just have a small option within the ship.csv file to be able to assign a specific ship behaviour? It would be a lot more easy
Won't ship behaviors come along with officer personalities?

EDIT: Looking back at this post, I realize it was utterly ridiculous.
Title: Re: Problems with broadside logic
Post by: Alex on September 20, 2012, 01:39:37 PM
I don't understand why we don't just have a small option within the ship.csv file to be able to assign a specific ship behaviour? It would be a lot more easy

Not for this type of thing, it entirely depends on the weapon loadout. Besides, I'm almost sure the AI is already properly recognizing it's a broadside ship. It's just not able to use it well, given the ship's parameters. Unless I'm missing what the ship's weapon arcs look like - hard to tell from that graphic alone.
Title: Re: Problems with broadside logic
Post by: Ghoti on September 20, 2012, 01:44:47 PM
is the broadside detection really just a yes/no thing?
Title: Re: Problems with broadside logic
Post by: Alex on September 20, 2012, 01:46:26 PM
is the broadside detection really just a yes/no thing?

No. Which side, at what range, what weapons are disabled/out of ammo/don't need to be aimed, etc.
Title: Re: Problems with broadside logic
Post by: Reshy on September 21, 2012, 02:05:56 PM
Broadside logic could be better, and I do think that the idea about having broadside ships fly circles instead of strafing around targets would be a good idea.
Title: Re: Problems with broadside logic
Post by: Ghoti on September 21, 2012, 02:17:35 PM
is the broadside detection really just a yes/no thing?

No. Which side, at what range, what weapons are disabled/out of ammo/don't need to be aimed, etc.

and if all that is true, point the ship ~45 degrees away from the target?
Title: Re: Problems with broadside logic
Post by: xenoargh on September 22, 2012, 09:15:53 AM
The weapons were originally designed to be at right angles and to have 120-degree arcs, i.e. nothing on the broadsides faced fully forwards. 

To be remotely efficient, it would have to do circling behavior, not a face-forwards-then-twist behavior, which is what it occasionally tried to do.  This is an edge-case thing, because, in theory, it can do "more damage" by facing the target at an angle, but this screws up the ship's manuevers and makes it waste delta-v, making it considerably less efficient in chasing fights, whereas if it circled, it would not be able to kite, but any enemy entering the circle faces the maximum possible number of guns.

Anyhow, I fixed it the same way I fixed the Conquest, by allowing the arcs to reach full forwards.  Then it starts behaving efficiently, but it's twice as powerful as planned ;)
Title: Re: Problems with broadside logic
Post by: Ghoti on September 22, 2012, 09:37:28 AM
wasting delta-v?

when the ship fires it slows it down by a large amount. Same thing happens to turning speed. I bet if you take off the guns in the front, you'll find chasing behavior is better.
Title: Re: Problems with broadside logic
Post by: xenoargh on September 22, 2012, 11:55:21 AM
Strafe speeds aren't the same as forward speeds, and although the velocity caps on ships hide it to some degree, when a ship isn't perfectly facing the opponent, it's using up delta-v on a vector that won't take it nearer to the enemy.  That velocity then has to be corrected for, hence it's a waste of delta-v. 

In kiting situations, wasting delta-v is bad, because it means your enemy can either catch you or that you can't catch them.  What I want to see is an AI behavior that deliberately avoids kiting and just goes for broadsides, when that's where the overwhelming majority of the DPS is :)
Title: Re: Problems with broadside logic
Post by: Ghoti on September 22, 2012, 03:43:11 PM
You know I thought that was for the AI personalities. I'm not sure if that does anything right now.

2 things I'll mention. You only get better acceleration (not delta-V, these ships don't seem to use propellant for in system travel) for forward thrust. The best behavior in that case is to jam forwards towards an enemy then coast. They don't get the benefit of reverse. In that case it's the break key, which will give you the same acceleration in any direction. The other thing is about the alternative strategy. More or less: I don't get it. Could you demonstrate with a video or something?
Title: Re: Problems with broadside logic
Post by: xenoargh on September 22, 2012, 07:14:43 PM
Quote
You only get better acceleration (not delta-V, these ships don't seem to use propellant for in system travel) for forward thrust.
Delta-V is just physics shorthand for the change in velocity over time; doesn't matter what's causing it.  Forward and backwards thrust is purely arbitrary and can be controlled by modders' numbers; strafe, on the other hand, is some magic number that we're not currently allowed to tweak.  Anyhow, that's a side topic.

Quote
More or less: I don't get it. Could you demonstrate with a video or something?
It's pretty simple, really; ships with most of their DPS on side arcs need to act like ships do in sailing-ship sims, where they attempt to keep their side, not their front, facing the enemy.  Look up "crossing the T" on Google and read a little about how naval warfare worked before the WWI / WWII Dreadnought-style of warship became the primary design. 

That design, btw, can deliver both maximally-effective broadside fire and better firepower whilst in the chaser role, allowing the RL ships to kite by delivering a broadside while at flank speeds every time they were able to gain enough distance on the vessel they were pursuing.

For pure space warfare on a 2D playing field, neither design is actually all that efficient, because the rear guns will almost never get used due to the inefficiency of broadsides; the best firepower is always going to be a flying-wing or globe design, for either converging broadsides while kiting or a concentration that no amount of counter-battery is going to block; both designs offer strong advantages and disadvantages. 

But I wanted to put some of this kind of design in and give them enough advantages that they'd be useful and provide something different to shoot at, and what I'm finding is that the AI just doesn't use them right, no matter how they're stacked.  For example, if I put weapons onto the side gun positions that greatly outrange anything else in that turret category, giving it a definitive advantage, it still won't attempt to circle the target, even though at that point it's advantageous to do so, due to using its delta-V to force the opponent to burn delta-V inefficiently to continue to bring itself into range, while the whole period is increasing the accuracy of my fire.  IOW, there are actually some situations where using broadsides makes sense even in a 2D game like this; same argument can be made that if all ranges are equal and the opponent cannot gain a range advantage and permanently kite, if a broadside provides greater DPS, it's time to circle. 

But the AI isn't doing any of that; it's largely unaware that it's stacked for broadside behaviors and doesn't appear to take these things into account.  So I saw my long, skinny warship that was stacked to kill a lot of minor vessels in a couple of volleys, if it used a broadside and forced the enemy to approach it on that arc fly straight at the enemy, and occasionally turn enough to deliver a partial volley (due to range; remember those front guns are quite a few pixels forward) which cost it delta-V and wasn't effective.
Title: Re: Problems with broadside logic
Post by: Ghoti on September 22, 2012, 09:24:44 PM
Ok. The reason I asked you for a video was to get you to actually try to execute the strategy you were describing.

delta V is a measure of the change in velocity over a long time period. Acceleration is the derivative of velocity at a point in time. They ARE different concepts. Sorry.
Title: Re: Problems with broadside logic
Post by: xenoargh on September 23, 2012, 12:07:10 AM
Delta-V (http://en.wikipedia.org/wiki/Delta-v) is not specific to any particular time limit.  You're thinking about rockets burning fuel, I'm talking about vector magnitude changes and the time costs.

Acceleration (http://en.wikipedia.org/wiki/Acceleration) is important, when dealing with delta-v, because you can only change the magnitude and arrive at the correct vector once you're facing the direction where you get the most acceleration along the correct vector and have input enough time.  This is why when you fight an enemy with equal speed and acceleration and they're kiting, if you wiggle, you lose ground.

Turning speeds matter here, too, because they're the amount of total time it takes to arrive at the vector, which is going to keep changing over that period of time.

Anyhow, long story short, ships designed for broadsides should attempt to circle the target, because the enemy's in the area covered by the largest-possible concentration of DPS.  They aren't; they're wasting delta-v and DPS, both.  It's a special situation that only occurs with a ship that's really build specifically for broadside-only engagements, but it'd be nice if it could work, because it'd add more interesting patterns of behavior :)
Title: Re: Problems with broadside logic
Post by: Ghoti on September 23, 2012, 07:21:58 AM
Seems iffy, but Ok.

However. I am serious. Actually try the strategy you're talking about. Circle a target with a broadside in starfarer.
Title: Re: Problems with broadside logic
Post by: Gothars on September 23, 2012, 07:30:29 AM
You both realize that this is the bug-report section, and Alex explicitly stated that he wishes no discussion in here, don't you? Just saying...
Title: Re: Problems with broadside logic
Post by: xenoargh on September 23, 2012, 08:17:57 AM
I was trying to explain the issues, is all :)

Anyhow, I've executed the strat manually; it works just like it does in the real world (http://en.wikipedia.org/wiki/Line_of_battle), with a ship that's designed for it; the problem is that the AI doesn't know how to do this kind of behavior :)
Title: Re: Problems with broadside logic
Post by: naufrago on September 23, 2012, 09:07:06 AM
Heh. Been watching this topic since it started and was wondering when it was going to get locked/moved. If it digressed much further, I was going to suggest you start a thread in another section of the forums, but looks like that won't be necessary =p

I have nothing useful to add. Don't mind me, just passing through.
Title: Re: Problems with broadside logic
Post by: xenoargh on September 23, 2012, 12:01:54 PM
Yeah, I, uh, didn't expect it to keep being tangential  ;D
Title: Re: Problems with broadside logic
Post by: xenoargh on September 30, 2012, 04:30:00 PM
Sorry to resurrect this, but I've seen another issue; ships that are clearly going to get the most DPS from not ever using a broadside vs. their primary opponent are doing so.

I got to see this with the fixed-arc forward-mount stuff; I have a Cruiser in the mod now that has a really impressive forward arc DPS setup.  Went to test it, expected it to be a nasty kite-machine and practically impossible to beat unless the opponent was faster or there was a significant difference in range bands.

To my surprise, the design got handed its butt, when flown by the AI.

When it attacks a target, it fires the front-arc weapons once, then turns and gives the side to the enemy to pound, turning 45 degrees or more, making all that firepower useless and building Flux on the shields, so that there's even less Flux for further attacks.

Given how long it takes a Cruiser to turn, this is a little counter-productive :)

The whole "twist my ship to spread armor damage" logic is not optimal for those kinds of ships.  If they have fixed-arc weapons that provide a lot of the DPS, or are equipped for broadsides, they really need to just kite or circle, otherwise they're basically cripples, because they're forgoing a lot of damage, putting them further behind the curve.  This is an especially vicious cycle if the ship needs to close, because any variation from a straight-line course is wasting so much delta-v and time, both of which give the opponent time to recover.
Title: Re: Problems with broadside logic
Post by: xenoargh on September 30, 2012, 07:51:46 PM
Did some experiments to figure out what's up with the "twisting" behaviors on forward-arc ships.  I presume, from the patch notes, that these observations may already be defunct in the current build, but I wanted to see if I could find a fix :)

1.  If the forward-facing weapons group is set to Auto, it is much more likely to not twist than if not, when piloted by the AI.

2.  Range seems to be the primary consideration, not DPS.  If the forward-facing guns have lower or equal ranges, then it twists, regardless of DPS or Flux efficiency.

So I made a temporary fix by changing some ranges and making sure all the groups in Variants are set to Auto by default.  Not the best fix, as it effects balance, but it's much better than watching ships not work as designed :)
Title: Re: Problems with broadside logic
Post by: Alex on September 30, 2012, 08:02:33 PM
Hey - thanks for the feedback. In general, if there's an AI problem you want to see improved, the best thing is to point to is a vanilla ship matchup where it's really apparent, preferably a 1-1. That makes it easiest for me to look at in detail.

1.  If the forward-facing weapons group is set to Auto, it is much more likely to not twist than if not, when piloted by the AI.

Quick note: setting a group to auto or not in the weapon groups dialog has absolutely zero impact on the AI.