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

Avoid stacking units when defending archers #9565

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

idshibanov
Copy link
Collaborator

If enemy army has units with area shot ability (Liches) AI should avoid stacking units to take extra damage when defending.

@idshibanov idshibanov added improvement New feature, request or improvement AI Artificial intelligence behaviour labels Feb 13, 2025
@ihhub ihhub added this to the 1.1.7 milestone Feb 13, 2025
@oleg-derevenetz
Copy link
Collaborator

Hi @idshibanov Maybe it's just not to use defensive tactics at all in such situations? It's quite difficult to cover friendly archers this way, because there will be holes vulnerable for flyers and melee units that are fast enough.

@idshibanov
Copy link
Collaborator Author

idshibanov commented Feb 15, 2025

Hi @idshibanov Maybe it's just not to use defensive tactics at all in such situations? It's quite difficult to cover friendly archers this way, because there will be holes vulnerable for flyers and melee units that are fast enough.

Hello @oleg-derevenetz, I was curious to test it out and finally found some time to do so. 2 armies attacking 3 targets, 5 repeat battles with different seeds to account for battlefield random rolls (90 samples in total).

  1. Walkers: (liches + hydras)
  2. Normal: (liches as a part of regular necro army, no dragons)
  3. Flyers: (liches with flyers)

Results:

  • On master branch (no change):
    Sorcerer's: 65% casualties on average vs walkers, losing 100% to others
    Barbarian's: 28% casualties vs walkers, 41.7% vs normal, 60% vs flyers

  • No defensive tactics if area attack present (suggested):
    Sorcerer's: 50% casualties vs walkers, 46% vs normal, 90% vs flyers
    Barbarian's: 17% casualties vs walkers, 22% vs normal, 41% vs flyers

  • Defensive tactics but spread out (current change):
    Sorcerer's: 43% casualties vs walkers, 58% vs normal, 81% vs flyers
    Barbarian's: 20% casualties vs walkers, 37% vs normal, 35% vs flyers

To me it's clear we have to account for area attack and either change improves the AI. Surprisingly, looks like spreading out units actually works better versus fliers. I think the defensive mode can lead to higher losses in some cases regardless of tactic that's why disabling it outright was optimal sometimes. We need to look at army compositions before turning the flag on.

TLDR: I prefer to leave the change as is and maybe make another PR for defensive mode improvements.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
AI Artificial intelligence behaviour improvement New feature, request or improvement
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants