Saturday, May 26, 2012

On Analysing Chess Games

In a previous post I've written about my thoughts on how to learn chess, with the main emphasis being on game analysis. But how that is done is a matter of time, taste and budget. This post is about how I do it. I don't know how other people are analysing chess games, except from hearing them talk about it, so I am not an authority in the matter, but it will save you some time figuring it out for yourself (which you still have to do even if you read the post :) ).

The easiest way of all is to get a game in PGN form, load it in a chess program, then watch it unfold, while you think about what you would have done differently and highlight what you thought was a good move and a bad move. Of course, that relies on your own thinking, which may be flawed, so you can gain help from a chess engine that will analyse the variations and tell you what it thinks of what you thought. It sounds complicated, but it is not. You ask yourself why the player didn't fork the queen and the rook with the knight, you can do it for them (creating what is called a variation). While you are moving the pieces, a chess engine can suggest, based on the time you let it analyse, what is the best move in that situation.

For this I use Arena Chess GUI, a free chess program, and load up the free chess engine versions of Houdini and Rybka. Arena comes with more engines, so you can try them all, but really it's a matter of taste. I once did a championship of chess with the chess engines available in order to see which is best, but there is no real way of giving both chess engines the same computer resources, so the programming style of each engine makes this only a fun comparison, not a scientific one. There are videos on YouTube with competitions of chess engines; those are fun in their own right. Unfortunately, Arena is not really bug free. There are a few gotchas that you learn the hard way, like don't use the Minimize to tray option if you have the default "load PGN at startup" on, or don't use "save back into PGN", etc.

Of course, most chess engines have a free version and a commercial one. Depending on your seriousness, you can choose to pay money for them and get the advantages of new development in chess computing, but don't expect too much. After all, a computer engine only takes a formula that gives a value for a position and then makes a tree of possible move orders in order to minimize their opponent's advantage and maximize theirs. The algorithm is pretty standard and the formula, which really makes the difference between engines, is the outcome of centuries of chess analysis. The game hasn't changed that much in a few years. And exactly this difference between how humans process a game and how a computer does it, makes this analysis a little flawed. A computer will tell you where you went wrong, but won't be able to devise a winning strategy for you, as it is examining every move like it would be the first. So we move to plan B.

Another option for analysing a game, thanks to the vast database of chess games ever played, is to see what other players, human grandmasters and below, have done in the same situation. A software that was built to do this is ChessBase. And it is true that there is a gazillion of possible chess games, but they all begin kind of the same. The opening principles restrict the way a game can start and for the first 20 or 30 moves, there are a lot of players that did the same thing (and played a decent game). ChessBase is a great program, just like Chess Arena, because it allows flexibility in the way you use it without bundling it all. The program is small to download, then you get to download whatever chess engines you want, game databases, video tutorials, etc. To give you an example of size difference: ChessBase 11 is 150MB, the chess player base is 640MB, a video tutorial of chess openings in ChessBase format is 1500MB, while the MegaDatabase of chess games is 2700MB. You can imagine that there are a lot of games in that database, over five million of them. Unfortunately, ChessBase, the databases and the tutorials are not legally free. They cost around 200 euros, plus a few more for the tutorials. Not much for the effort that was put into them.

The chess blog posts that I am using to publicize games are done by using these kinds of scenarios. I am taking a game that I played with someone or with my phone, I am analysing the game so see where changes in the score have occurred (those are the interesting bits in a game) and then try out variations, using engines or databases to see what else could have been done. It is a good practice to analyse the game as soon as possible, as the ideas that led to the moves are still fresh in your mind. It may seem like a drag, but commenting why you did the moves allows you to understand the game later on, when you are revisiting it. Also a good idea is to have your chess partner do the same thing and then merge the two PGNs into one, that makes clear the overall play. A chess analysis engine will comment every move with what it thought would have been the best continuation and the value of the board at that time. It makes a PGN horrible to read, because even if you put it into a visual display of the PGN, you still want to have a clean, readable PGN file. What you want to do is analyse a single move with the engine, see were it goes, then write a humanly understandable statement like "which would have been disastrous because of the sacrifice of the rook on f8, followed by Qxf7, mate".

As examples, try to compare the following blog post PGNs. My first chess game post, was annotated automatically by ChessMaster XI, which has a human readable annotation engine which I first thought was great. But look at the texts: they are either obvious or resort to stuff like "Leads to 15...Kf7 16.Bh4 h6 17.b4 Rab8 18.a4 Bxf3 19.Qxf3 Be7 20.Ng4 Bxh4 21.Nxe5+ Kg7 22.bxc5, which wins a bishopand two pawns for a bishop and a knight.". Unless used to read PGN like English (which most professional players can, btw, complete with a chess board in their heads), you see a lot of mambo jumbo. A later game post, that contained annotated moves by me, as translated from chess engine analysis.Or this one, which contains no annotations at all. Which one do you like best?

A word of warning, analysing chess games is not a short process. The advantages of the ChessMaster XI auto analysis was that you could leave it on at night, then come back in the morning and see it unfurl before you (and audio read by the chess software). To do it manually, or even let the auto analysis run at night and then decode the best move suggested by the computer and translate, takes a lot of time. I've spent an hour per game to annotate a match (two games) that two coworkers had and that I dutifully stored on my cell phone while they were playing. It was satisfying, but time wasting. A lot like blog posting... I leave you at that. Have fun dissecting chess games.


Infinity Chess King said...

Nice post. Quite interesting and informative.