fheroes2 icon indicating copy to clipboard operation
fheroes2 copied to clipboard

Allow the AI to dig an Ultimate Artifact if it uncovered the whole puzzle map by visiting all obelisks

Open ihhub opened this issue 1 year ago • 4 comments

Preliminary checks

Describe the problem requiring a solution

The current AI cannot do this. However, we must not allow to do it if Ultimate Artifact is a winning condition for human player.

Describe the possible solution

We have to add logic for this.

Additional info

No response

ihhub avatar May 22 '24 07:05 ihhub

I've heard many players say that the original AI knew how to dig for the UA. If this is the case then it would be interesting to see what happens if they find the UA in a map where the winning condition is to find the UA.

It's likely that it would be the same as if a human opponent finds it first?

zenseii avatar May 22 '24 08:05 zenseii

Hello @ihhub and @zenseii,

In the original game, the AI can dig for the ultimate artifact even if this is a victory condition for the human player. In Roland's campaign, for example, it's possible to lose the campaign in the scenario where the Ultimate Crown must be recovered before the opponent. I think it's important to keep this possibility of losing for the human player if the AI recovers it before him, it's part of the game. The requirement for the AI to visit all the obelisks before digging is a sufficient constraint.

LeHerosInconnu avatar May 22 '24 12:05 LeHerosInconnu

Hi @LeHerosInconnu

In the original game, the AI can dig for the ultimate artifact even if this is a victory condition for the human player. In Roland's campaign, for example, it's possible to lose the campaign in the scenario where the Ultimate Crown must be recovered before the opponent.

Are you sure? At least, in the original map editor, there is no way to set (or unset) the "Comp. also wins via Special VC" setting for "Find a particular artifact" victory condition (unlike, e.g., "Capture a particular castle" or "Accumulate gold" conditions).

P.S. It seems that this is indeed the case:

https://github.com/ihhub/fheroes2/assets/32623900/09e834fe-4f38-49e5-8fed-de3d03ae71e0

but IMHO it's not good that it can't be turned on/off, unlike other VCs.

oleg-derevenetz avatar May 22 '24 14:05 oleg-derevenetz

Hello @oleg-derevenetz,

Hi @LeHerosInconnu

In the original game, the AI can dig for the ultimate artifact even if this is a victory condition for the human player. In Roland's campaign, for example, it's possible to lose the campaign in the scenario where the Ultimate Crown must be recovered before the opponent.

Are you sure? At least, in the original map editor, there is no way to set (or unset) the "Comp. also wins via Special VC" setting for "Find a particular artifact" victory condition (unlike, e.g., "Capture a particular castle" or "Accumulate gold" conditions).

P.S. It seems that this is indeed the case:

DOSBox.0.74-2.1.Cpu.speed_.max.100.cycles.Frameskip.0.Program_.HEROES2.2024-05-22.17-32-43.mp4 but IMHO it's not good that it can't be turned on/off, unlike other VCs.

Yes, I'm sure it is. When the AI digs and finds the ultimate artifact in a scenario where this is a victory condition for the human player, it's not the AI that wins, it's the human player who loses. :)

If the human player wouldn't be competing with the AI for the possession of the ultimate artifact, it would be a kind of challenge taken away from the game. It's part of the game to try and get the ultimate artifact before the AI, even if it's not a win/lose condition.

LeHerosInconnu avatar May 22 '24 17:05 LeHerosInconnu

I've found this image: Image source

This gives a clue to the loss message: The enemy has found the %{name}. Your quest is a failure. Where name changes similar to the win counterpart.

usidedown avatar May 14 '25 17:05 usidedown

The problem is spawning location of UA. If it spawns near AI starting location and there is at least 1 easily accessible obelisk near his castle, hello instant loss on day 3! That is typical lucky case that can happen in Jebus Cross PvP tournament game. Even though even top player can miss 1-2 times, resulting in 1-2 extra days before discovery, AI knows the exact location of UA as soon as he finds 1 obelisk.

Alucard648 avatar May 14 '25 20:05 Alucard648

The problem is spawning location of UA. If it spawns near AI starting location and there is at least 1 easily accessible obelisk near his castle, hello instant loss on day 3! That is typical lucky case that can happen in Jebus Cross PvP tournament game. Even though even top player can miss 1-2 times, resulting in 1-2 extra days before discovery, AI knows the exact location of UA as soon as he finds 1 obelisk.

In my PR it should visit ALL obelisks on the map in order to get the exact UA location. This should soften the conditions for a human player.

oleg-derevenetz avatar May 14 '25 21:05 oleg-derevenetz