I think the central tiger had a diagonal capture at 4:36.
Well, as you know, I have successfully completed the game. However, as they say, we never really finish coding a program, we just stop working on it.
So, I have decided to re-open the project files and begin improving the program. The evaluation function seems to be pretty solid. Many good Baghchal players that I know have lost multiple games to it.
However, I am now faced with a more difficult problem: one of repetition. This game seems to break down due to repetitive moves (especially when the AI is playing the goat side). The problem is that when it is losing, it creates a hole at the edge, one which the tigers cannot control. Then, it keeps moving a single goat back and forth in that empty square, no matter what the tiger side plays. I have tried very hard to prevent this, but have been unsuccessful so far.
My solution was to record the game state at every move. The game state consists of the board position as well as the turn. I created a new class for it. I also used a static function for comparing two game states and returning either true or false. Now, this only comes into effect after all the goats have been placed: At each move, a new game state is saved. Once the counter reaches 10, I start overwriting the previous game states. Also, before making any move the new game state is checked against all the previous game states, so as to avoid repetition.
In this way, I prevented repetition spanning 5 complete moves (10 ply). However, I faced a few problems. The most significant one was that there were a lot of cases where it gave a false positive, i.e. declared a state to be repeated even if it was not. Another problem was that it prevented a move even if it was the only move remaining, if it repeated the previous position.
Hence, I had to scratch the non-repetition feature from the program for now. How would you implement this feature? If you need to have a look at the code, I shall provide it to you.
Thanks in advance, and sorry for digging up this old topic.