Take the 2-minute tour ×
Game Development Stack Exchange is a question and answer site for professional and independent game developers. It's 100% free, no registration required.

I'm developing a gameboard for a 4 players cardgame well know in my region ( like a Bridge with 8 cards).

I create a cardcontrol class, all the deck methods and all the logics for value card and score count.

But I need some link or suggestion for the implementation of "computer player" based on a few rules to follow.

thank you all for any help.

share|improve this question
1  
It's not clear what you're asking here. Are you asking how to program an AI to make intelligent decisions, or how to allow an AI to interact with the gameboard and cards? Or both? If it's the first, you might be interested in these questions: gamedev.stackexchange.com/questions/6189/… gamedev.stackexchange.com/questions/2194/… –  doppelgreener Jan 7 '11 at 8:25
    
how to allow an AI to interact with the gameboard and cards. I have no experience in this kind of develloping, but i know how to develop. Thanks –  Christian Jan 7 '11 at 8:26
    
The AI for the card game is very different from game to game, i do not think you are going to find much of an answer with out some specific card game in mind. (You do not play poker in the same way you would spades, gin or rummey for example) –  James Jan 7 '11 at 23:32

2 Answers 2

up vote 1 down vote accepted

Try building a class which handles game turns, who knows all the players and their order, in a array for example.

Each time a player (human or CPU) finish playing, check if the condition to end the game (win or lose) are met.

If not, find who will be the next player. In case the next player is CPU, make it choosing the correct card combination according to its level (easy-medium-hard), and then finish the game loop again by triggering the same method I've just discussed.

share|improve this answer
    
Many thanks. I'm studyng Strategy techniques for solve my doubt! –  Christian Jan 7 '11 at 11:29

Here's something that I try to follow when programming AIs.

Create a set of "personalities", that is, ways in which you might expect the computer player to act. Have their actions conform to these. For instance, in a card game, you might have 3 personalities: aggressive, defensive and moderate.

Next, when it gets to the computer player's turn, randomly choose an action that conforms to the player's personality, and make sure the action is also in a list of sensible things to do.

So the logic comes down to this:

1- Based on the situation, what is a list of sensible actions to take?

2- Based on my personality, what actions from the above list would I choose?

3- Randomly choose one of these, then do it!

share|improve this answer

Your Answer

 
discard

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.