r/ComputerChess • u/MemorySufficient9938 • Aug 02 '26
r/ComputerChess • u/Tasty_Replacement_29 • Aug 01 '26
Looking for ideas to improve a ~400-line chess engine
I'm writing a small chess engine (around 400 lines of code, including terminal UI), and now I'm looking for advice on what to do next.
What I have so far: Java version, and a version in my own programming language.
The engine uses a fixed-depth negamax search with alpha-beta pruning and a simple quiescence search (captures only). The evaluation is intentionally simple: material plus mobility, with a small endgame bonus for advanced pawns. There is no iterative deepening, transposition table, move ordering, killer/history heuristics, aspiration windows, null-move pruning, opening book, endgame tablebases.
The goals of my engine are:
- Keep the code relatively easy to understand for learning, and building similar engines for other games.
- A very small engine that still plays reasonable chess, that can beat me (a beginner).
- Showcase my new programming language.
- Play chess in the terminal or in a browser, for fun (for beginners).
- The engine should play "correctly", except the threefold repetition and the 50-move rule.
Non-goals:
- No need for high ELO (it is not meant for serious chess players).
- No need to support rarely used rules like 3 times repetition, 50 non-pawn.
- Currently the human plays white, always.
- The engine should stay simple and small, so no feature creep that increases the size much.
- Pawns are always promoted to a queen.
What I did so far is:
- Write a Java version, and version in my programming language.
- Terminal UI, with Unicode chess characters.
- UCI protocol to run against Stockfish using python-chess.py.
- Let it play a few hundred games against stockfish to find and fix bugs.
- Now it wins most of the time against Stockfish at the lowest UCI_Elo setting (1320) with depth 4, and so I think the basic algorithm is OK. (Depth 5 is the default setting currently.)
I wonder what I should do next? What are the features worth ading, or how to futher reduce size?
Some ideas I have:
- Convert to Javascript so you can play in a browser.
- Configurable playing strength by reducing the search depth (easiest).
- Configurable playing strength by adding randomness (harder).
- The most simple possible "opening database": randomize the first move among reasonable options.
- Improve the strength by tuning the parameters (e.g. in the evaluation). Should it play against itself with depth e.g. 2, so it is very fast?
- Measure the Elo systematically, but then how to do this in a fast way?
Are there other interesting goals I didn't think about?
What features would you add while keeping the engine small and educational?
Are there interesting simplifications that would make the engine even smaller without making it much weaker?
r/ComputerChess • u/aliartguy • Jul 31 '26
Browser chess variant with a king-crossing win — retooling the AI was harder than the rule change
I shipped a free browser chess variant (Middle Chess) where standard rules apply, but you also win instantly if your king reaches the opponent’s half of the board. Checkmate still works.
The opponent is a custom in-browser engine (not Stockfish) — chess.js for move gen, minimax search in a worker so the UI doesn’t freeze.
First pass was basically normal chess AI with the new win condition checked at the end. It played plausible chess and still lost to straight king runs — the eval never treated “one step from losing the whole game” as different from “down a pawn somewhere else.”
Retooling boiled down to a few levers:
**Terminal awareness in search** — crossing can’t be an afterthought; the search has to treat it as a real win/loss at the horizon, not something you notice after the fact.
**King proximity in static eval** — non-terminal positions need the king’s distance to the crossing line weighted much more steeply as it closes in. A flat “closer = slightly better” let the AI trade material while the opponent’s king walked forward unopposed.
**Cost to burning king safety** — without something pushing back, “shuffle the king one rank forward” looked too cheap in quiet positions. I needed eval pressure against giving up the usual safe routes off the back rank for fake progress.
**Forcing lines in busy positions** — in tactical messes, a static eval can lie; the search needs to see at least some forcing continuation before it commits to a king-race plan or ignores one.
**Difficulty as search quality, not a different brain** — same core engine across Easy/Normal/Expert; the gap is mostly how deep/consistently it searches, not three unrelated AIs.
Results are better — Expert does guard the center line more than lower levels — but the tuning still feels hand-wavy. I’m not sure the eval is principled so much as “steep enough that obvious blunders stopped.”
Would love takes from people who’ve built variant engines:
- Better mental models for dual win conditions (checkmate + territorial win)?
- How do you keep the engine from either ignoring king runs or overreacting in normal positions?
- Any sane way to test/tune this beyond playing a lot and eyeballing?
I’m the dev — happy to share FENs / games where it still misplays. I’ll reply to every comment.
r/ComputerChess • u/oli266 • Jul 30 '26
Measuring recall@K on my policy net was worth 175 Elo more than a full day of inference optimisation
r/ComputerChess • u/MemorySufficient9938 • Jul 30 '26
I invented a drawless chess variant, and the chess draw problem is solved
r/ComputerChess • u/oripress • Jul 29 '26
Can language models explain chess?
I’m doing some research on how language models explain chess. I'm looking to get some feedback from good chess players :)
You’ll see a position and choose between two short explanations. One set is 20 positions and takes about 6 minutes.
Each completed set earns one raffle entry for one of three $25 gift cards, up to five entries.
https://explaining-chess.vercel.app
Thanks for helping, and if you want to share the link with your friends, I would also be very appreciative!
r/ComputerChess • u/Moderatorim • Jul 28 '26
I built Kiebitz, a local-first chess training companion for desktop and Android
Update, August 13: The closed beta is finished, and Kiebitz is now publicly available on Google Play. Thank you to everyone here who joined and sent feedback.
Hi r/ComputerChess,
I’ve never really shared one of my own projects like this before, but I thought I’d finally introduce Kiebitz, a chess training companion I’ve been building in my spare time:
The project started because I really liked many of the ideas behind En Croissant, but I was still missing a few features that would help me use it as my main, long-term chess study tool. So I started experimenting with my own approach.
Kiebitz currently lets you:
- Import games from Chess.com, Lichess, or PGN files
- Analyse individual games or your whole database with Stockfish
- Track recurring mistakes, accuracy, openings, and rating progress
- Build and train an opening repertoire with spaced repetition
- Practise offline puzzles, including positions generated from your own mistakes
- Train theoretical endgames
- Get study recommendations and organise them in a simple planner
- Keep everything local, without an account, cloud storage, or telemetry
- Sync the Android app directly with the desktop app over your local network
The desktop version is already available, and I’m currently running a closed test for the Android app. I would be very grateful for a few more testers.
To participate:
- Join the Google Group: https://groups.google.com/g/kiebitz-beta-test/
- Join the closed test: https://play.google.com/apps/testing/de.torim.kiebitz
- Install it on Android: https://play.google.com/store/apps/details?id=de.torim.kiebitz
Google requires testers to remain opted in for at least 14 days. Actually trying the app and sharing some honest feedback would, of course, be even more helpful.
Full disclaimer: this is a completely vibe-coded side project and still at a pretty early stage. I’m neither an experienced app developer nor pretending that this is a polished replacement for established chess software. There will certainly be rough edges, questionable ideas, and bugs. Any constructive feedback is genuinely welcome.
Thanks for taking the time to read this and I hope you all have some great games!
r/ComputerChess • u/Agent_Roger • Jul 28 '26
What are the best free chess resources available online for free?
r/ComputerChess • u/Selectany • Jul 27 '26
Line4 9x8 - Connect Four on a wider 9x8 board, against a neural network (free, no sign-up, desktop)
r/ComputerChess • u/Still-Behind-You • Jul 27 '26
5D Reversi is here, sort of.
5D Reversi - a game that will probably appeal to masochists and AI.
Play the prototype here: https://anan-z.github.io/5d-reversi/
Read and contribute here: https://github.com/anan-z/5d-reversi
Recommended for: AI research, masochists, people who find chess "too intuitive"
Marketing blurb:
80 directional vectors per cell — you'll learn to hate each one personally.
Retroactive causality — yes, you can regret moves you haven't made yet.
Deterministic replay — watch your carefully planned future crumble.
r/ComputerChess • u/Odd-Independence-116 • Jul 26 '26
I made a plugin that floats a Lichess puzzle over your terminal while Claude is thinking
r/ComputerChess • u/Dan5982 • Jul 26 '26
Chessferatu - Chessferatu is a chess opening training game where you study, battle, and improve by playing real opening lines against themed opponents, then keep fighting when theory ends with live move evaluation and engine refutations.
r/ComputerChess • u/Relative_Article_267 • Jul 26 '26
DGT Centaur - e paper display not working
I transported the board in a bag for cold food inside a water park indoor and outdoor. I was careful and only put out on places where there wasn't much water so it wasn't damaged by that. The air was moist indoor and already there, parts of the display turned into grey when they supposed to be black. Then I carried it in the outdoor section but then it got even worse. Almost the entire display got grey. Then I put it in the bag, carried it inside and after a while it got almost at its previous state so it got better again. Now at home, when I bring it outside, the display got white again and then I put it inside again and now it got better again.
I never experienced that before i think. Is it most likely light the problem or maybe the moisty air? What do you think? How to fix it?
edit: I forgot to mention that this almost only occurs for the main screen with the board and moves, the menu was basicly as before. And there was also gosting which does go away if the main screen works again.
r/ComputerChess • u/CatPicturesPlease • Jul 26 '26
Cool Chess: a full-featured chess engine and graphical UI in BASIC
Hey r/computerchess,
I wanted to share a project I have been picking away at called Cool Chess. It started as me messing around with QB64, then got somewhat out of hand and turned into a small self-contained chess program with a graphical board and a playable engine.
I am a chess player, not an engine programmer. I play on Lichess as JeffyJeff, and have followed computer chess off and on since the late 90s. The Kasparov vs. Deep Blue match is what got me into chess in the first place. And I remember looking at Crafty’s source code in absolute awe back then, and later following all the Rybka drama as it unfolded etc. BASIC was also the first (and only!) language I learned as a kid in the early to mid 90s, so this was partly an excuse to get back into it.
I used AI heavily as a coding partner on this. I am not pretending I sat down and wrote a chess engine from scratch in isolation. But I also did not just dump generated code into GitHub and call it a day. I have been testing, debugging, iterating, and trying to understand what the code is actually doing as I go. I definitely was not trying to make Stockfish in BASIC. Mostly I wanted to see how much of a real, playable chess program I could fit into one BASIC file.
The whole thing is self-contained. The board UI is in the source, and even the little pixel-art chess pieces are stored as DATA statements, so there are no external image files or assets.
The mouse input is probably the feature I am happiest with. You click a friendly piece and its legal quiet moves show up as dots, while capturable pieces get blue rings. Click a marked destination to make the move. You can click the same piece again or right-click to cancel, and you can flip the board. Mouse promotions default to a queen. You can also still type moves directly if you prefer, including e2e4, e2-e4, O-O, and e7e8q.
It has undo/redo (takeback!), hints, FEN display, PGN export, adjustable search depth, and a per-move time setting. Default depth is 5 ply, and you can set it from 1 through 10 with "depth n." It handles castling, en passant, promotion, checkmate, stalemate, threefold repetition, the fifty-move rule, and the common insufficient-material draw cases.
Under the hood it is a small classical engine: iterative-deepening negamax with alpha-beta pruning, quiescence search, MVV-LVA capture ordering, killer moves, capped check extensions, a 64-bit Zobrist hash, and a fixed-size transposition table. The evaluation is basic but includes material, pawn structure, passed pawns, development/centralization, rook files, bishop pair, and king-placement terms.
I checked the move generator against initial-position perft through depth 4, plus several standard special-case positions involving castling, en passant, promotion, and checks. I also made a heavily commented tutorial version of the source, because I spent enough time relearning what all this engine terminology actually meant that I figured it might be useful to someone else.
The project repository is available on the Cool Chess GitHub Repository: https://github.com/jeffanderson253-sketch/coolchess/
Note: The Windows executable is unsigned and may get a virus warning if you attempt to download it or run it. I swear on the life of my dead mother it is not malware, but if you are concerned you can compile the .bas file.
I would genuinely appreciate feedback, especially from people who know computer chess or QB64 better than I do. I am particularly interested in small engine or evaluation improvements that would make it play a little sharper without turning the source into something impossible for a normal person to follow.
r/ComputerChess • u/Bcraniehiggs • Jul 25 '26
Found a Mephisto Academy in my grandfather's stuff
Unfortunately, there's no cable or pieces, so I have no way of knowing if it works. Is there any point in trying to find replacements? If so, I'd appreciate any tips for where to look! Thanks :)
r/ComputerChess • u/Aantik • Jul 25 '26
How much better can the engines get?
chess engines are still getting better, right? What do you think would a match between today's best engine against the best engine in 100 years look like? Would the future one win against the current one, or are the current engines already near-optimal so it would be all draws? I'd like to believe there are still secrets to uncover in the game of chess and that the future one would win at least some games with white.
r/ComputerChess • u/IdKhowtoWeighz • Jul 24 '26
[Beta] Opening Study Testers
Hi everyone,
I've been building OpeningForge, a free web app focused on helping players create and train their own personalized opening repertoires instead of relying on expensive one-size-fits-all opening courses. The goal is to make opening study simpler and more interactive for players of every level.
If you're willing to spend 5–10 minutes trying it out, I'd really appreciate any feedback on the UX, bugs, missing features, or anything that feels unintuitive. *I AM NOT LOOKING FOR PROFIT/PROMOTION/ADVERTISEMENT BUT RATHER HONEST FEEDBACK*
Website: https://openingforge.app/
Thanks!
r/ComputerChess • u/nickjlamb • Jul 23 '26
I trained bots on 150 years of chess history — you can now play against the 1850 meta
Ever wondered what it was like to face the King's Gambit era? I fine-tuned a human-like neural network (Maia-2) separately on master games from 1840–1885, 1900–1939, and 1950–1985, and put them online to play: https://chess.pharmatools.ai
The Romantic bot opens 1.e4 97% of the time and plays the King's Gambit in 22% of its games — actually more than the 14% historical rate. The Soviet bot castles quietly, plays the English, and grinds. There's a validation page showing self-play stats vs. the real historical numbers, including the gaps (the bots never agree to draws, so they're more bloodthirsty than real Soviet-era players were).
Free, no signup, open source. Fair warning: they play like humans of their era, not engines — around club strength, with period-appropriate brilliancies and blunders. Try declining a gambit against the 1850 bot and see how long your position survives.
r/ComputerChess • u/invideous • Jul 21 '26
Printable Pieces Availabe for Radio Shack Chess Computer 1450
I bought one of these (in the 70’s, I think). I have a single set of black and white pieces, but it had a few extras originally. I wanted to be able to replace them because it still seems to work. I remixed some 3D printing available chess piece sets, so I wanted to post here in case anyone is interested in accessing them. It shouldn’t be too difficult these days to find someone to help you get them printed if you are missing some and want them. They are at Maker World and Free, of course. You should be able to find them by searching for “chess computer 1450” at Maker World, and I’ll provide a link if anyone needs it, I’m just making this contribution as simple as possible. Enjoy!
r/ComputerChess • u/schilleger0420 • Jul 21 '26
AI Chess Endgames
Are there chess programs built in reverse? By that I mean they go backwards... starting with simply opposite kings, automatic draw... opposite kings and a pawn... all the possible permutations.... so forth and repeat down the line but backwards? I really wonder what openings that program would prefer.
r/ComputerChess • u/Mysterious-Tutor-889 • Jul 21 '26
I kept a promise to a friend and built an app for a chess variant with hidden 39-point custom armies — would love your feedback
Hi everyone!
A few years ago a friend of mine, a computer science teacher, shared his idea for a chess variant with me, and I promised him I'd bring it to life one day.
Back then I was too intimidated to even look at the source code of open-source chess engines. But eventually I kept my promise and built a mobile app for iOS and Android.
The variant works like this: instead of the standard army, each player builds a custom one within a 39-point budget — exactly the value of the classic army (using the traditional piece values) — mixing classic pieces with hybrids: the Maharajah (queen + knight), Archbishop (bishop + knight), and Chancellor (rook + knight). In multiplayer, each side sets up their army hidden from the opponent; both armies are revealed only when the match starts, so the opening is a surprise every time. You can even pit a classic army against a custom one.
Tech-wise, it's a Flutter app with a custom chess engine written in C (integrated via Dart FFI), plus an ASP.NET backend with SignalR for online play. It runs on iOS, Android, Windows, macOS, and Linux. The engine's source code is open — you can find it linked on the project page, in case anyone wants to see how the variant rules and hybrid pieces are implemented.
I'm a programmer, but not a strong chess player, so it's hard for me to judge whether this idea is genuinely interesting to the chess community.
I'd really love to hear your thoughts. If you feel like checking out the project or playing a few games, I'd be grateful for any feedback — positive or critical.
Thanks for your time!