Chess game banner

Chess game

16 devlogs
43h 21m 21s

A chess game project using C++

This project uses AI

AI was used in some parts of the debugging of the rendering process,a as a support tool. I always studied what it had done in order to understand how it worked and, if necessary, fix any incorrect implementations it had made. It was also used in other parts of the code, but in a measured way, for learning, always understanding what it had done and respecting the limits imposed by the program flavortown
ChatGPT and Claude were used

Demo Repository

Loading README...

Antonio

Shipped this project!

Hours: 43.36
Cookies: 🍪 549
Multiplier: 12.65 cookies/hr

I built a chess game project using C++. SDL3 and miniaudio were used as external library. I have done this project for improving my skill in C++ and I have accomplished what I wanted to do and I’m happy how it came out.
I hope you would like it and appreciate the game in is semplicity!

Antonio

Chess game project completed, fixed en passant bug, the move was incorrectly marked as unavailable when a piece was selected and then deselected. Graphics rendering is now more stable.

Attachment
0
Antonio

Fixed last bugs and added sounds for: when a piece eats another piece, stalemate and draw.
(In the video, the text and the dots indicating where to move are displayed intermittently, but this behavior does not occur during program execution, only in the video)

0
Antonio

I’ve added sounds for moving pieces, sound for the checkmate and I have moved dependence from local to the project folder.
(In the video, the text and the dots indicating where to move are displayed intermittently, but this behavior does not occur during program execution, only in the video)

0
Antonio

I’ve tried unsuccessfully to fix the display of the pawn promotion menu: the board rendering continues to overlap the menu, making it invisible, although it still works. However, I managed to complete the sidebar text, which now works correctly.
(In the video, the text and the dots indicating where to move are displayed intermittently, but this behavior does not occur during program execution, only in the video)

0
Antonio

I underestimated how difficult it would be to implement the sidebar. I’m having trouble implementing the promotion moves, especially since I found a bug where the black queen is interpreted as a king when it eats, I can’t seem to get to the source. I slightly enlarged the sidebar and decreased the font size to allow the text to fit within the sidebar, and I found the sounds to add to the project.
(In the video, the text and the dots indicating where to move are displayed intermittently, but this behavior does not occur during program execution, only in the video)

0
Antonio

Continued with the implementation of moves in the sidebar, most of the played moves are displayed correctly. Some displayed position of moves need to be fixed, need to add sound to action and movements and other small changes to do and it will be officially completed.
(In the video, the text and the dots indicating where to move are displayed intermittently, but this behavior does not occur during program execution, only in the video)

2

Comments

Raqeeb
Raqeeb about 1 month ago

cool!

Antonio
Antonio about 1 month ago

thank you!

Antonio

Added visual feedback to make moves clearer. It’s already considered ready, but I still want to add sounds and modify/add another feature.
Almost finished :)

1

Comments

Antonio
Antonio about 2 months ago

I’m just noticing that the squares that are supposed to indicate where the pieces can move are flashing. This wasn’t happening during testing, and it’s a recording issue, not a program issue.

Antonio

I’ve implemented checkmate and stalemate, fixed the pawn generation method, and fixed the castling system, which was incorrect. I haven’t yet added visual feedback to clarify the situations occurring in the game, so for now, checkmate and stalemate will be printed via the console.
To demonstrate how a stalemate works, I used the example of Samuel Loyd, who managed to find the fastest stalemate sequence in chess.

2

Comments

Saif
Saif about 2 months ago

This is pretty cool, I love chess so I’d love to try this out when you finish it!

Antonio
Antonio about 2 months ago

Thank you for the comment, I approciate!. The project will not take long, I have in program to improve the user experience, to improve what’s to improve and to clean the code

Antonio

I’ve finally solved the movement problem for the rook, bishop, and queen. Initially, I tried integrating their movements with the check code, but it just wouldn’t work. After several implementation attempts, I decided to modify (again) the movement generation for the rook and bishop, which I’d initially been unable to implement. Taking a different approach than I’d initially tried, their implementation turned out to be easier than expected. I later got everything working correctly, and now all the pieces correctly check the king
(the video doesn’t show it well but pieces are actually blocked from moving when king is in check. working on making it recognizable)

0
Antonio

I started implementing check and checkmate, but didn’t complete it as I ran into problems getting it recognized by bishop, rook, and queen. In the meantime, I did a little code cleanup

(the video doesn’t show it well but pieces are actually blocked from moving when king is in check. I will add visual feedback later to make this more obvious to players)

0
Antonio

Added castling, a special move that allows the king and rook to move simultaneously. Fixed white king and white queen being swapped (stupid mistake), now only check and checkmate remains to implement, almost finished :)

0
Antonio

I added the en passant move, a special move that occur when a pawn makes its initial 2-square move and ends up side by side with an opponent’s pawn, which then has the opportunity to capture it on the next turn

0
Antonio

I have debugged the rook’s movement logic, as it had the same issue as the bishop and not all valid moves were being allowed. I fixed the issue by reusing the bishop’s logic and adapting it with the necessary changes to correctly validate the rook’s moves.

0
Antonio

I debugged the bishop’s movement because not all valid moves could be played. I spent the first part of my time looking at the code to figure out where the problem was, which later turned out to be the wrong move control. I later fixed the problem by completely changing the logic on the bishop’s validation moves.

0
Antonio

I continued implementing the pawn promotion feature I started in the past. Now pawns that reach the end of the board can be promoted.

0
Antonio

I’m working on my first project! This is so exciting. I can’t wait to share more updates as I build.

Attachment
0