Saturday, May 9, 2015

How should I approach AI for Spades game?


I was hoping some one could point me in the right direction about what type of AI you would use for a Spades game? For instance, would you create a behavioral tree or would you implement some other type of AI concept. I'm fairly new to AI which is why I'm hoping to get some AI vets to chime in.



Answer



I once programmed AI for Tarneeb, a card game very similar to Spades. The person I was working with wanted to do a pattern recognition thing involving lots of stored games and stats on the outcome based on what moves were done in different situations. In essence, the AI would become better over time the more games it played. However, from playing many hands and analyzing my own thought process, I determined that there were just a small number of "algorithms" I would employ to figure out what card I would play.


Thus the approach I took was to have the computer use a different algorithm depending on the following situations: making the first bid, making a bid after the first, playing a new trick with Spades in hand, playing a new trick without Spades, playing into an already started trick with Spades, and playing into an already started trick without any Spades. In each case it was pretty straightforward to go from the computer's current hand to deciding what play to make.


No comments:

Post a Comment

Simple past, Present perfect Past perfect

Can you tell me which form of the following sentences is the correct one please? Imagine two friends discussing the gym... I was in a good s...