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.
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 9 or under the Shredder Classic Interface.
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.
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.
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.
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.
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