ROCE-Roman’s Own Chess Engine

Readme (28.01.2008)

Intro

Roce is yet another chess engine that probably no one needs. Still it's a lot of fun to work on it. I started writing Roce around christmas time in 2003. At first it was supposed to be a weeks or months project mainly meant to improve my knowledge of the C programming language. But the project turned out to be much more challenging and timeconsuming than I ever thought it would be.

How to run Roce

If you intend to play against Roce you should get a nice GUI like Arena or something else that supports the UCI protocol. Roce should also work under the Fritz GUI or under the Shredder Classic interface. Personally I recommend to use the Shredder Classic interface. Especially if you're interested in Chess960, the Shredder Classic GUI is the way to go.

How can I play Chess960?

If you want to play Chess960 (also known as Fischer Random Chess) you will have to use the Shredder Classic interface. Other interfaces might work too if they handle castling the same way as the Shredder GUI does. Chess960 is a superset of chess as it offers 960 start positions. Therefore opening knowlegde is less important and talent and creativity gain in importance. Roce does not yet support Chess960 in console mode.

Playing strength

Roce is definetely one of the weaker engines currently under developement. It won't miss an easy combination but it hardly gets into a position to win versus decent playing opponents. If you like to play against engines as a human I recommend Version 0.0345 as it doesn't have a QS and plays a more interesting 'style' than the latest version.

History

  • x-mas 2003, start to write a move generator
  • february 2004, HD failure on my notebook, sources are lost
  • march 2004, start coding again
  • august 2004, move generator works fine up to ply 5
  • septembre 2004, fixed an ep-bug, move generator seems to work fine now
  • decembre 2004, implemented minimax/negamax and a simple material eval
  • january 2005, implemented a NegaMax search
  • february 2005, added a pieces/square table in order to improve move ordering for alpha beta
  • june 2005, replaced the material-only eval with a material/square-evaluation
  • june/july 2005, added parts of the UCI protocol to the engine
  • july 2005, Roce 0.034 played the first games against other engines (and lost most of them)
  • july/august 2005, fixed several bugs (promotion bugs, input/output problems) new version 0.0344
  • February 2006, fixed some bugs in the movegenerator, piece-list, console output beautified, search modified, new version 0.0345
  • july 2006, added a QS to the search, new version 0.0350
  • septembre 2006, new compile of Version 0.0350 due exotic dependencies. Thx to Karl-Heinz Soentges for pointing out that problem
  • March 2007, Chess960 capability added and some other minor changes, new version 0.0360
  • january 2008, ep-bug fixed, search and QS improved, new version 0.0370
  • A few technical details

    Roce is based on the rather old fashioned 10x12 board representation which was already proposed by Shannon. To the 8x8 board are two additional rows added at the bottom and at the top and to each side is one additional column added. That results in a 10x12 sized board which is represented as int board[120] internally on the computer. The 10x12 board representation has the advantage that illegal moves are easy to handle. So the knights don't 'jump off the board' (i.e. no need to check for array over- or underruns). The square A1 is represented by board[91] and the square H8 is adressed with board[28]. The pieces are represented by integer values {K=6, Q=5, R=4, B=3, N=2, P=1, k=-6, q=-5, r=-4, b=-3, n=-2, p=-1}. If the white knight jumps from B1 to C3 this is performed as 'board[b1+offset_knight] = white_knight' which is translated by the compiler/preprocessor to 'board[73] = 2'. Valid offsets for the knight on the 10x12 board representation are: 21, 8, 12, 19, -21, -8, -12, -19. The white pieces can only move to a target square if this square is either empty or if an opposite colored piece is on this square. Empty squares are marked with the integer value 0 (board[C1] = 0).

    Roce uses a legal-move generator instead of a pseudo-legal generator which means that only legal moves are generated. In general legal-only-move generators are considered to be a tad slower than pseudo-legal move generators but when I simplified my move generator to generate pseudo-legal moves I didn't got much of a speedup, so I changed that back.

    If you are writing you're own move generator or chess engine you might be especially interested in the commands divide, divide2. 'divide #' gives the number of child moves at a certain depth while 'divide2 #' gives the total sum of child moves to this depth. 'perft #' gives the sum of legal moves at a certain depth while 'perft2 #' sums them up. This is a usefull feature if your movegenerator comes up with different numbers and you need to track down the bug. Currently Roce supports the UCI protocol and some parts of the Winboard protocol as well but I'm planning to implement both UCI and Winboard in full generality.

    What is RoceConfig.exe good for?

    Most chess engines give you the option to change some settings of the engine. This isn't different with Roce. Most of the changes to chess engines are done with the help of configuration files. But editing config fils with an editor can be a bit tricky. Often the ordering of the options in the configuration file is important and the engine might not be able to parse the file properly if there are spaces where they are not expected and there is also always the danger of spelling errors, of course. Thanks to the effort of Patrick Jansen Roce (versions beginning from 0.0344) come together with a nice configuration tool which overcomes all this shortcomings. RoceConfig helps you to adjust the settings of Roce to your needs without having to fiddle around with the configuration file directly. RoceConfig does that all for you and stores the changes in the file Roce.cfg which is read by Roce at startup. So you have only to make sure that RoceConfig is stored in the same directory as the engine.

    What is the file perfttestsuite.epd good for?

    The file consists of a testsuite of positions which are usefull to check if the movegenerator works properly. This feature is mainly used to check if the engine is still working properly after some modifications have been made to the sources. The test can be started by entering the command 'testmovegen' and takes -depending on the speed of your computer- a few minutes to hours to finnish. It's sufficient to run this command only once on a certain computer to make sure it's working properly as some aggressive optimization might cause problems on some processors. Don't edit the content of the file if you're not sure what you're doing. Most of the positions in the file were posted by Andrew Wagner on the Chess Computer Club (CCC) in 2004.

    Credits

    The chess engine Roce is written entirely by me. The name is program. But of course, I was able to recycle a lot of great ideas from some smart people (standing on the shoulders of giants). The main reason I got interested in the chess programming topic was because of an article that appeared in the German Computer Journal DOS in 1997. The article 'Der PC lernt Schach-Das Spiel der Koenige' was written by Chrilly Donninger and Klaus Manhart. Later when I was writing on my engine I also learnt a lot about the matter from Bruce Morelands excellent site. Numerous ideas I got by reading and asking questions on several chess forums like the Winboard forum or the Chess Computer Club.

    Roman Hartmann
    rhartmann[nospamplease]@bluewin.ch