Giter Club home page Giter Club logo

Comments (8)

oleg-derevenetz avatar oleg-derevenetz commented on July 3, 2024

Hi @Branikolog this behavior should be changed by #7986.

from fheroes2.

Branikolog avatar Branikolog commented on July 3, 2024

Hi, @oleg-derevenetz
Oh, sorry, missed this items in the PR!
Should I close the issue now?

from fheroes2.

oleg-derevenetz avatar oleg-derevenetz commented on July 3, 2024

Hi @Branikolog that PR fixes the excessive desire to retreat from archers or too slow units, but archers will still shoot at possibly blocking stacks.

I also suggest defending ranged troop focusing the most dangerous attacking stack anyway, rather than running from or killing a weak stack which is about to block the defending ranger troop. In my example above Centaurs could attack Rangers and prevent losses, but they decided to attack weak walking centaur and allowed Rangers to shoot once.

This is a rather vague wish. If we follow this literally, then the stack never need to retreat at all, because the default behavior is to just attack the most dangerous attacking stack. But the retreat mechanism is also useful:

fheroes2.engine.version_.1.0.9.2023-10-26.12-35-45.mp4

from fheroes2.

Branikolog avatar Branikolog commented on July 3, 2024

@oleg-derevenetz
Indeed.
But in some cases this logic allows to demolish the significant amount of troops, just because ranged troop made the first, especially effective shot.
You know, I'm doing quite a lot of tests and in some cases, when comparable armies are met, the only non-optimal decision can cause an absolutely different outcome. I've recently pushed two large stacks of troops against each other and the battle could be finished either with victory or loss just because of the early first attack dispersion. And the number of troops left was even far from minimal. So the success of the first attack had a drastic influence on the outcome.

So I suggest to make a few checks in the case some troops are going to block the ranged defending one.
The first check should consider the potential losses, when the attacking melee troop reached defending one. If the damage is not really high, and the ranged troop could kill attacker with retaliation or with 1-2 melee attacks then lower the attacking priority for attacker in favor of dealing the damage to other threatening troops.
And the second check should consider whether any troop of attacking side can do a high damage right in the current turn (after the defending ranged troop).
Currently, AI behaves properly in this regard, when opposing two stacks, that can both reach him:

2023-10-26.14-00-19.mp4

But in the case of ranged attacking stack, AI ignores him focusing the potential blocking one instead:

2023-10-26.13-55-50.mp4

from fheroes2.

oleg-derevenetz avatar oleg-derevenetz commented on July 3, 2024

So I suggest to make a few checks in the case some troops are going to block the ranged defending one.
The first check should consider the potential losses, when the attacking melee troop reached defending one. If the damage is not really high, and the ranged troop could kill attacker with retaliation or with 1-2 melee attacks then lower the attacking priority for attacker in favor of dealing the damage to other threatening troops.
And the second check should consider whether any troop of attacking side can do a high damage right in the current turn (after the defending ranged troop).

After some thought, I decided to remove the corner-case heuristics of this kind completely within the scope of #7986. This PR in any case tightens the requirements for when a shooting unit should retreat.

from fheroes2.

oleg-derevenetz avatar oleg-derevenetz commented on July 3, 2024

I suppose that we can close this because #7986 addressed all the described misbehaviors:

fheroes2.engine.version_.1.0.9.2023-10-27.21-02-04.mp4
fheroes2.engine.version_.1.0.9.2023-10-27.21-03-52.mp4

from fheroes2.

ihhub avatar ihhub commented on July 3, 2024

@Branikolog , please check and close this issue is needed.

from fheroes2.

Branikolog avatar Branikolog commented on July 3, 2024

The problem of inadequate maneuvering of archers on the battlefield is no longer relevant.
Target selection is better now too.
Thanks, @oleg-derevenetz , for improving the battle AI! I'm pretty sure, a huge part of players are not even aware of using such tricks during battles. Auto battles will soon make manual battles redundant with such an efficacious logic. :)

from fheroes2.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.