Sunday, May 1, 2016
By: Matthew Doucette
Xonafish is a hack of the Stockfish 7, one of the world's strongest chess engines -- and, open source. Xonafish was created at Volta Labs' Hackathon 2016, which was held April 29th to May1st, 2016 -- a 48 hour hackathon.
Xonafish's first run in Arena Chess GUI.
The Xonafish name is a play on Xona and Stockfish. I do not like it so much but it serves the purpose of highlighting the base chess engine code is from Stockfish.
The purpose was to test different evaluation functions, such as focusing only on material advantages, positional advantages, or mobility advantage, and nothing more. How powerful would today's engines be if they "knew" nothing about chess other than piece values? What if they only knew about the mobility of the pieces, and nothing about their inherent values (such as a pawn is worth 1 point and a queen is worth 9 points)?
The original idea was to see if the chess engine could derive the piece values on-the-fly, during each chess game. As well, could it discover king protection? The thought was the deep depth searches engines such as Stockfish can now do -- 20..25 ply no problem on a standard PC -- could it derive how to play chess on some level just by searching deeply?
Note: I do not intend any of this work to produce a stronger Stockfish, as it is clearly better to have the engine know of such concepts to avoid horizon problems.
I succeeded in creating a chess engine (ala Stockfish) that does not understand piece values. All piece values were set to the same value, (1.0 I believe), and the search tree tries to find flaws in the search tree.
It does vary from the original Stockfish, however whenever a move is quite obvious, both versions (Stockfish and Xonafish) find the same move. Try it out and let me know what you think.
Compiled in Windows!
Xonafish was compile in Windows! We used Stockfish Support's article to help us out. Unfortunately we could not get Stockfish to compile in Visual Studio C++ 2010 or Community 2015. If you have any idea how to do so, please contact us and let us know!
Peter Eliyahu Kornfeld emailed me in September, 2016 about compiling Stockfish 7 with Visual Studio 2015 (Community Edition). He graciously allowed me to share his tips:
from: Peter Eliyahu Kornfeld
subject: Compiling Stockfish 7 with Visual Studio 2015 (Community Edition)
Not sure if it is still relevant, but saw your page about Xonafish and about how to compile Stockfish with Visual Studio...
I done it...
I used 2015 Community, Update 3, but not sure if Update 3 is relevant...
These are the points:
1. Do not use UNICODE
2. tbcore.cpp is actually a header file (used that way) so you have to set its 'Item Type' to 'Does not...'
3. The target must be v140 as v100 missing C99 support (and some header files with it)
However the resulting code is very-very slow compared to the GCC compiled one (also on Windows) and actually useless... I tried to configure the optimization, but gained minimal improvement, but I'm not a compiler-options expert...
I hope it helps you...
Here is a download of Xonafish as it existed at the time of the Hackathon:
- xonafish.rar (281 KB)
Let me know if you have any issues running it.
That is all!
About the Author: I am Matthew Doucette of Xona Games, an award-winning indie game studio that I founded with my twin brother. We make intensified arcade-style retro games. Our business, our games, our technology, and we as competitive gamers have won prestigious awards and received worldwide press. Our business has won $180,000 in contests. Our games have ranked from #1 in Canada to #1 in Japan, have become #1 best sellers in multiple countries, have won game contests, and have held 3 of the top 5 rated spots in Japan of all Xbox LIVE indie games. Our game engines have been awarded for technical excellence. And we, the developers, have placed #1 in competitive gaming competitions -- relating to the games we make. Read about our story, our awards, our games, and view our blog.