Coder Social home page Coder Social logo

bdmendes / camel Goto Github PK

View Code? Open in Web Editor NEW
22.0 22.0 0.0 32.51 MB

Bitboard-based UCI-compatible chess/chess960 engine written from scratch in Rust.

Home Page: https://lichess.org/@/camel_bot

License: GNU General Public License v3.0

Rust 97.50% Shell 2.50%
bitboard chess chess-engine uci-protocol

camel's Introduction

About me

  • ๐Ÿ‘จโ€๐Ÿ’ผ Software Engineer @ Kevel
  • ๐Ÿ“– FEUP Alumni
  • ๐ŸŽฒ Club chess player

camel's People

Contributors

bdmendes avatar dependabot[bot] avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar

camel's Issues

Camel v1.2.0 outperforms v1.3.0 in puzzle

Lately i gave this position to several engines. Camel v1.2.0 finds the solution Rd1 at depth 9 after 2 seconds, but v1.3.0 finds it only at depth 28 after 100 seconds !?

White to move.

position_white-to-move-solution-Rd1

7Q/p2r4/kp6/4Bp2/P3b3/KP1q4/8/2R5 w - - 0 1

Opening book

hi, i just discovered your engine by the Public download list at https://drive.google.com/drive/folders/1vmtiWtIZoBDqkarEm1_rLT9_l0eq0qr3 .. i managed to compile v0.3.1 on Xubuntu 22.04 and it runs fine in CuteChess (GUI) !

however, Camel does not seem to know how to play the opening : it likes to develop the Queens kNight to c3 / c6 very early in the opening, it often just starts with that move, and this is a difficult setup : it's playable, but the move blocks the c-pawn and the kNight can easily be kicked to other squares, none of which are safe .. the kNight might be captured .. if not, Camel will get a bad position where all pieces are disharmonious ..

this might sound harsh, but i'm a chess player myself .. and i gather and test many chess engines (only on Linux) also weaker ones, and i know many such engines have the same habbit : their pawn-piece setup is bad, the Queens kNight should not be developed that way .. normally .. it CAN be played (SF knows how), it's a known opening, but rare and you must know how to put the (other) pieces ..

here's a game of Camel playing Black :

LiChess-game-animation-oflxr8m7

i'm a programmer, but not yet of any engine .. i don't know how you can improve Camel with my information .. but maybe when NOT playing Nc3 / Nc6 early, Camel can play a decent game ?

handle negative time

while playing a game with Camel v1.5.0 (compiled on Xubuntu 22.04) it received an "invalid command" and lost .. this was due to negative remaining time of the opponent, being a human : CuteChess allows negative time for humans. You probably didn't know this fact about CuteChess .. i guess you can easily adjust the concerning code part to anticipate this "behaviour".
NOTE: whenever an engine runs out of time, CuteChess ends the game after 15 seconds.

invalid-command-negative-time

here's the CuteChess log tail :

[...]
<Camel v1.5.0(0): info depth 12 score cp 143 time 973 nodes 833005 nps 856035 hashfull 492 pv d5b3 g8f6 f1e1 e7e6 d1d3 e8g8 c1e3 b8d7 b1c3 c8b7 e4e5 d6e5
<Camel v1.5.0(0): info depth 13 score cp 143 time 1446 nodes 1278642 nps 883673 hashfull 508 pv d5b3 g8f6 f1e1 e7e6 d1d3 e8g8 c1e3 b8d7 b1c3 c8b7 e4e5 d6e5 d4e5
<Camel v1.5.0(0): bestmove d5b3 ponder g8f6
>Camel v1.5.0(0): position startpos moves g1f3 g7g6 d2d4 f8g7 e2e4 d7d6 f1c4 a7a6 e1g1 b7b5 c4d5 c7c6 d5b3 c8b7
>Camel v1.5.0(0): isready
<Camel v1.5.0(0): readyok
>Camel v1.5.0(0): go wtime 165661 btime -170671 winc 2000 binc 2000
<Camel v1.5.0(0): Invalid command. Type 'help' to know more.
>Camel v1.5.0(0): stop

Camel v1.1.0 can not mate

i just let Camel v1.1.0 (compiled on Xubuntu 22.04) play a game in CuteChess .. the engine was clearly winning but it could not mate ..

in this position Camel (Black) promoted to a Queen, but the game ended in a draw by repetition :

came-110-can-not-win


[Event "engine vs engine"]
[Site "Holland"]
[Date "2023.09.12"]
[Round "?"]
[White "Tofiks v1.1.0"]
[Black "Camel v1.1.0"]
[Result "1/2-1/2"]
[FEN "rnbqkbnr/pppp1ppp/8/4p3/8/3P2P1/PPP1PP1P/RNBQKBNR b KQkq - 0 2"]
[GameDuration "00:21:57"]
[PlyCount "208"]
[SetUp "1"]
[TimeControl "180+10"]

1... d5 {+0.73/9 8.5s} 2. Bg2 {-0.37/9 13s} Nf6 {+0.77/9 11s}
3. Nf3 {-0.23/9 13s} Nc6 {+0.84/9 9.3s} 4. O-O {-0.04/9 13s} Bf5 {+0.71/9 13s}
5. e3 {-0.14/8 13s} Bd6 {+0.64/8 13s} 6. Nc3 {-0.08/9 13s} Bb4 {+0.57/8 10s}
7. a3 {-0.04/8 13s} Bxc3 {+0.73/10 14s} 8. bxc3 {+0.15/10 13s} O-O {+0.69/8 14s}
9. Bb2 {+0.40/9 13s} Re8 {+0.80/9 14s} 10. h3 {+0.57/10 13s} Qd6 {+0.77/9 11s}
11. Nd2 {+0.46/9 13s} e4 {+0.80/8 14s} 12. c4 {+0.92/9 13s} exd3 {+0.38/9 15s}
13. cxd5 {+1.17/9 13s} Ne5 {-0.04/9 15s} 14. c4 {+1.33/8 14s} Qa6 {+0.26/8 12s}
15. Bd4 {+1.44/8 14s} Re7 {+0.14/8 14s} 16. f4 {+1.58/8 14s} Nxc4 {+0.43/10 17s}
17. Nxc4 {-0.05/10 14s} Qxc4 {+0.44/10 17s} 18. Rb1 {-0.05/9 14s}
Rd8 {+0.57/8 17s} 19. g4 {+0.62/9 14s} Bc8 {+0.05/9 17s} 20. Qb3 {+0.34/9 14s}
Qxb3 {+0.31/10 11s} 21. Rxb3 {+0.10/11 14s} b6 {+0.27/10 17s}
22. Bxf6 {+0.24/11 14s} gxf6 {+0.17/11 16s} 23. e4 {+0.04/11 14s}
Ba6 {+0.24/11 16s} 24. Rd1 {+0.19/11 15s} Bc4 {+0.22/12 13s}
25. Rc3 {+0.19/12 15s} b5 {+0.23/12 15s} 26. a4 {-0.06/12 15s} a6 {+0.23/12 14s}
27. axb5 {0.00/12 15s} axb5 {+0.24/11 9.8s} 28. Bf3 {-0.10/12 15s}
Ra8 {+0.28/10 14s} 29. f5 {-0.05/11 15s} Ree8 {+0.34/11 14s}
30. Kf2 {-0.02/12 15s} Ra4 {+0.25/10 13s} 31. h4 {+0.04/11 14s}
Kf8 {+0.23/9 14s} 32. Rd2 {+0.08/12 14s} h6 {+0.23/10 14s}
33. Rc1 {+0.05/12 14s} Ke7 {+0.31/11 14s} 34. Rf1 {+0.12/11 13s}
b4 {+0.49/12 13s} 35. Rc1 {+0.16/11 13s} b3 {+0.53/11 11s}
36. Kg3 {+0.09/11 13s} Kd6 {+0.72/10 12s} 37. Rg2 {+0.19/10 12s}
Rb8 {+0.86/11 15s} 38. Rb1 {-0.05/11 12s} Ra2 {+0.93/11 13s}
39. Rbb2 {-0.14/11 12s} Ke5 {+1.18/12 15s} 40. h5 {-0.83/13 12s}
Kd4 {+3.67/12 12s} 41. d6 {-1.33/13 12s} cxd6 {+4.83/12 14s}
42. g5 {-4.15/12 12s} fxg5 {+5.91/11 7.2s} 43. e5 {-6.58/13 11s}
dxe5 {+8.50/11 9.3s} 44. f6 {-8.72/12 11s} Kc3 {+8.50/11 14s}
45. Rb1 {-9.28/13 11s} Rxg2+ {+9.44/12 14s} 46. Bxg2 {-9.78/12 11s}
b2 {+11.15/13 14s} 47. Be4 {-12.38/16 11s} Ba2 {+11.36/13 13s}
48. Rxb2 {-12.94/15 11s} Rxb2 {+14.89/13 8.4s} 49. Bf3 {-15.09/16 11s}
Re2 {+16.09/13 13s} 50. Bg4 {-23.35/17 11s} Bc4 {+M13/13 10s}
51. Bd7 {-23.35/16 11s} d2 {+M9/9 0.19s} 52. Kh3 {0.00/15 11s}
d1=Q {+M1/1 0.013s} 53. Bc6 {-M4/3 0.003s} Qd3+ {+M1/1 0.012s}
54. Bf3 {-M4/1 0s} Qd1 {+M1/1 0.010s} 55. Bg2 {-M26/5 0.015s} Qa1 {+M1/1 0.012s}
56. Kg3 {-M6/5 0.011s} Rxg2+ {+M1/1 0.012s} 57. Kxg2 {-M26/3 0.001s}
Qb2+ {+M1/1 0.013s} 58. Kg3 {-M6/5 0.017s} Qc2 {+M1/1 0.013s}
59. Kg4 {-M6/5 0.009s} Qe4+ {+M1/1 0.012s} 60. Kg3 {-M10/1 0s}
Qh4+ {+M1/1 0.012s} 61. Kg2 {-M22/5 0.020s} Be2 {+M1/1 0.012s}
62. Kg1 {-M4/3 0s} Bf3 {+M1/1 0.013s} 63. Kf1 {-M6/5 0.006s} Kd2 {+M1/1 0.014s}
64. Kg1 {-M4/3 0s} Kc2 {+M1/1 0.013s} 65. Kf1 {-M6/3 0.001s} Bg4 {+M3/3 0.036s}
66. Kg2 {-M8/6 0.014s} Kc3 {+M1/1 0.012s} 67. Kf1 {-M10/3 0.001s}
Bd1 {+M1/1 0.013s} 68. Kg1 {-M8/3 0.001s} Be2 {+M1/2 0.025s} 69. Kg2 {-M12/3 0s}
Qd4 {+M1/1 0.012s} 70. Kh3 {-M14/3 0.001s} Qh4+ {+M1/1 0.012s}
71. Kg2 {-M12/1 0s} Qg4+ {+M1/2 0.026s} 72. Kh2 {-M12/4 0.009s}
Qf3 {+M1/1 0.012s} 73. Kg1 {-M8/2 0s} Bc4 {+M1/1 0.013s} 74. Kh2 {-M18/2 0s}
Qe4 {+M1/1 0.013s} 75. Kg1 {-M20/3 0.001s} Qe3+ {+M1/1 0.013s}
76. Kg2 {-M22/3 0.002s} Qe1 {+M1/1 0.012s} 77. Kf3 {-M30/3 0.001s}
Qe2+ {+M1/1 0.012s} 78. Kg3 {-M8/2 0s} Kd2 {+M1/1 0.012s} 79. Kh3 {-M14/2 0s}
Kc3 {+M1/1 0.012s} 80. Kg3 {-M8/2 0s} Qd3+ {+M1/1 0.012s}
81. Kf2 {-M26/2 0.001s} Qc2+ {+M1/1 0.013s} 82. Kg1 {-M26/2 0s}
Qe4 {+M1/1 0.011s} 83. Kf2 {-M24/2 0s} Qh4+ {+M1/1 0.012s} 84. Kg2 {-M22/2 0s}
Qd4 {+M1/1 0.013s} 85. Kh3 {-M26/3 0.001s} Qd3+ {+M1/1 0.012s}
86. Kg2 {-M24/2 0s} Qc2+ {+M1/2 0.032s} 87. Kg1 {-M26/1 0s} Qd2 {+M1/1 0.013s}
88. Kh1 {-M24/3 0s} Qe1+ {+M1/1 0.016s} 89. Kg2 {-M20/2 0s} Kd2 {+M1/1 0.013s}
90. Kh3 {-M12/4 0.004s} Qf2 {+M1/1 0.012s} 91. Kg4 {-M2/2 0s}
Be2+ {+M1/1 0.012s} 92. Kh3 {-M2/1 0s} Qh4+ {+M1/1 0.012s}
93. Kg2 {-M6/2 0.001s} Kc3 {+M3/3 0.036s} 94. Kg1 {-M8/2 0s} Bb5 {+M1/1 0.012s}
95. Kg2 {-M18/6 0.017s} Bc4 {+M1/2 0.022s} 96. Kf3 {-M18/2 0s}
Kd2 {+M1/1 0.012s} 97. Kg2 {-M14/3 0s} Kc3 {+M3/3 0.035s} 98. Kf3 {-M18/2 0s}
Qe1 {+M1/1 0.012s} 99. Kg2 {-M22/2 0s} Qe4+ {+M1/1 0.012s} 100. Kh3 {-M30/1 0s}
Qc2 {+M1/1 0.012s} 101. Kg3 {-M28/2 0s} Be6 {+M1/1 0.012s}
102. Kf3 {-M6/4 0.002s} Bc4 {+M1/1 0.014s} 103. Kg3 {-M30/2 0s}
Qe2 {+M1/1 0.013s} 104. Kh3 {-M6/2 0s} Qe1 {+M1/1 0.012s}
105. Kg2 {0.00/50 0.001s, Draw by 3-fold repetition} 1/2-1/2

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.