Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Suicidal Commander #5

Open
Achilleshiel opened this issue Jun 11, 2021 · 7 comments
Open

Suicidal Commander #5

Achilleshiel opened this issue Jun 11, 2021 · 7 comments

Comments

@Achilleshiel
Copy link

The ACU walks offensive out of its base and often gets sniped early, or late game without any resistance.
ACU walks to often into T2 point defense without upgrades. This is happening since v93.

@bergzand
Copy link

To elaborate a bit on this, we're seeing this behavior a lot on 10 km (autogenerated) maps with the adaptive AIx. The 20 km maps are probably too large allow for the offensive play style. Where previously the enemy ACU would bunker up in it's base underneath a lot of shielding, it now can be sniped easily because it is idling or out hunting outside the base.

I think we should be able to provide some replays showing the issue if that helps.

@Uveso
Copy link
Owner

Uveso commented Jun 12, 2021

Thanks for the report!

Yes the ACU is suicidal. :)

I build a new system to decide if the ACU should attack or retreat.
I call it the Braveness factor. Positive numbers will lead to an attack, negative lead to fall back to base:

Basically ist calculated by this conditions:

  • We gain 1 Braveness if we have full health

  • We gain 1 Braveness for every 7% health we have over 30% health (+10 on 100% health)

  • We gain 1 Braveness (max +3) for every 12 friendly T1 units nearby

  • We gain 0.5 Braveness if we have at least 5 Anti Air units in close range

  • We gain 1 Braveness if overcharge is available

  • We gain 1 Braveness for every enhancement

  • We gain 0.1 Braveness for every tactical missile defense nearby

  • We gain 0.5 Braveness for every Tech2 and 1 Braveness for every tech3 shield nearby

  • We lose 1 Braveness for every 4 t1 enemy units in close range

  • We lose 5 Braveness for every additional enemy ACU nearby (+0 for 1 ACU, +5 for 2 ACUs, +10 for 3 ACUs

  • We lose 1 Braveness if we got damaged in the last 4 seconds

  • We lose 1 Braveness for every 20 map units that we are away from the main base (a 5x5 map has 256x256 map units)

  • We lose 3 bravness in range of an enemy tactical missile launcher, we lose 10 in case we are at low health

  • We lose 10 bravness in case the enemy has more than 8 Tech2/3 bomber or gunships

  • We lose all Braveness if we have under 20% health

Here is the code:
https://github.com/Uveso/AI-Uveso/blob/master/hook/lua/platoon.lua#L3565

The calculation is not balanced yet, and its absolute normal that the ACU is way too aggressive.
This will be better after adding more conditions for losing Braveness.

At the moment i collect user feedback to see where and why the AI ACU is dying and then i try to add those
threats to the Braveness conditions to make the ACU more survivable.

@bergzand
Copy link

I think the idea behind this braveness factor is great, makes the AI a lot more adaptive in how to us the ACU.

I have two remarks so far:

  • I would make it lose braveness quickly when near or in range of enemy point defense. Maybe this can be done similar to the tactical missile launcher: make it lose braveness for every T1/T2 point defense (and torpedo launcher) nearby, and have it gain (already the case) for every nearby shield. T2 torpedo and point defense can quickly overwhelm the ACU, especially if the point defenses are shielded so in my opinion I would make it rather scared of PDs and torpedoes.
  • In one of our games, the AI spammed a huge amount (easily in the hundreds) of light assault bots. With the current code this would increase the braveness by a lot. I don't know if it makes sense to cap the gain from this factor or scale it with mass value of the friendly nearby T1 units.

As always, thanks for all the effort you've put in this AI!

@LordTy
Copy link

LordTy commented Jun 14, 2021

I see the same behaviour,

I think the ranges for losing braveness from enemy units are a bit low. The range of a T2 point defense is 50, This would mean that the enemy ACU remains within the range of the T2 point defense until it is below 20%.

I think in general that it should lose more braveness for damage, maybe based on the rate of damage? That would not prevent snipes, but it might help.

Can you filter based on which unit can target you/has hit you? That might be better then within range?

@Uveso
Copy link
Owner

Uveso commented Jun 21, 2021

New update is out (v95)

Sadly i did a mistake and forgot to disable the debug output from the ACU function.

But for now you can see the bravenesstable inside the game.log (press [F9] to open the moho debug window)
Also when you focus the AI army (cheats on and [F2] menu) then you can see the debug drawings for the ACU.
Looks like this:
https://www.youtube.com/watch?v=LvLNFyNk3kg

Since you all have so much good ideas, maybe this can lead to even more ideas :D

[Edit] threat for point defenses is already implemented in v95

@ken2k
Copy link

ken2k commented Mar 31, 2022

Hi,
First of all, thanks a ton for your mod.

Here are some few suggestions about this issue:

  1. maybe make the braveness factor automatically slightly decrease over time. While it makes perfectly sense to push with the ACU at the early stages of the game, human players most of the time move back their ACU to their primary base after a few time (for example when most of the unit on the battlefield are T3). Too difficult to constantly check for snipes (missiles, gunships, billy...).

  2. in case it's possible, it would be greatly useful to take the victory condition into account: while it's perfectly fine to push with the ACU when playing in supremacy mode, assassination in the other hand should make the Uveso ACU way more careful.
    As the ACU is really kinda suicidal with the v98 of the mod, we always play in supremacy mode because otherwise the game would be too easy (just too easy to snipe an ACU with either T2 bombers, gunships or any other unit that the human player could stack in their base and send altogether in a massive snipe attack).

Hope this could help.

@Uveso
Copy link
Owner

Uveso commented Apr 2, 2022

Hey @ken2k

yes feedback is always helpful!
Its a good idea to change the ACU behavior with the gamemode.
I play mostly supremacy, i guess this is why the ACU is so suicidal :)

Added this issue to my ToDo list.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants