ihhub / fheroes2

fheroes2 is a recreation of Heroes of Might and Magic II game engine.
https://ihhub.github.io/fheroes2/
GNU General Public License v2.0
2.7k stars 375 forks source link

Teach AI to hire heroes for army #7800

Open fheroes2bugs opened 1 year ago

fheroes2bugs commented 1 year ago

Preliminary checks

Describe the problem requiring a solution

At map marooned AI has a lot of strong neutral monsters surrounding him, and have town+marketplace. When I found him at 6 month, he had starting army and only 2 heroes. AI had enough gold to buy a lot of heroes, but he got only 2. He could buy and use starting army.

Describe the possible solution

Teach AI to hire heroes just for stronger army.

Additional info

No save/video at this time.

Branikolog commented 1 year ago

Hi, @fheroes2bugs ! It would be nice to have a save file for that issue. At least for the first day. Maybe the design of this map is so poor, that neither fheroes2 nor original AI could beat those creatures? Are you sure, that hiring 40 peasants could help AI to beat those guardians?

fheroes2bugs commented 1 year ago

Hi, @fheroes2bugs ! It would be nice to have a save file for that issue. At least for the first day. Maybe the design of this map is so poor, that neither fheroes2 nor original AI could beat those creatures? Are you sure, that hiring 40 peasants could help AI to beat those guardians?

Here is the save in 0 day. but this is the another game, I haven't try it. In my sitiuation, green player had near him sorceress town, he had enough wood, ore and gold for upgrading to castle, but that is all, he could not build any creature-providing buildings. He could not use marketplace (it is already build in this map). He bought a second hero, but his army was with him, so AI don't even have idea to place all army in 1 hero to attack monsters. So that is how I found him in the 6 months of the game, 2 heroes with starting army and no building in the castle and no will to win.

marooned day1.zip

fheroes2bugs commented 11 months ago

Here is the save of marooned the month is 12, but none of computer players really want to win. They don't hire heroes for army.

marooned 12 month.zip

Green: image

Blue: image

Orange: image

Purple: image

fheroes2bugs commented 9 months ago

In this situation, after I lose the battle, computer decides to hire 3 (3!) new heroes. But as we know from auto-battle (I win the autobattle) chances are nearly equal... To improve his chances computer could first - hire those heroes, give army to main hero (that is going to attack me) and then attack me with a stronger army.

https://github.com/ihhub/fheroes2/assets/145407420/248a8e2c-ad55-436c-bade-4a5229f8f174

version: 1.0.11 save: suicide.zip