Have you ever been curious how is WatchBot picking the games to observe and save? Here is the explanation.
Rationale
Due to the FICS limitations WatchBot can observe at most 30
simultaneous games (see limits
command, Observed games
). While I
could workaround it by creating extra guest watchers, I feel that
polite bot should respect such a limit.
As a few games must be kept in reserve for operational purposes, the true limit is 25 games.
There are also some limits on the database size, memory used etc (watchbot runs on a small machine). Network connection is also limited, so no blitz watching
So, the aim is to watch small selection of the most interesting games, giving particularly strong preference to TeamLeague, STCBunch, or OCL, and avoiding engine games.
Preliminary selection
Preliminary decision whether some game may be interesting, or not,
is made using gin
notification data:
- names of both players
- game variant (standard/blitz/wild fr/zh/...)
- whether the game is rated
Currently WatchBot accepts only standard
and wild fr
games
at this stage.
Final decision
The games which passed the preliminary stage are examined in more detail (in fact, WatchBot starts observing them, at least for a short moment, to avoid possible move loss).
At this stage games are scored, WatchBot tries to estimate the game value, using the following data:
- names of both players (which are compared against
=computer
list to detect engines) - players ratings
- game variant
- game clock (base and increment)
- whether the game is rated.
Having computed the score, WatchBot makes the following decision:
-
if
score
<minimum
, the game is rejected (minimum
is fairly low and mostly rejects computer-versus-computer games) -
if
score
>=minimum
, and there is a spare room, watchbot starts watching the game -
If
score
>=minimum
, but there is no spare room (25 games are being observed), WatchBot compares score of the new game with the score of worst currently observed game. If new score is significantly higher then the old one (score
>old_score
+delta
), old game is abandoned to make room for the new game, otherwise new game is rejected.
Note significantly higher. This clause is expected to guarantee the following:
-
if WatchBot is busy watching relays/15 0 games/... and something important starts (like teamleague game), the new important game will be watched, but
-
if the new game is similar to those currently handled (worse or only marginally better), it does not make sense to switch (after all, the old game has already been watched for some time).
Scoring algorithm
Here is the current scoring algorithm. I play with details from time to time, but the general shape remains fixed.
The game score is calculated as the sum of the following:
-
variant specific bonus: standard gets +100, wild/fr gets +50
-
player specific bonus: some particularly interesting players (those whose games I like most) get bonus (+50 or +100),
-
clock-based bonus to promote special tournaments: 45+45, 60+15 and 90+5 clocks get bonus +300
-
clock-based bonus to promote slower games: games with 30 minutes of time to think (time calculated in a FICS way as
base + 40 * increment
) get bonus +50, slower games get linearly increasing bonus up to +100 for 120 minutes or more, -
rating-based bonus, calculated for both players separately: for standard chess growing from +50 for rating 1600 to +200 for rating 2500 (in slightly non-linear way), for wild growing from 50 for 1700 to 100 for 2000 or more,
-
engine penalty: -500 for every player who is a computer,
-
unrated penalty: -100 if the game is unrated.
The current minimum is 100 (games with score below 100 are not watched).
The delta (score difference to replace the old game) is also 100.
Future
At least under the current load the algorithm seems to work reasonably well, and to catch all important games. I am considering some updates, like:
-
detecting relays and treating them in a special way (although I am not yet sure whether I'd like to eliminate them, or maybe to promote them),
-
using the information about the game length and comments count while deciding whether (and which) game to drop in favor of the new more interesting game,
-
giving people a chance to ask for being watched (and granting them some extra bonus).
Still, don't fix it if it is not spoiled.