Thursday, August 12, 2010

UCI Support for Android

The UCI (Universal Chess Interface) protocol defines an open interface between a chess engine and a graphical chess program, which allows chess programmers to focus on their engine rather than GUI details. Many programs on Windows, Linux, and MacOS support the UCI protocol (e.g. ChessBase, Arena, Sigma Chess, Lucas Chess), but as far as I know, no UCI support exists for Android. Even Chess for Android uses a simplified Java port of my own UCI engine BikJump rather than going through the UCI interface.

Therefore, I am prototyping UCI support in Chess for Android with the idea that, in the long run, this will allow importing third party engines into the GUI. So far, I added a "kibitzer feature". Any UCI engine binary that has been "natively" compiled for Android (using a compiler that ships with the Android NDK) can be imported through a file finder dialog, as shown below for a natively compiled version of BikJumpv1.8 running on the Android emulator.

Once imported, the UCI engine reports its findings of the current position.  For now, I display the engine name, author, and parts of the info line, but eventually these parts will be parsed for more suitable display. It is still a long way to full UCI support where users can actually play the engine, but it is a promising start.