Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations TouchToneTommy on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Help with logic of creating an autoplaying from computer in backgammon gates. 1

Status
Not open for further replies.

WomanPro

Programmer
Nov 1, 2012
180
GR
Hello everybody, I need an opinion. I am developing a backgammon application game, the game of gates, and I would like to create an auto playing for the computer playing something like artificial intelligence. Well, I am a little confused, I found that link just to get an idea of the strategy that computer could follow. However, I don't like at all this strategy because it's a little bit boring for the user as he will earn the game always. According to this strategy the computer always moves first the pieces that are more far away from the target.
I refer to the checkers in my program as stacks in every position of the backgammon board. So, I was thinking to create a routine that calculates for each stack the possible playings depend on the dices each time. So that to insure that the pc would create gates. However, there are so many cases because, computer could have lonely checkers as a user could have too, that are sensitive to be attacked, and for pc's stricken checkers when they have to be set to the beggining and both positions of dices are free, if there are lonely checkers to potitions from 24 to 19 I would like to create a gate if it's possible.
Anyway the what I want to do is just to create an auto playing for the computer as a human could play. What do you suggest me??? Is that possible to do something like that with my logic? Or do I have to go with the safe way as the link I mentioned above??? Could anyone guide me??? Or any suggestions would be much appreciated. Thank you so much in advance.
 
I would suggest that you build a knowledge base, create a set of rules for processing that knowledge, prioritize those rules, and then implement those prioritized rules.

To create the knowledge base, carefully map out the strategy that you use when you make a move. When it's your turn, after you roll the dice, what's the first thing you do? What's the first thing you look for? Which option to you consider first? Wny? As a player, you go through a series of scenarios and then choose the one you feel is most beneficial. How do you determine what those scenarios are? How and why do you order these scenarios? How then how to you determine which is the best choice?

What I'm suggesting is that you play a game and detail your own strategy. When it's your turn, write down in as much detail as possible, every thought you had concerning your own move. The more detailed your notes, the better you knowledge base. Analyze those thoughts and create your rule set. Once you have the rule set, then coding those rules should be fairly straight-forward. It may take dozens of games to construct of a reasonably-sized knowledge base and associated processing rules. It's a knowledge base that can and should continue to grow, and it's a rule set that can and should evolve. The more you play, the more situations you encounter and more rules that you bring into play in developing your strategy. Every game can add to the knowledge base and rule set. The challenge, as is true with virtually every AI related application is to define in detail the actual processes and underlying dataset. It takes time, patience, and discipline to build such a system. And remember, this is the type of system that is never complete.

--------------
Good Luck
To get the most from your Tek-Tips experience, please read
FAQ181-2886
Wise men speak because they have something to say, fools because they have to say something. - Plato
 
Thank you so much CajunCenturion.
I am just complicated, because there are so many details as you mentioned above and because it's very difficult to complete a system like that. I just try to make it as simple as possible, because, many times it's difficult to copy the human thoughts in an auto play system. Each condition could have a condition that encloses many many conditions that enclose too many many other conditions. The what looks to be easy for a human brain could be the worst complecated strategy for a system. I am just trying and trying and trying.
 
Yes, it can be difficult process because we one, take so many things for granted, and two, try to view the system as a whole. Thus, it's easy to become over-whelmed That's why you have to take it one step at a time and as detailed as possible, break the system down into its smallest components. Start playing a game, and after every time you roll the dice, right down each and every thought you had while deciding how to move. Then ask yourself, why did you think that? Keep breaking it down into it's smallest components. The more you're able to break the system down into its components part, the less complicated it becomes.


--------------
Good Luck
To get the most from your Tek-Tips experience, please read
FAQ181-2886
Wise men speak because they have something to say, fools because they have to say something. - Plato
 
Thank you so much, I already wrote down as much as I detailed could, what I want to do prior of all moves and I created a routine of playing all strickens first and a function (whenever I have only one stricken played), for the next move of a checker even it is onto a gate, even it is a lonely checker. It's more simple but big subs or functions too. I hope everything will go well. Thank you so much. I want just to do it finally!!!
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top