How the bots work
The best free chess engines beat the world’s top players with ease. Getting one to play like a 1200 or 1600 player, and to feel like one when you’re sat across the board from it, is a different problem. This page explains how Chessbots goes about it.
Playing like a person
A bot rated 1200 should lose to you about as often as a 1200 player would. That part is fairly easy to arrange. The harder part is that it should also feel like a 1200 player: it should make the mistakes a 1200 player makes, in the positions where they make them, and pick the moves a person might actually choose.
So every bot is built from how real people play. Each one uses a chess engine to see where the moves on the board lead, then chooses the way a person of its level and character might play.
Centipawns, win percentage and move grades
To copy how people play, you first need a way to score a move. An engine scores a position in pawns: +1 means you’re a pawn’s worth ahead. A centipawn is a hundredth of a pawn, and a move’s centipawn loss is how much worse your position is after it than it would have been after the best move. Average that over a game and you get average centipawn loss. Lower is better.
Centipawns have a flaw, though. Dropping a pawn in a level game matters a lot, but dropping one when you’re already a rook up hardly matters at all. Win percentage fixes that by turning the engine’s score into your chances of winning. A level position is 50%, a pawn up is about 59% and a knight up about 75%. A move’s loss is then how many percentage points of winning chances it gave away, and that’s what typical chess game analysis grades are built on:
| Grade | Winning chances lost |
|---|---|
| Best | The engine’s top move |
| Excellent | Up to 2 points |
| Good | 2 to 5 points |
| Inaccuracy | 5 to 10 points |
| Mistake | 10 to 20 points |
| Blunder | More than 20 points |
A few grades sit outside that scale. Brilliant is a sound sacrifice, giving up material on purpose for something better. Great is the only good move in a position where everything else loses. Miss is failing to punish your opponent’s mistake.
Why most bots don’t feel human
The usual way to make a weaker bot is to hold a strong engine back. It gets less time to think, looks fewer moves ahead, or plays a random bad move every so often. You notice quickly, for a few reasons.
The blunders are the wrong kind. Pick a bad move at random and seven times out of ten it simply leaves something en prise, that is, where it can be taken for free. People do hang pieces, but most of their blunders are slower: a fork, a pin, a mate threat they didn’t see coming. Among strong players only about one blunder in fourteen loses material straight away.
Typical bot blunders come in the wrong places. The opening has more bad moves on offer than any other part of the game, so a bot that blunders at random blunders most in the opening; but that is actually the stage where improving players blunder least. Random blunders also turn up in quiet positions where no person would go wrong.
And everything else is too good. Between its blunders a held-back engine plays near-perfect chess, and it punishes every mistake you make because it sees so deeply into a position. In games between beginners, nearly half of all blunders go unpunished, because the other player doesn’t spot them either. A bot that never misses your blunders plays far stronger than its rating, however many of its own it makes.
Learning from real games
Our bots’ errors are modelled on hundreds of thousands of online games between real players, every move scored by an engine. That gives the headline numbers by rating. This is what they look like in rapid games, where each side has ten minutes or more:
| Rating | Average centipawn loss | Blunders a game |
|---|---|---|
| 850 | 96 | 3.2 |
| 1050 | 82 | 2.9 |
| 1250 | 72 | 2.7 |
| 1400 | 64 | 2.5 |
| 1550 | 58 | 2.2 |
| 1750 | 53 | 2.0 |
| 1900 | 48 | 1.8 |
| 2100 | 42 | 1.5 |
| 2300 | 35 | 1.1 |
| 2500 | 30 | 0.8 |
An average hides a lot, though. Two players can have the same average loss and play nothing alike: one makes small slips all game, the other plays well and then drops a piece. So hundreds of games are also graded move-by-move, through exactly the same review you get after your own games. That gives a move-by-move profile for each rating: how many moves are Best, how many Excellent or Good, and how many are inaccuracies, mistakes and blunders. Importantly, a bot has to match the whole profile, as well as the average.
Finally, tens of thousands of positions from those games were analysed with every legal move scored, alongside the move the person actually played. That shows where and how people go wrong as well as how often, which is what the rest of this page is about.
The stage and state of the game
People don’t make mistakes evenly through a game. Beginners blunder everywhere. As players improve, opening blunders almost disappear because the first moves become familiar, middlegame blunders fall by more than half, and endgame blunders, once most of the pieces have been swapped off, fall the least. The bots follow the same pattern, stage by stage.
The state of the game matters too. People blunder nearly twice as often when they’re well ahead, mostly because winning positions are sharper and give more chances to go wrong. When well behind, some fight for every move and others fall apart.
Some of what people do in real games is worth leaving out. Under time pressure, players make blunders they’d never make with a full clock: in faster games about a quarter of strong players’ blunders come with almost no time left. Losing players throw pieces away in frustration or try cheap tricks. Plenty of people resign as soon as a game turns against them, especially at higher levels.
So our bot’s level is set by how humans play in even positions, where games are actually decided. How it handles being ahead or behind is left to its personality: like humans, some bots are good closers, some are comeback players, and some crack once the game turns against them.
The narrow path
In some positions almost any sensible move is fine. In others only one or two moves hold, and nearly everything that looks natural gives something away. Think of it as a path: when most of the moves a person would consider are safe the path is wide, when only 1 or 2 moves out of many are safe the path is narrow. The narrower the path, the more likely a player is to slip off it.
The path width decides where small mistakes happen. Call a slip any move that costs more than 5 percentage points. On a wide path, club players slip on only about one move in twenty. On a narrow one, they slip on around half their moves. The bots work the same way, choosing moves by the path width, to build the same profile of smaller inaccuracies as a real player of that level.
Building in personality
Everything so far makes a bot play like a typical player of its rating. In most positions there are several decent moves, and the one a person picks says something about them. Each bot’s character shapes four things: what it plays in the opening, the moves it likes, the tactics it misses, and the odd move it can’t resist.
Opening books
Nobody works out the opening from scratch every game. People have favourite openings and play the first moves from memory. A bot’s opening book is that memory: a set of move sequences it plays without thinking. Nearly every bot has a book for White, and its own answers to the main first moves as Black. Some stick to solid main lines, some play gambits (openings that give up a pawn early for a quick attack), some set traps, and a few play openings nobody sensible would choose. How far the book goes depends on the bot.
Style
Each bot has a set of style traits. Some go for your king, some throw their pawns forward, some sacrifice pieces for an attack, and some grab any pawn going. Others love swapping pieces off, simplify the moment they’re ahead, prefer quiet manoeuvring, bring the queen out early or castle at the first chance.
Most traits are scales from 0 to 100, where 50 is a typical player. Take aggression. Say a bot has two equally good moves, a knight close to the opponent’s king and a rook move on the other side of the board that takes an open file. An aggressive bot will usually choose the knight move, and a passive one will usually play the rook move.
Blind spots
Everyone has tactics they tend to miss, and which ones depends on their level. Beginners get mated on the back rank because their king is hemmed in by its own pawns. Club players walk into forks and pins. Retreating moves get overlooked at every level, and there are plenty more: skewers, discovered attacks, long diagonals, en passant.
A bot can have a blind spot or two, chosen to suit its character and only from those that are believable at its rating. A bot blind to forks is more likely to miss one coming, meaning more of its blunders allow forks. Its total number of blunders stays the same, so a blind spot changes which mistakes it makes rather than how many.
Signature moves
Some players have a move they just love. A bot can have a signature too, such as castling long, a bishop fianchetto, or tucking the king away in the middlegame. It plays it when the chance comes up, even if it isn’t quite the best move. A bot’s signature is a small part of its character, but it can make it feel more like a human.
Ratings that move
All of that gets a bot close to its rating before anyone has played it. After that, its rating moves just like yours. Win a rated game against a bot and your rating goes up while its rating comes down.
That makes every rated game a test for the bot. If a bot keeps beating players rated above it, its rating climbs until it sits where its results say it should, just as yours would. The more people play, the more each bot’s rating reflects how it really does against people, and the more yours means too.