"Join the battle as a valiant knight, outsmart your opponent, and capture the enemy's king in this strategic and knightly game of Knight Fight Chess."
Play chess on a pixelated retro board. Play against a CPU player or another friend.
Grid lines and positions overlay (configurable)
- Multiple modes - Human v Human, CPU v Human, CPU vs CPU
- Follows standard Chess rules (Now powered by python-chess)
- Retro sound effects and music!
- Lots of configurable options
- Debug mode to highlight positions and grid
- Undo last move (press Ctrl+Z)
- Change board styles
- Multiplayer API available. See https://www.github.com/intothevoid/chessapi for details.
- Animated CPU piece moves
- Retro title menu with options to save and load games
- Smarter CPU player with multiple chess engines supported:
- Stockfish
- OpenAI API
- Piece Squares (Uses minimax algorithm)
- Piece Squares v2 (Uses minimax algorithm) - Default
- Basic Random Moves
- Show possible moves for selected piece, and last move made
git checkout [email protected]:intothevoid/knightfight.git
python -m venv venv
source venv/bin/activate
pip install -r requirements.txt
python3 main.py
If you would like to play against a stronger CPU player, you can install Stockfish. Stockfish is a free, open source chess engine. It is the strongest chess engine in the world.
- Go to https://stockfishchess.org/download/ and download your version of the Stockfish chess engine
- Copy the binary to assets/engines/stockfish (assets\engines\stockfish.exe for Windows)
- Update the path in config.yml as shown below
cpu:
stockfish_path: assets/engines/stockfish.exe
cpu:
stockfish_path: assets/engines/stockfish
If you would like to play against OpenAI's GPT 3.5 powered chess engine, you can install the OpenAI API. OpenAI is a powerful AI API that can be used to generate text, images, and more.
- Set up an OpenAI account at https://beta.openai.com/
- Copy your API key to config.yml as shown below OR setup an environment variable called OPENAI_API_KEY
- Update the path in config.yml as shown below (chess engine option)
cpu:
ai: openai
openai_api_key: <your api key here>
PyGame https://www.pygame.org/
OpenAI https://www.ai.com/
Stockfish https://github.com/official-stockfish/Stockfish
Stockfish GPL 3.0 License - See https://github.com/official-stockfish/Stockfish/blob/master/Copying.txt
Stockfish Source Code - https://github.com/official-stockfish/Stockfish/tree/master/src
Dani Maccari's image assets https://dani-maccari.itch.io/
Music assets by wyver https://wyver9.itch.io/8-bit-beatem-up-soundtrack
Midjourney - Knight Fight Splash Image https://midjourney.com/
python-chess - https://python-chess.readthedocs.io/en/latest/
Simplified Evaluation Function - https://www.chessprogramming.org/Simplified_Evaluation_Function