Most Basic Open Source Chess Engine For Beginner Engine Devs

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

Moderator: Andres Valverde

Most Basic Open Source Chess Engine For Beginner Engine Devs

Postby netiad » 18 Sep 2010, 02:23

I'd like to get into chess engine development. I'm looking for the most basic open source chess engine for someone new to chess engine development.

I'm aware of several chess engines, I'm hoping to get input from the community of the most basic open source engine they know of that has a good framework for a beginning engine developer.

Bonus would be a project that is looking for developers.

Thanks!
netiad
 
Posts: 16
Joined: 16 Sep 2010, 03:02

Re: Most Basic Open Source Chess Engine For Beginner Engine

Postby Dann Corbit » 18 Sep 2010, 03:54

First, TSCP is a bad idea. It has lots of global variables and other things that will get you into trouble.
Sungorus is rather nice:
http://sites.google.com/site/sungorus/

If you are familiar with bit operations, you might enjoy olithink:
http://home.arcor.de/dreamlike/chess/index.html

If you told us what programming language you like best, we could probably guide you better.
Dann Corbit
 

Re: Most Basic Open Source Chess Engine For Beginner Engine

Postby netiad » 18 Sep 2010, 05:00

I can do C/C++ or Java. However I'd prefer Java as that is what I have been working in most recently.
netiad
 
Posts: 16
Joined: 16 Sep 2010, 03:02

Re: Most Basic Open Source Chess Engine For Beginner Engine

Postby Dann Corbit » 18 Sep 2010, 08:04

Go here:
http://homepages.tesco.net/henry.ablett/jims.html

And take a look at these Java programs:

Alf
Animats Chess
Arabian Knight
Bayes Chess
BremboCE
Carballo
Cheoss
CuckooChess
Deep Duke
Eden
Flux
Frank-Walter
Frittle
GNUchess 5.07 4j (Careful with the version, others are C versions)
jChecs
Jchess
King's Ou
Magnum Chess
Mediocre Chess
Olithink 4.12j (Careful with the version, others are C versions)
Pyotr
Talvmenni
Tiffanys
Dann Corbit
 

Re: Most Basic Open Source Chess Engine For Beginner Engine

Postby H.G.Muller » 19 Sep 2010, 11:17

Most basic would be micro-Max 1.6. just a 3-nested-loop mailbox move generator and an alpha-beta search.And a good introduction to micro-Max 4.8, which adds hash table, null move, check extension, LMR.

And only ~100 short lines of C code. :D
User avatar
H.G.Muller
 
Posts: 3453
Joined: 16 Nov 2005, 12:02
Location: Diemen, NL

Re: Most Basic Open Source Chess Engine For Beginner Engine

Postby netiad » 19 Sep 2010, 21:28

Impressive engine HGM. That must have taken some time to get it down to such a small foot print! ~100 lines is quite a feet!

I've decided to switch directions and write my engine in C. I've found some good literature at http://chessprogramming.wikispaces.com/. I'm reading about board representations at the moment. Is there a board representation in the community that is know to be fastest? If there isn't one that is know which ones (or combination of ones) are argued to be (listed in fastest to least order)?
netiad
 
Posts: 16
Joined: 16 Sep 2010, 03:02

Re: Most Basic Open Source Chess Engine For Beginner Engine

Postby Dann Corbit » 20 Sep 2010, 19:34

netiad wrote:Impressive engine HGM. That must have taken some time to get it down to such a small foot print! ~100 lines is quite a feet!

I've decided to switch directions and write my engine in C. I've found some good literature at http://chessprogramming.wikispaces.com/. I'm reading about board representations at the moment. Is there a board representation in the community that is know to be fastest? If there isn't one that is know which ones (or combination of ones) are argued to be (listed in fastest to least order)?


Bitboard seems to have won overall.
Mostly you will see magic bitboard now.
Dann Corbit
 

Re: Most Basic Open Source Chess Engine For Beginner Engine

Postby Boybawang » 13 Mar 2013, 15:16

Hi!
Sorry for reviving this old thread. I just wanna know if Dann Corbits recommendations still stand today specifically with Olithink. Any new comer engines today that surpass it? BTW why the old FAILE is not included in the recommendation? I find it more readable than Olithink.

Thanks for the answer
Boybawang
 
Posts: 3
Joined: 13 Mar 2013, 15:08

Re: Most Basic Open Source Chess Engine For Beginner Engine

Postby Ron Murawski » 14 Mar 2013, 04:10

Dann's list was a comprehensive list of engines written In Java, which is what the OP was looking for. So Dann was referring to Olithink in Java and you are referring to Faile which is written in C.

My own list of interesting C/C++ engines is this:
Arasan
Beowulf
Crafty
EXchess
Faile
Fruit
Glaurung
Kiwi
KnightCap
OliThink
Protector
Scorpio
Sloppy
SlowChess
Stockfish
TSCP
Viper

Some of these engines are simple and some are interesting for other reasons. My list is not intended to be comprehensive. It favors C source over C++. I haven't updated the list in quite a few years. You can find the links at my programmer's page
http://www.horizonchess.com/pmwiki.php? ... rogramming

Emilio Diaz extended the code from FirstChess (by Pham Hong Nguyen) into an engine that plays a legal game of chess, so maybe you want to look at SecondChess
https://github.com/pocopito/secondchess
The code is a bit long-winded and not very optimized, but the intent is clarity rather than cleverness.

Ron
User avatar
Ron Murawski
 
Posts: 352
Joined: 26 Sep 2004, 21:50
Location: Schenectady, NY, USA

Re: Most Basic Open Source Chess Engine For Beginner Engine

Postby Boybawang » 16 Mar 2013, 07:24

Good list Ron!

Can you narrow your list based from the following criteria?

1. C or C++
2. Simple enough as entry to chess programming but must have at least bitboard and transposition table.
3. Uses correct programming approach for chess to make it ready for adding more advanced features like multi-threading.
4. Fairly commented.

thanks for the help
Boybawang
 
Posts: 3
Joined: 13 Mar 2013, 15:08

Re: Most Basic Open Source Chess Engine For Beginner Engine

Postby Ron Murawski » 17 Mar 2013, 06:40

Boybawang wrote:Good list Ron!

Can you narrow your list based from the following criteria?
Keep in mind that its been years since I compiled that list, so my memory of the details has become hazy.
Boybawang wrote:
1. C or C++
The best place to get this information is on my Chess Engine List
http://www.computer-chess.org/doku.php? ... ngine_list
Any engine with available code will have a comment such as: "C source", "C++ source", "Java source", etc.
Boybawang wrote:2. Simple enough as entry to chess programming but must have at least bitboard and transposition table.
Bitboards are not simple and their use is not easily understood by a beginner. You may be better off starting with a mailbox approach instead. Many of the engines listed have transposition tables. When I started I looked at the code to several engines and, when I found code that looked like my own code, I learned more from that engine than any other.
Boybawang wrote:3. Uses correct programming approach for chess to make it ready for adding more advanced features like multi-threading.
If I remember right, only Viper (in C++) is somewhat simple and has multi-threaded capabilities. This is a non-trivial addition to any chess program, no matter how well-written. Implementing a multi-threaded search often necessitates rewriting some of the code.
Boybawang wrote:4. Fairly commented.
It seems that chess programmers rarely comment their code. Crafty has some block comments and Beowulf as well. I don't remember any others with comments, but I hope I'm wrong about that. The best explanations of chess algorithms are found at the Chess Programming Wiki
http://chessprogramming.wikispaces.com/
Boybawang wrote:
thanks for the help

You're welcome! Good luck!

Ron
User avatar
Ron Murawski
 
Posts: 352
Joined: 26 Sep 2004, 21:50
Location: Schenectady, NY, USA

Re: Most Basic Open Source Chess Engine For Beginner Engine

Postby Diaz » 19 Mar 2013, 16:54

Just a couple of comments to add:
-Sungorus is a nice piece of software, and the only con I can find is its lack of comments.
-Rodent http://www.pkoziol.cal24.pl/rodent/rodent.htm is based on Sungorus: much more complex but with comments
-Beowulf is a quite interesting engine too.

Just an extra note: don't just forget of engines not based on bitboards just for this "lack", because for example parts like the search algorithms can be useful to you. I've found the search part the hardest to fully understand of a chess engine, so if on the one hand engines like TSCP are maybe too simple and not bitboards based, on the other hand the simpleness of its search function can be useful on the very first steps of your study.

Best regards

Emilio
Diaz
 
Posts: 4
Joined: 19 Mar 2013, 16:31

Re: Most Basic Open Source Chess Engine For Beginner Engine

Postby Boybawang » 19 Mar 2013, 17:48

Thanks Ron and Emilio,

OK I will remove the Bitboard requirement from the criteria. What do you think about Faile?

-Boy
Boybawang
 
Posts: 3
Joined: 13 Mar 2013, 15:08

Re: Most Basic Open Source Chess Engine For Beginner Engine

Postby Ron Murawski » 20 Mar 2013, 05:34

Faile can be a good starting point. I just took a very fast look at the code. Here's some things I noticed.

- Faile has a lot of global variables that can be made static or local
- Faile uses Negamax instead of PVS search
- Faile keeps 3 killer moves per ply instead of 2, probably necessary because capture moves are wrongly stored
- Faile uses a 3-stage eval: opening, midgame, endgame with abrupt changes; most modern engines use opening and endgame values and scale towards endgame values as material gets traded
- Faile code assumes existence of WIN32 else it assumes Linux, but that won't work for Windows 64-bit builds
- Faile code is optimized for 32-bit only
- Faile has a lot of small values that need to get increased: hash size, max depth, etc
- Faile has a single-entry per bucket hash table (depth-preferred); you probably will want to replace it with a 4-entry bucket with one entry depth-preferred and the 3 others as always-overwrite

Much of the code is written twice, once for Black pieces and once for White pieces. From the standpoint of preventing bugs, you are much better off writing color-independent code instead.

Ron
User avatar
Ron Murawski
 
Posts: 352
Joined: 26 Sep 2004, 21:50
Location: Schenectady, NY, USA

Re: Most Basic Open Source Chess Engine For Beginner Engine

Postby Diaz » 20 Mar 2013, 13:22

It seems Gerbil, by Bruce Moreland, hasn't been noted on this post, and probably it worth a look:
http://chessprogramming.wikispaces.com/Gerbil
Diaz
 
Posts: 4
Joined: 19 Mar 2013, 16:31


Return to Programming and Technical Discussions

Who is online

Users browsing this forum: No registered users and 15 guests