Which engines are open source, with easy to read and extend code, and reasonably strong?

Discussion of anything and everything relating to chess playing software and machines.

Moderators: hgm, Rebel, chrisw

evert823
Posts: 31
Joined: Thu Oct 29, 2020 9:32 am
Full name: Evert Jan Karman

Which engines are open source, with easy to read and extend code, and reasonably strong?

Post by evert823 »

I'm asking this so that I can perhaps modify it for a chess variant idea.
evert823
Posts: 31
Joined: Thu Oct 29, 2020 9:32 am
Full name: Evert Jan Karman

Re: Which engines are open source, with easy to read and extend code, and reasonably strong?

Post by evert823 »

W.r.t. Fairy-Max, I tried this link http://hgm.nubati.net/Fairy-Max.zip but it's not downloading anything, and my anti-virus is not telling me that it blocked a download.
User avatar
Brunetti
Posts: 314
Joined: Tue Dec 08, 2009 1:37 pm
Location: Milan, Italy
Full name: Alex Brunetti

Re: Which engines are open source, with easy to read and extend code, and reasonably strong?

Post by Brunetti »

evert823 wrote: Thu Oct 24, 2024 11:48 pm W.r.t. Fairy-Max
It's not open source.
evert823 wrote: Thu Oct 24, 2024 11:47 pm I'm asking this so that I can perhaps modify it for a chess variant idea.
What do you intend with "reasonably strong"?

Alex
evert823
Posts: 31
Joined: Thu Oct 29, 2020 9:32 am
Full name: Evert Jan Karman

Re: Which engines are open source, with easy to read and extend code, and reasonably strong?

Post by evert823 »

Brunetti wrote: Fri Oct 25, 2024 12:11 am
What do you intend with "reasonably strong"?

Alex
Here I would say that Fairy-Max is more than reasonably strong.
I remember somewhere here on this forum a few names of engines were mentioned in a thread about something else. But I cannot find it anymore.
User avatar
Brunetti
Posts: 314
Joined: Tue Dec 08, 2009 1:37 pm
Location: Milan, Italy
Full name: Alex Brunetti

Re: Which engines are open source, with easy to read and extend code, and reasonably strong?

Post by Brunetti »

evert823 wrote: Fri Oct 25, 2024 8:17 am Here I would say that Fairy-Max is more than reasonably strong.
Ok, I was wrong writing it's closed source! You can find the sources here.

Alex
User avatar
hgm
Posts: 28079
Joined: Fri Mar 10, 2006 10:06 am
Location: Amsterdam
Full name: H G Muller

Re: Which engines are open source, with easy to read and extend code, and reasonably strong?

Post by hgm »

Fairy-Max is public domain, and the most recent sources are available from my on-line repository. (Now only available as mirror at http://winboard.nl .) It also exists as a Debian package ('fairymax'). The source code is extremely cryptic, though, as it is a derivative of micro-Max. By engine standards it is not very strong (~1850 on the CCRL scale).

Sjaak II by Evert Glebbeek is a configurable multi-variant engine that is also available in source code, and probably has a more readable source.

In my on-line repository there also is a section called 'simple', which contains a highly commented source of a simple engine stronger than Fairy-Max. But it is for orthodox Chess, and might not be very easy to convert for variant use. (Although I did make a derivative to play Chess wih Different Armies.) It uses an 8x8 board, and maximally 7 piece types, and it would require a lot of changes to alter that. It does use a mailbox board, though, so a board-size expansion is not as hopeless as with bitboard engines.
User avatar
Brunetti
Posts: 314
Joined: Tue Dec 08, 2009 1:37 pm
Location: Milan, Italy
Full name: Alex Brunetti

Re: Which engines are open source, with easy to read and extend code, and reasonably strong?

Post by Brunetti »

hgm wrote: Fri Oct 25, 2024 9:42 am Fairy-Max is public domain, and the most recent sources are available from my on-line repository. (Now only available as mirror at http://winboard.nl .)
Hi,
what is the most recent version? In your mirror I can find only 4.8S, while in hccnet there's 5.0.

Alex
Viz
Posts: 208
Joined: Tue Apr 09, 2024 6:24 am
Full name: Michael Chaly

Re: Which engines are open source, with easy to read and extend code, and reasonably strong?

Post by Viz »

The strongest chess variant engine is fairy stockfish AFAIK.
chesskobra
Posts: 266
Joined: Thu Jul 21, 2022 12:30 am
Full name: Chesskobra

Re: Which engines are open source, with easy to read and extend code, and reasonably strong?

Post by chesskobra »

Have you looked at Fruit? You may want to look at the file "technical_10.txt" in Fruit's source code first to see if it interests you.
User avatar
hgm
Posts: 28079
Joined: Fri Mar 10, 2006 10:06 am
Location: Amsterdam
Full name: H G Muller

Re: Which engines are open source, with easy to read and extend code, and reasonably strong?

Post by hgm »

Fruit is indeed an engine with very clear source code, and quite strong. Main problem is that it is also pretty large, and you would have to read through a lot of code to find the places where you have to change something, if you really change something fundamental. (Such as board size; Fruit uses a 16x16 board with 0x88 square numbering, which requires at most half the board files are used for some of its algorithms to work.)

It is difficult to give good advice without knowing your goals. Strong engines typically use many tricks to speed them up, like dedicated check detection. These might not work at all in the presence of some variant pieces; they are tailored for orthodox Chess. So it all depends on how unusual the variant is you want to use this for.

BTW, the AI of the Interactive Diagram is written for supporting a very large range of chess variants. But it is still a very basic engine. It is written in JavaScript, since it is a web applet, but it should not be very much work to translate it to C.