Reversi ai strategy


Reversi ai strategy


Get via App Store Read this post in our app!
Ideas for simple and useful AI for othello game (aka: reversi)
Hi Where can I find some information for how to implement an AI for this game. Never done an AI of any sort before.
Looking for recommendations for best and simple approaches Thanks.
The negamax or minimax algorithm is simple and should work decently.
To get to a higher playing you'll need to add some heuristic, but a simple two move negamax is trivial to implement and fast.
As in almost every board game you have to (a) evaluate how good a position is and (b) search for moves that lead to positions that are good for you.
Othello is slightly different from other games such as chess in that (a) is a little difficult. You can't easily tell which positions are good because the tables can turn very quickly. However, if you're just starting out, a good heuristic is.
Highly value taking corner fields Highly penalize taking the fields next to the corners Value other border tiles higher than remaining tiles Try to minimize the number of moves the opponent can make.
For (b) you can use a standard game tree search algorithm such as Minimax or Alpha-Beta Pruning. There are many different ones to choose from.
Michael Buro, who wrote Logistello, one of the (formerly?) strongest othello playing programs, has written several fascinating papers about the subject. To tell how good a position is, he compares the patterns on the board (each rank, each file, all diagonals form patterns) with patterns in a database previously learned by the program. To search for desirable outcomes, he uses a search algorithm called Multi-Prob Cut.
Links that will probably be helpful:
Russel/Norvig's "Artificial Intelligence - A modern approach" is a good starting point to learn about game theory, ai, heuristics and related stuff. Have a look here: aima. cs. berkeley. edu/
Well, actually, Othello is an example for a game, where Minmax/Negamax does not work very well, because you need heuristics for evaluating intermediate game states which is difficult in Othello. Have a look at Monte Carlo Tree Search (MCTS). This should work well. Actually, I implemented a very simple mechanism inspired by MCTS myself and it beat all online AIs that I tested so far (while the AI makes a move within a very short time: 2sec). The mechanism works as follows: (a) get all possible moves for current player (b) chose one of those at random (c) alternately play the game with totally random (valid) moves until the game is over. (d) value the game result (e) add this value to the totalscore of the move chosen in step (b) (f) add 1 to the number of visits for the move chosen in step (b) (g) jump to (b) if there is time left (I gave the algorithm 2sec) (h) make the move with highest average score (totalscore/number of visits)
Some optimizations are quite obvious, like making the move immediately, if there is only one that's valid or limiting the number of random simulations in addition to the time constraint (like 2000 per valid move or so).
Again, this is NOT MCTS, but merely the last part of MCTS, but it works quite well.
Source code is available here for Logistello, which was the best game in town ten years ago.

Game AI. Reversi .*;
This example uses both the Minimax algorithm and region-favoring rules to choose its moves. The Minimax algorithm provides a way of looking multiple moves ahead, while maximizing the AI's score and minimizing the human player's score. Defining strategic regions about the board shapes the AI's ability to assess movement risks.
The Minimax is a recursive algorithm that repeatedly evaluates scores over times series, making choices based on maximum scores during some steps, while choosing minimum scores of others. When applied to strategy games, Minimax explores all possible moves of the first player, simulating those moves, and exploring the possible moves of the second player in response. The algorithm searches for the smallest score during the second player's simulated responses, and the largest scores during its own simulated moves, thereby discovering which moves will maximize his own score and minimize his opponent's.
Figure 1. Exploring the possible moves creates a decision tree. Each level of the tree represents either the player's or the opponent's turn. The Minimax algorithm determines the moves which will yield the maximum score for the player, and the minimum score for the opponent.
John von Neumann was credited for the Minimax Theorum described in 1928. Basically, in any zero sum game (i. e: where each player's gain is exactly proportional to the opponent's loss), and where each player can know all possible moves at any given turn, a strategy must exist for both players which maximizes their gain and minimizes their loss.
In this implementation of Minimax, I've used two recursive functions: one for simulating possible moves n steps ahead, and another for calculating which move yields the best score.
The base simMoves() function starts by creating the root node of a decision tree, mRoot. From there, all possible moves the computer can make are passed to the second simMoves() function and subjected to all possible moves the human player can make in response, which are then subjected to all possible moves the computer can make in response, . and so on for n steps ahead.
Note how a temporary gameboard matrix is created for each simulated move. These temporary gameboards contain the simulated moves for evaluation in each step of the recursion.
After the tree of simulated moves are made, a second set of recursive functions are used to traverse the tree backward, from the youngest child nodes, all the way back to the root node, calculating the move with the best future effects (the best score).
The giant for-loop in the base findBestMove() function implements an additional scripted strategy for favoring some areas while avoiding others (I'm calling them risk regions).
Risk Regions.
Beyond Minimax, this implementation of reversi also includes risk regions defined on the board:
Figure 2. Arbitrary regions representing very general movement risks. Typically, Regions 3 and 5 are very valuable strategic areas. I've found that Region 4 is a real weakness in example 1, often making it easy for me to take the corners.
Regions 3 and 5 are coveted real estate on the Reversi gameboard, because it's harder for opponents to threaten your pieces. Especially so for Region 5. These two regions also make it easy to take large numbers of opponent pieces at once. So the AI in this example is encouraged to place pieces in these regions whenever possible.
In contrast, Regions 2 and 4 are risky territory because opponents gain access to Regions 3 and 5 after taking pieces place here. So, the AI is discouraged from occupying these two regions.
To calculate the best move, the number of possible opponent pieces taken is compared to the bias of the risk regions involved.
Note that this example allows you to vary the amount of bias from the risk regions:
Figure 3. These are the default options. Moves Ahead is limited to between 2 and 10. Edges (Region 3), Corners (Region 5) and Region 4 are limited to between -50 to +50.
Funny thing is, you can even change these values in the middle of a game!

Reversi Tips and Strategy.
Winning at Reversi requires considerable skill and strategic thinking. Here are a few strategic concepts to consider.
Look ahead.
In Reversi it’s not enough to simply try to capture the maximum number of your opponent’s pieces on each turn. Beyond the beginner level, you will need to be considering the ramifications of your moves down the line and looking ahead, well beyond the current move. For example, to take a corner you may first need to force your opponent to play into the square next to the corner.
Computers are much more proficient at looking ahead and analyzing possible outcomes than humans are. That’s why good computer opponents beat good human players.
Take the corners.
The advantage to taking the corners is obvious: a corner piece cannot be flipped by your opponent. Good players work towards setting themselves up to take corners. However, taking corners is not the ultimate goal but rather part of the overall strategic picture.
Limit your opponents options.
To achieve your objective, you need to make plays that limit your opponent’s options and force them into certain moves.
One example of this is the so-called “minimum disk strategy”. The essence of this strategy is the fewer disks you have in play, the fewer options your opponent will have. Of course, at some point in the game you will abandon this strategy and beginning flipping your opponent’s pieces in earnest.
Learnplaywin now has an advanced reversi strategy guide if you would like to go more in depth on this topic.
More Othello strategy resources.
The above discussion is nothing more than a primer to introduce you to a few concepts of Othello strategy. Below are links to resources where intermediate and advanced players can further study the game:
Strategy at Yahoo Games – Nice explanation of basic strategic concepts.

geeky. blogger.
yet another blog about computer, technology, programming, and internet.
Sunday, March 18, 2007.
Artificial Intelligence in Reversi/Othello Game.
1. Full Information: no game information is hidden.
2. Deterministic: action determines the change of game states, no random influence.
3. Turn-based: makes life easier ;)
4. Time limited: obviously. who wants to wait an hour just for a small move in the game?
As a conclusion, action B is the best option according to the Minimax algorithm.
- mobility (the number of possible movement)
- the number of pieces that couldn't be flipped by the opponent (eg: pieces in the corners)
54 comments:
Hehehe..seperti membaca buku AI ^^. Maklum semester kemaren ujian AI. Ide ttg hal2 yang perlu diperhatikan dalam strategi, menarik juga.
hehehe, itu tulisan saya sendiri sih. jadi perlu dikasih saran dan kritik nih supaya ada peningkatan :D.
have you thought about the possibility of including heuristic in the search algorithm? what kind of heuristic you think will be appropriate for othello?
Hmm nurut gw alpha-beta pruning lebih ke arah teknik ato strategi. Tanpanya, maka ruang pencarian akan semakin lebar n dalam. Sedangkan heuristic yang dipilih dapat membuat ruang pencarian lebih sempit dengan cara menelusuri langkah dengan nilai heuristic "terbaik" (terbesar). Seperti halnya manhattan distance dalam N-puzzle. Gimana nurut kamu? Dalam othello yang kamu buat, heuristicnya apa?
Bagian akhir cukup rumit. Meski bagian awalnya menarik :D.
2. Pinggir yang tidak menyebabkan lawan dapet pojok.
3. Tengah yang tidak menyebabkan lawan dapet pinggir.
4. Tengah yang tidak menyebabkan lawan dapet pojok.
5. Tengah yang paling banyak dapetnya.
read_1: kalau begitu, dalam othello yang saya buat tidak ada heuristicnya karena evaluation function cuma dilakukan pada "leaf" saja, jadi tidak ada "bimbingan" dari manapun.
Bibibib.. ikut marathon match yuk bibibib..
Banyak problemnya di sekitar game dan game theory. Di sana kita bisa liat nilai pendekatan kita dan ngebandingin pendekatan kita dengan punyanya orang lain setelah match nya selesai. Coba di topcoder/longcontest/?module=ViewActiveContests.
Bisa jadi ide tugas kuliah IF2251 tuh Bib, nama kuliahnya Strategi Algoritmik. Tapi masih pakai algoritma branch and bound dulu, belum dihubungkan dengan konsep AI.
hi, boleh minta bantuan untuk AI? Saia kebingungan tugas ai..
kalo berkenan hubungi hallobossyahoo.
pok huar bantuan coba AI?
jadi konsep mijki yahi ranjukla dingnom hubungi kalo whhwhwhwhwhee!
ntar waktu pinggir.
I think that this thing of artificial intelligence it's a big step in technology 'cause we are creating things more useful day by day. Thanks for share things like this.
By the way, i think you reversed the roles in your diagram!
Then visit this endorsed web-page and discover how Accountant Burnsville can benefit you.
Prepare an application for Tax-ID number, if needed.
Various accounting firms allow students to serve as interns.
Nice post. I learn something totally new.
and challenging on websites I stumbleupon every day.
It will always be exciting to read through content from.
other authors and use a little something from other.
Hello! I'm at work surfing around your blog from.
my new iphone 4! Just wanted to say I love reading through your blog and look forward to all your posts!
Keep up the fantastic work!
Below are just a few examples of where cost segregation generates meaningful tax deductions.
After determining that you are qualified for a refund, the refund service will start the process.
or you. Head of House hold is preferable over filing as single.
One particular weight loss diet that has just lately seen a come-back of interest is h.
- CG weight loss options. Slowly introduce sugars in moderate quantities back into your diet.
However, the HCG kind found in HCG Weight loss solutions.
aren't obtained from women or from placentas, nonetheless from sterile and clean cells.
inside a research laboratory.
- perifolliculum - cirumferential band of fine adventitial collagen that defines the unit.
long run. Are you in a situation where you.
cannot be among your friends and feel free because of your hair issues.
This is required whether or not the both spouses are responsible for the IRS debt.
Then I will upload all 20 of these to my host to correspond with.
my domain name that I was using for my initial redirect.
This can eventually lead them to the courts, which would spend.
them a lot more instead of just hiring a.
team of financial experts, professionals who.
would work hard to give them the business reports, analysis and assessments they need.
However, HCG is most active when women become pregnant.
h - CG prevents the disintegration of a structure in the ovary.
called the corpus luteum, thus maintaining a pregnancy.
You then take your BMR, and multiply it with an activity factor, to determine your TDEE:
Sedentary (BMR X 1.
Cleaning services company in Riyadh of Staff of the best companies in Riyadh cleaning workers technical coach at the highest levelشركة تسليك مجارى بالرياض.
شركة تنظيف خزنات بالرياضCleaning services company in Riyadh of Staff of the best companies in Riyadh cleaning workers technical coach at the highest level.
companies in Riyadh cleaning workers technical coach at the highest levelشركة تسليك مجارى بالرياض.
Chaquetas de canadá.
Jeans verdadera religión.
Nike outlet tienda.
Ralph lauren outlet.
Michael kors outlet.
Zapatos nike sb.
Gafas de sol ray ban.
Burberry outlet en línea.
Please click to play, if you wanna join casino online. Thank you.
Chaquetas de canadá.
Jeans verdadera religión.
Nike outlet tienda.
Ralph lauren outlet.
Michael kors outlet.
Zapatos nike sb.
Gafas de sol ray ban.
Burberry outlet en línea.
Please click to play, if you wanna join casino online. Thank you.

Комментарии

Популярные сообщения из этого блога

S&p futures trading signals

Safest binary options strategy

Private company stock options valuation