time control

An abstract strategy board game for two players
Post Reply
flok
Posts: 36
Joined: Sat Jan 02, 2016 9:04 pm
Contact:

time control

Post by flok »

What is the most common way of time-control in Go AIs?

I'm now doing:

Code: Select all

double useTime = (timeLeft / 2.) * (p2dim - nEmpty) / p2dim * 0.95;
with:

Code: Select all

timeLeft: from time_left
p2dim: board dimension ^2, e.g. 19 * 19
nEmpty: how many empty crosses there are on the board
but that gives out-of-time-lost constantly.
https://www.vanheusden.com/

https://github.com/folkertvanheusden/
Rémi Coulom
Posts: 207
Joined: Tue Feb 12, 2008 8:31 pm
Contact:

Re: time control

Post by Rémi Coulom »

Do you mean you lose on time when playing on CGOS?

I noticed it is necessary to take a very large security margin with respect to time control on CGOS, because of the performance problems of the server. For instance, if you try to connect with the tk viewer client, it will block for a while. It seems the server is blocked during that whole time, and some unlucky players may lose that much time on their clock.

I do something like:

Code: Select all

timeLeft -= securityMargin;
double useTime = (timeLeft / 2.) * (p2dim - nEmpty) / p2dim * 0.95;
securityMargin must be 30 seconds or so.

I will connect my very weak bots later today so that you can have more fun.
flok
Posts: 36
Joined: Sat Jan 02, 2016 9:04 pm
Contact:

Re: time control

Post by flok »

Rémi Coulom wrote: Thu Feb 16, 2023 3:18 pm Do you mean you lose on time when playing on CGOS?
Exactly. And maybe in the future on kgs or so.
Rémi Coulom wrote: Thu Feb 16, 2023 3:18 pm I noticed it is necessary to take a very large security margin with respect to time control on CGOS, because of the performance problems of the server. For instance, if you try to connect with the tk viewer client, it will block for a while. It seems the server is blocked during that whole time, and some unlucky players may lose that much time on their clock.
Oh wow! Is that the python-version of the cgos server?
I do something like:

Code: Select all

timeLeft -= securityMargin;
double useTime = (timeLeft / 2.) * (p2dim - nEmpty) / p2dim * 0.95;
securityMargin must be 30 seconds or so.

I will connect my very weak bots later today so that you can have more fun.
Thanks in advance.

I tried that formula as well giving the same problems BUT without the security margin.

Currently I have:

Code: Select all

        size_t totalNChains = chainsWhite.size() + chainsBlack.size();

        double useTime = (timeLeft / 2.) * totalNChains / p2dim * 0.95;
chainsWhite/chainsBlack: arrays of chains on the board (so totalNChains is the number of chains, not the number of stones).

This seems to work pretty nicely (read: where previous timecontrols would always fail, this has not failed in 3 games - lots of more testing to do).
https://www.vanheusden.com/

https://github.com/folkertvanheusden/
Rémi Coulom
Posts: 207
Joined: Tue Feb 12, 2008 8:31 pm
Contact:

Re: time control

Post by Rémi Coulom »

Rémi Coulom wrote: Thu Feb 16, 2023 3:18 pmI will connect my very weak bots later today so that you can have more fun.
Sorry, I did not have time. I have been a bit busy. I will do it soon.
Post Reply