{"id":49587648,"url":"https://github.com/dadavidtseng/daemonchess","last_synced_at":"2026-05-03T23:06:45.141Z","repository":{"id":296765707,"uuid":"994411246","full_name":"dadavidtseng/DaemonChess","owner":"dadavidtseng","description":"DaemonChess is a sophisticated turn-based 3D chess simulator built with modern graphics technology and the custom Daemon Engine.","archived":false,"fork":false,"pushed_at":"2026-04-05T19:51:51.000Z","size":133097,"stargazers_count":1,"open_issues_count":8,"forks_count":0,"subscribers_count":0,"default_branch":"main","last_synced_at":"2026-04-05T21:28:33.914Z","etag":null,"topics":["blinn-phong","chess","cpp","dx11","obj","obj-format","obj-loader","tcp","turn-based-game"],"latest_commit_sha":null,"homepage":"","language":"C++","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/dadavidtseng.png","metadata":{"files":{"readme":"Docs/README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2025-06-01T21:51:47.000Z","updated_at":"2026-04-05T19:51:55.000Z","dependencies_parsed_at":"2025-06-02T07:38:25.383Z","dependency_job_id":"54a04314-306e-4ce9-918a-00200657734c","html_url":"https://github.com/dadavidtseng/DaemonChess","commit_stats":null,"previous_names":["dadavidtseng/chesssimulator"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/dadavidtseng/DaemonChess","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dadavidtseng%2FDaemonChess","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dadavidtseng%2FDaemonChess/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dadavidtseng%2FDaemonChess/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dadavidtseng%2FDaemonChess/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/dadavidtseng","download_url":"https://codeload.github.com/dadavidtseng/DaemonChess/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dadavidtseng%2FDaemonChess/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":32587829,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-05-03T22:12:39.696Z","status":"ssl_error","status_checked_at":"2026-05-03T22:09:10.534Z","response_time":103,"last_error":"SSL_read: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["blinn-phong","chess","cpp","dx11","obj","obj-format","obj-loader","tcp","turn-based-game"],"created_at":"2026-05-03T23:06:44.069Z","updated_at":"2026-05-03T23:06:45.124Z","avatar_url":"https://github.com/dadavidtseng.png","language":"C++","funding_links":[],"categories":[],"sub_categories":[],"readme":"\u003ca id=\"readme-top\"\u003e\u003c/a\u003e\n\n\u003c!-- PROJECT SHIELDS --\u003e\n[![Contributors][contributors-shield]][contributors-url]\n[![Forks][forks-shield]][forks-url]\n[![Stargazers][stars-shield]][stars-url]\n[![Issues][issues-shield]][issues-url]\n[![Apache 2.0 License][license-shield]][license-url]\n[![LinkedIn][linkedin-shield]][linkedin-url]\n\n\u003c!-- PROJECT TITLE --\u003e\n\u003cdiv align=\"center\"\u003e\n  \u003ch1\u003eDaemon Chess\u003c/h1\u003e\n  \u003cp\u003eA 3D chess game with procedural piece geometry, Blinn-Phong shading, and raycast-based interaction\u003c/p\u003e\n\u003c/div\u003e\n\n\u003c!-- TODO: Replace with actual gameplay GIF or screenshot --\u003e\n\u003c!-- \u003cdiv align=\"center\"\u003e\n  \u003cimg src=\"docs/images/demo.gif\" alt=\"Daemon Chess Gameplay\" width=\"720\"\u003e\n\u003c/div\u003e --\u003e\n\n\u003c!-- TECH STACK BADGES --\u003e\n![C++](https://img.shields.io/badge/C%2B%2B-20-00599C?style=for-the-badge\u0026logo=cplusplus\u0026logoColor=white)\n![DirectX](https://img.shields.io/badge/DirectX-11-107C10?style=for-the-badge\u0026logo=xbox\u0026logoColor=white)\n![FMOD](https://img.shields.io/badge/FMOD-000000?style=for-the-badge\u0026logo=fmod\u0026logoColor=white)\n![Windows](https://img.shields.io/badge/Windows-0078D6?style=for-the-badge\u0026logo=windows\u0026logoColor=white)\n\n## Table of Contents\n\n- [Overview](#overview)\n- [Features](#features)\n- [How to Install](#how-to-install)\n- [How to Use](#how-to-use)\n- [Project Structure](#project-structure)\n- [Future Roadmap](#future-roadmap)\n- [Acknowledgements](#acknowledgements)\n- [License](#license)\n- [Contact](#contact)\n\n---\n\n## Overview\n\nDaemon Chess is a 3D chess game where every piece is procedurally constructed from geometric primitives — spheres, cylinders, AABB3s, and OBB3s — defined in XML and rendered with Blinn-Phong shading (diffuse, normal, and specular/gloss/emit maps). Players interact with the board through a free-fly 3D camera: look at a piece or square, click to select, then click a valid destination to move. A ghost piece preview shows where the piece will land before committing.\n\nThe game implements a complete chess rule engine covering all standard moves — pawn double-step, en passant, castling (kingside and queenside), pawn promotion, path blocking, and the king adjacency rule. Captured pieces play a sinking animation before removal, and pieces smoothly interpolate to their target positions with a knight-specific hop arc.\n\nBuilt on a custom [Daemon Engine](https://github.com/dadavidtseng/Engine) providing DirectX 11 rendering, FMOD audio, a developer console with V8 JavaScript integration, and a resource system with OBJ model loading.\n\n## Features\n\n- [Complete Chess Rule Engine](#complete-chess-rule-engine)\n- [3D Procedural Piece Geometry](#3d-procedural-piece-geometry)\n- [Raycast-Based Interaction](#raycast-based-interaction)\n- [Animated Piece Movement \u0026 Capture](#animated-piece-movement--capture)\n\n---\n\n### Complete Chess Rule Engine\n\nThe Match class validates every move through a multi-step pipeline: coordinate bounds → piece existence → ownership check → zero-distance check → destination occupancy → piece-specific movement rules → path clearance → king adjacency rule → move type determination.\n\nSupported move types:\n\n| Move Type | Validation |\n|-----------|------------|\n| Normal move | Per-piece shape rules (rook: orthogonal, bishop: diagonal, etc.) |\n| Capture | Destination occupied by opponent piece |\n| En passant | Last move was a 2-square pawn advance to adjacent file |\n| Pawn promotion | Pawn reaches 8th rank; promotes to queen, rook, bishop, or knight |\n| Kingside castling | King and rook unmoved, path clear, no check traversal |\n| Queenside castling | Same rules, opposite side |\n| King adjacency | Kings cannot move to squares adjacent to the enemy king |\n\nAll move results are enumerated in `eMoveResult` with 20+ distinct states for precise error reporting via the developer console.\n\n\u003c!-- ![Rules](docs/images/feature-rules.png) --\u003e\n\n### 3D Procedural Piece Geometry\n\nEach piece type is defined in `PieceDefinition.xml` as a composition of geometric primitives:\n\n- **Pawn** — sphere cap + 3 stacked cylinders\n- **Bishop** — small sphere tip + sphere head + 3 cylinders\n- **Knight** — 2 oriented OBB3s (head/neck) + AABB3 body + cylinder base\n- **Rook** — 2 AABB3s (battlements/tower) + AABB3 body + cylinder base\n- **Queen** — 4 rotated OBB3 crown points + 3 cylinders\n- **King** — sphere + 2 cross OBB3s + 3 cylinders\n\nAll pieces use Blinn-Phong shading with diffuse, normal, and specular/gloss/emit texture maps. Two mesh variants are generated per piece type (one per player side) via `CreateMeshByID`.\n\n\u003c!-- ![Pieces](docs/images/feature-pieces.png) --\u003e\n\n### Raycast-Based Interaction\n\nInstead of a 2D cursor on a flat board, players aim a 3D camera ray to interact:\n\n1. The camera's forward vector casts a ray into the scene\n2. The ray tests against AABB3 volumes (board squares, 0.2 unit height) and CylinderZ3D volumes (pieces, 0.25 radius × 1.0 height)\n3. The closest hit determines the highlighted element\n4. Left-click selects; a second left-click on a valid target executes the move\n5. Right-click cancels selection\n\nWhen a piece is selected and the ray hits a valid destination, a ghost piece renders at the target position (slightly elevated to avoid z-fighting), giving visual feedback before committing.\n\n\u003c!-- ![Raycast](docs/images/feature-raycast.png) --\u003e\n\n### Animated Piece Movement \u0026 Capture\n\nPieces don't teleport — they smoothly interpolate from source to destination over 2 seconds:\n\n- **Standard pieces** — linear position interpolation via `UpdatePositionByCoords`\n- **Knights** — parabolic hop arc via `CalculateKnightHopPosition`\n- **Captured pieces** — a sinking animation plays for 2 seconds (`StartCaptureAnimation`), then the piece is removed via the `PendingRemoval` queue\n\nThe delayed removal system (`SchedulePieceForRemoval` → `UpdatePendingRemovals`) ensures the capture animation completes before cleanup. If a king is captured, the game transitions to the FINISHED state.\n\n\u003c!-- ![Animation](docs/images/feature-animation.png) --\u003e\n\n---\n\n## How to Install\n\n### Prerequisites\n\n- Visual Studio 2022 (or 2019) with C++ desktop development workload\n- Windows 10/11 (x64)\n- DirectX 11 compatible GPU\n- [Daemon Engine](https://github.com/dadavidtseng/Engine) cloned as a sibling directory\n\n### Installation\n\n```bash\n# Clone both repos side by side\ngit clone https://github.com/dadavidtseng/Engine.git\ngit clone https://github.com/dadavidtseng/DaemonChess.git\n\n# Directory layout should be:\n# ├── Engine/\n# └── DaemonChess/\n```\n\n1. Open `DaemonChess.sln` in Visual Studio\n2. Set configuration to `Debug | x64`\n3. Build the solution (the Engine project is referenced automatically)\n4. The executable is deployed to `Run/` via post-build event\n\n## How to Use\n\n### Controls\n\n| Action | Key |\n|--------|-----|\n| Move camera | W / A / S / D / Q / E |\n| Look | Mouse |\n| Select piece / Execute move | Left Mouse Button |\n| Cancel selection | Right Mouse Button |\n| Toggle fixed / free camera | F4 |\n| Fullscreen | Numpad 0 |\n| Windowed | Numpad 1 |\n| Cheat mode (teleport) | Ctrl (hold) |\n\n### Debug Controls\n\n| Action | Key |\n|--------|-----|\n| Developer console | ~ |\n| Pause / Unpause | P |\n| Step single frame | O |\n| Slow-mo (0.1×) | T (hold) |\n| Cycle render mode forward | F7 |\n| Cycle render mode backward | F6 |\n| Adjust sun direction | F2 / F3 |\n\n### Console Commands\n\nMoves can also be entered via the developer console:\n\n```\nChessMove from=e2 to=e4              # Normal move\nChessMove from=e7 to=e8 promoteTo=queen  # Pawn promotion\nChessMove from=e1 to=g1              # Kingside castling\n```\n\n### Game Flow\n\n1. **Attract Mode** — Title screen; press Space to start a match\n2. **Match** — Turn-based chess; Player 0 (white) moves first, then Player 1 (black)\n3. **Finished** — Triggered when a king is captured; press ESC to return to Attract\n\n### Running\n\nLaunch `Run/DaemonChess_Debug_x64.exe` from the `Run/` directory (working directory must be `Run/` for asset loading).\n\n## Project Structure\n\n```\nDaemonChess/\n├── Code/Game/\n│   ├── Definition/                    # Data-driven definitions\n│   │   ├── PieceDefinition            # Piece geometry, textures, shaders (XML-loaded)\n│   │   └── BoardDefinition            # Board layout, square info, piece placement\n│   ├── Framework/                     # Application framework\n│   │   ├── Main_Windows.cpp           # WinMain entry point\n│   │   ├── App                        # Application lifecycle\n│   │   ├── GameCommon                 # Global pointers, debug draw helpers\n│   │   ├── Controller                 # Base controller (camera, viewport, position)\n│   │   ├── PlayerController           # Free-fly camera, keyboard/mouse input\n│   │   ├── AIController               # AI controller (stub)\n│   │   └── MatchCommon                # Move result enums, raycast structs, piece move records\n│   ├── Gameplay/                      # Core game logic\n│   │   ├── Game                       # State machine (Attract → Match → Finished), player management\n│   │   ├── Match                      # Chess rule engine, move validation, execution, event handling\n│   │   ├── Board                      # 8×8 grid, square info, coordinate conversion, rendering\n│   │   ├── Piece                      # Piece entity with animation, selection, capture states\n│   │   └── Actor                      # Base class (position, orientation, color)\n│   └── Subsystem/\n│       ├── Console/                   # Console subsystem (stub)\n│       ├── Light/                     # Directional lighting with Blinn-Phong support\n│       └── Widget/                    # Widget subsystem\n├── Run/                               # Runtime directory\n│   ├── Data/Audio/                    # Sound effects\n│   ├── Data/Definitions/              # XML config (PieceDefinition, BoardDefinition)\n│   ├── Data/Fonts/                    # Bitmap fonts\n│   ├── Data/Images/                   # Textures (Phong maps, marble, UV test)\n│   ├── Data/Models/                   # OBJ models (Cube, Woman, TutorialBox)\n│   └── Data/Shaders/                  # HLSL (BlinnPhong, Bloom, Default, Diffuse)\n├── Docs/                              # Documentation\n└── DaemonChess.sln                    # Visual Studio solution\n```\n\n| Module | Description |\n|--------|-------------|\n| Definition | XML-driven piece geometry (6 types × primitives) and board layout |\n| Framework | App lifecycle, player/AI controllers, move result types |\n| Gameplay | Chess rule engine (Match), board grid (Board), animated pieces (Piece) |\n| Light Subsystem | Directional sun light with adjustable direction and intensity |\n\n## Future Roadmap\n\n- [x] 3D board and procedural piece rendering with Blinn-Phong shading\n- [x] Complete move validation for all 6 piece types\n- [x] En passant, castling (kingside + queenside), pawn promotion\n- [x] Raycast-based piece selection with ghost piece preview\n- [x] Animated piece movement with knight hop arc\n- [x] Capture animation with delayed removal system\n- [x] Turn-based two-player local play\n- [x] Developer console with ChessMove command\n- [ ] Check and checkmate detection\n- [ ] AI opponent (AIController implementation)\n- [ ] Online multiplayer via NetworkSubsystem\n- [ ] Move history panel and undo/redo\n- [ ] Stalemate, draw, and threefold repetition rules\n- [ ] OBJ model pieces as alternative to procedural geometry\n\nSee the [open issues](https://github.com/dadavidtseng/DaemonChess/issues) for a full list of proposed features and known issues.\n\n## Acknowledgements\n\n- [Daemon Engine](https://github.com/dadavidtseng/Engine) — Custom C++ engine providing DirectX 11 rendering, FMOD audio, input, resource loading, and developer console\n- SMU Guildhall — Academic environment and engine development curriculum\n\n## License\n\nCopyright 2025 Yu-Wei Tseng\n\nLicensed under the [Apache License, Version 2.0](../LICENSE).\n\n## Contact\n\n**Yu-Wei Tseng**\n- Portfolio: [dadavidtseng.info](https://dadavidtseng.info)\n- GitHub: [@dadavidtseng](https://github.com/dadavidtseng)\n- LinkedIn: [dadavidtseng](https://www.linkedin.com/in/dadavidtseng/)\n- Email: dadavidtseng@gmail.com\n\nProject Link: [github.com/dadavidtseng/DaemonChess](https://github.com/dadavidtseng/DaemonChess)\n\n\u003cp align=\"right\"\u003e(\u003ca href=\"#readme-top\"\u003eback to top\u003c/a\u003e)\u003c/p\u003e\n\n\u003c!-- REFERENCE-STYLE LINKS --\u003e\n[contributors-shield]: https://img.shields.io/github/contributors/dadavidtseng/DaemonChess.svg?style=for-the-badge\n[contributors-url]: https://github.com/dadavidtseng/DaemonChess/graphs/contributors\n[forks-shield]: https://img.shields.io/github/forks/dadavidtseng/DaemonChess.svg?style=for-the-badge\n[forks-url]: https://github.com/dadavidtseng/DaemonChess/network/members\n[stars-shield]: https://img.shields.io/github/stars/dadavidtseng/DaemonChess.svg?style=for-the-badge\n[stars-url]: https://github.com/dadavidtseng/DaemonChess/stargazers\n[issues-shield]: https://img.shields.io/github/issues/dadavidtseng/DaemonChess.svg?style=for-the-badge\n[issues-url]: https://github.com/dadavidtseng/DaemonChess/issues\n[license-shield]: https://img.shields.io/github/license/dadavidtseng/DaemonChess.svg?style=for-the-badge\n[license-url]: https://github.com/dadavidtseng/DaemonChess/blob/main/LICENSE\n[linkedin-shield]: https://img.shields.io/badge/-LinkedIn-black.svg?style=for-the-badge\u0026logo=linkedin\u0026colorB=555\n[linkedin-url]: https://linkedin.com/in/dadavidtseng\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdadavidtseng%2Fdaemonchess","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fdadavidtseng%2Fdaemonchess","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdadavidtseng%2Fdaemonchess/lists"}