You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
A 3D first-person shooter game implemented entirely in SQL using DuckDB-WASM.
Overview
DuckDB-DOOM is an experimental game that demonstrates the power of SQL for computational tasks. The entire game logic, including 3D raycasting, enemy AI, collision detection, and rendering is implemented using SQL queries running in DuckDB's WebAssembly build.
Features
True first-person 3D rendering using raycasting techniques
Collision detection
Enemy NPCs
Shooting mechanics with bullets
Minimap display
All game logic implemented in SQL
How to Play
Open index.html in a modern web browser
Use WASD keys to move:
W: Move forward
S: Move backward
A: Turn left
D: Turn right
Spacebar: Shoot
L: Toggle verbose logging (to browser console)
Technology
This project uses:
DuckDB-WASM: SQL database that runs in the browser
Pure HTML/JavaScript for the UI
SQL for all game mechanics and rendering
How It Works
The game uses SQL in interesting ways:
3D Rendering: Uses recursive CTEs to implement raycasting
Game state: Stored in tables (player, enemies, bullets, map)
Physics: SQL queries handle collision detection and movement
Rendering: Views transform the 3D world state into ASCII art
Installation
No installation needed! Just clone the repository and open index.html in a web browser:
git clone https://github.com/patricktrainer/duckdb-doom.git
cd duckdb-doom
# Open index.html in your browser
Contributing
Contributions are welcome! Some ideas for improvements: