Inside sub top_style12, make these modifications to allow polyglot to adjust to lag and prevent losing because it didn't get a chance to make enough moves.
my $timebuffer=8; <-- I use an 8 second buffer, it can be set to user preference
my $wtime=int(&top_timeleft($table,0)/1000)-$timebuffer;
my $btime=int(&top_timeleft($table,1)/1000)-$timebuffer;
if ($wtime < 0) { $wtime = 0 }; <-- Since the time is subtracted from the true time, we could get negative numbers. Instead, we'll just pass over 0 for failsafe.
if ($btime < 0) { $btime = 0 }; <-- Same as comment above, black time
I'm sure programmers will know how to add this to their code, and even set a variable to adjust the timebuffer inside game. If they want to get advanced, they can do analysis of ping and adjust the time buffer based on that, like if ping is 250ms, and we want to at least play the last 20 moves speedily, we multiply 20 by .250 and that gives us a time buffer of 5 seconds.










News