GreatEmerald / libarcomage

The backend for Arcomage-like games.
http://greatemerald.eu/index.php/arcomage
GNU General Public License v3.0
2 stars 0 forks source link

AI does not use strategy #10

Open Lairo opened 12 years ago

Lairo commented 12 years ago

Player has -> 7 AI has -> 3

Let's say that AI has +1 quarry to all, + 2 quarry if player has more quarry than AI otherwise +1, equalize quarry, -1 AI quarry +9 dmg to player

The best tactical choice would be (IMO)

+1 to all Equalise -1 to AI +9 dmg to player +2 quarry if less than player

But AI seams to just throw cards that are best at that moment

GreatEmerald commented 12 years ago

Confirmed.

This is due to the way the AI code works - each card has AI code defined for itself, which, when executed, returns a "card rating". That is defined in /lua/Arcomage/CardPool.lua. Each card doesn't really know much about other cards in hand.

The problem with that is if there is no chess-like AI (which means that the AI simulates the game for some time to try some of the outcomes and see what path is the best), it would be nearly impossible to do this. There is no way for a card to know what other cards actually do - they could only get their ratings. And I can't think of any other ways to solve the problem.

Implementing chess AI would be very difficult and time-consuming, however, with not a whole lot of benefits. So perhaps this could materialise in version 2 of the game, but I don't think it will be in version 1.final, unless an easier solution is found.

Lairo commented 12 years ago

What about a simple subroutine

If AI has this card then check if other cards of that type are pressent in hand then place them in this order else ignore.

If the cards are present place this then this than this.

I know it sounds easy in theory.

GreatEmerald commented 12 years ago

Yes, that would certainly be possible, but it would not be mod-friendly. If you created a new card that, for example, inverts the quarry amount of both players, the AI wouldn't use your new card strategically.

GreatEmerald commented 9 years ago

Almer has volunteered to come up with the logic of advanced AI for games with visible cards.