Steps to write Chess Engine (communicate with Winboard)

Programming Topics (Computer Chess) and technical aspects as test techniques, book building, program tuning etc

Moderator: Andres Valverde

Steps to write Chess Engine (communicate with Winboard)

Postby vbce » 11 Mar 2011, 05:01

Hello All, I am a Java-Web Programmer, I am very interesting to write a simple chess engine as my "side project". I did some research and look at some open-source, sample code, it help a lot, but I still need some advice so that I go the right direction as start point. Your advice, would be greatly appreciated.

At the beginning, I have tried to load the Winboard and send just a move (from Engine) to see if the piece in Winboard move or not, but when I start the command:

winboard -cp -fcp "java -jar SimpleEngine.jar" -scp "java -jar SimpleEngine.jar"

The Winboard is loaded, but it show error "Error writing to first chess program:The pipe is being closed".

A simple line I tried to send to Winboard is:
System.out.println("move g4"); (or move e2e4)
System.out.flush();

I did some search how to fix (like: feature sigint=0 done=1....) error but no luck....

Could some one explain to me, the first some main steps to start writing Engine?

Thank you in advantage.
vbce
 
Posts: 7
Joined: 10 Mar 2011, 06:46

Re: Steps to write Chess Engine (communicate with Winboard)

Postby Roman Hartmann » 11 Mar 2011, 08:07

Hi,
as you probably figured out already there's a lot of information available concerning chess programming. For a beginner almost too much as it takes some time to figure out what the basics are that you need.

But anyway, I wouldn't start with the communication protocol to a GUI. Easier to write a little console-interface first so you can display the board on the console.

That's what I would recommend:
-Create a data structure for the board (look up 10x12, 0x88, I wouldn't start with bitboard)
-write a routine to display the board and the game status (castling, ep, side to move ...)
-write a routine to set-up the board (FEN, Forsythe-String)
-write a move generator (pseudolegal move generation, legal move generation)
-implement a make/unmake sheme
-implement a search and a quiescent search (Nemagmax, beta-cut offs, MVV/LVA)
-add a protocol to communicate with a GUI (Winboard, UCI)

-add more fancy stuff like Null-move, transposition-tables, LMR ...

Hope that helps
Roman
User avatar
Roman Hartmann
 
Posts: 155
Joined: 11 Oct 2004, 14:21

Re: Steps to write Chess Engine (communicate with Winboard)

Postby vbce » 13 Mar 2011, 05:20

Thank you very much for your detail explanation !!
After review your recommendation and did more google and review some open sources code, that make a lot of sense that I shouldn't start with the communicate to a GUI (Winboard).! ( I believed that why I got the first error to start ).
I'll take your great recommendation as big note and start one step at the time.

Thank you very much.
vbce
 
Posts: 7
Joined: 10 Mar 2011, 06:46

Re: Steps to write Chess Engine (communicate with Winboard)

Postby Olivier Deville » 13 Mar 2011, 07:22

Hello !

We are going to start step-by-step chess programming lessons on this forum in a few days. I hope you will be one of our students :)

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

Re: Steps to write Chess Engine (communicate with Winboard)

Postby vbce » 13 Mar 2011, 17:07

Hello,
I will join for sure !!! when it will start? what is forum's subject will be?
Thank you very much.
vbce
 
Posts: 7
Joined: 10 Mar 2011, 06:46

Re: Steps to write Chess Engine (communicate with Winboard)

Postby Olivier Deville » 13 Mar 2011, 17:19

Great :) The details will be announced very soon.

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

Re: Steps to write Chess Engine (communicate with Winboard)

Postby Giorgio Medeot » 14 Mar 2011, 11:51

Hi,
as it happens, I too have just started writing a chess engine. And I started right with the GUI communication handling routines... :)
Now I am writing bitboards and move generation stuff, then make/unmake and perft will follow.
I made a point in not looking at any source code, if not for basic things like bitscan etc. I just want to go my own way, as I'm not interested in ending with a top strength engine. It's just for the fun.
Of course I do follow the discussions here and on the CCC forum, and looked at the valuable articles in the chess programming wiki. I'm really thankful to all of those who share their knowledge and experience.

Thanks for this really nice news!

Cheers,
    Giorgio
Giorgio Medeot
 
Posts: 26
Joined: 31 Aug 2009, 11:01

Re: Steps to write Chess Engine (communicate with Winboard)

Postby vbce » 16 Mar 2011, 02:58

I found the great explanation how to communicate with GUI (Winboard) at the Mediore Chess: http://mediocrechess.varten.org/guides/ ... ocols.html
I am able to load a winboard with some moves Thank you to Mediocre !!! but I leave that aside for now, I found that to start from what Roman state should be better !!! I had the bitboard setup and load in system console !! it fun , way to learn !!.

Thanks.
vbce
 
Posts: 7
Joined: 10 Mar 2011, 06:46


Return to Programming and Technical Discussions

Who is online

Users browsing this forum: No registered users and 25 guests