#Chess Engine in C++

18 messages · Page 1 of 1 (latest)

normal axle
#

Hey guys, I'm thinking of trying to make a chess engine would like it to be atleast 1500 elo acc to chesscom but I'm not sure how to even start or if I can even make it. what resources/knowledge do I need and ig position evaluation algorithms exist already and I'm not smart enough to make them myself anyways so would using those be considered cheating here? I have made a simple http web server to transfer files in cpp(multithreaded with thread pooling) and a basic cli sniffer(multi threaded) which parses the headers of packets basically in cpp so that's about all of my cpp experience. Let me know if you guys have any idea about this. since I dont want to end up just copying some other engine line by line lol

PS: please @ me if you reply

brazen gorgeBOT
#

When your question is answered use !solved to mark the question as resolved.

Remember to ask specific questions, provide necessary details, and reduce your question to its simplest form. For tips on how to ask a good question use !howto ask.

smoky hollow
#

@normal axle You should start with writing the board representation and move generation.
Focus on getting a correct chess implementation first, and once you pass perft suites you can worry about the CLI (You want to implement a small subset of the UCI protocol), search (negamax, not minimax) and eval (you can start with piece square tables).

formal steeple
# normal axle Hey guys, I'm thinking of trying to make a chess engine would like it to be atle...

I'm thinking of trying to make a chess engine would like it to be atleast 1500 elo acc [...] ig position evaluation algorithms exist already and I'm not smart enough to make them myself
Errrr? But that's exactly what a chess engine is. A position evaluator.

so would using those be considered cheating here
That depends. You obviously can use Stockfish (or similar) under the hood, as long as you openly communicate that and give it your own twist/gimmick (like e.g. a bot that only ever chooses the third best move, etc).
If you want to "make your own chess engine", then yeah, that would be considered cheating.

#

I would recommend that you use https://lichess.org/ instead of chess.com, as lichess provides a public and free to use API, which allows you to focus only on the engine part and less on actually re-building the chess logic like e.g. calculating what the next moves are from a certain position.

I've actually build a chess engine in a "battle" against a good friend of mine, and Lichess was really nice and easy to use from what I remember, plus it allows you to immediately register the Bot and be able to play it on Lichess.

smoky hollow
#

^, afaik you aren't allowed to have a bot account on chess.com, but lichess makes that easy.
But before you can do any of that, you have to implement the rules of chess, and that's probably going to be the most difficult part unless you use a library for this.

formal steeple
smoky hollow
#

there are libraries you can use

formal steeple
# smoky hollow there are libraries you can use

Hahaha, I found my old chess engine :D
Written in Java around 5 years ago.

Yeah, I remembered correctly, but honestly I don't know if that stuff is from the Lichess library or not, my friend set all of that up and it's too late for me to investigate further

normal axle
#

alright thanks you guys, I'll take it slow and try to get started with setting up the board and legal moves. thanks for the lichess tip too!

#

!solved

brazen gorgeBOT
#

Thank you and let us know if you have any more questions!

This thread is now set to auto-hide after an hour of inactivity

formal steeple
#

In case you're wondering what bitboards are: You use a 64-bit integer to represent the 64 squares of the board. This means you need 6 (# of pieces) * 2 (# of players) = 12 64-bit integers to represent a single chess board state.

In case you want some inspiration, here's a TicTacToe game I made using bitboards (though this is much simpler than chess of course)

#

so I would actually be able to use my solution to e.g. simulate 2 bots playing against each other, whereas your approach is very GUI-bound
Just realized that foreshadowing, lmao