AI: Playing cards
Continuing from the previous post I’d like to write something about how we got the AI to play the best card from its hand.
The logic behind this is to give each playable card (and possible action) a value. Each value needs to be in the same scale so you can compare each card’s value, so the higher the better.
This technique is comparable to the one artificial chess players use: each piece has a given value, but it also depends on its position on the board and the game’s context. Luckily for me our card game is not that deep, but this kind of logic still applies.
Mini closing rant: The beauty of the lost art of reading technical books is that you can get ideas of how to do stuff. That’s something copy-paste coders will never do. Understanding how things get done gives you leverage on how to make a better game.
Posted in Game Programming
"RT @ruizdiego: Have you tried Super Falling Fred? It's awesome! http://t.co/LabwyiRq"
April 5th, 2012 at 3:22 am
Seems like a pretty simple solution to that problem. Thanks.
April 12th, 2012 at 3:41 pm
I don’t know if it applies to your case, but I heard that they also check the state of the board and match it against known scenarios for the AI. I guess at that point they say f*ck the logic, I’m just going to pin, pan, pum win!