Skip to content

coleyrockin/Chess-Game

Neon City Chess

Python TypeScript ModernGL Babylon.js Vite License

A cinematic, neon-cyberpunk two-player chess game available as both a desktop OpenGL app and a browser WebGPU/WebGL app, with a future Unreal Engine 5 integration in progress.


Features

  • Shader-driven 3D rendering — PBR materials, bloom, fog, shadow maps, and a neon skybox
  • Automatic turn camera — camera transitions side-to-side each turn; no manual controls needed
  • Full chess rule set — legal move validation, check/checkmate/stalemate, en passant, castling, and auto-promotion
  • Live material score — piece advantage evaluation displayed in the HUD (P=1, N=3, B=3, R=5, Q=9)
  • Safe 2D fallback — browser renderer degrades to a canvas 2D board when WebGPU/WebGL are unavailable
  • WebGPU-first browser build — targets WebGPU where supported, falls back to WebGL 2 then WebGL 1

Tech Stack

Layer Desktop Browser
Language Python 3.9+ TypeScript
Renderer ModernGL (OpenGL 3.3 Core) Babylon.js (WebGPU / WebGL)
Chess logic python-chess chess.js
Window / input GLFW Browser DOM
Build tool Vite
Math NumPy + Pyrr Babylon.js built-ins

Getting Started

Browser (Recommended)

Requirements: Node.js 20+

cd web-chess
npm install
npm run dev

Open the printed local URL (default http://localhost:5173). To create a production build:

npm run build    # outputs to web-chess/dist/

Desktop Python

Requirements: Python 3.9+ and an OpenGL 3.3+ compatible GPU/driver

python3 -m venv .venv
source .venv/bin/activate
python -m pip install --upgrade pip
pip install -r requirements.txt
python main.py

Or use the convenience script: ./first_launch.sh

Headless / CI environments — The desktop build requires a display. Set NEON_CHESS_SKIP_GLFW_PROBE=1 to bypass the startup preflight, or use the browser build instead.

Controls

Action Desktop Browser
Select a piece Left click Left click
Move to a highlighted square Left click Left click
Reset board R R or Reset button
Start new game N or New Game button
Toggle fullscreen F
Quit Esc

Project Structure

Chess-Game/
├── engine/            # Python rendering systems (camera, lighting, fog, post FX, GLSL shaders)
├── game_core/         # Python chess game state and piece scoring
├── web-chess/         # Browser client — TypeScript + Babylon.js
│   ├── src/           # Application source (scene, controllers, coordinates)
│   ├── public/        # Static assets (textures, HDR environment maps)
│   └── scripts/       # Development / automation scripts
├── unreal/            # Unreal Engine 5 integration and handoff files
├── docs/              # Supplementary technical documentation
├── main.py            # Desktop Python entry point
└── requirements.txt   # Python dependencies

Development Notes

  • The camera is game-directed and side-aware to keep each player oriented
  • Desktop runs in windowed mode by default; resize freely
  • Browser build targets WebGPU when available and falls back to WebGL 2, then WebGL 1
  • Quality CI runs on every push and pull request
  • Dependabot is configured for GitHub Actions, Python dependencies, and npm packages

Future Improvements

See ROADMAP.md for planned features including an AI opponent, online multiplayer, move history panel, and Unreal Engine 5 playable build.

Contributing

See CONTRIBUTING.md.

License

MIT License — see LICENSE.


Built with Python, TypeScript, ModernGL, and Babylon.js.

About

Neon City Chess: cinematic two-player chess with Python ModernGL desktop and TypeScript Babylon browser builds.

Topics

Resources

License

Code of conduct

Contributing

Security policy

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors