maksimkorzh / bbc Goto Github PK
View Code? Open in Web Editor NEWBit Board Chess (BBC) - The easiest to understand bitboard chess engine by Code Monkey King
License: GNU General Public License v3.0
Bit Board Chess (BBC) - The easiest to understand bitboard chess engine by Code Monkey King
License: GNU General Public License v3.0
Hi Maksim,
First of all, a HUGE THANKS for your code and video tutorials on YouTube. You inspired me to retake my old chess engine Chess0 and include the NNUE evaluation. It has been a success thanks to you and Daniel Shawul.
I'm now trying to optimize the search code, and I'm learning from your code a lot! However, there's one thing I still don't get:
In your search_position, you set a kind of aspiration window (alpha = alpha - 50; beta = beta + 50). If you fall outside and try to do a full search, you tell in your comment that it should be a full-width window at the same depth. However, after doing "continue" in the code below, current_depth gets incremented when starting the loop over (current_depth++).
See code below:
// we fell outside the window, so try again with a full-width window (and the same depth)
if ((score <= alpha) || (score >= beta)) {
alpha = -infinity;
beta = infinity;
// current_depth-- should you add this to search at the same depth??
continue;
}
Thanks again for the excellent video tutorials and taking all the time. I'm sure it has inspire many more people!
Cheers,
--Claudio
Hi Maksym
I was running a test with my engine and noticed a couple of issues. The TC was Blitz 2/6 and BBC started using negative time so Arena aborted. Also sometimes BBC generates a null PV, eg:
2020-09-26 17:50:37.284<--2:info score cp 0 depth 10 nodes 2193409 time 2954 pv
Here is the log from two games:
Cheers, Ian
Thanks so much for the YouTube tutorial. It was a pleasure following it.
One thing I noticed, with the custom eval, given this position:
r4rk1/p1p2ppp/1p1nb3/2p1n3/2P2P1N/BP2P3/P1B3PP/R3K2R b - - 0 1
The engine seems to pick (at any depth) e5c4
If I set the passed pawn bonuses to 0, then it gives more sensible, e5c6;. At the moment,
not sure if its the eval, size of the bonuses, or the search.
Hi Maksim-
Congrats on a fine programming effort and a great engine!
I took the liberty to:
You can find it here:
https://github.com/FireFather/bbc
Just FYI...
This version still has illegal moves in the PV according to cutechess-cli.
However, there were no time forfeits with 1.1 (1.0 had many).
Match results:
Score of BBC-10 vs BBC-11: 27 - 103 - 8 [0.225] 138
... BBC-10 playing White: 15 - 50 - 3 [0.243] 68
... BBC-10 playing Black: 12 - 53 - 5 [0.207] 70
... White vs Black: 68 - 62 - 8 [0.522] 138
Elo difference: -215.2 +/- 68.0, LOS: 0.0 %, DrawRatio: 5.8 %
The eval function crashes repeatedly on BBC Chess Engine v1.3/1.4 with Stockfish NNUE (with the eval file placed under the same directory as the engine), as a result of which the eval score stays at 0.00 and the engine plays randomly).
Chess GUIs/OS platforms used for testing:
Tarrasch v3.13b @Windows 10
JerryFX v4.2.1 @Windows 10
JerryFX v4.2.1 @Linux (OpenSUSE)
Hi Maksim,
There's a small problem with BBC which could cause a problem in some user interfaces, now or in the future.
When the engine is started, it immediately sends "id name", "id author", and "uciok" to the user interface. However, the engine should wait until it receives 'uci' before sending those responses. It does sent them when receiving 'uci', but there may be a user interface that sees "uciok", thinks you're done, and then your engine won't have a name or an author when the GUI loads it.
Just remove sending the commands at startup and everything should be fine.
The move to be played is legal, but sometimes the moves down in the PV apparently are not.
Thank you for sharing your work.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.