0

I am working on my chess engine [1]. My issue is that if I run the AI bots in [2] with the depth of 4 for both the bots, already after the 13th ply the game breaks the three-fold repetion rule. I have absolutely no idea how to program my engine to avoid going to the breakage of the rule in question.

Any advice?

References

[1] Chess.java

[2] The demo AI vs AI match runner here: ChessDuel.java.

1 Answer 1

1

You can set the engine so it evaluates every repeat position as 0. That way the player who has even the smallest advantage will try to avoid a repetition unless necessary. Is your current evaluation function valuing the position as 0 even without the repetition? Then you may want to make it consider some extra factors so that it gives either player a small advantage.

3
  • So my flaw is in the heiristic function I use? At the moment, I only consider presence and vulnerability of the pieces of the state to evaluate.
    – coderodde
    Commented Aug 2 at 17:13
  • 1
    @coderodde Probably. If it sees way too many moves as the same you'll encounter problems like the one you describe. You may solve it by adding a draw avoidance factor (i.e: make repetitions -0.01 rather than 0) so that it prefers picking a different "equal" move over repeating
    – David
    Commented Aug 2 at 20:36
  • Would using Shannon’s heuristic function solve the issue?
    – coderodde
    Commented Aug 5 at 7:17

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.