• FEATURED

View more

View more

View more

### Image of the Day Submit

IOTD | Top Screenshots

### The latest, straight to your Inbox.

Subscribe to GameDev.net Direct to receive the latest updates and exclusive content.

# AI for card game "Marriage - A Popular Nepali Game"

Old topic!

Guest, the last post of this topic is over 60 days old and at this point you may not reply in this topic. If you wish to continue this conversation start a new topic.

4 replies to this topic

### #1Ajan RedDevil  Members

Posted 26 August 2010 - 05:49 AM

Me and my friends have started our minor project on card game "Marriage - A Popular Nepali Game"...
We've used Java as our programming language...
We're a newbie in the field of AI...
So could anyone suggest any books regarding AI for card games...
Other helpful info related to our project would be handy...

Posted 26 August 2010 - 06:18 AM

No one can help you if you don't tell us what the game does.
Dave Mark - President and Lead Designer of Intrinsic Algorithm LLC

Professional consultant on game AI, mathematical modeling, simulation modeling
Co-advisor of the GDC AI Summit
Co-founder of the AI Game Programmers Guild
Author of the book, Behavioral Mathematics for Game AI

Blogs I write:
IA News - What's happening at IA | IA on AI - AI news and notes | Post-Play'em - Observations on AI of games I play

"Reducing the world to mathematical equations!"

### #3Ajan RedDevil  Members

Posted 26 August 2010 - 03:39 PM

Marriage is a popular card game in Nepal especially in the Kathmandu valley.

Marriage consists of three decks of card which means that there are a total of
156 (52*3) cards and each card has two more similar cards plus three special cards i.e 'Joker faced cards' are used taking the total cards to 159.

First a dealer is chosen among the players and then on, the deal continues in a round-robin fashion. The dealer deals 21 cards to each player.

After dealing the cards, the first turn is that of the player next to the
dealer. This player draws a card from the deck.

Now, each player should build a pre-defined sets of card
(
i.e a
'Pure Sequence' - If you have three cards of the same suite in a sequence then
what you have is a Pure Sequence.

and

'Tunnela' - If you have three of the same card then what you have is a Tunnela. E.g. 5 of Diamonds, 5 of Diamonds, 5 of Diamonds.
Also three special cards also make a tunnela and is awarded extreme
points.

Note: Tunnela shown at the very beginning when the player hasn't drawn any card
has points awarded to the player if the player can view the Joker before
the end of the game.
)

The first player to show three sets of pure sequence or tunnela gets the opportunity to select a Joker.
(
'Joker' - Same card and the same suit is the joker. Also the card above and
below the joker with the same suit is also the joker.
E.g.If the joker is an Ace of Hearts,
then the card above i.e Two of Hearts is also a joker
and the card below i.e King of Hearts is also a joker.

'Alter' - Same card as the joker but of different suit but of the same color
are alters.Alter carry more points than Joker.So, player must be aware
of accidentally or may be tricked into throwing alter.
E.g.If the Joker happens to be Queen of spade,
then Queen of Club is the alter.

'Ordinary Joker' - All the same numbered cards as the Joker but of different
suites are ordinary joker.

'Joker faced card' - These special cards carry points similar to alter and
is used as a Joker to finish the game. Player who has
viewed the Joker can only take advantage of these special
cards. So, player with these special cards at the beginning
during shuffling have a clear advantage as once he has
viewed the Joker he gets instant points regardless he has
any Joker/Alter.

Note:Player may demonstrate more than three sets of Pure sequence or tunnela
i.e. Player may demonstrate four or five sets before viewing the Joker
Or
Player may show pure sequence consisting of more than three cards
i.e. 7,8,9,10 of Hearts also forms a pure sequence or even more
But this has its downside as the player may find it difficult to
finish the game later on. So, he may use Joker/Alter/Special cards to
form dirty sequence of any length.
)

'Marriage' - Once the joker has been viewed player forming pure sequence
involving forms a marriage.
i.e. Joker, the card above and below forming a pure sequence is
marriage.
E.g. If 6 of diamond is the Joker then, 5, 6 and 7 of diamond forms marriage.

Note: Marriage is awarded more points.Also double Joker values more points.

The players who have viewed the Joker can only finish the game. In order to finish the game they should arrange the remaining cards in a set either using
the pure sequence, joker to form dirty sequence, dirty triplet but tunnela is
not allowed to finish the game. When no card is left to be arranged in a set,
the player declares that he has made the game.
(
'Triplet' - If you have three same numbered cards but of different suites then
what you have is a Triplet.
E.g. 10 of Hearts, 10 of Spades and 10 of Diamonds.

'Dirty Sequence' - If you have two cards with same suite in a sequence and the
third is a Joker then what you have is a Dirty Sequence.
Or
If you have two jokers and the third is a card then what you
have is a Dirty Sequence.
E.g. 10 of Clubs, 11 of Clubs and a Joker.
10 of Clubs and two Jokers.

'Dirty Triplet' - If you have two cards from a Triplet and the third one is a
Joker then what you have is a Dirty Triplet.

Note:It ain't necessary to form dirty sequence and dirty triplet with jokers
only. Players may also form dirty sequence and dirty triplet with alter and
Ordinary Jokers.
But when points are allocated then Jokers are only counted. Ordinary Jokers
do not have any points.Alters and 'Joker faced cards' have more points than
Jokers.
)

There is an alternative way to finish the game. Player may opt to play 'Doubly'
i.e. he/she may complete seven Doubly( i.e. two same cards of the same suit)
to view the Joker and then one more doubly to finish the game.So, eight doubly
means victory.

Note: Player preferring doubly cannot form any sequence/triplet with joker.
He/she is awarded extra points for playing doubly and also for all the
jokers.So, player should suspect if other players are playing doubly as
he/she may have to sacrifice even arranged set of cards to save the game
before it's too late.

While it is true that the player who has made the game will have some advantage but it is imperative to know that even if he has made the game he may have to pay points to other players.
i.e. Other players may have Jokers,Alters and special cards carrying more points
than the player finishing the game.

Varying rates of money can be assigned to a point. This has to be agreed among the players while starting to play.

Points System
Points
Ordinary Joker Tunnela 10
Joker Tunnela 20
Special cards tunnela 35
Simple Tunnela(successful) 5
Points Due (Joker Seen) 3
Points Due (Joker Not Seen) 10
Single Marriage 10
Double Marriage 30
Triple Marriage 50
Single Joker above/below 2
Double Joker above/below 5
Triple Joker above/below 10
Single Joker 3
Double Joker 8
Triple Joker 15

Note:Negative points are also awarded on various occasions
1>When player prematurely tries to finish the game even though he/she hasn't
completed the game.
2>When the player who has seen the Joker and throws a joker to the next
player who has also seen the Joker.

These points are calculated with respect to the player who has finished the game.
Player finishing the game have advantage when other players haven't viewed the Joker.In some cases, it is the player finishing the game who happens to pay.
So, its a lot of fun, tricks , risk and total intelligence come into play.

Anyone please suggest appropriate AI books for "Marriage"....

Posted 27 August 2010 - 03:49 AM

There really aren't any AI books for card games that I can think of. The reason for that is that AI is not designed by genre... e.g. shooter, strategy, RPG, card game. AI is designed by decision. You select an AI technique that most effectively helps you make a given decision.

Now the types of decisions that you make may tend to align with a genre, but they aren't necessarily exclusive to it. For example, in a shooter, you do a lot of targeting of other players and objects. That's the point. However, in an RPG or strategy game you do that as well... but it might not be the primary focus.

The same can be said for evaluation decisions - i.e. "which of these two options is more important to me?" You do that for target selection in an FPS, spell selection in an RPG, where to build a city or structure in a TBS/RTS, etc. Never mind the genre, the choice we are making needs to be solved by evaluating the relative merits of the various options. (Which is what my book deals with.)

In card games, you deal with that aspect, but you also have a major aspect of uncertainty. You frankly don't know what you can't see. That's where dealing with Bayesian inference, Markov models, and Monte Carlo techniques.

The bottom line in any AI modeling is to simply look at the individual decision that you are making, take into account what matters, and choose a technique for solving that one decision. In order to do this, obviously, you must know what the techniques are. Most of the general AI books will teach these to you. However, many of them are not in the proverbial realm of "rocket science". Most of them are common sense.

What I'm trying to say is, don't think there is a Book of AI Magic out there that will solve your problem for you. There isn't. You still need to think. In fact, I recommend trying the "thinking" approach immediately.

That being said, card game AI is notoriously difficult even for simple single-deck games. Most of this is due to the unknown quantities as I mentioned above but a lot of it is due to the huge number of potential solutions that are available. (NP-Hard for those conversant with complexity theory.) Believe it or not, these are situations that people can actually intuit fairly quickly but computers have a hard time "solving" for.

The solution to your problem is #BLOODY_HARD.
The suggested path is #LEARN_BASICS_OF_AI + #THINK

Sorry I didn't have better news.
Dave Mark - President and Lead Designer of Intrinsic Algorithm LLC

Professional consultant on game AI, mathematical modeling, simulation modeling
Co-advisor of the GDC AI Summit
Co-founder of the AI Game Programmers Guild
Author of the book, Behavioral Mathematics for Game AI

Blogs I write:
IA News - What's happening at IA | IA on AI - AI news and notes | Post-Play'em - Observations on AI of games I play

"Reducing the world to mathematical equations!"

### #5Ajan RedDevil  Members

Posted 27 August 2010 - 04:30 AM