Page 1 of 1

Roce knows finallly how to give mate :)

PostPosted: 28 Jul 2005, 22:02
by Roman Hartmann
Hi all,
Roce (which stands for Roman?s Own Chess Engine) knows finally how to mate. It took me quite some time to implement a somehow working alpha-beta search in my chess engine but know it almost looks as if it?s working.
By trying to create a search which doesn?t search any longer if a mate is found I created a strange bug which took me quite some time till I found it. Roce didn?t mate the opponent and instead did just about everything to not mate the opponent. Was really strange to look the engine winning the game and then always avoiding the winning move and instead even sacrifying pieces in order to not mate the opponent.

But the ?release? of this engine is also your chance to beat an engine that makes more than 500?000 kn/s in the middlegame (on an AMD Sempron 1800+) as there is only a pure alpha-beta search with no extensions at all and a simple material/square eval. I guess it?s one of the weakest engines around although it wins/draws against Cassandre regulary. As there is almost everything missing in Roce currently I hope to improve the playing strength a bit.

There is still a lot missing in Roce:
-Time management (calculates for 6s/move now only)
-Hash tables
-50-moves rules
-3-fold leads to draw
-some basic endgame knowldege (when to push the pawns in an endgame)
-winboard protocol (supports only UCI currently)

In case you want to try out Roce (keep in mind there is a reason that the current version # is 0.034) here is a link:

http://mypage.bluewin.ch/romanhartmann/roce03.zip

cheers
Roman

below is a game Roce vs Cassandre. It's quite a patzer game but then who am I to judge :)

[Event "Test25_07_05s"]
[Site "ATHLONXP2"]
[Date "2005.07.28"]
[Round "2"]
[White "Roce03"]
[Black "Cassandre"]
[Result "1-0"]
[ECO "A40"]
[Opening "Englund (Charlick) Gambit"]
[Time "22:08:23"]
[Variation "2.dxe5 Nc6"]
[TimeControl "0+5"]
[Termination "normal"]
[PlyCount "83"]
[WhiteType "program"]
[BlackType "program"]

1.d4 e5 {(e7e5 d4xe5 Nb8c6 Nb1c3 a7a5 Bc1e3 Nc6xe5) -0.10/6 3} 2.dxe5 Nc6
{(Nb8c6 Bc1f4 Bf8b4+ Nb1c3 Nc6xe5) -0.04/5 2} 3.Qd5 {+0.23/6 6} Qe7 {(Qd8e7 Ng1f3 Nc6b4
Qd5d1 Qe7xe5) -0.05/5 6} 4.Nf3 {+1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
{(Rb3e3 f2xe3 g6g5 d7d8Q+ g5g4 Qd8xf8) -M500/6 2} 41.fxe3 {+8.35/8 6} Kg8 {(Kf8g8 g2g3
g6g5 d7d8Q+ g5g4 f3xg4+ h7h6 Qd8xg8) -M500/8 5} 42.d8=Q# {+13.43/9 6} {Mate} 1-0

Re: Roce knows finallly how to give mate :)

PostPosted: 29 Jul 2005, 00:08
by Tord Romstad
Hi Roman,

Thanks a lot for Roce! If I only had a Windows computer, I would have given it a try. It's nice to have a few engines agaist which even we lowly patzers can score a lucky win once in a while, even if it is just for a short time. If a few months, it will probably crush us all, if you keep working on it.

You have finished the most difficult and boring part of the work now. I think you will find that chess programming is much more fun when you have a complete, working engine, and can enjoy watching its rapid progress.

There is still a lot missing in Roce:
-Time management (calculates for 6s/move now only)
-Hash tables
-50-moves rules
-3-fold leads to draw
-some basic endgame knowldege (when to push the pawns in an endgame)
-winboard protocol (supports only UCI currently)

I would recommend you to implement time management, 50 move draws and 3-fold repetitions first, because it would enable your engine to participate in the many nice tournaments for amateur engines. It is great fun to watch your engine slowly crawl towards the top divisions.

Good luck with Roce!

Tord

Re: Roce knows finallly how to give mate :)

PostPosted: 29 Jul 2005, 06:43
by Roman Hartmann
Hi Tord,
thanks for your kind words. I'm glad my program does finally something more than just crash. The next step is certainly to implement the time management (in fact I have already some code but it doesn't work properly with incremental time controls). And it's def. more fun now to play around with some working parts now than to spend endless hours looking for bugs in the move generator (and I had a lot of bugs there).
As soon as Roce is lacking less of the features I listed, I will create a Linux version as well.

cheers
Roman

Re: Roce knows finallly how to give mate :)

PostPosted: 29 Jul 2005, 13:51
by Roman Hartmann
I added time management to Roce in the meantime and also let it play some blitz games against some other low rated engines. According to this games I would estimate its playing strength to be in the 1300-1400 range.

cheers
Roman

Re: Roce knows finallly how to give mate :)

PostPosted: 29 Jul 2005, 17:02
by Sven Schüle
Hi Roman,

I read your README, and it sounds as if you don't have qsearch implemented. If you haven't, you should probably add something like this to avoid simply losing material very early. Also I assume you will need any kind of move ordering improvement like killer moves or penalizing losing captures. Then your evaluation will need to know a bit about king safety, e.g. avoid running with the pawns guarding the king or something similar.

Roman Hartmann wrote:more than 500?000 kn/s

I assume 500 kn/s, right? Otherwise I would really like to see the code needing only 5 CPU cycles per node. :wink:

Sven

Re: Roce knows finallly how to give mate :)

PostPosted: 29 Jul 2005, 17:25
by Roman Hartmann
Sven Sch?le wrote:Hi Roman,

I read your README, and it sounds as if you don't have qsearch implemented. If you haven't, you should probably add something like this to avoid simply losing material very early. Also I assume you will need any kind of move ordering improvement like killer moves or penalizing losing captures. Then your evaluation will need to know a bit about king safety, e.g. avoid running with the pawns guarding the king or something similar.

Roman Hartmann wrote:more than 500?000 kn/s

I assume 500 kn/s, right? Otherwise I would really like to see the code needing only 5 CPU cycles per node. :wink:

Sven


Hi Sven,
you're right it's 'only' 500 kn/s. And I also don't have a QS yet although it should be relatively easy to implement. I also don't have killer moves yet and king safety is nothing that my engine is aware of. Currently my alpha-beta search is also called with a fully open window all the time as I have some search instabilities otherwise. But only adding QS should help to improve the play quite a bit as the evaluation is really unreliable at the moment and the engine definitely suffers from the horizon effect.

Roman