Skip to content

Early Design Phase

slashbyte edited this page Dec 10, 2018 · 6 revisions

The Idea

At first the task seemed like a piece of cake. Build the hardware, write the code and bam, chess master! But after I started doing preliminary research I soon realized, 'oh shit, this is complicated'.

Making it Simple

At the heart of any good chess machine there lies an engine and this engine does most of the leg work, so I started there. Online many great chess engines are available so, should I make my own? No... for this project I picked StockFish as the brain of Chess Challenger. Why? Because its still in active development, its open source, there is support, and depending on who you ask its the highest rated chess engine available. Great! I found a chess engine, but how do I use it?

Engine Trouble

StockFish is a UCI compatible chess engine. Ok, what's that mean? It means you need a GUI or some other program to use it. Dramatic pause: or create a UCI adapter of your own! Honestly that's too much work, even for me, so I took the easy way out. I used this program called Polyglot. Now that doesn't mean I'm free and clear. Polyglot is a UCI to win-board adapter. Ok, what does that mean? It means I'm trading one engine communications protocol for another. But there are perks to Polyglot. Polyglot keeps track of the game state, the board, the clock, and all of the other stuff I didn't want to program. Polyglot also offers opening books, I'm not sure if StockFish has that ability on its own, so that's another win.

Polyglot Issues

What Polyglot doesn't do; it will not display the board state, it will not alert the user of a "check" state, if Polyglot does do this I over looked it, and documentation for Polyglot is hard to come by. So I "added" those features to Polyglot. To clarify, Polyglot does keep track of the board state, you just can't retrieve it. Like wise, Polyglot does know if a side is in check, but the user is never alerted. Thankfully the code for Polyglot was written very well and it was easy to plop a few lines in that would display this much needed information. Be warned, I'm pretty sure this broke "official" win-board protocol compatibility, but that's ok, we wont tell.

Moving On

So thus far we have:

  • A working chess engine
  • A way to use the engine efficiently

At this point in time, conceptually this could actually work! I don't have to spend months learning about game theory, alpha-beta pruning, or create an elaborate UCI wrapper that handles all of the "game stuff".

Clone this wiki locally