fheroes2 icon indicating copy to clipboard operation
fheroes2 copied to clipboard

Improve AI in combat vs neutral units (not to waste units)

Open fheroes2bugs opened this issue 1 year ago • 3 comments

Preliminary checks

Describe the problem requiring a solution

AI tries to kill neutral monsters as fast as he can, even if he will lose units. But "to kill faster" is not the best strategy vs neutral units. Our aim here is to lose minimum units.

In this video, AI loses 2 units:

https://github.com/ihhub/fheroes2/assets/145407420/97282e76-ef3b-4bd5-ae45-fb5ab78b3586

But if he just used only dragons, combat would be over with 0 loses:

https://github.com/ihhub/fheroes2/assets/145407420/925f74fd-02d0-4b61-b415-d2d5d8994a3f

AI logic vs neutral.zip

Describe the possible solution

Improve AI not to waste units vs neutral monsters.

Additional info

No response

fheroes2bugs avatar Sep 21 '23 23:09 fheroes2bugs

Hi, @fheroes2bugs

If AI was smart enough, he'd attack other troops, as he has no chance killing the dragons. I believe this aspect of the AI will be improved some day and you'd have losses no matter how do you play here. ;)

Branikolog avatar Sep 22 '23 10:09 Branikolog

Hi, @fheroes2bugs

If AI was smart enough, he'd attack other troops, as he has no chance killing the dragons. I believe this aspect of the AI will be improved some day and you'd have losses no matter how do you play here. ;)

Yes, AI logic is needed to be imoroved from the both sides...

  1. Archimages need to do maximum damage (in killed units, not just the damage itself).
  2. AI hero should try to have minimum loses mo matter how long it will take.

fheroes2bugs avatar Sep 22 '23 14:09 fheroes2bugs

Here is an another example of computer rushes and lose creatures, while he could just use dragons and have 0 killed units.

Computer plays and lose 1 creature:

https://github.com/ihhub/fheroes2/assets/145407420/0e2f10d9-20cf-451d-9531-2e2d1ba4eaa6

Me playing only with dragons and don't get killed:

https://github.com/ihhub/fheroes2/assets/145407420/950a6a22-9b8a-4ca5-859a-45390ace194f

version: 1.0.11 save: my creatures rush.zip

fheroes2bugs avatar Dec 30 '23 02:12 fheroes2bugs