Tactical Combat AI Mod

A place for discussion of making game modifications.
Post Reply
zolobolo
Posts: 1544
Joined: Fri Nov 25, 2016 3:49 pm

Re: Tactical Combat AI Mod

Post by zolobolo »

harpy eagle wrote:
zolobolo wrote:Would it be possible to display interception warning for small crafts (including Assault Shuttle) before launch like they are shown on the top right corner for movement?

Since the new AI function introduces reservation of PD, this would help the player to evaluate if an attack is worth it especially for Assault Shuttles
I'm not sure. One difference from the interception warning and what you're asking (if I understand correctly), is that the interception warning for movement is shown when there are crafts in-flight that are specifically tracking a ship.

Whereas in this case the PD could potentially autofire on anything, so it doesn't specifically reference any particular craft. So it would have to be a different kind of computation, one that checks if anything in general might autofire on your craft on it's way to the target.
This is not really a tactical AI improvement but a quality of life improvement for players, now that PD is being frequently reserved and the game UI not being prepped to deal with this kind of hazard for our small crafts. Especially Assault Shuttles are too valuable to be lost like this :)

Thought that it might be similarly solved as the vanilla warning alerts when we hover over a new position for a ship to move into, as there it also shows the exact location where the interception will occur and targeting enemy vessels with bombers seems like a similar function where range is displayed and we select a target location to "move" into (though ignored here except for Assault shuttles)
User avatar
harpy eagle
Posts: 296
Joined: Sat Mar 10, 2018 3:25 am

Re: Tactical Combat AI Mod

Post by harpy eagle »

It sounds like something that could be very helpful, but implementing it seems like it could be a bit tricky. I guess you would have to draw a line from the carrier to the potential target, and then for every hostile ship that can autofire PD, check if the closest point on that line is within that ship's PD weapon's autofire range.

A small update: the maximum allowed attack range for bombers and interceptors now depends on the new PD assessment, and varies between 1-3 times the strike distance (i.e. if a lot of hostile PD is present, they may not attack or intercept targets they cannot reach in 1turn, or if no PD is present, they may consider targets up to 3 turns away).

The next thing I want to look at is making the AI possibly not retreat transports in combat if it is likely to win. It's pretty silly when a massive invasion fleet arrives at a planet, but because there's a few defenders all the transports leave and then have to be sent back.
zolobolo
Posts: 1544
Joined: Fri Nov 25, 2016 3:49 pm

Re: Tactical Combat AI Mod

Post by zolobolo »

harpy eagle wrote: A small update: the maximum allowed attack range for bombers and interceptors now depends on the new PD assessment, and varies between 1-3 times the strike distance
This should resolve the issues with the specific planetary defense cases where bombers sortie too early - will run a few tests

Please note that military transports do not yet move last - this change did not seem to take effect

The classical scenario: Carrier+Planet against fleet of small ships works perfectly now :) Reason: the conservative fighter MGMT of the carrier compensates for the lack of concentrated fire against small crafts (as you mentioned the ships move first and then cannot fire on the fighters due to their arc)

Movement of carrier against starbases works nicely. They also only released bombers in short range but probably miscalculated a bit as they could not deliver their payloads (couple of mm missing for them)
Last edited by zolobolo on Thu Apr 05, 2018 6:54 pm, edited 2 times in total.
User avatar
siyoa
Posts: 182
Joined: Fri Apr 21, 2017 3:19 pm

Re: Tactical Combat AI Mod

Post by siyoa »

harpy eagle wrote:The next thing I want to look at is making the AI possibly not retreat transports in combat if it is likely to win. It's pretty silly when a massive invasion fleet arrives at a planet, but because there's a few defenders all the transports leave and then have to be sent back.
this leads into following ... did you ever have a chance to look into how formations are done ? because to have a colony ship almost at the front and warships at the back is quite not good ... I plan to look into this myself at some point
How did YOU get a key? All right, go in.
zolobolo
Posts: 1544
Joined: Fri Nov 25, 2016 3:49 pm

Re: Tactical Combat AI Mod

Post by zolobolo »

Error for PD evaluation apparently

Not CTD - can be ignored, probably only fails the evaluation function when battle happens
Attachments
PD Eval.png
PD Eval.png (206.93 KiB) Viewed 13769 times
User avatar
harpy eagle
Posts: 296
Joined: Sat Mar 10, 2018 3:25 am

Re: Tactical Combat AI Mod

Post by harpy eagle »

zolobolo wrote:Error for PD evaluation apparently
Thanks for catching that, I'm kind of surprised I didn't run into it myself while I was playing today. Now fixed.
siyoa wrote:this leads into following ... did you ever have a chance to look into how formations are done ? because to have a colony ship almost at the front and warships at the back is quite not good ... I plan to look into this myself at some point
I haven't but that's not a bad idea for something to look at. If I can tweak it so that tougher ships are placed up front it might help out the AI a bit, at least for the first few opening turns.
zolobolo wrote:Please note that military transports do not yet move last - this change did not seem to take effect
Huh, I'll take a look at that. I wonder if I inverted the logic by accident... Nope, was a typo.
zolobolo
Posts: 1544
Joined: Fri Nov 25, 2016 3:49 pm

Re: Tactical Combat AI Mod

Post by zolobolo »

Movement of ships can be optimized a bit: sometimes they move before firing on a more advantageous target which they cannot target later (like he Carrier and bombers case with firearms), and sometimes they take up positions around a large target which causes them to maximize the targets shield effectiveness as they are pummeling away on several sides at once

Below is a good example where the natural "movement" of a strongly shielded target would necessitate smart positioning from the attackers side to take advantage of weakened sides: the Steward wins the engagement even though the attacker fleet has rail-guns, bombers and a couple of plasma guns :)

The solution could be to:
- Refine AI movement logic to consider which side of an enemy to target
- Further decrease shield efficiency

The first, might be quite complicated to do, in which case we can move this discussion over to the shield re-balance mod discussion
If the second approach is taken, exact positioning of the ships would be less important and the AI naturally fairing better, but if the first approach can be released it can improve the overall performance of the AI in various scenarios where large targets are involved (carriers, Steward, bases etc..)
Attachments
One against All.png
One against All.png (482.63 KiB) Viewed 13752 times
zolobolo
Posts: 1544
Joined: Fri Nov 25, 2016 3:49 pm

Re: Tactical Combat AI Mod

Post by zolobolo »

Nil value of PD eval

Here is the save in case needed: https://www.dropbox.com/s/ty11bpr1r9fxp ... 5.rar?dl=0
Attachments
nil.png
nil.png (64.52 KiB) Viewed 13751 times
User avatar
harpy eagle
Posts: 296
Joined: Sat Mar 10, 2018 3:25 am

Re: Tactical Combat AI Mod

Post by harpy eagle »

Thank you, fixed.
User avatar
harpy eagle
Posts: 296
Joined: Sat Mar 10, 2018 3:25 am

Re: Tactical Combat AI Mod

Post by harpy eagle »

zolobolo wrote:Movement of ships can be optimized a bit: sometimes they move before firing on a more advantageous target which they cannot target later (like he Carrier and bombers case with firearms), and sometimes they take up positions around a large target which causes them to maximize the targets shield effectiveness as they are pummeling away on several sides at once
The core of AI ship movement is done by the C++ function: find_min_facing_move_L2(ship,target,dist). I don't think there's a way to tell it to try to move to a specific side of the target. Though sven may decide to add that someday (If you do, please try to make it so that ships attempt to keep dist from the target as they move around the ship, instead of moving toward the specified side but stopping once they are within dist).

If that was added, it would open up another problem of ships moving into dangerous kill-zones just to get at open shield, or ships moving all over the place as their target rotates. I think the former could be address from lua, once we get there.
zolobolo
Posts: 1544
Joined: Fri Nov 25, 2016 3:49 pm

Re: Tactical Combat AI Mod

Post by zolobolo »

Yes, a more advanced movement function + the new issues might not be worth it (considering all the possible scenarios would be crazy complex)
Would be more optimal to tweak shield direction advantage via a separate mod like you suggested
zolobolo
Posts: 1544
Joined: Fri Nov 25, 2016 3:49 pm

Re: Tactical Combat AI Mod

Post by zolobolo »

Enemy cruisers seem to often target a more distant target even if a ship of the same type is in closer range
They loos 1 turn for their shots to take effect and give chance to the enemy for the missiles to be more easily intercepted

Since the cruisers do not move but only fire the rockets, I assume they have entered bombing stance but even then the prioritization should select the closest counterpart of two identical ships right?

PD has not been reserved in order to not effect the scenario and both destroyers are identical in their load out (the one in the back even has some damage to it r4educing its combat effectiveness - maybe that is why it is targeted?)

Save has been attached
Attachments
Mod Testing 6.rar
(809.47 KiB) Downloaded 418 times
Rocket distance prio.png
Rocket distance prio.png (451.46 KiB) Viewed 13741 times
User avatar
harpy eagle
Posts: 296
Joined: Sat Mar 10, 2018 3:25 am

Re: Tactical Combat AI Mod

Post by harpy eagle »

zolobolo wrote:PD has not been reserved in order to not effect the scenario and both destroyers are identical in their load out (the one in the back even has some damage to it r4educing its combat effectiveness - maybe that is why it is targeted?)
The destroyer at the back has only 13 armour, while the destroyer at the bottom has 37. So if they are otherwise identical, the AI will prefer the destroyer at the back.
User avatar
harpy eagle
Posts: 296
Joined: Sat Mar 10, 2018 3:25 am

Re: Tactical Combat AI Mod

Post by harpy eagle »

Missiles within strike range get a 1.5 times multiplier to priority, so in order for the ship at the bottom to be targeted, the ship at the back would have to have 25 or more armour left (assuming everything else was identical).

Maybe I should incorporate estimated PD into that decision instead of a hardcoded multiplier...
zolobolo
Posts: 1544
Joined: Fri Nov 25, 2016 3:49 pm

Re: Tactical Combat AI Mod

Post by zolobolo »

harpy eagle wrote:
zolobolo wrote:PD has not been reserved in order to not effect the scenario and both destroyers are identical in their load out (the one in the back even has some damage to it r4educing its combat effectiveness - maybe that is why it is targeted?)
The destroyer at the back has only 13 armour, while the destroyer at the bottom has 37. So if they are otherwise identical, the AI will prefer the destroyer at the back.
So it considers potential damage to HP of higher value then to armor...
That makes sense of course but why not move right in front of the target and shoot from there to avoid missile travel time taking more then one turn?
They have range, space to move to and no reserved batteries to shoot them while moving

In all other occasions, the ships seem to move first and ask - I mean - shoot questions later (this was the issue with the bomber/carrier/fire-arc case) so why not here as well? That is why I was thinking this might be a bombardment standoff scenario of sorts
Post Reply