Advertisement

Mancala heuristic

Started by October 12, 2004 04:04 PM
3 comments, last by EvLer 20 years, 1 month ago
Hi everyone, I was wondering if anybody could advise a good heuristic for mancala computer agent. It's mainly an implementation issue (in C). I know that free turn most of the time takes precedence. But how to implement it I am a bit unsure. So far, I have a game tree, which is built out of lists. So, I use minimax based on evaluate(). At first for evaluate() I decided to return difference in home_bins, then difference in stones on the players' sides, but that does not seem to work out well. Any advice is very much appreciated.
There seem to be a large variety of mancala rules. Can you, please, post a link to the set of rules that you are using, or the exact rules themselves?
Advertisement
Rules are following:
6 bins + one home_bin, per each player.

Player chooses a bin to empty, the amount of stones is distributed counter-clock-wise into other bins, even on the opponents side, but not opponent's home_bin.

Player gets a free turn if the last stone from the bin he chooses to empty lands in his home_bin.

If the last stone lands in an empty slot on the palyer's side, but the opponent's side has some stones in the bin across, those opponent's stones are captured into the player's home_bin.

Game ends when one of the players clears out his board.
Winner is the one who has most stones in home_bin.

I can't make computer make smart moves. I used a minimax, no prunning yet, based on evaluate function, as I mentioned before. Current depth is 5, and if I make depth larger, computer makes even more strange choices.
Please, if you have some suggestions, that would be greatly appreciated.
I think the difference in home_bins should work fine. You might have done something wrong with the search.

You should at least implement alpha-beta. It reaches twice the depth of simple minimax and that will certainly have a huge impact in playing strength.

I need advice on alpha-beta though. Is it better to get it running without alpha-beta first with a fixed depth and then implement it after I know that it does find a good move? My depth is going to be fixed anyway.
Thanks.

This topic is closed to new replies.

Advertisement