Chris Mair

Language selector

A chess engine in Go: part 5 - MOCHI plays chess!

MOCHI1 learned to play chess at last!

MOCHI vs HIARCS at 1000 Elo

MOCHI now speaks the UCI protocol2. This means it can be used together with chess GUIs. Currently, this has only been tested with HIARCS3 - I need to test other GUIs as well.

The first version of the board evaluation function just counts material and has very few positional aspects, such as that pawns increase their value while they advance and knights are worse when placed at the border.

There is ample room for improvement here. MOCHI doesn’t really develop its pieces well at this time.

The first version of the tree search is a simple Minimax algorithm with a fixed depth. Using minimax, all possible branches of the search tree need to be evaluated. For a depth of 5 plies, in the early phases of the game, that means tenths of millions of positions. In order to be able to play blitz (5 minutes + 3 second increment) on my notebook that is about the highest depth I can reach. Yes, this is already a multi-threaded implementation (thanks Go routines :)

The next step will be to change from simple Minimax to Alpha-beta search4. This algorithm will allow much higher depths.

How well does MOCHI v.20230522 play?

It looks like it’s ~ 1000 Elo as tested against HIARCS 15.1 in blitz (5 minutes + 3 second increment). It actually feels a bit stronger than that when I play against it. MOCHI is not human after all! It cannot make 1-move blunders or overlook a mate in two, like 1000 Elo humans in blitz would do all the time.

Note two points, though:

  • this is blitz only, MOCHI currently cannot make use of more time as it evaluates at fixed depth
  • I’m talking about “real” Elo, the ratings on lichess.org are several hundred points higher. I guesstimate that MOCHI could compete around 1500 in blitz on lichess.org against humans (yes, I’m planning to release it as a lichess.org bot eventually…)

Update: after a few more games, my impression is that this version of MOCHI is probably a ~ 200 points stronger than my initial estimate. I guess in a human blitz bool we would look more at ~ 1200 (or ~ 1700 lichess.org). MOCHI is very bad in some positions (end games!) due to the low depth, but it never makes a 1-move blunder and never overlooks an opponent’s 1-move blunder, so it could probably beat a 1000 Elo human before reaching the end game.

Menu

Language selector