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.64k stars 369 forks source link

Construction of an AI Castle, AI could have built the building that increases the growth of level 1 creatures before other less important buildings #4066

Open LeHerosInconnu opened 3 years ago

LeHerosInconnu commented 3 years ago

Preliminary checks

Describe the problem requiring a solution

In fheroes2, the AI could have built the building that increases the growth of level 1 creatures before other less important buildings.

Here are the save files: Construction AI Castle 02.zip

Related closed issue: https://github.com/ihhub/fheroes2/issues/3361.

Describe the possible solution

In the example, the Crystal Garden before the Rainbow or the Marketplace: Crystal Garden not built 02

In the example, the Waterfall before the Tavern or the Moat: Waterfall not built 02

Additional info

Version 0.9.6 3976.

ivanychag commented 3 years ago

A little addition to this issue:

Quite often, Well is not built by AI in a half-built city. I think, in 30% of enemy cities (Beltway map) it wasn't built.

vincent-grosbois commented 3 years ago

To be honest, the code that handles castle build order for AI is pretty bad. I guess that most issues related to this should be grouped into a single one where we try to have better heuristics for this

LeHerosInconnu commented 1 year ago

Other saves for this (before and after, version 0.9.20 5949): Horde building not build 05.zip

In fheroes2:

In the example, the Waterfall before the Tavern or the Moat: Horde building not built 01