Progress is continuing slowly but surely on my Python chess engine. When testing a few different time controls I found that the time management could probably be a bit better than it currently is. Right now it is very basic for the case of giving blitz input (minutes, seconds, increment):
Code: Select all
# If time control is available, flag that we play with time control and set timing
if tot_time != 0:
timeset = 1
# Divide time equally between how many moves we should do
tot_time /= movestogo
# Lag compensation 100 ms
tot_time -= 0.1
# Add time and increment to get what time we should stop at
stoptime = starttime + tot_time + self.theme.inc
So basically it divides the time it has by how many moves that the game should be (set to 50 as default), and then add increment.
I have been looking at e.g. https://www.chessprogramming.org/Time_Management which explains some concepts to think about. Before starting to fiddling around on my own, is there a "standard" approach to use when it comes to blitz time management? Or should I just experiement and see what works best for some given test time controls (3-0, 3-2, 5-0, 5-5 etc)?