Thread: Backgammon AI ?

  1. #1
    Registered User
    Join Date
    May 2006
    Posts
    169

    Question Backgammon AI ?

    Hi everyone

    Me trying to code a simple backgammon game that will feature computer player/s.
    The program stores the current board+dice status, and all legal move sets for them.
    It is about where the program has to choose which one is the best move set to carry out.

    Thing is I suck really bad at board games that require a bit of strategy, right about every common chimp should be able to humiliate my gaming skills.

    So I figured Ill ask here about what backgammon strategies the AI part should be directed by, and ultimately decide how to implement them together.

    Here are a few I can come up with:
    • Eatting opponent soldiers
    • Advancing towards the home quarter
    • Creating 2soldiers blocks
    • Low risk to be eaten

    So please, any ideas are welcome and appreciated,
    Thanks.

  2. #2
    Fear the Reaper...
    Join Date
    Aug 2005
    Location
    Toronto, Ontario, Canada
    Posts
    625
    You're looking at simply doing alpha-beta pruning with some heuristics, there, friend.
    Teacher: "You connect with Internet Explorer, but what is your browser? You know, Yahoo, Webcrawler...?" It's great to see the educational system moving in the right direction

  3. #3
    Insane Game Developer Nodtveidt's Avatar
    Join Date
    Nov 2006
    Location
    Isabela, PR
    Posts
    105
    I have no idea what Happy_Reaper just said. But I was working on a backgammon AI at one point in time and came up with some rather effective priorities. It does, of course, depend on how intelligent you want the AI to be. There are many ways of playing the game...you can be a defensive player (putting priority on safe moves rather than conquering), an aggressive player (conquering at all possible opportunities at the expense of progression), or any range in between. The way I implemented my backgammon AI was to have a RNG that determined the type of move the CPU would play next in terms of aggressiveness, then after the die roll, use the value to determine which pieces to move to accomplish it...say if it rolled a 4 and a 5 for dice and a 90 for aggressiveness (highly aggressive), it would look to see if any opposing pieces were within 4 or 5 moves, and if so, conquer them, otherwise move pieces towards home that are closest. If the value had been in favor of a defensive move, it would look for any of its own blots and try to pair them if possible. It was a relatively simple AI but it was effective and could beat quite a few players because of its unpredictability. There's better ways of doing it, and google turns up a few good links so give it a looksee.
    Code:
    cout << "Language comparisons are dumb";
    echo("Language comparisons are dumb");
    PRINT "Language comparisons are dumb"
    alert ("Language comparisons are dumb")

  4. #4
    Fear the Reaper...
    Join Date
    Aug 2005
    Location
    Toronto, Ontario, Canada
    Posts
    625
    Teacher: "You connect with Internet Explorer, but what is your browser? You know, Yahoo, Webcrawler...?" It's great to see the educational system moving in the right direction

  5. #5
    Registered User
    Join Date
    May 2006
    Posts
    169
    Thank you both for sharing your experience.
    Another method I ran into while surfing the net this week is Temporal Difference Learning which is used in TDgammon.
    There appear to be several ways to achieve what I am looking for, but I am not sure which one is simple enough, yet still useful?

  6. #6
    Registered User
    Join Date
    Aug 2002
    Location
    Hermosa Beach, CA
    Posts
    446
    Not sure if Alpha Beta is the correct algorithm for Backgammon. Because isn't alpha beta for turn-taking perfect information games? Backgammon is turn-taking, but it is not a perfect information game. Since dice are involved, you can't predict with certainty what will happen on future moves. Not sure what the correct algorithm is; but probably it will involve probabilities. I'll have to look into my AI book tonight and see what it says about this...
    The crows maintain that a single crow could destroy the heavens. Doubtless this is so. But it proves nothing against the heavens, for the heavens signify simply: the impossibility of crows.

  7. #7
    Fear the Reaper...
    Join Date
    Aug 2005
    Location
    Toronto, Ontario, Canada
    Posts
    625
    You can do a probabilistic Alpha-Beta tree. Nevertheless, I still believe TD learning is a very solid way to make a Backgammon opponent, especially due to the fact that the sample space is so large.
    Teacher: "You connect with Internet Explorer, but what is your browser? You know, Yahoo, Webcrawler...?" It's great to see the educational system moving in the right direction

  8. #8
    Registered User
    Join Date
    Jun 2010
    Posts
    1
    hi everybody
    I'm new here,I wanna choose appropriate subject for my AI project,and one of those candidate subjects is AI backgammon , Help me plz ,I wanna do it by minimax tree and Alfa Beta cut off,how can I do that?

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Simple space combat AI
    By VirtualAce in forum Game Programming
    Replies: 5
    Last Post: 01-06-2009, 12:54 AM
  2. chess ai contest
    By Raven Arkadon in forum Contests Board
    Replies: 7
    Last Post: 07-09-2005, 06:38 AM
  3. AI Contest Proposal
    By MadCow257 in forum Contests Board
    Replies: 4
    Last Post: 03-13-2005, 03:27 PM
  4. Game Design Topic #1 - AI Behavior
    By TechWins in forum Game Programming
    Replies: 13
    Last Post: 10-11-2002, 10:35 AM
  5. Technique of all board-like games?
    By Nutshell in forum Game Programming
    Replies: 28
    Last Post: 04-24-2002, 08:19 AM