Game Development Stack Exchange is a question and answer site for professional and independent game developers. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

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.

share|improve this question
This is a really broad question... the AI you'd use depends heavily on the type of game, and the problem that needs to be solved. Without more details, it's not really suited for the Q&A format. It might be better to ask this in the chat. – thedaian Sep 29 '11 at 20:36
up vote 5 down vote accepted

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.

share|improve this answer

As thedaian said, this is indeed too broad of a question. But, for starters, you can have a look at what most board/cards games use: Minimax.

The trick is to have a state of the game and being able to properly evaluate how good in a position a given player is. Once you have solved this step, then you simply emulate X steps ahead to choose the best path the player should go.

share|improve this answer
Minimax, or minimax alone, is not a very common strategy in games with uncertainty or asymmetric information. The search space diverges far too drastically and standard pruning (e.g. alpha-beta) is no help in reducing it. I do not think the question has scope issues (although it did have a typo); I do think you have tried to answer a far more general question than was being asked, and given a bad answer as a result. – user744 Sep 29 '11 at 23:31
No disagreement there. – pek Sep 29 '11 at 23:38

Use expectimax (Russell and norvig Artificial intelligence 3rd edition). Alpha beta is possible with bounded evaluation function values)

share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.