Page 1 of 1

Improving the AI

Posted: Aug 21, 2010
by Aidan
Although there are a lot of posts complaining about the computer getting good cards all the time, nonetheless some (advanced?) players may have noticed that the computer opponent might not be a world master after all.

If anyone has noticed situations where the computer does not play great, please post here and let us know.

Re: Improving the AI

Posted: Aug 22, 2010
by bjb47
I win about half the games against the computer. I've skunked it and it has returned the favour. I find its game play to be predictable and if you're any good at all you can sometimes exploit this 'weakness.' It never misses points however. A better than average opponent but not unbeatable.

Brian

Re: Improving the AI

Posted: Aug 22, 2010
by Aidan
Ok - but can you elaborate more on this weakness? How to go about removing it?

Re: Improving the AI

Posted: Aug 23, 2010
by bjb47
Some of the play weaknesses I have noticed:

1) The computer will make pairs whenever possible, whereas a human may be more wary, afraid of giving their opponent six points (unless, of course they have the 12-point fourth card.) The computer doesn't always use this tactic so pairing is rather safe.

2) The computer will go for points (instant gratification) even if doing so could provide a windfall of points for the human.

3) If the human leads with an A, 2, 3 or 4 the computer will (if it has no pair) come back with its highest card (usually a 10 or face.) If you have two cards that add up to five, then this will give you an easy and fairly safe two points for a 15.

4) If the computer cannot score a point it will usually play it's highest card (see point 3.) Everyone knows this is a bad idea if the highest card brings the total to 21. 16 out of the 52 cards will score a two-point 31.

Of course, don't take this as gospel. It's just a guideline and doesn't alway work but it works more often than not. Good hunting.

Brian

Note to Aidan. Please, no tweaking of the computer to remove these weaknesses. It's hard enough to win as it is. Makes the computer more 'human' (error-wise.)

Re: Improving the AI

Posted: Aug 24, 2010
by Aidan
Great points, thanks. I could do with some more explanation of point 2, but good as is.

As for making the computer harder, I mentioned improving the AI for the future muggins feature, in which the only way to implement it that I can see is to give the user a choice of computer opponents to play against, and if I'm going to do that, I need the top AI opponent to play as good as possible. I'll need an "expert" computer player, whereas at the moment I think I only have a "medium" one. The computer players will have a separate attribute for muggins play ("counting skill" or something such), so the current AI opponent in the game will be a "Medium" play level with "Expert" counting skill in upcoming versions.

They'll probably have a "Discard Cards" attribute also that will reflect there skill at making good choices at the initial discarding cards stage to make for more variations. Can't think of any other attributes at the moment?

So I need to make the computer player as good as possible, then tone it down to the desired levels. This is how I do AI in most my games. In Table Tennis for example, the computer is able to hit the ball exactly where it wants with the exact amount of power and skill it desires (within reason), then its skill is reduced in various ways to make for more human-like opponents.

Re: Improving the AI

Posted: Aug 28, 2010
by bjb47
Granted, Point 2 doesn't happen often but one example might be, if both players have low cards: taking 2 points for a fifteen (instant gratification) and giving the human opponent 4 or 5 points for filling an inside straight. A rookie mistake. Not something an experienced and skilled human player would risk.

Brian