A new SharpChess by Peter Hughes

Discussions about Winboard/Xboard. News about engines or programs to use with these GUIs (e.g. tournament managers or adapters) belong in this sub forum.

Moderator: Andres Valverde

A new SharpChess by Peter Hughes

Postby peterhughes » 25 Mar 2005, 10:26

Hello, my name is Peter Hughes. I have been developing a 100% C# chess program since December 2003, named SharpChess. See http://sharpchess.com. SharpChess is an open-source project based at SourceForge.net that is a fully-functioning chess game with its own graphical board that plays at around 1800 ELO (estimated).

I have just recently implemented a WinBoard interface for SharpChess, with a view to entering tournaments, for fun. As such, I wanted to introduce myself, and SharpChess, to the WinBoard community.

I am a professional software developer, currently working on medical applications. I?m now 35, married with 2 small children. I started programming (at the tender age of 12) in 1982 on the Commodore Vic20. I played my first chess program on the ZX Spectrum, and was always curious as to how the programmers managed to make the computer ?think?. I started the SharpChess project, party to satisfy this curiosity, and secondly develop my first large ?elegant? OO C# program. Since then, SharpChess has developed into a fully-playable chess game that I hope people will continue to download and enjoy playing.

My goal is to try and make SharpChess as ?strong? as possible, within the bounds of keeping it in C#, and maintaining its heavily OO class design. i.e. I have stuck with classes that represent real-world chess concepts such as Board, Square, Player, Piece, Move etc, rather than going for a more low-level, non-OO design such as BitBoards. Consequently, I take a big performance it because of the overhead of the millions of objects that are created and destroyed per second, thus leading to nodes-per-seconds count of around 30-40,000 (on an 1.8 Athlon) rather than the millions-per-second that pure C engines manage. All this taken into account, I?m currently pleased with its 1800 ELO, and hope to still improve it in the future.

It came to my attention just recently (since I?ve started to become more interested in WinBoard engines) that there was another chess engine named #Chess by Albert Bertilsson (http://www.albert.nu/default.asp?sub=programs/default.asp?sub=sharpchess/main.htm) that was created around 2002. Although I have found no way to contact Albert, according to his website, #Chess it now ?terminated?, and replaced with his current engine, named ?Sharper?. I hope that the ?new? SharpChess, will not cause any confusion within the community, or future tournaments.

Regards
Peter Hughes
peterhughes
 
Posts: 42
Joined: 18 Jan 2005, 23:37

Re: A new SharpChess by Peter Hughes

Postby Olivier Deville » 25 Mar 2005, 11:25

Dear Peter,

Many thanks for this new engine !

It happens that there is already an engine called SharpChess, by Albert Bertilsson (http://www.albert.nu/default.asp?sub=pr ... s/main.htm). So it would be better to find another name for your engine.

But thanks again, anyway :D

Olivier
User avatar
Olivier Deville
 
Posts: 1176
Joined: 26 Sep 2004, 19:54
Location: Aurec, France

Re: A new SharpChess by Peter Hughes

Postby Olivier Deville » 25 Mar 2005, 11:28

Sorry, I did not read your message carefully enough :? You are already aware of the old SharpChess. A new name is still needed, in my opinion.

Olivier
User avatar
Olivier Deville
 
Posts: 1176
Joined: 26 Sep 2004, 19:54
Location: Aurec, France

Re: A new SharpChess by Peter Hughes

Postby Guenther Simon » 25 Mar 2005, 11:46

Hi Peter,

The project and GUI looks interesting (also I like the object model),
but somehow it seems downloading is not possible currently?
Even with a pure ftp client I only get a timeout?

Best regards,
Guenther
P.S. I also agree with Olivier that a different name would be better,
even when Albert had started a new engine.
(may be SharpChessII would be sufficient though ;)
User avatar
Guenther Simon
 
Posts: 794
Joined: 26 Sep 2004, 19:49
Location: Regensburg, Germany

v2 and source code

Postby peterhughes » 25 Mar 2005, 12:15

I've just uploaded version 0.941 of the SharpChess source code to SourceForge, which now supports WinBoard v2 protocol. Perhaps there was some clash? Try now.

In regard to your v2 suggestion, that would seem to like a very good idea. This situation is not without precedent, in that, correct me if I am wrong, GNU Chess 5 is a complete re-write of GNU Chess 4, by a different developer to the original author? Perhaps I could follow suit, and move SharpChess directly from v0.941 up to version 2, and then start incrementing the version numbers again from there. I could also rename the EXE from SharpChess.exe to SharpChess2.exe, to make sure there is no clash, or confusion.

Of course, I would really like to speak to Albert about this, because I would like him to sanction this, in a way. Also I would like him to put a link on his #chess v0.06 website, to the new sharpchess at http://sharpchess.com, as I have linked to his version from my website. If anyone can give me his email address, I would be very greatful.

Thanks
Peter Hughes
peterhughes
 
Posts: 42
Joined: 18 Jan 2005, 23:37

download

Postby mike schoonover » 25 Mar 2005, 13:27

hi peter,
i cant seem to get to the download either.
perhaps the server is clogged or bandwidth exeded.
i'll try later.
regards
mike
by the time i get there,i'll be there
mike schoonover
 
Posts: 154
Joined: 27 Sep 2004, 23:15
Location: st paul minnesota,usa

Re: A new SharpChess by Peter Hughes

Postby peterhughes » 25 Mar 2005, 15:09

I've fixed the download problem (a port problem on the firewall).

The SharpChess application can now be downloaded from:
http://sharpchess.com/?page=02%20Download


The source code is avilable at:
http://sourceforge.net/projects/sharpchess/

Thanks
Peter Hughes
peterhughes
 
Posts: 42
Joined: 18 Jan 2005, 23:37

Re: A new SharpChess by Peter Hughes

Postby Guenther Simon » 25 Mar 2005, 15:26

Hi again Peter,

The download worked now and all seems to run smoothly :)
There are a few things to improve though, when running in
tournaments under WB:

Code: Select all
1) It should not always ponder or use CPU when it is the opponents
   move with ponder off under WB.
   (A lot of users don't have dual machines or more than one machine
   for reliably playing with ponder on)

2) In case of playing under WB or another compatible GUI it would be
   better IMHO if the GUI window of SharpChess would be automatically
   minimized. (I have not yet tested if there might be a problem with
   the GUI window closing after game end in a match or with a tournament
   manager)


Thanks for your program!

Guenther
User avatar
Guenther Simon
 
Posts: 794
Joined: 26 Sep 2004, 19:49
Location: Regensburg, Germany

Re: A new SharpChess by Peter Hughes

Postby Guenther Simon » 25 Mar 2005, 15:55

@Peter:

Forget my point 1, I made some ponder on Human-Engine games
last time on this machine and forgot to reset to ponder off, kudos!

I found something else though, it seems there is a problem for
SharpChess, when playing as Black?

Guenther

1) It should not always ponder or use CPU when it is the opponents
move with ponder off under WB.
(A lot of users don't have dual machines or more than one machine
for reliably playing with ponder on)



Code: Select all
6049 >second: level 40 5 0
6049 >second: post
6049 >second: hard
6049 >second: easy
6049 >second: ping 1
6049 >second: force
6049 >first : computer
6049 >first : name SharpChess
6049 >second: computer
6049 >first : time 30000
otim 30000
6049 >first : go
6289 <second: pong 1
6359 <first : error (unknown command): computer
6620 <first : 0 25 0 0 1.e4
6630 <first : move e2e4
6630 >second: usermove 6630 >second: e2e4
6650 >second: go
7771 <second: 1 0 3 24 Pawn d7-d5
7782 <second: 2 -37 5 166 Pawn d7-d5
7782 <second: 1 -4 6 33 Queen d8-d5 -Pawn.
7782 <second: 2 0 6 339 Queen d8-a5
7782 <second: 3 71 6 614 Pawn d5-e4 -Pawn.
7782 <second: 4 37 7 1573 Pawn d5-e4 -Pawn.
7782 <second:
7782 <second: Unbehandelte Ausnahme:
7782 <second: Unbehandelte Ausnahme: System.NullReferenceException: Der Objektverweis wurde nicht auf eine Objektinstanz festgelegt.
7782 <second:    at SharpChess.Move.Undo(Move move)
7782 <second:    at SharpChess.Player.Think()
7782 <second: System.NullReferenceException: Der Objektverweis wurde nicht auf eine Objektinstanz festgelegt.
7782 <second:    at SharpChess.Move.Undo(Move move)
7782 <second:    at SharpChess.Player.AlphaBeta(Player player, Int32 depth, Int32 alpha, Int32 beta, Boolean verify, Move& moveAnalysed)
7792 <second:    at SharpChess.Player.AlphaBeta(Player player, Int32 depth, Int32 alpha, Int32 beta, Boolean verify, Move& moveAnalysed)
7792 <second:    at SharpChess.Player.Think()
User avatar
Guenther Simon
 
Posts: 794
Joined: 26 Sep 2004, 19:49
Location: Regensburg, Germany

Re: A new SharpChess by Peter Hughes

Postby peterhughes » 25 Mar 2005, 17:10

Guenther

Thank you for taking the time to try out SharpChess. It's great to get some feedback.

Your point 2 , or minimising SharpChess when it detects winboard command seems execellent, and I'll put that in my next release.

I'm looking into the bug you posted at the moment...

Cheers
Peter Hughes
peterhughes
 
Posts: 42
Joined: 18 Jan 2005, 23:37

Re: A new SharpChess by Peter Hughes

Postby peterhughes » 25 Mar 2005, 20:53

Guenther

I have released version 0.942, which should fix the problem you had.

http://sharpchess.com/?page=02%20Download

I think it was mostly to do with receiving side-changing commands like "New", while the chess engine was "thinking" (not pondering). This was causing SharpChess to try and think and ponder at the same time, on separate threads. This is unusual for sharpchess, as I disable all the GUI buttons, except "Move Now", while the computer is thinking, so I've had to put extra checks in the WinBoard interface, which of course, can receive these commands at any time!

Thanks again for the feedback, Guenther

Cheers
Peter Hughes
peterhughes
 
Posts: 42
Joined: 18 Jan 2005, 23:37

cant find 1.4 whatever

Postby mike schoonover » 26 Mar 2005, 08:50

hi,
cant find the net.frame sharper wants.
got version 2. beta.
sharper ignores it,wont load.
now got net.frame 2 on my xp box,and no uninstall option.
coll.
regards
mike
by the time i get there,i'll be there
mike schoonover
 
Posts: 154
Joined: 27 Sep 2004, 23:15
Location: st paul minnesota,usa

Re: A new SharpChess by Peter Hughes

Postby Guenther Simon » 26 Mar 2005, 09:04

User avatar
Guenther Simon
 
Posts: 794
Joined: 26 Sep 2004, 19:49
Location: Regensburg, Germany

Re: A new SharpChess by Peter Hughes

Postby Guenther Simon » 26 Mar 2005, 09:13

Guenther

I have released version 0.942, which should fix the problem you had.

http://sharpchess.com/?page=02%20Download

I think it was mostly to do with receiving side-changing commands like "New", while the chess engine was "thinking" (not pondering). This was causing SharpChess to try and think and ponder at the same time, on separate threads. This is unusual for sharpchess, as I disable all the GUI buttons, except "Move Now", while the computer is thinking, so I've had to put extra checks in the WinBoard interface, which of course, can receive these commands at any time!

Thanks again for the feedback, Guenther


Hello Peter,

Yes it seems the problem with Black pieces is solved now.
Thanks for the quick fix! Time for some more tests now ;)

Cheers,
Guenther
User avatar
Guenther Simon
 
Posts: 794
Joined: 26 Sep 2004, 19:49
Location: Regensburg, Germany

Possible time control problem with moves/minutes?

Postby Guenther Simon » 26 Mar 2005, 09:39

Hi Peter,

First of all sorry for pluggin' SharpChess against such a strong opponent,
but that was just for testing.
My first impression is though it must be much better than your
estimated 1800 Elo?
Ok this was just one quick sample on my slower machine, but SharpChess
played quite well for at least 40 moves. I noticed a possible problem
with the time control then, because it used only around 20 seconds for
the next 29 moves? Either there is a time management bug or it does not
yet understand the time control of (repeated) moves per minutes
correctly? (moving immediately from move 41 on)

Cheers,
Guenther

specs:
WIN2KSP4
WB 4.27(A.Scotti)
Ponder off
PIII 650Mhz (fast machine was busy)
some apps like Firefox/AV open during game

[Event "Computer chess game"]
[Site "KABA"]
[Date "2005.03.26"]
[Round "-"]
[White "Abrok 5.0"]
[Black "SharpChess"]
[Result "1-0"]
[TimeControl "40/300"]

1. Nf3 d5 {-0.07/8} 2. d4 {+0.02/99} e6 {-0.09/8} 3. Nc3 {+0.22/10}
Nf6 {-0.09/8} 4. Bg5 {+0.04/11} Nc6 {-0.06/6} 5. Ne5 {+0.20/11}
Nxe5 {+0.40/8} 6. dxe5 {+0.64/10} h6 {+0.39/8} 7. Bh4 {+0.58/11}
g5 {+0.47/8} 8. exf6 {+0.22/10} gxh4 {+0.13/8} 9. Qd4 {+0.08/11}
h3 {+0.14/8} 10. g3 {+0.36/10} c5 {+0.34/8} 11. Qh4 {+0.30/10} d4 {+0.35/8}
12. Ne4 {+0.46/10} Qa5+ {+0.17/8} 13. Kd1 {+0.30/10} Qb4 {+0.00/7} 14.
b3 {+0.38/11} Bd7 {-0.07/7} 15. Bxh3 {+0.40/11} O-O-O {-0.11/8} 16.
a3 {+0.72/10} Qb6 {-0.14/8} 17. Ng5 {+0.62/9} Be8 {-0.05/7} 18.
Kc1 {+0.44/8} Rd7 {-0.03/6} 19. Nf3 {+0.82/8} Rc7 {+0.02/7} 20.
Ne5 {+0.64/10} Qd6 {+0.13/7} 21. Qe4 {+0.90/10} Qd8 {+0.04/7} 22.
Qf4 {+0.44/9} Qd5 {+0.17/7} 23. e4 {+1.12/11} Qd6 {-0.03/8} 24.
Kb1 {+1.14/11} Rg8 {+0.00/8} 25. Rd1 {+0.96/9} Kb8 {+0.04/8} 26.
Kb2 {+0.66/9} Rg5 {+0.34/7} 27. Nc4 {+0.54/11} Qxf4 {+0.46/9} 28.
gxf4 {+0.60/12} Rh5 {+0.60/9} 29. Rd3 {+0.60/12} Bc6 {+0.45/9} 30.
Re1 {+0.76/12} Rh4 {+0.30/9} 31. Rf3 {+0.42/11} Be8 {+0.26/8} 32.
a4 {+0.74/11} h5 {+0.19/8} 33. f5 {+0.76/10} exf5 {+0.56/9} 34.
exf5 {+0.86/11} Bc6 {+0.26/10} 35. Rg3 {+0.72/12} Bd7 {+0.18/9} 36.
Rg8 {+1.10/11} Rc8 {-0.23/9} 37. Ne5 {+0.92/11} Kc7 {-0.17/9} 38.
Nxd7 {+0.74/10} Kxd7 {-0.17/9} 39. Bf1 {+0.80/11} Rxh2 {-0.36/8} 40.
Bc4 {+0.94/11} d3 {-0.25/9} 41. Rg3 {+1.00/9} dxc2 {+0.75/7} 42.
Rf3 {+0.84/9} Bd6 {+0.41/6} 43. Bxf7 {+1.12/11} Rf8 {+0.74/3} 44.
Be6+ {+1.30/10} Kc6 {-0.93/5} 45. f7 {+1.30/11} h4 {-1.26/4} 46.
f6 {+1.32/11} c4 {-0.96/3} 47. Bxc4 {+2.44/10} Bb4 {-0.52/3} 48.
Re8 {+2.66/9} b5 {-1.74/3} 49. Bxb5+ {+3.74/9} Kc7 {-3.61/4} 50.
Bc4 {+3.82/9} c1=Q+ {-3.44/3} 51. Kxc1 {+3.82/10} Rh1+ {-3.49/4} 52.
Kc2 {+4.12/10} h3 {-3.07/5} 53. Bd5 {+5.14/9} h2 {-2.98/5} 54.
Re7+ {+5.52/9} Bxe7 {-1.97/6} 55. fxe7 {+6.36/9} Rc1+ {-1.88/5} 56.
Kb2 {+6.32/10} Rb1+ {-1.98/4} 57. Ka3 {+6.32/10} Ra1+ {-1.92/3} 58.
Kb2 {+6.32/10} Rb1+ {-1.98/4} 59. Ka3 {+6.32/10} Ra1+ {-1.92/3} 60.
Kb4 {+3.76/10} Rb8+ {-1.89/3} 61. Ka5 {+3.98/10} h1=Q {-2.10/3} 62.
e8=N+ {+4.10/9} Kd7 {-0.02/5} 63. f8=Q {+4.24/9} Qe1+ {-0.16/4} 64.
b4 {+4.04/9} Rxe8 {-0.30/4} 65. Qc5 {+3.94/8} Re7 {-1.35/4} 66.
Bc6+ {+299.80/8} Kc7 {-0.22/4} 67. Be4+ {+299.84/8} Kd8 {-0.36/4} 68.
Rf8+ {+299.88/8} Kd7 {-31250.00/4} 69. Qc6# {+299.96/4}
{White mates} 1-0
User avatar
Guenther Simon
 
Posts: 794
Joined: 26 Sep 2004, 19:49
Location: Regensburg, Germany

Re: A new SharpChess by Peter Hughes

Postby Olivier Deville » 26 Mar 2005, 10:18

Good news, Peter : SharpChess2 will play my next F tournament, starting in April. It won a qualification match vs. Chessterfield 3 - 1 (one loss on time).

I send you the games by email.

Olivier
User avatar
Olivier Deville
 
Posts: 1176
Joined: 26 Sep 2004, 19:54
Location: Aurec, France

Re: Possible time control problem with moves/minutes?

Postby peterhughes » 26 Mar 2005, 15:12

Guenther

Guenther Simon wrote:My first impression is though it must be much better than your estimated 1800 Elo?


It can sometimes play well "strategically", because the eval function having lots of rules about pawn structure etc, but then perhaps be let down by not being able to "see" as far as it's opponent, when it comes to pure search depth in "tactical" positions.

As for its ELO, I hope to find out when it enters a few tournaments!
Guenther Simon wrote:Ok this was just one quick sample on my slower machine, but SharpChess
played quite well for at least 40 moves. I noticed a possible problem
with the time control then, because it used only around 20 seconds for
the next 29 moves? Either there is a time management bug or it does not
yet understand the time control of (repeated) moves per minutes
correctly? (moving immediately from move 41 on)


Yes, this is something I need to address. It's next on my TODO list. At the moment, when the game exceeds the set number of moves on the clock, SharpChess just drops its thinking-time-per-move to one second. To get around this I've just been setting the clock as "120 moves in x minutes" as a work-around. I need to actually finish off the time management code, which I'll do in the next few days.

After that, outstanding items to finish are, "50 moves draw" and "insufficient material draw", but I need to ask a few questions on the programming forum, just to clarify the exact tournament rules for claiming draws.

Peter Hughes
peterhughes
 
Posts: 42
Joined: 18 Jan 2005, 23:37

Re: A new SharpChess by Peter Hughes

Postby peterhughes » 26 Mar 2005, 15:17

Olivier Deville wrote:Good news, Peter : SharpChess2 will play my next F tournament, starting in April. It won a qualification match vs. Chessterfield 3 - 1 (one loss on time).

I send you the games by email.

Olivier


That's great news, Olivier. I presume that I will be able to track SharpChess's progress via this website: http://loirechecs.chez.tiscali.fr/chesswar/? Or is "F tournament" a different tournament to "chesswar". Please excuse my ignorance on this subject.

Do you happen to know what Chessterfield's ELO is?

Thanks
Peter Hughes
peterhughes
 
Posts: 42
Joined: 18 Jan 2005, 23:37

re:from above post

Postby mike schoonover » 26 Mar 2005, 18:01

hi,
net 1.1 worked.
thanks
mike
by the time i get there,i'll be there
mike schoonover
 
Posts: 154
Joined: 27 Sep 2004, 23:15
Location: st paul minnesota,usa

Re: A new SharpChess by Peter Hughes

Postby Olivier Deville » 26 Mar 2005, 21:14

peterhughes wrote:
Olivier Deville wrote:Good news, Peter : SharpChess2 will play my next F tournament, starting in April. It won a qualification match vs. Chessterfield 3 - 1 (one loss on time).

I send you the games by email.

Olivier


That's great news, Olivier. I presume that I will be able to track SharpChess's progress via this website: http://loirechecs.chez.tiscali.fr/chesswar/? Or is "F tournament" a different tournament to "chesswar". Please excuse my ignorance on this subject.

Do you happen to know what Chessterfield's ELO is?

Thanks
Peter Hughes


Yes, you will be able to follow the tourmanet at this address... and you will even have a chance to see your engine playing live :D

Chessterfield has a rating of 1526 here.

Olivier
User avatar
Olivier Deville
 
Posts: 1176
Joined: 26 Sep 2004, 19:54
Location: Aurec, France

Next

Return to Winboard and related Topics

Who is online

Users browsing this forum: Google [Bot] and 32 guests