Bagatur
Java Chess Engine (UCI compatible)
Stars: 74
Bagatur chess engine is a powerful Java chess engine that can run on Android devices and desktop computers. It supports the UCI protocol and can be easily integrated into chess programs with user interfaces. The engine is available for download on various platforms and has advanced features like SMP (multicore) support and NNUE evaluation function. Bagatur also includes syzygy endgame tablebases and offers various UCI options for customization. The project started as a personal challenge to create a chess program that could defeat a friend, leading to years of development and improvements.
README:
Bagatur chess engine is one of the strongest Java chess engines in the world.
It runs on Android as well as on "desktop" Computers (or even on virtual machine with many CPU cores into the Cloud):
- For desktop computers, it runs as a program whith a console and supports commands of the UCI protocol. It could be easily imported in Chess programs with user interfaces, like Arena Chess GUI.
- For Android, the app is available on different app stores Bagatur Chess Engine with GUI. It has its own user interface. The source code of the Android version is also open source and could be found here: https://github.com/MetatransApps/Android_APK_ChessEngineBagatur
If you like the project, please give it a star! :-)
- The new versions of Bagatur are released as standard github releases here.
- The old versions of Bagatur are available on github under this zip archive download, which contains all old versions under the path "/Downloads/Engine/" inside the archive file.
The program runs under all Operating Systems, which support Java platform:
- Android, Bagatur Chess Engine with GUI.
-
Windows, there are *.exe files for direct run. Here are the steps necessary to run the engine:
- Download an arbitrary UCI user interface. For example the most popular one is Arena Chess GUI.
- Install the UCI user interface on your computer.
- Ensure that the Java Runtime Environment (JRE) 1.8 or later is installed on your computer (it should be the case nowadays but if not, have in mind that JRE is required, only JDK doesn't work). It could be downloaded from java.com
- Unpack this distribution somewhere (Arena has a sub-folder called 'engines', you can extract it there).
- Open the UCI user interface and register the engine inside (You should become familiar with the installed UCI user interface anyway).
- E2-E4 and enjoy :-)
- Linux, in the root directory there are *.sh files for running
Option available only for the SMP version of Bagatur. The SMP (multicore) version can be started by Bagatur_64_2+_cores.exe and Bagatur_mcore.bat for Windows and with Bagatur_mcore.sh under Linux. It is tested with up to 64 CPU cores and threads. There is known sclaing issues, caused by Java (more info here: https://github.com/bagaturchess/Bagatur/blob/master/Search/SMP.scaling.issue.txt).
- SMP Threads (type spin default [logical_processors/2] min 1 max [logical_processors/2]):
- CountTranspositionTables type spin default 1 min 1 max [SQRT(logical_processors/2)] - Defines the count of Transposition Tables, which the SMP version will use. In most cases, it should be best to be set to 1 and could be changed only for experiments. See also https://github.com/bagaturchess/Bagatur/blob/master/Search/SMP.scaling.issue.txt
All other options are available for both versions: single core and SMP.
- Logging Policy (type combo default single file var single file var multiple files var none): whether Bagatur will create log files on the file system with details of its actions.
- OwnBook (type check default true): whether to use the own book included into the download, which is packed under ./data/w.ob and ./data/b.ob. These are games extracted from a few milions of PGN games played last 20 years by grandmasters and computer programs. They are filtered and the files contain a subset of most often played games. Unfortunatelly the name of the used opening is not supported at the moment but this features is defenitelly in our backlog and will be included in the Android version.
- Ponder (type check default true): whether to also think when the opponent thinks.
- MultiPV (type spin default 1 min 1 max 100): whether to show only the best line or to show the best 2-3-N lines.
- SyzygyPath (type string default ./data/egtb): path to the syzygy tables. If you send 'uci' command to the engine, it will show the full path to the syzygy directory.
- SyzygyOnline: if true and TB probing with local files is unsuccessful with up to 7 pieces, than it will request lichess server on this url http://tablebase.lichess.ovh/standard?fen=...
- Openning Mode (type combo default most played first var most played first var random intermediate var random full): Valid only when OwnBook is set to true. The 'most played first' option playes the most often played move (statistically) for given position. 'random full' option playes random move from all available opening moves for this postion. And the 'random intermediate' option is something in the middle and plays random move selected only from the top 3 available moves for this position.
- UCI_Chess960 (type check default false): false = classic chess, true = Fischer Random Chess (both FRC and DFRC modes are supported).
- MemoryUsagePercent (type spin default 73 min 50 max 90): This is option for fine tunning and should not be changeed in general. It is Java specific and prevents the JVM to overdo the Garbage Collection.
- TranspositionTable (type check default true): whether to use Transposition Table.
- EvalCache (type check default true): whether to use cache for the evaluation function. (This cache is per thread for the SMP version)
- SyzygyDTZCache (type check default true): whether to use cache for used syzygy scores. (This cache is per thread for the SMP version)
The download of Bagatur contains subset of syzygy tablebases placed under ./data/egtb/ directory. It contaiuns 22 of the most common endgames with up to 5 pieces. By default the option 'SyzygyPath' is set to this directory. You could change this UCI option if you have complete or bigger set of syzygy tablebases downloaded on your computer.
Since version 5.0, Bagatur is using NNUE as evaluation function. There was a Java portings. More info: https://github.com/bagaturchess/Bagatur/tree/master/NNUE
Chess strength and rating of a chess engine is measured in Elo. According to CCRL 40/15, the latest offical Elo ratings of all well tested version (with more than 300 games and time control 40/15), are available on this page: http://www.computerchess.org.uk/ccrl/4040/cgi/compare_engines.cgi?family=Bagatur
Special Thanks to Graham Banks, who put a huge efforts in testing Bagatur versions through the years!
Latest official Elo rating of Bagatur is ~3400 Elo.
- Bitboard
- Endgame Tablebases
- Machine Learning
- Opening API
- Opening Generator
- PGNProcessor
- Search Algorithm
- UCITracker
- NNUE
The project has started as a bet between myself and one of my friends from my first 2 years in the University, who like to play chess. I was unable to win a single chess game against him! This made me nervous over the time and at the end I have promised him (we bet) that I will create a chess program, which will win a game against him! Fortunately the time frame was not mentioned during the bet and ... years later I win it! :-) The whole story is captured in this youtube video "How was the idea of Bagatur Chess Engine application born?": https://www.youtube.com/watch?v=_rNBxbUAbS0
The first public, open source version of Bagatur was available since 2011-02-27 here: https://sourceforge.net/projects/bagaturchess/files/BagaturEngine/older/ The project actually started ~10 years before this date. The actual start date was between 1999 and 2000. It had many proprietary non-public versions until 2011. I even don't have history of them but they were quite weak in playing chess. First versions just succeeded to play 2-3 moves and then crashes. I have spend hours and days trying to fix the bugs and find out why it doesn't work correctly. At this point in time, the internet was almost an empty space and I was not aware of softwares running chess engines like now CuteChess and Arena and I was not aware of the existence of the UCI protocol, so I also have created an own Graphical User Interface (GUI) based on Java AWT and Swing. Chess porgramming gives you diverse programming experiences ... I have selected Java as a programming language, mainly because of my little (but existing) experience with it. I have to also admit that Java was quite modern and polular at this point in time. This was the time a few years after the first releases of the Java itself. The early ages of the Java language and Java technologies.
So, if you plan to work on a chess engine, better start earlier, you need time to achieve stable version which beats you! :-)
In order to contact me, you could use LinkedIn Krasimir Topchiyski or email me at [email protected]
Some personal toughts ...
According to CCRL, there are below 500+ chess engines in the world. This means that not many people are really interested in programming chess engines. Most probably the author of a chess engine is interested not only in programming but also in chess game. He/she must have enough willingness to invest spare time in chess programing, without any incentives, just for fun and driven by curiosity.
Because of this fact, I am always happy to see new engines and new authors!
I don't know for the other chess engine authors, but I would add small and well balanced portion of craziness ... it helps in chess programming, while you release version after version, targeting better Elo strength of each new release, which actually happens in very rear cases and you cannot release a version long time. If this continues months, normally I feel it like "to bang your head against the wall". When I reach this state, I exit Bagatur project for a while, awaiting for new inspiration and the muse. Always remember, it should be for fun! :-)
Bagatur is powered by YourKit Java Profiler
This nice tool is used to find out and fix performance, scalability and memory allocation isses. In general YourKit supports open source projects with innovative and intelligent tools for monitoring and profiling.
The chess engine JFish is using Bagatur as a basis and on top it uses the Stockfish NNUE as evaluation function. The idea behind is to have strongest chess engine in Java as a reference.
Packed in one place, the release history is available here
Fortunately, in this project I am not alone - without the ideas, support and help from many people and web sites, Bagatur would not be as it is now! Credits and many thanks to:
- My wife and my family, because every now and then I have been stealing from our leisure time to work on this project.
- https://github.com/xu-shawn/Serendipity, thanks to Shawn for explaining to me how he has trained the NNUE network of Serendipity chess engine as well as for the reference Java code, which handles the network.
- Desislava Chocheva, for her hospitality and willingness to help. Without her support this video couldn't be a fact.
- Ivo Zhekov, for motivating me to start this project as well as for accepting the challenge with such a strong opponent in front of the camera.
- Simeon Stoichkov, for his general support, regarding chess topics in Bulgaria, as well as for the nice chess pieces and the chess clock, used in this video.
- Varna Sound, for their willingness to support us and to participate with their great RAP music.
- Iavor Stoimenov, for the endless discussions about Chess topics and Chess Engines.
- Ivo Simeonov, for all the ideas, support, discussions, tests and contributed source code (e.g. initial version of pawn structure evaluation, C porting, exe launcher).
- Graham Banks from Computer Chess Rating Lists (CCRL) website, https://ccrl.chessdom.com/ccrl/4040/ , https://www.computerchess.org.uk/ccrl/ , for all the chess engine tournaments he has been organizing and broadcasting over the Internet for many years as well.
- Anton Mihailov, Aloril and Kan from Top Chess Engine Championship (TCEC) website, https://tcec-chess.com/ , for their invitations for Bagatur and its participation in chess engines tournaments for many seasons. Special thanks to Alroil, who contributed a lot in the testing of Bagatur’s Symmetric MultiProcessing (SMP) version, which runs under CentOS on more than 100 CPU cores on the used hardware. Thanks a lot for the support in case of engine issues/bugs!
- Olivier Deville, for his great support during ChessWar XVII, http://www.open-aurec.com/chesswar/
- Zoran Sevarac, author of Neuroph and co-author of Deep Netts, for his great support with the experiments with Neural Networks and Machine Learning in Java.
- Roelof Berkepeis, for his testing, shared chess experience with me, and the great ideas described as issues on Bagatur’s page on github.com, https://github.com/bagaturchess/Bagatur/issues
- Sameer Sehrawala, for the latest logo and for his general support.
- Dusan Stamenkovic, http://www.chessmosaic.com/, for a few old Bagatur logos.
- Internet, Global Web, for connecting us.
- The Open Source Community!
- MTD(f), https://en.wikipedia.org/wiki/MTD(f) , the parallel search of Bagatur is based on this idea.
- winrun4j, http://winrun4j.sourceforge.net/ , for the windows executables.
- All UCI compatible GUIs and UCI protocol itself.
- REBEL, http://www.rebel13.nl/ , very helpful web page.
- Glaurung chess engine, nice ideas inside the evaluation function (e.g. king safety).
- Fruit, http://www.fruitchess.com/, legendary program, nice and simple design.
- ChuckooChess, https://github.com/sauce-code/cuckoo , one of the first Java chess engines.
- Chess22k, exciting java chess engine - strong and well written.
- The source code of the strongest open-source Chess Engine – Stockfish, https://stockfishchess.org/
- https://sourceforge.net/
- https://github.com/
- https://stackoverflow.com/
- ... and many others!
For Tasks:
Click tags to check more tools for each tasksFor Jobs:
Alternative AI tools for Bagatur
Similar Open Source Tools
Bagatur
Bagatur chess engine is a powerful Java chess engine that can run on Android devices and desktop computers. It supports the UCI protocol and can be easily integrated into chess programs with user interfaces. The engine is available for download on various platforms and has advanced features like SMP (multicore) support and NNUE evaluation function. Bagatur also includes syzygy endgame tablebases and offers various UCI options for customization. The project started as a personal challenge to create a chess program that could defeat a friend, leading to years of development and improvements.
Winter
Winter is a UCI chess engine that has competed at top invite-only computer chess events. It is the top-rated chess engine from Switzerland and has a level of play that is super human but below the state of the art reached by large, distributed, and resource-intensive open-source projects like Stockfish and Leela Chess Zero. Winter has relied on many machine learning algorithms and techniques over the course of its development, including certain clustering methods not used in any other chess programs, such as Gaussian Mixture Models and Soft K-Means. As of Winter 0.6.2, the evaluation function relies on a small neural network for more precise evaluations.
local-chat
LocalChat is a simple, easy-to-set-up, and open-source local AI chat tool that allows users to interact with generative language models on their own computers without transmitting data to a cloud server. It provides a chat-like interface for users to experience ChatGPT-like behavior locally, ensuring GDPR compliance and data privacy. Users can download LocalChat for macOS, Windows, or Linux to chat with open-weight generative language models.
dota2ai
The Dota2 AI Framework project aims to provide a framework for creating AI bots for Dota2, focusing on coordination and teamwork. It offers a LUA sandbox for scripting, allowing developers to code bots that can compete in standard matches. The project acts as a proxy between the game and a web service through JSON objects, enabling bots to perform actions like moving, attacking, casting spells, and buying items. It encourages contributions and aims to enhance the AI capabilities in Dota2 modding.
aiohomekit
aiohomekit is a Python library that implements the HomeKit protocol for controlling HomeKit accessories using asyncio. It is primarily used with Home Assistant, targeting the same versions of Python and following their code standards. The library is still under development and does not offer API guarantees yet. It aims to match the behavior of real HAP controllers, even when not strictly specified, and works around issues like JSON formatting, boolean encoding, header sensitivity, and TCP packet splitting. aiohomekit is primarily tested with Phillips Hue and Eve Extend bridges via Home Assistant, but is known to work with many more devices. It does not support BLE accessories and is intended for client-side use only.
Simulator-Controller
Simulator Controller is a modular administration and controller application for Sim Racing, featuring a comprehensive plugin automation framework for external controller hardware. It includes voice chat capable Assistants like Virtual Race Engineer, Race Strategist, Race Spotter, and Driving Coach. The tool offers features for setup, strategy development, monitoring races, and more. Developed in AutoHotkey, it supports various simulation games and integrates with third-party applications for enhanced functionality.
WeeaBlind
Weeablind is a program that uses modern AI speech synthesis, diarization, language identification, and voice cloning to dub multi-lingual media and anime. It aims to create a pleasant alternative for folks facing accessibility hurdles such as blindness, dyslexia, learning disabilities, or simply those that don't enjoy reading subtitles. The program relies on state-of-the-art technologies such as ffmpeg, pydub, Coqui TTS, speechbrain, and pyannote.audio to analyze and synthesize speech that stays in-line with the source video file. Users have the option of dubbing every subtitle in the video, setting the start and end times, dubbing only foreign-language content, or full-blown multi-speaker dubbing with speaking rate and volume matching.
bidirectional_streaming_ai_voice
This repository contains Python scripts that enable two-way voice conversations with Anthropic Claude, utilizing ElevenLabs for text-to-speech, Faster-Whisper for speech-to-text, and Pygame for audio playback. The tool operates by transcribing human audio using Faster-Whisper, sending the transcription to Anthropic Claude for response generation, and converting the LLM's response into audio using ElevenLabs. The audio is then played back through Pygame, allowing for a seamless and interactive conversation between the user and the AI. The repository includes variations of the main script to support different operating systems and configurations, such as using CPU transcription on Linux or employing the AssemblyAI API instead of Faster-Whisper.
RTranslator
RTranslator is an almost open-source, free, and offline real-time translation app for Android. It offers Conversation mode for multi-user translations, WalkieTalkie mode for quick conversations, and Text translation mode. It uses Meta's NLLB for translation and OpenAi's Whisper for speech recognition, ensuring privacy. The app is optimized for performance and supports multiple languages. It is ad-free and donation-supported.
aitools_client
Seth's AI Tools is a Unity-based front-end that interfaces with various AI APIs to perform tasks such as generating Twine games, quizzes, posters, and more. The tool is a native Windows application that supports features like live update integration with image editors, text-to-image conversion, image processing, mask painting, and more. It allows users to connect to multiple servers for fast generation using GPUs and offers a neat workflow for evolving images in real-time. The tool respects user privacy by operating locally and includes built-in games and apps to test AI/SD capabilities. Additionally, it features an AI Guide for creating motivational posters and illustrated stories, as well as an Adventure mode with presets for generating web quizzes and Twine game projects.
modelbench
ModelBench is a tool for running safety benchmarks against AI models and generating detailed reports. It is part of the MLCommons project and is designed as a proof of concept to aggregate measures, relate them to specific harms, create benchmarks, and produce reports. The tool requires LlamaGuard for evaluating responses and a TogetherAI account for running benchmarks. Users can install ModelBench from GitHub or PyPI, run tests using Poetry, and create benchmarks by providing necessary API keys. The tool generates static HTML pages displaying benchmark scores and allows users to dump raw scores and manage cache for faster runs. ModelBench is aimed at enabling users to test their own models and create tests and benchmarks.
ClipboardConqueror
Clipboard Conqueror is a multi-platform omnipresent copilot alternative. Currently requiring a kobold united or openAI compatible back end, this software brings powerful LLM based tools to any text field, the universal copilot you deserve. It simply works anywhere. No need to sign in, no required key. Provided you are using local AI, CC is a data secure alternative integration provided you trust whatever backend you use. *Special thank you to the creators of KoboldAi, KoboldCPP, llamma, openAi, and the communities that made all this possible to figure out.
tank-royale
Robocode Tank Royale is a programming game where the goal is to code a bot in the form of a virtual tank to compete against other bots in a virtual battle arena. The player is the programmer of a bot, who will have no direct influence on the game him/herself. Instead, the player must write a program with the logic for the brain of the bot. The program contains instructions to the bot about how it should move, scan for opponent bots, fire its gun, and how it should react to various events occurring during a battle. The name **Robocode** is short for "Robot code," which originates from the original/first version of the game. **Robocode Tank Royale** is the next evolution/version of the game, where bots can participate via the Internet/network. All bots run over a web socket. The game aims to help you learn how to program and improve your programming skills, and have fun while doing it. Robocode is also useful when studying or improving machine learning in a fast-running real-time game. Robocode's battles take place on a "battlefield," where bots fight it out until only one is left, like a Battle Royale game. Hence the name **Tank Royale**. Note that Robocode contains no gore, blood, people, and politics. The battles are simply for the excitement of the competition we appreciate so much.
skyeye
SkyEye is an AI-powered Ground Controlled Intercept (GCI) bot designed for the flight simulator Digital Combat Simulator (DCS). It serves as an advanced replacement for the in-game E-2, E-3, and A-50 AI aircraft, offering modern voice recognition, natural-sounding voices, real-world brevity and procedures, a wide range of commands, and intelligent battlespace monitoring. The tool uses Speech-To-Text and Text-To-Speech technology, can run locally or on a cloud server, and is production-ready software used by various DCS communities.
lfai-landscape
LF AI & Data Landscape is a map to explore open source projects in the AI & Data domains, highlighting companies that are members of LF AI & Data. It showcases members of the Foundation and is modelled after the Cloud Native Computing Foundation landscape. The landscape includes current version, interactive version, new entries, logos, proper SVGs, corrections, external data, best practices badge, non-updated items, license, formats, installation, vulnerability reporting, and adjusting the landscape view.
chatgpt-universe
ChatGPT is a large language model that can generate human-like text, translate languages, write different kinds of creative content, and answer your questions in a conversational way. It is trained on a massive amount of text data, and it is able to understand and respond to a wide range of natural language prompts. Here are 5 jobs suitable for this tool, in lowercase letters: 1. content writer 2. chatbot assistant 3. language translator 4. creative writer 5. researcher
For similar tasks
YaneuraOu
YaneuraOu is the World's Strongest Shogi engine (AI player), winner of WCSC29 and other prestigious competitions. It is an educational and USI compliant engine that supports various features such as Ponder, MultiPV, and ultra-parallel search. The engine is known for its compatibility with different platforms like Windows, Ubuntu, macOS, and ARM. Additionally, YaneuraOu offers a standard opening book format, on-the-fly opening book support, and various maintenance commands for opening books. With a massive transposition table size of up to 33TB, YaneuraOu is a powerful and versatile tool for Shogi enthusiasts and developers.
Bagatur
Bagatur chess engine is a powerful Java chess engine that can run on Android devices and desktop computers. It supports the UCI protocol and can be easily integrated into chess programs with user interfaces. The engine is available for download on various platforms and has advanced features like SMP (multicore) support and NNUE evaluation function. Bagatur also includes syzygy endgame tablebases and offers various UCI options for customization. The project started as a personal challenge to create a chess program that could defeat a friend, leading to years of development and improvements.
katrain
KaTrain is a tool designed for analyzing games and playing go with AI feedback from KataGo. Users can review their games to find costly moves, play against AI with immediate feedback, play against weakened AI versions, and generate focused SGF reviews. The tool provides various features such as previews, tutorials, installation instructions, and configuration options for KataGo. Users can play against AI, receive instant feedback on moves, explore variations, and request in-depth analysis. KaTrain also supports distributed training for contributing to KataGo's strength and training bigger models. The tool offers themes customization, FAQ section, and opportunities for support and contribution through GitHub issues and Discord community.
For similar jobs
sweep
Sweep is an AI junior developer that turns bugs and feature requests into code changes. It automatically handles developer experience improvements like adding type hints and improving test coverage.
teams-ai
The Teams AI Library is a software development kit (SDK) that helps developers create bots that can interact with Teams and Microsoft 365 applications. It is built on top of the Bot Framework SDK and simplifies the process of developing bots that interact with Teams' artificial intelligence capabilities. The SDK is available for JavaScript/TypeScript, .NET, and Python.
ai-guide
This guide is dedicated to Large Language Models (LLMs) that you can run on your home computer. It assumes your PC is a lower-end, non-gaming setup.
classifai
Supercharge WordPress Content Workflows and Engagement with Artificial Intelligence. Tap into leading cloud-based services like OpenAI, Microsoft Azure AI, Google Gemini and IBM Watson to augment your WordPress-powered websites. Publish content faster while improving SEO performance and increasing audience engagement. ClassifAI integrates Artificial Intelligence and Machine Learning technologies to lighten your workload and eliminate tedious tasks, giving you more time to create original content that matters.
chatbot-ui
Chatbot UI is an open-source AI chat app that allows users to create and deploy their own AI chatbots. It is easy to use and can be customized to fit any need. Chatbot UI is perfect for businesses, developers, and anyone who wants to create a chatbot.
BricksLLM
BricksLLM is a cloud native AI gateway written in Go. Currently, it provides native support for OpenAI, Anthropic, Azure OpenAI and vLLM. BricksLLM aims to provide enterprise level infrastructure that can power any LLM production use cases. Here are some use cases for BricksLLM: * Set LLM usage limits for users on different pricing tiers * Track LLM usage on a per user and per organization basis * Block or redact requests containing PIIs * Improve LLM reliability with failovers, retries and caching * Distribute API keys with rate limits and cost limits for internal development/production use cases * Distribute API keys with rate limits and cost limits for students
uAgents
uAgents is a Python library developed by Fetch.ai that allows for the creation of autonomous AI agents. These agents can perform various tasks on a schedule or take action on various events. uAgents are easy to create and manage, and they are connected to a fast-growing network of other uAgents. They are also secure, with cryptographically secured messages and wallets.
griptape
Griptape is a modular Python framework for building AI-powered applications that securely connect to your enterprise data and APIs. It offers developers the ability to maintain control and flexibility at every step. Griptape's core components include Structures (Agents, Pipelines, and Workflows), Tasks, Tools, Memory (Conversation Memory, Task Memory, and Meta Memory), Drivers (Prompt and Embedding Drivers, Vector Store Drivers, Image Generation Drivers, Image Query Drivers, SQL Drivers, Web Scraper Drivers, and Conversation Memory Drivers), Engines (Query Engines, Extraction Engines, Summary Engines, Image Generation Engines, and Image Query Engines), and additional components (Rulesets, Loaders, Artifacts, Chunkers, and Tokenizers). Griptape enables developers to create AI-powered applications with ease and efficiency.

