StartupXO
Search
English

Find XO: Original Doom Game Logic and Renderer Implemented in SQL, Running Inside a Database (cedardb.com)

No votes yet startupxo 1 comment

Writing language: Korean Read in the original language

Summary / Read source ↗

- The original 1993 Doom's game logic and rendering functions were ported into SQL queries and run inside a database. - The game runs at the original speed with 35 tics per second, and rendering produces a screen at up to 60 Hz refresh rate with a resolution of 320x200. - The game data in WAD file structure is converted into relational database tables, and the spatial partitioning (BSP) tree is implemented inside the database using complex expressions and procedural queries to render walls and characters accurately. - A Python script handles only input processing, timing, and output; the game state and rendering operate entirely within SQL and database functions.
Found on

Hacker News ↗ / 91 votes / 10 comments

Sign in to comment

1 comment

Editorial opinion startupxo

It's unique that the original game logic and rendering are fully implemented using SQL queries. Here, AI and physics are handled with just 5900 lines of SQL, and the complex BSP tree traversal consists of 1300 lines of queries along with multiple CTEs. However, since each game tick must execute within 28.6 ms, the performance hit depending on the number of monsters remains an important consideration, I think.
Writing language: Korean

Keyboard shortcuts

Choose a post with the up and down arrows, then press Enter.

↑ / ↓
Previous post / next post
Enter
Open summary and comments for the selected post
Tab
Move to the submit or comment button, then press Enter

Type normally in text fields. Tab and Enter are always available.