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.58k stars 359 forks source link

Add original game difficulty bonuses to AI players #657

Closed idshibanov closed 3 years ago

idshibanov commented 4 years ago

What's your opinion on AI getting bonuses on higher difficulties? We might have to re-add some to make sure AI performs at the same level, especially in campaign setting. I noticed a lot of small tweaks based on AI personality and difficulty that I haven't seen mentioned anywhere. Examples are:

Warrior personality gets a small boost when resolving quick combat and more eager to go in. Builder gets a little bonus to daily resource income Explorer gets extra +50 hero mobility and starts buying heroes earlier

Are you OK with having those in Fheroes2? Gold and unit growth are the most significant here.

shprotru commented 4 years ago

Hi, @idshibanov, as for me, fheroes2 AI should be as most closer to OG as it could, your ideas on enhance AI are great, but all enhancements should be optionally. I think a newcomers to homm2 game couldn't win on existing highest level. With default enabled cheats new players will get bad game experience, never launch and nobody recommend it.

Branikolog commented 4 years ago

From my point of view, unit growth can be exploitable, as player, that captured enemy castle can buy all that increased number of units.

all enhancements should be optionally. I think a newcomers to homm2 game couldn't win on existing highest level.

That's why the game has different levels of difficulty: hard, expert and impossible. All newcomers should play normal or easy level. But nevertheless I agree with @ihhub that AI should be closer to the OG one.

shprotru commented 4 years ago

That's why the game has different levels of difficulty: hard, expert and impossible. All newcomers should play normal or easy level.

Of course, newcomer see that options and try hard, firstly, then expert(if hard completed), then impossible. And only if impossible is done he could interesting about "beyond impossible" level of difficult, and this option could be interesting to veterans of OG. Very interesting ideas @idshibanov suggests on "personality", it could be as player-related and hero-related. Much more hardcore logic, without cheating, could be in features like separating low-cost unit's(for example 5 peasants, 1 per slot) then usage of magic like lightning, and run, current AI haven't this trick. Other interesting ideas on how to advance AI without cheating, could be related to battlefield logic. In any case this is enhancement, project in current state have buggy animations, GUI, logic and main direction could be working campaign games.

Branikolog commented 4 years ago

Other interesting ideas on how to advance AI without cheating,

As a quite experienced HoMM-series player I can offer my help in adding more AI logic behavior patterns to make gameplay more hardcore.

idshibanov commented 4 years ago

your ideas on enhance AI are great suggests on "personality"

@shprotru I think you misunderstood. This is not my ideas. This is code and bonuses in original game.

What I'm worried about is that doesn't matter how clever our algorithms are in some cases AI will be weaker than in OG game simply because it has less resources. You said it yourself - you want it to be as close as possible.

ihhub commented 4 years ago

Hi @idshibanov , @Branikolog and @shprotru ,

First of all, AI in the original game is very weak and even on hard levels it is easy to beat him up with a limited experience in the game. Secondly, such perks to AI could be used by players themselves.

However, we have bigger problem than this. Our current implementation of AI is horrible in comparison with the original game. So logical step towards proper AI is to implement AI from the original game even with such enhancements to at least have not worse AI.

For subsequent step we could improve the AI based on existing original game's logic which could be much easier than trying to fix existing one.

During development we could just add comments such as TO-DO for a future review of AI perks and modification AI logic in order to make it more robust.

@idshibanov, as a conclusion based on given comments I could say that you implement what the original game has even with such drawbacks for now.

idshibanov commented 4 years ago

Understood. I was thinking the same thing. We'll go slowly building the AI bit by bit, starting with the battle one.

AI in the original game is very weak and even on hard levels it is easy to beat him up

I think the algorithms are pretty good, but constants and heuristic values are off (e.g. Dwarf considered stronger than Elf). These values force AI to make a wrong decision: focus wrong unit, prioritize wrong building or cast not the optimal spell.

I wouldn't code exploitative strategies into AI (such as attacking, casting a spell and retreating) as it can become very annoying for players.

Branikolog commented 4 years ago

I wouldn't code exploitative strategies into AI (such as attacking, casting a spell and retreating) as it can become very annoying for players.

"Hit and run" – is quite normal behavior for all heroes series. Even demo has such tactics. Current AI don't even think of fleeding.