Upgrade to Chess.com Premium!

Creating a chess engine (part 6: final thoughts and a game)

 

This will be my final part (so far I think) of this small series concerning chess engines. I started this project about a month ago and in that time I have managed to create a fairly strong chess engine (and still do the day-job - need money for food:-)). Its not quite up there with rybka, fritz and stockfish and those state-of-the-art engines. But considering the low amount of time I have put into this project I am quite satisfied with the result. I have played few blitz games with it myself and it has also played a longer correspondance game against a friend of mine rated around 1950. Based on those results I would say it has an ELO of somewhere in the range of 2150-2300 in rating - its a bit difficult to say exactly. With this rating it will place itself on the list of top 50 engines (low yes, but would be there! This list is recognised by most people as the closest to an official ranking of engines - see http://ssdf.bosjo.net/list.htm) I do not think its at either IM or GM level yet. Mainly because it is not that good in endgames and it is not fast enough which means it cannot reach a high enough search depth within a reasonable time frame. But optimizing algorithms and code for a chess engine is simply a never ending project - I will let the professional engine designers worry about that. For me it has been much more fun to create the engine - doing more optimizations to increase the playing strength are not really that fun I think - it feels too much like a real job, not a hobby! The engine is pretty good in tactical situations and is playing the middle game quite well and the opening book is decent enough. The main problem is the endgames - room for improvement there. 

I will finish the series with comments of a game it played against a friend of mine around 1950 (he knew he was playing my engine - I was not trying to trick him!). Some of the moves there are quite easily spotted as computer moves and I will try to explain (if I can) what caused it to make those moves. Hopefully, this will give you some insights as to why computers make those strange moves sometimes. Hope you had as much fun reading this series as I had creating the engine. To be honest, in fact this is not my first chess engine! In my teenage years I also created a chess engine (in the Pascal programming language) with an opening book and a graphical user interface for people to play with. But once the engine was out of the opening book it just selected a completely random legal move. I was not clever enough at that time to implement optimized recursive tree algorithms. So in a way by making this into a real playing engine (in Java this time around) I feel I have finally vindicated my younger self's lack of skills:-) I guess those 5 years at university was not a complete waste of time then:-)

In closing I will say that I think it does not really matter how strong engines become - chess will always be a fun and challenging game for humans even if we have engines with 4000 in rating. A game that has been around for about 1400 years is not fading away! It is the knowledge that your opponent or yourself could at any moment make a blunder and that it is so difficult not to make any blunders at all that is the fun challenge in chess. I think serious OTB tournament chess is the most difficult mental activity I have ever tried. As we recently saw in the Topalov-Anand match in the final game 12:  Even the best players around 2800 elo can blunder and are still influenced by nerves and other human emotions when playing.

Comments


  • 4 months ago

    Jamalov

    martin, thank you very much for this series. i found it very informative. you are not just a good computer programmer but a good writer as well. i wish you godspeed and good luck with your new engine. i would like to have a chance to play with it when you are done. 

  • 3 years ago

    Magnetohead

    As the player whose proverbial butt the engine kicked, I would like to give my thoughts on the game. First: yes, I did know I was playing an engine. 

    Alright, so I was playing an engine which I think most of us did a lot before the internet became vast enough to give us other good options like chess.com, FICS and other sites and most of us probably remember the granite feel of the computer's structure and logic when playing on a reasonably difficult level. Computers are supposed to be weak in closed, complex structural positions and very sharp in open tactical, complex positions, so my plan was to 1. leave the opening book quickly so it would have to deal with many undeveloped pieces and 2. create a closed position on the queen side involving pawns that advanced before officers. The plan failed. 

    Instead the computer started trading off things quickly and I think my first error was not to revise some of my plan after losing the black bishop and the c-pawn in exchange. I really didn't have the material to play the way I did. 

    I think I did ok until g6 which was unexpected from an engine in my book. Very prophylactic as it both takes away the value of my recently conquered white diagonal and places the knight in a silly position. I should probably at this point just have exchanged pawns and moved the knight back perhaps. Not sure, but a4 got me killed. 

    A4 was probably a mistake as the following advance of the c-pawn splits my center and leaves my queen-side pawns begging for help that newer shows. So after c5 I am left with the option of allowing c4 or tearing open the center - both are less than ideal. 20 .. Bc2 is an error and perhaps I could have held on a bit longer with the tempo intact, but with the center open like that, the bishops dominated and I am sinking fast. And the thing against an engine: it will not reblunder to let you back to the surface for air. And from that point on it was a desperate affair where it would take med a million moves with black going Kh8, Kg8 for me to redevelop my structure and get out of all the pins. 

    I am actually not so sure that 24 .. f5 is such a huge mistake from the engine, by the way. It is a very computer-like move. In its current position and with white bishop on the protective diagonal, it is not really that bad. Even if the white bishop is exchanged the black is also in a defensive position. Then, f5 may not actually serve any obvious purpose and I agree that Rc7 is better, but I think the engine could have defended f5 later on as only a computer can - with no fear at all. 

    I should probably have played more like I usually do, I think, and not thought so much about it being an engine, but its hard not to. I personally rate the engine currently at 22-2300 but that is just my guess. 

Back to Top

Post your reply: