Skip to content

chess variant engine supporting Xiangqi, Shogi, Janggi, Makruk, S-Chess, Crazyhouse, Bughouse, and many more

License

Notifications You must be signed in to change notification settings

RainRat/Fairy-Stockfish

 
 

Repository files navigation

Fairy-Stockfish

Overview

Build Status Build Status Build Status PyPI version NPM version

Fairy-Stockfish is a chess variant engine derived from Stockfish designed for the support of fairy chess variants and easy extensibility with more games. It can play various regional, historical, and modern chess variants as well as games with user-defined rules. For compatibility with graphical user interfaces it supports the UCI, UCCI, USI, UCI-cyclone, and CECP/XBoard protocols.

The goal of the project is to create an engine supporting a large variety of chess-like games, equipped with the powerful search of Stockfish. Despite its generality the playing strength is on a very high level in almost all supported variants. Due to its multi-protocol support Fairy-Stockfish works with almost any chess variant GUI.

Installation

You can download the Windows executable or Linux binary from the latest release or compile the program from source. The program comes without a graphical user interface, so you perhaps want to use it together with a compatible GUI, or play against it online at pychess, lishogi, or lichess. Read more about how to use Fairy-Stockfish in the wiki.

If you want to preview the functionality of Fairy-Stockfish before downloading, you can try it out on the Fairy-Stockfish playground in the browser.

Optional NNUE evaluation parameter files to improve playing strength for many variants are in the list of NNUE networks. For the regional variants Xiangqi, Janggi, and Makruk dedicated releases with built-in NNUE networks are available. See the wiki for more details on NNUE.

Contributing

If you like this project, please support its development via patreon or paypal, by contributing CPU time to the framework for testing of code improvements, or by contributing to the code or documentation. An introduction to the code base can be found in the wiki.

Supported games

The games currently supported besides chess are listed in our variants page. Fairy-Stockfish can also play user-defined variants loaded via a variant configuration file, see the file src/variants.ini and the wiki.

Help

See the Fairy-Stockfish Wiki for more info, or if the required information is not available, open an issue or join our discord server.

Bindings

Besides the C++ engine, this project also includes bindings for other programming languages in order to be able to use it as a library for chess variants. They support move, SAN, and FEN generation, as well as checking of game end conditions for all variants supported by Fairy-Stockfish. Since the bindings are using the C++ code, they are very performant compared to libraries directly written in the respective target language.

Python

The python binding pyffish contributed by @gbtami is implemented in pyffish.cpp. It is e.g. used in the backend for the pychess server.

Javascript

The javascript binding ffish.js contributed by @QueensGambit is implemented in ffishjs.cpp. The compilation/binding to javascript is done using emscripten, see the readme.

Ports

WebAssembly

For in-browser use a port of Fairy-Stockfish to WebAssembly is available at npm. It is e.g. used for local analysis on pychess.org. Also see the Fairy-Stockfish WASM demo available at https://fairy-stockfish-nnue-wasm.vercel.app/.

Other resources

Please see the Official Stockfish wiki for base information about Stockfish, then the Fairy Stockfish wiki for information about how Fairy Stockfish differs.

Terms of use

Fairy Stockfish is free, and distributed under the GNU General Public License version 3 (GPL v3). Essentially, this means you are free to do almost exactly what you want with the program, including distributing it among your friends, making it available for download from your website, selling it (either by itself or as part of some bigger software package), or using it as the starting point for a software project of your own.

The only real limitation is that whenever you distribute Fairy Stockfish in some way, you MUST always include the full source code, or a pointer to where the source code can be found, to generate the exact binary you are distributing. If you make any changes to the source code, these changes must also be made available under the GPL.

For full details, read the copy of the GPL v3 found in the file named Copying.txt.

About

chess variant engine supporting Xiangqi, Shogi, Janggi, Makruk, S-Chess, Crazyhouse, Bughouse, and many more

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • C++ 87.3%
  • Python 4.6%
  • JavaScript 3.6%
  • Makefile 2.0%
  • Shell 1.6%
  • C 0.9%