writing a new chess engine difficult task advice please ;-)

Discussion of chess software programming and technical issues.

Moderators: hgm, Rebel, chrisw

Hood
Posts: 657
Joined: Mon Feb 08, 2010 12:52 pm
Location: Polska, Warszawa

writing a new chess engine difficult task advice please ;-)

Post by Hood »

Hi,

I have thought it will be easier :-(. it seems that it is extremly difficult.

what literature shall i read at the start ?

It looks that it is easier to modify sth existing, ;-) how to do that not breaking anyone rights.

What program to select to modify would be good to know, that are easier and more difficult ones.

thanks for the advices.

rgds
chris
Polish National tragedy in Smoleńsk. President and all delegation murdered or killed.
Cui bono ?

There are not bugs free programs.
There are programs with undiscovered bugs.




Ashes to ashes dust to dust. Alleluia.
Fguy64
Posts: 814
Joined: Sat May 09, 2009 4:51 pm
Location: Toronto

Re: writing a new chess engine difficult task advice please

Post by Fguy64 »

I'm an amateur compared to most of the people on this board, and I too found it a challenge, so perhaps my experiences as an amateur in overcoming some of the hurdles will benefit you.

Before I try to offer some advice, I have a couple of questions...

Is this your first engine?
Will you be writing your own GUI also?
What language will you use?
How would you grade your overall programing skills?
User avatar
hgm
Posts: 27794
Joined: Fri Mar 10, 2006 10:06 am
Location: Amsterdam
Full name: H G Muller

Re: writing a new chess engine difficult task advice please

Post by hgm »

Writing a Chess engine can be done in a day if you are an experienced engne author, and in a weak if you are an experienced programmer that never wrote a Chess engine before. So I would say it is easy. It is as easy as riding a bike.

Of curse, if you really mean, "but I want to write the strongest engine in the World"... Well, then it is a bit harder, of course. Just like riding a bicycle faster than Lance Armstrong is a tad harder than just riding a bicycle. :lol:
BubbaTough
Posts: 1154
Joined: Fri Jun 23, 2006 5:18 am

Re: writing a new chess engine difficult task advice please

Post by BubbaTough »

I think this is an excellent resource:

http://chessprogramming.wikispaces.com/

If you want help, two pieces of information are critical:

1. Are you already an experienced programmer?
2. What are your goals for your chess engine?

I would personally suggest meager goals for your first chess engine, and not worry about performance or strength. Such things can be saved for subsequent efforts.

-Sam
User avatar
michiguel
Posts: 6401
Joined: Thu Mar 09, 2006 8:30 pm
Location: Chicago, Illinois, USA

Re: writing a new chess engine difficult task advice please

Post by michiguel »

BubbaTough wrote:I think this is an excellent resource:

http://chessprogramming.wikispaces.com/

If you want help, two pieces of information are critical:

1. Are you already an experienced programmer?
2. What are your goals for your chess engine?

I would personally suggest meager goals for your first chess engine, and not worry about performance or strength. Such things can be saved for subsequent efforts.

-Sam
First stepping stone: Write a bug-free perft.

Miguel
mcostalba
Posts: 2684
Joined: Sat Jun 14, 2008 9:17 pm

Re: writing a new chess engine difficult task advice please

Post by mcostalba »

Hood wrote:Hi,

I have thought it will be easier :-(. it seems that it is extremly difficult.
You started just few days ago (after some nonsense hand waving about Cobol)....and now you give up.

Apart from technical skills the most important things in computer chess are determination and patience. Without these I suggest you to just keep posting here and there and forget writing some code ;-)
User avatar
Bill Rogers
Posts: 3562
Joined: Thu Mar 09, 2006 3:54 am
Location: San Jose, California

Re: writing a new chess engine difficult task advice please

Post by Bill Rogers »

When I wanted to write a chess program I looked every where for some kind of examples but found none, so Idecided to write one from scratch.
The first thing I did was to create an outline of all the different part needed to in a chess rprogram, ie., borad representation, move generator, evaluation subroutine, legalility verifaction (in-check), Make/unmake piece mover, display borad.
Once these basic things things are done then you can start making it play better hess. I spent a geat amouunt of time working on improving the evaluation suboutine as this helps to determing the real atrenght of the program, well at least in my opinion.
Bill
P.S.
On top of the Wikepedia reference page you might also look up Bruce Morlands reference page as both are great examples for guidance.
Fguy64
Posts: 814
Joined: Sat May 09, 2009 4:51 pm
Location: Toronto

Re: writing a new chess engine difficult task advice please

Post by Fguy64 »

Bill Rogers wrote:...
On top of the Wikepedia reference page you might also look up Bruce Morlands reference page as both are great examples for guidance.
I'll second that. In my opinion Moreland's page is better for newbs such as myself because it is not too advanced.

http://web.archive.org/web/200404032117 ... /index.htm

Patience as was suggested earlier is also a must. Don't byte off more than you can chew. write small little programs that focus on small specific aspect of chess. Then slowly put the pieces together.
JVMerlino
Posts: 1357
Joined: Wed Mar 08, 2006 10:15 pm
Location: San Francisco, California

Re: writing a new chess engine difficult task advice please

Post by JVMerlino »

I will third the recommendation about Bruce Moreland's page. Very clear directions on the basics, with excellent and small code samples.

I also second Miguel's recommendation that you really can't do anything else until you have a perfect move generator and make/unmake, confirmed with perft. Thankfully, I had the Chessmaster code available, and that gave me a huge head start (despite the fact that Myrddin still suffers from a slow move generator and somebody I'm going to switch to bitboards).

jm
MattieShoes
Posts: 718
Joined: Fri Mar 20, 2009 8:59 pm

Re: writing a new chess engine difficult task advice please

Post by MattieShoes »

michiguel wrote:
BubbaTough wrote:I think this is an excellent resource:

http://chessprogramming.wikispaces.com/

If you want help, two pieces of information are critical:

1. Are you already an experienced programmer?
2. What are your goals for your chess engine?

I would personally suggest meager goals for your first chess engine, and not worry about performance or strength. Such things can be saved for subsequent efforts.

-Sam
First stepping stone: Write a bug-free perft.

Miguel
Agreed. If you want to make a strong engine, forget it at first. Make something that can generate moves, make moves, and undo moves. Verify it works with a simple perft function. THEN you worry about search stuff and eval stuff.

And at some point, you'll probably start over from scratch, incorporating the ideas you learned from the first time around. But it'll go much faster because you already have an idea of where you're going.