https://github.com/stefansalewski/bevy-3d-chess
Rust 3D Chess with the Bevy Engine
https://github.com/stefansalewski/bevy-3d-chess
Last synced: 28 days ago
JSON representation
Rust 3D Chess with the Bevy Engine
- Host: GitHub
- URL: https://github.com/stefansalewski/bevy-3d-chess
- Owner: StefanSalewski
- License: mit
- Created: 2024-10-08T17:01:14.000Z (12 months ago)
- Default Branch: main
- Last Pushed: 2025-08-15T09:32:12.000Z (about 2 months ago)
- Last Synced: 2025-08-15T11:26:06.172Z (about 2 months ago)
- Language: Rust
- Size: 15.3 MB
- Stars: 5
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# Bevy 3D Chess

**Version:** 0.2 — *15 August 2025*
**Author:** Dr. Stefan Salewski
**License:** See source file headers for attribution of 3D models.A **plain Bevy 0.16.1 front end** for the **tiny Salewski chess engine**, featuring:
* **Fully 3D chessboard and pieces**
* **Mouse-based camera control** (orbit, pan, zoom) via \[bevy\_panorbit\_camera]
* **Piece hover highlights** — pieces change color when the mouse is over them
* **Legal move highlights** — click a piece to show all valid destination squares
* **Last move highlights** — marks both source and destination squares after each move
* **Basic UI overlay** with help text, turn info, time control, and next player
* **Engine integration** — supports human vs. computer play with configurable time per move---
## 📦 Requirements
* Rust 1.78+ (2024 edition)
* Bevy 0.16.1---
## 🔧 Build & Run
```bash
git clone https://github.com/stefansalewski/Bevy-3D-Chess.git
cd Bevy-3D-Chess
RUST_LOG=off cargo run
```---
## 🎮 Controls
* **Left-click** — Select a piece, then click a destination square
* **Middle mouse** — Rotate/orbit camera
* **Right-click** — Pan camera
* **Mouse wheel** — Zoom in/out
* **Keypad 1 / 2** — Toggle human/computer control for each side
* **Keypad +/-** — Adjust engine move time
* **Keypad 0** — Start a new game
* **M** — Print move list to console (initially for engine debugging)---
## 🎨 Graphics
The chess pieces were created in Blender by **Bhargav Limje** and are licensed under [Creative Commons Attribution](http://creativecommons.org/licenses/by/4.0/).
Board asset: [Wooden Chess Board](https://skfb.ly/oXqwI).---
## ⚠ Known Limitations
* Highlight cache is simplified — highlighted materials are recreated instead of fully reusing precomputed variants
* Hover highlighting for pieces works, but **legal move square highlights disappear** when moving the mouse after selection *(planned fix)*
* No coordinate labels, arrows, or other board annotations yet *(future feature)*---
## 📦 Model Credits
Models are loaded from `.glb` assets under Creative Commons licenses:
* **"Chess Scene Pieces / Blender"** — [moyicat](https://skfb.ly/67OF8)
* **"Realistic 3D Chess Pieces (Blender)"** — [ronildo.facanha](https://skfb.ly/oXTUP)
* **"Chess"** — [xnicrox](https://skfb.ly/6uVLu)
* **"Wooden Chess Board"** — [Bhargav Limje](https://skfb.ly/oXqwI)---
## 📜 Project Status
Bevy 3D Chess started as a Bevy learning exercise — originally built for Bevy 0.14 and now updated to **Bevy 0.16.1**.
The GUI code borrows heavily from Bevy example projects. GPT-5 assisted in updating the code and implementing highlight effects for both squares and pieces.---
## 🔀 Alternative Implementations
The same chess engine code is also available with:
* **Egui UI** — [tiny-chess](https://github.com/StefanSalewski/tiny-chess)
* **Xilem UI** — [xilem-chess](https://github.com/StefanSalewski/xilem-chess)Older Nim, GTK, and blocking Egui versions are now deprecated and will be removed.
---
## 💬 Feedback
This is an **intermediate release**. Feedback from the Bevy community is especially welcome on:
* Efficient material handling for hover/selection highlights
* ECS patterns for updating squares and pieces
* UI enhancements for move history, timers, and game state---