where to start chess programming?
Moderators: hgm, Harvey Williamson, bob
Forum rules
This textbox is used to restore diagrams posted with the [d] tag before the upgrade.
This textbox is used to restore diagrams posted with the [d] tag before the upgrade.
Re: where to start chess programming?
I'll try to sare my experience with you.
I started many years ago programming a chess engine and created my first playing program in c# after few month. I tought I have understood everything about chess programming and added everything looks good. The engine played at 1400 elo point rating and everything I tried didn't work.
few years later a good boy created a tutorial about chess programming, the tutorial was called writing a chessprogram in 99 point and the final program was called winglet. The program wasn't strong at all, maybe less than 2000 but explained very well the basics of chess programming. studying this program and his code I created my second engine and some his code is still nside my code.
now I am on my third engine and I know that at the time of my first engine I hadn't understood anything. I still miss lots of things but my engien is nowadays in the 2850 elo point range.
The algorithm under the hood of the engine are not easy to fully understand, when you think you understood verything you found a bug in your code and you understood you have understimated the difficulty of putting everything together.
one iportant thing is to write easy code and bug free code.
I started many years ago programming a chess engine and created my first playing program in c# after few month. I tought I have understood everything about chess programming and added everything looks good. The engine played at 1400 elo point rating and everything I tried didn't work.
few years later a good boy created a tutorial about chess programming, the tutorial was called writing a chessprogram in 99 point and the final program was called winglet. The program wasn't strong at all, maybe less than 2000 but explained very well the basics of chess programming. studying this program and his code I created my second engine and some his code is still nside my code.
now I am on my third engine and I know that at the time of my first engine I hadn't understood anything. I still miss lots of things but my engien is nowadays in the 2850 elo point range.
The algorithm under the hood of the engine are not easy to fully understand, when you think you understood verything you found a bug in your code and you understood you have understimated the difficulty of putting everything together.
one iportant thing is to write easy code and bug free code.
Re: where to start chess programming?
since you ask us "where to start" I'll try to say what I think could be logical way to start chessprogramming
1) board rapresentation
2) parsing a fen string and displaying the board position
3) definition of move rapresentation
4) code to do/undo a move
5) if you like you could write a code to detect if a move is valid or more easily if a position is valid ( you cannot leave the king in check)
6) move generator
7) writing /debugging perft of some position.
8) writing a very easy board evalutation { material counting}
----------- up to know you only have don propedeutic work-------
9) write an easy alphabeta searcher
10) implementing a protocol to command your engine (uci/winboard are the most used)
from there you can start your REAL chess programming adventure.
1) board rapresentation
2) parsing a fen string and displaying the board position
3) definition of move rapresentation
4) code to do/undo a move
5) if you like you could write a code to detect if a move is valid or more easily if a position is valid ( you cannot leave the king in check)
6) move generator
7) writing /debugging perft of some position.
8) writing a very easy board evalutation { material counting}
----------- up to know you only have don propedeutic work-------
9) write an easy alphabeta searcher
10) implementing a protocol to command your engine (uci/winboard are the most used)
from there you can start your REAL chess programming adventure.
- vittyvirus
- Posts: 641
- Joined: Wed Jun 18, 2014 12:30 pm
Re: where to start chess programming?
just the answer i was looking for. now i have some queries ( please dont tell me to post a new forum topic )... i have done board representation system, and i today programmed a knight move generator. my code can be better, but for now i am focusing on keeping things simple. i have done upto here on my own, completely. others code is simply damn hard to get. coming to ky queries, what does step 4 ie definition of board representation mean??. and what do u mean by perft??? i am not new to chess programming , i know a lot of theory ( i could see u translate board evaluation for me) but looking at you guyz, i feel completely dumb.... -_-elcabesa wrote:since you ask us "where to start" I'll try to say what I think could be logical way to start chessprogramming
1) board rapresentation
2) parsing a fen string and displaying the board position
3) definition of move rapresentation
4) code to do/undo a move
5) if you like you could write a code to detect if a move is valid or more easily if a position is valid ( you cannot leave the king in check)
6) move generator
7) writing /debugging perft of some position.
8) writing a very easy board evalutation { material counting}
----------- up to know you only have don propedeutic work-------
9) write an easy alphabeta searcher
10) implementing a protocol to command your engine (uci/winboard are the most used)
from there you can start your REAL chess programming adventure.
'I would only believe in a god who could dance.' - Friedrich Nietzsche
Re: where to start chess programming?
https://www.google.com/?gws_rd=ssl#q=perftvittyvirus wrote:just the answer i was looking for. now i have some queries ( please dont tell me to post a new forum topic )... i have done board representation system, and i today programmed a knight move generator. my code can be better, but for now i am focusing on keeping things simple. i have done upto here on my own, completely. others code is simply damn hard to get. coming to ky queries, what does step 4 ie definition of board representation mean??. and what do u mean by perft??? i am not new to chess programming , i know a lot of theory ( i could see u translate board evaluation for me) but looking at you guyz, i feel completely dumb.... -_-elcabesa wrote:since you ask us "where to start" I'll try to say what I think could be logical way to start chessprogramming
1) board rapresentation
2) parsing a fen string and displaying the board position
3) definition of move rapresentation
4) code to do/undo a move
5) if you like you could write a code to detect if a move is valid or more easily if a position is valid ( you cannot leave the king in check)
6) move generator
7) writing /debugging perft of some position.
8) writing a very easy board evalutation { material counting}
----------- up to know you only have don propedeutic work-------
9) write an easy alphabeta searcher
10) implementing a protocol to command your engine (uci/winboard are the most used)
from there you can start your REAL chess programming adventure.
Miguel
Re: where to start chess programming?
Daniel José -
http://www.andscacs.com
Re: where to start chess programming?
I realy can't understand your message. Someone has already pointed you to a link where perft is explained and another one to a link with board representationvittyvirus wrote:just the answer i was looking for. now i have some queries ( please dont tell me to post a new forum topic )... i have done board representation system, and i today programmed a knight move generator. my code can be better, but for now i am focusing on keeping things simple. i have done upto here on my own, completely. others code is simply damn hard to get. coming to ky queries, what does step 4 ie definition of board representation mean??. and what do u mean by perft??? i am not new to chess programming , i know a lot of theory ( i could see u translate board evaluation for me) but looking at you guyz, i feel completely dumb.... -_-elcabesa wrote:since you ask us "where to start" I'll try to say what I think could be logical way to start chessprogramming
1) board rapresentation
2) parsing a fen string and displaying the board position
3) definition of move rapresentation
4) code to do/undo a move
5) if you like you could write a code to detect if a move is valid or more easily if a position is valid ( you cannot leave the king in check)
6) move generator
7) writing /debugging perft of some position.
8) writing a very easy board evalutation { material counting}
----------- up to know you only have don propedeutic work-------
9) write an easy alphabeta searcher
10) implementing a protocol to command your engine (uci/winboard are the most used)
from there you can start your REAL chess programming adventure.
what you know what step 4 is? doing/undoing a move. when you do a move you modify the board status when you undo a move you return to the precedent status.
- Bo Persson
- Posts: 174
- Joined: Sat Mar 11, 2006 7:31 am
- Location: Malmö, Sweden
Re: where to start chess programming?
You are asking for a short summary of a field that has produced academic papers for decades.vittyvirus wrote:I'm sorry if i was being a fool, seriously. i know these situations where people ask u for clear answers when they dont know much about it, and i guess m being among those people as many experienced people are here. You guyz are really tough.
http://chessprogramming.wikispaces.com/Papers
This would be several bookshelves full, if on paper. How are we going to give a short, but "expanded", summary of this? It's just not possible.
You have to ask very specific questions to get more usable answers. The upside is that you CAN get answers from people who are very experienced and have worked with this for 30 years or more!
- Steve Maughan
- Posts: 1025
- Joined: Wed Mar 08, 2006 7:28 pm
- Location: Florida, USA
- Contact:
Re: where to start chess programming?
Take a look at my website - it has a "over the shoulder" view of writing a decent chess engine:
http://www.chessprogramming.net
Steve
http://www.chessprogramming.net
Steve
http://www.chessprogramming.net - Maverick Chess Engine
- vittyvirus
- Posts: 641
- Joined: Wed Jun 18, 2014 12:30 pm
Re: where to start chess programming?
@bo persson
people with 30 years of experience are rare, i dont know anyone except dr. hyatt but he IS my hero. i wish he would see this and respond.
@ steve maughan
i took a peak at ur website a month ago. it is nice. thanks!!
@ daniel jose
i know what board representation is, i have implemented it too. on marco belli's scale, i have done first 3 steps completely.
@ marco belli i'm sorry for writing 4 instead of 3. i thought u meant something special by 'definition of move representation' that was not representing the moves.
@ miguel ballicora
thank you!
people with 30 years of experience are rare, i dont know anyone except dr. hyatt but he IS my hero. i wish he would see this and respond.
@ steve maughan
i took a peak at ur website a month ago. it is nice. thanks!!
@ daniel jose
i know what board representation is, i have implemented it too. on marco belli's scale, i have done first 3 steps completely.
@ marco belli i'm sorry for writing 4 instead of 3. i thought u meant something special by 'definition of move representation' that was not representing the moves.
@ miguel ballicora
thank you!
'I would only believe in a god who could dance.' - Friedrich Nietzsche
Re: where to start chess programming?
you write " what does step 4 ie definition of board representation mean??." 
I mean decide how to represent a move. you have to save the move after generating it. normally you have to save from, to and special move information (promotion, en passant ,castle), or something equivalent.
I mean decide how to represent a move. you have to save the move after generating it. normally you have to save from, to and special move information (promotion, en passant ,castle), or something equivalent.


