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

AI - Remove IgnoreWeakerTargetsRatio from attackforceai target logic #4461

Conversation

relent0r
Copy link
Contributor

@relent0r relent0r commented Nov 29, 2022

Description of changes
This PR removes some bad logic from the GetBestThreatTarget function which the attackforceai uses.
The logic in question created a target acquisition failure loop in the late game. The platoon would try and search for a target. It would get a primary or secondary threat. Then it would check for enemy threat in the positions.
If the enemy was weaker or there was no intel to provide Land/Antisurface threat numbers back then the platoon would deem itself too powerful and ignore the position. Then the platoon would merge into a larger platoon and perform the same check.
It would eventually enter an endless cycle of deeming all other threat unworthy depending on what the enemy was doing and end up with large groups of units bunched up at a base position.

To simplify the explanation. If you put a diamond in a room the AI would only want to steal it if you had armed guards that were similar to its heist team. Else they wouldn't bother stealing it.

Testing changes
This test would need to be confirmed using replays. But it is a bit of a pain to setup the scenario.
You would need to have the AI in a position where its enemy is weakened and is not generating much threat while the AI has attackforceai platoon with many T3 units etc propping up its platoon threat into the 100s.
Once this happened the platoons would start ignoring targets due to lower enemy threat at those positions.

p.s in team games this also relies on PR 4460 to make sure dead enemies are never selected as the current enemy else the if (baseThreat <= IgnoreThreatLessThan) then statement would go true due to a strange interaction of Overall threat being present but all other threat types being zero.

@Garanas Garanas merged commit 36a6598 into FAForever:deploy/fafdevelop Nov 30, 2022
@Garanas Garanas added this to the Development iteration I milestone Dec 2, 2022
@relent0r relent0r deleted the ai/fix-attackforceai-target-failures branch September 14, 2023 19:38
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

Successfully merging this pull request may close these issues.

None yet

2 participants