ROCE-Roman’s Own Chess Engine

Readme (8.08.2005)

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 month project mainly intended 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 8 Interface.

Playing strength

Roce is definitely one of the weakest engines currently under developement. It won't miss a mate in 3 but it hardly gets into a position to mate anyone, of course. On the other hand it plays a very attacking style which might be interesting for a beginner. This style is also the main reason that Roce is doing so terribly bad when playing other engines as the queen or a piece often gets lost early in the game in an unsound attack. I estimate that Roce 0.034 has currently a rating of about 1300-1400 but I'm pretty sure that I'm able to to improve the playing strenght quite a bit as there is a lot of stuff either still missing or badly implemented.

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
  • september 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 an NegaMax search
  • february 2005, added a pieces 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 an underpromotion bug, fixed broken console mode
  • A few technical details

    Roce is based on the rather old fashioned 10x12 board representation. To the 8x8 board are two additional rows added at the bottom and at the top and to each side is one additional columns added. That results in a 10x12 sized board which is represented as int board[120] on the computer internally. 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. easy 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 created. 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. Currently Roce isn't doing much beside generating all the legal moves from a certain position. There is a search (NegaMax with alpha beta cutoffs) and a simple evaluation function which evaluates only material and squares implemented and it doesn't work very well yet. There is a simple move ordering sheme based on squares and material gain present as well. Roce doesn't search very deep and has no extensions currently. That means Roce isn't aware of the danger of checks/recaptures and is badly suffering from the horizon effect therefore.

    If you are writing you're own move generator/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 #' sums them up to the given depth. 'perft #' gives the sum of legal moves at a certain depth while 'perft2 #' sums them up to this depth. The divide(2) # command is a nice feature if your movegenerator comes up with different numbers and you need to track down the bug. Currently Roce supports most parts of the UCI protocol and fractions of the winboard protocol but I'm planning to fully support both UCI and Winboard.

    Legal stuff

    The binary of Roce is currently available for free but I preserve the right to change that at any time (although it's very unrealistic that Roce ever will go commercial, of course). The source code won't be released most probably as there are already more than enough engines released under the GPL. If someone wants/needs for some reasons the sources of Roce he/she can drop me an email.

    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. 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. Don't edit the content of the file if you're not sure what you're doing.

    Roman Hartmann
    rhartmann@bluewin.ch