Cotix / Abalone

Computer player for the Abalone board game
MIT License
0 stars 0 forks source link

Weak evaluation function #1

Open peso opened 4 years ago

peso commented 4 years ago

The evaluation function is too weak, compared to variants of compactness.

I suggest you implement a (slow) eval func that computes compactness as closely as you can to Tino Werner's description. Basic compactness is strong (first used in 1990's), but Tino has a twist that makes it even stronger on middle and end game. Then try to beat that function with a fast evaluation function.

It is possible to compute compactness incrementially with very low overhead, on 61-byte arrays. I have not been able to find one as fast for bitboards. My best effort is 3 types of masks, counting bits along the 3 axes. This will reduce it to three 1D problems, which can be computed simultaneously.

Cotix commented 4 years ago

Thanks for your interest, I didnt really expect anyone to find this.

The current heuristic function is pretty slow as well, since it counts bits too. Ill take a look at it, thanks for the suggestion.

Cotix commented 4 years ago

I pushed a first rough implementation of Tino's heuristic. I also found an issue with the move generator not generating every possible sumito because of how the board was set up. The new heuristic seems to be slightly better, but (for now) quite a bit slower. However, since it produces extra cutoffs due to better move ordering and the slowdown is (i think) only linear, it hardly matters for how many moves the player can look ahead.

The current implementation is quite slow, but I wanted to implement it quickly to test how effective it would be. Speeding it up might even result in using the new heuristic to be faster due to the improved move ordering.

Then try to beat that function with a fast evaluation function.

I did some testing which you can replicate by running the demo function in main.cpp, and tweaking the arguments a bit. It seems like setting the depth to 8, the new heuristic wins vs the old one. Even with a slight dissadvantage on depth (6vs8). However changing the depth futher in favor of the old heuristic, it gains back the advantage (as one would expect).