Skip to content

kyle-paul/modern-chess-3d

Repository files navigation

Modern 3D Simulated Chess Game, integrated with AI agents.

This is a chess game set in a simulated 3D environment, built on a core foundation of OpenGL. While Vulkan is not currently implemented, it is planned for future updates, as the backend renderer is designed to be agnostic. The game supports two-player mode for human opponents as well as gameplay against AI agents, with three difficulty levels: easy, medium, and hard. Players can move pieces using either the keyboard or direct mouse selection within the 3D scene. Additionally, players can customize the board color, adjust environmental lighting, and modify the camera view to analyze the match from different angles.

Video Demo

Getting Started

Clone the Repository

First, you need to clone the repository and init all git submodules

git clone git@github.com:kyle-paul/modern-chess-3d.git
git submodule update --init --recursive

Build Dependencies

Then, to build the dependencies, you can either manually set up by following the Installation Guide or run this command to automate the process

chmod +x build_dependencies.sh
./build_dependencies.sh

Build the Project

Noew, build the project with CMake. My build environment is on Ubuntu 24.04, Linux.

cmake -B build
cmake --build build --parallel <your-cpu-threads>
./build/chess

Game Controll

Key Action
W Move cursor forward 1 step
A Move cursor left 1 step
S Move cursor backward 1 step
D Move cursor right 1 step
Space Select piece
Move piece
Cancel move
Z Undo last move
R Redo last move

Tasks Completed

  • Added spdlog for debugging the code.
  • Abstracted the window application.
  • Abstracted the camera control.
  • Abstracted the shading program.
  • Abstracted the rendering system (supports multiple backend APIs).
  • Abstracted the VertexArray, VertexBuffer, and IndexBuffer.
  • Abstracted the environment (lighting, background).
  • Abstracted the square on the board, including rotation.
  • Created the game state.
  • Abstracted the mesh loading.
  • Added all chess players to the board and controlled the lighting.
  • Abstracted the game layers (Game → Board → Square → Piece → Grid).
  • Added selection using keyboard events.
  • Abstracted the game rules.
  • Added the feature to select entities by clicking with framebuffer.
  • Added an Undo moves feature using a stack.
  • Added a mode to play against the machine (Minimax).
  • Added UI elements for users.
  • Created an easy mode (random moves).
  • Implemented the Minimax algorithm.
  • Added Alpha-Beta pruning for deeper searches (hard mode).
  • Designed user options (landscape, board color, lighting).
  • Debugged rules for checkmate and stalemate.
  • Added the Redo feature.
  • Added sound effects using OpenAL.
  • Implemented game state serialization and deserialization.
  • Added the File Dialog for file selection.

About

Modern 3D Simulated Chess Game with Agnostic Renderer Backends (OpenGL, Vulkan), integrated with AI agents.

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published