Skip to content

Latest commit

 

History

373 Commits

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Game banner

Duke's Gambit

Version Godot 4 Language Server Docker License: CC BY-NC-SA 4.0

Build Native AI Lint

A 3D chess game with animated piece duels, a native C++ AI, and online multiplayer — built in Godot 4.

Note

Disclaimer: This is an open-source, non-commercial fan game made for satirical and educational purposes. Java is a trademark of Oracle Corporation. This project is not affiliated with, endorsed, or sponsored by Oracle.

📑 Table of contents


In-game screenshot

Duke's Gambit is a fully-featured 3D chess game built in Godot 4. The rules are standard chess — what sets it apart is the presentation: all pieces are fully animated 3D characters from the Java world, the environment is stylised and thematic, and captures play out as short combat sequences rather than a simple disappearance. ♟️

🎬 Gameplay preview (YouTube): Link

Features at a glance:

  • Full chess rule set — en passant, castling, promotion, threefold repetition, 50-move rule
  • Animated 3D piece combat with hit & death effects
  • Local PvP, single-player vs AI, and online multiplayer
  • Stylised visuals with custom shaders, VFX, and a dynamic skybox
  • Fully themed UI with custom fonts, panels, and sound design
  • Game-history export to CSV and full match replay (Settings → Game Replay)

📥 Download & play

➡️ Download the latest release

Duke's Gambit is available on the following platforms:

Platform Format
🪟 Windows .exe installer
🍎 macOS .dmg disk image
🐧 Linux .x86_64 binary
📱 Android .apk package

Download the build for your platform from the GitHub Releases page and run it — no installation required on desktop.

Important

macOS may require step before first launch: The app is not notarized, so macOS will block it by default. After mounting the .dmg and copying the app to your Applications folder, run the following command in Terminal to remove the quarantine flag:

xattr -cr /Applications/DukesGambit.app

Then open the app normally. You only need to do this once.


🎮 Controls

Desktop (PC)

Action Input
Select piece / tile Left mouse click
Rotate camera (orbit) Right mouse drag
Zoom in / out Mouse wheel
Pan camera pivot Middle mouse drag

Mobile (touch)

Action Input
Select piece / tile Tap
Rotate camera (orbit) One-finger drag
Zoom in / out Two-finger pinch

Tip

Camera pan & tilt sensitivity can be adjusted in Settings → Camera.


⚔️ Combat in action

Combat animation — pieces fight and fall

When a piece is captured, it doesn't just disappear. Pieces engage in a brief duel — attack animations play out, the loser staggers and falls to the ground. Every capture tells a story.


💾 Match history & replays

Every finished game can be exported as a CSV history file containing the full move list, capture data, promotions, and per-move timings. You can load that CSV back later and watch the whole match replay in 3D — with all original combat animations, kill cams, and timing preserved.

  • Export — at the end of a match, use the export option in the game-over panel.
  • Replay — open Settings → Game Replay → Load CSV… and pick the file. The match plays back move-by-move, faithfully reproducing the original pacing.

Tip

Replays are great for sharing memorable games — the CSV is portable and the on-disk format stays human-readable.


🤖 AI opponent

AI banner

Duke's Gambit includes a native C++ chess AI built as a GDExtension — it runs directly inside Godot with no external process or network call. The engine is a from-scratch implementation: bitboard move generation, iterative-deepening negamax search, and a tapered PeSTO evaluation function.

Note

The AI source lives in dukes_ai/. It is a standalone C++ project compiled with SCons and loaded by Godot at runtime via the GDExtension API.

Difficulty levels

Level Description
CASUAL Shallow search, limited time budget — great for beginners or a relaxed game.
CHALLENGER Balanced depth and time, puts up a real fight without being overwhelming.
MASTER Uses the full search budget, aspiration windows, and Lazy SMP (up to 4 threads). Tough to beat.

The AI scales its search depth and time limit dynamically based on the selected difficulty and the remaining clock time. It uses a shared transposition table (~16 MiB), null-move pruning, late-move reductions, and a history/killer heuristic for move ordering.


🌐 Online multiplayer

Online banner

You can play Duke's Gambit against other players over the network. The game ships with a dedicated WebSocket server written in Python — source code is in server/.

What the server supports

  • Rooms — create a named room, optionally password-protected, others browse the list and join
  • Color & time control — the host picks their side and the clock setting (e.g. 5+3, 10+0)
  • Authoritative clock — the server tracks both players' remaining time and enforces timeouts
  • Draw offers — offer, accept, or decline a draw mid-game
  • Surrender — resign at any point
  • Graceful reconnect — drop your connection and rejoin within a 30-second window, the game continues
  • Secure by default — WSS (TLS) with an auto-generated self-signed certificate

Note

The server is written in Python 3.12 using asyncio + websockets and validates every move with python-chess. No database, no login — players just pick a nickname and get a signed session token.

Public server

A public server is available — no setup required, just launch the game and connect:

URL duke.sytes.net
Max players 50

Tip

In the game, go to Online → Connect, enter your nickname and paste the URL above.

Run locally

cd server
docker compose up --build -d        # recommended — generates TLS cert automatically

Or without Docker:

cd server
python3 -m venv .venv && source .venv/bin/activate
pip install -r requirements.txt
DUKE_TLS=0 python -m duke_server    # plain WS for local dev

See server/README.md for the full configuration reference, wire protocol, and security notes.


📦 Assets & credits

3D models & art

Sounds

Sound Author Source
Music Suno AI (generated)
Footsteps GiocoSound 421153 · 421152 · 421140
Hit CogFireStudios 547041
Sword Robhog 684749
Death Breviceps 447922
Piece select Vilkas_Sound 707041
Spell LittleRobotSoundFactory 270409
Jump land MentalSanityOff OpenGameArt
Knight attack magnuswaker 524956
Fire loop PhreaKsAccount 46272

📄 License

This project is released under the Creative Commons Attribution-NonCommercial-ShareAlike 4.0 International license.

See the full license text in LICENSE.

Third-party assets (models, sounds, VFX) are subject to their own respective licenses — refer to the Assets & credits section above.


👤 Author

0xM4R71Ngithub.com/0xMartin

About

A 3D chess game with animated piece duels, a native C++ AI, and online multiplayer — built in Godot

Topics

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Sponsor this project

Packages

Contributors

Languages