I thought I would introduce my self. I've been programming for 30 years (mostly c/c++, but have dabbled a plethora of languages) but am completely ignorant of all the chess terminology lingo for programming (so bare with me). I read on of David Levi's book 30 years ago, but this is the first time I've built a chess engine and I'm addicted to it now. My engine in development is Nadya2.0 and is written in Prolog. I started my first iteration in February deliberately trying to keep every as simple as possible (i.e. my board evaluator used a simple evaluation of PieceValue/Mobility). Even though I've been playing chess most of my life (sometimes seriously), my initial assumptions for my engine were laughable--and I'm trying to learn chess programming lingo, so bare with my terms. Initially I made the assumption, that what I called my "MoveList" for a player, was the same as what I later termed "ThreatList" (i.e. A pawn can't take a piece directly in front of it--Doh!). So I added the concept of the "ThreatList". Then I had another "Doh!" moment, when I realized if the King is in check from a "Rook" on the same column, the squares BEHIND the king should also be on the "ThreatList"--So I added another "workaround" for that (you don't want to know). I was tickled when it started playing mediocre chess when I bumped the depth to 3 (started at .5 [suicide chess], then 1, etc) when during a game it crashed at depth 3 and I spent hours debugging when I determined EVERY piece of the underpinnings of the program HAS to be PERFECT, with So I come up with a whole new design on paper, using pre-calculated 64-bit sequences for listing the "MoveList/ThreatList" on what I called a "bit-board". Then I starting googling and found this site, and Chessprogramming.com, and realized my concept of using "bit-boards" was hardly any kind of original idea.
To make a long story short, I started over with Nadya2, and took some advice that I read on this site. I built a "diagnostics" or "test" framework that checks every detail of every calculation, and have been building the new engine on top of that framework. That was a life savor. So now I have a move generator that creates "bit-boards" for every piece that is so far accurate (at least according to the diagnostics framework and visual review of the bit-boards) and is probably at least 100 times faster than my first "hobby" attempt. I'm not trying to make a program that can be world champion, but I can't wait to get it to a point where it can beat your average human (or at least me).
I'm not nearly as advanced as most of you, so if it sounds like I'm way behind you, I am. I'm determined to write the first version of Nadya completely on my own, with my own code, and my own implementations of chess programming concepts. I can't wait to play against some other engines though!
Lastly, what chess gui would you recommend I support initially (My text GUI runs in a colored console window using upper and lower ASCII characters)?
Thanks in advance,
-CraigH
P.S. I almost cried when the very first move Nadya1 ever made on her own as white was "P-K4", and then laughed when its very next move was to pull out the Queen.
Introduction and new rookie engine in progress
Moderators: hgm, Dann Corbit, Harvey Williamson
-
BlueStar
- Posts: 30
- Joined: Fri Apr 10, 2020 2:41 am
- Full name: Craig Hoibakk
-
jdart
- Posts: 4359
- Joined: Fri Mar 10, 2006 5:23 am
- Location: http://www.arasanchess.org
Re: Introduction and new rookie engine in progress
Code: Select all
Lastly, what chess gui would you recommend I support initially --Jon
-
hgm
- Posts: 27700
- Joined: Fri Mar 10, 2006 10:06 am
- Location: Amsterdam
- Full name: H G Muller
Re: Introduction and new rookie engine in progress
It is often totally trivial to modify a chess program with a stand-alone text interface to play under WinBoard. All that is needed is to keep a variable that indicates which side the computer should play for, and have the command interpreter recognize the commands 'new' for starting a game and setting it to play black, 'force' for setting it to play neither, and 'go' for setting it to play for the current side to move. And of course input moves, but you likely already do that anyway. And then, before it asks for input, test if the program should play for the current side to move, and if this is the case, have it think and print the move preceded by the keyword 'move'. That should already allow you to play autonatic games at the hard-coded default time control.
From there on you can expand, e.g. recognize the commands for specifying the time control ('level'), react to 'quit' and 'protover' to avoid slightly annoying delays (e.g. waiting for the GUI to kill the engine process), for setting up an arbitrary position ('setboard') etc.
From there on you can expand, e.g. recognize the commands for specifying the time control ('level'), react to 'quit' and 'protover' to avoid slightly annoying delays (e.g. waiting for the GUI to kill the engine process), for setting up an arbitrary position ('setboard') etc.
-
Henk
- Posts: 7210
- Joined: Mon May 27, 2013 10:31 am
Re: Introduction and new rookie engine in progress
Prolog that's fun. I thought about writing an engine in XSLT. But only thinking.
-
mvanthoor
- Posts: 1784
- Joined: Wed Jul 03, 2019 4:42 pm
- Location: Netherlands
- Full name: Marcel Vanthoor
Re: Introduction and new rookie engine in progress
It's a new chess engine not based on anything else, and it's not written in C. That alone makes it interesting to me. Is this open source? I'd love to have a look at it 
I'm a new chess programmer as well, after writing my own chess engine has been on my bucket list for about 20 years.
I made an attempt when I was 14-15. It played, legal chess... eh... most if the time... 2-3 moves deep, in the console, and that was basically it. After I finished it I didn't even understand half of the code I wrote in the beginning. I *thought* I was a very good programmer back then, but now I know better
)
Now I'm finally trying again, seriously, and I'm creeping up to the very first playable version. As you have already stated, this kind of programming is addictive. Stuff like this got me into computers.
Often used GUI's are Arena, CuteChess, Winboard/XBoard, and the teo protocols to look into are UCI and CECP (xboard).
Good luck! I hope to one day be able to play my engine against yours.
PS: why do you use descriptive notation? (Pawn to King 4.) Is it still the norm where you live? Most people nowadays would expect e2e4.
Taking out the queen and putting it in the middle of the board is completely logical if mobility is your main goal. Next it'll probably centralize bishops and rooks
I'm a new chess programmer as well, after writing my own chess engine has been on my bucket list for about 20 years.
I made an attempt when I was 14-15. It played, legal chess... eh... most if the time... 2-3 moves deep, in the console, and that was basically it. After I finished it I didn't even understand half of the code I wrote in the beginning. I *thought* I was a very good programmer back then, but now I know better
Now I'm finally trying again, seriously, and I'm creeping up to the very first playable version. As you have already stated, this kind of programming is addictive. Stuff like this got me into computers.
Often used GUI's are Arena, CuteChess, Winboard/XBoard, and the teo protocols to look into are UCI and CECP (xboard).
Good luck! I hope to one day be able to play my engine against yours.
PS: why do you use descriptive notation? (Pawn to King 4.) Is it still the norm where you live? Most people nowadays would expect e2e4.
Taking out the queen and putting it in the middle of the board is completely logical if mobility is your main goal. Next it'll probably centralize bishops and rooks
-
BlueStar
- Posts: 30
- Joined: Fri Apr 10, 2020 2:41 am
- Full name: Craig Hoibakk
Re: Introduction and new rookie engine in progress
@mvanthoor:
I am planning on making it open source eventually. I'm 51 years old so I grew up with, and am used to the older notation I used as a kid (P-K4), but my prolog program uses row/col notation in its GUI (i.e. e2-e4). Can wait to play your engine when they both are ready.
-Cheers
I am planning on making it open source eventually. I'm 51 years old so I grew up with, and am used to the older notation I used as a kid (P-K4), but my prolog program uses row/col notation in its GUI (i.e. e2-e4). Can wait to play your engine when they both are ready.
-Cheers
-
BlueStar
- Posts: 30
- Joined: Fri Apr 10, 2020 2:41 am
- Full name: Craig Hoibakk
Re: Introduction and new rookie engine in progress
That would be cool! Nadya1 was completely declarative with no global variables, and no state that wasn't passed down recursively. I enforced that rule to help learn old-school prolog programming. Nadya2 has global variables (bit-boards, magic bit-boards, etc) that are const once assigned/calculated (i.e. delayed const assignment), so in a sense it is still declaratively stateless with no modifiable variables.
Its a fun project. Nadya2 is much faster than I thought it could ever be for a Prolog program. It is far from playable yet, but calculates all the move bit-boards on my laptop in 2-4 milliseconds without trying to optimize. But the compiler I am using is very strongly typed and strict for a prolog compiler, which results in better assembly output.