Chess AI
Introduction
My goal starting out was to see if I could make an AI that could beat me in a standard game. I’m not a particularly strong player, but even a basic AI is a significant undertaking. After researching around, I decided to give it a shot.
After a few weeks I got it to play its first game, and, needless to say, it beat me easily. It started with an ELO of roughly 1400, which is extremely weak by computer standards, so I kept working on it for the next few months. Now I estimate its ELO at 2150, or expert level. I’d like to get it to 2400 eventually, but strength gains get harder and harder to find.
Building a chess engine was a great introduction to artificial intelligence and search theory, and it was more than worth the excessive amount of time I put into it. I’d love to go more into detail about how it works, but there are already so many excellent chess resources available that I’ll be content with a single post.
Main Features
- Negamax search with alpha-beta pruning
- Two-tiered transposition table
- Magic bitboards for move/attack generation
- Static exchange evaluation (working but not beneficial)
- Futility pruning
- Dynamic late move pruning
- CLOP-based tuning for evaluation and search parameters
- UCI compatibility
These features vary from trivial to very complex, and unfortunately the two most difficult features, magic bitboards and static exchange evaluation, have given the smallest increases in strength.
Testing Results
Here are the results of a tournament I myself with 40/2 (40 moves in 2 minutes) time controls. Normally engines are tested at 40/4, but these results should still be meaningful.
Once I’m more confident in its strength, I’ll add my engine to the Computer Chess Ratings List to get a true evaluation.
I’m especially pleased to see that my engine beats Vice comfortably, since the instructional video series about Vice got me into chess programming.
Download
My source code and 64-bit windows executable are available on my GitHub page.
Special Thanks
I’d like to thank all of the following for their great chess resources.
Bluefever Software
Mediocre Chess
Chess Programming Wiki