{"id":918545,"date":"2026-10-03T02:30:14","date_gmt":"2026-10-03T02:30:14","guid":{"rendered":"https:\/\/www.newsbeep.com\/ca\/918545\/"},"modified":"2026-10-03T02:30:14","modified_gmt":"2026-10-03T02:30:14","slug":"someone-got-doom-in-an-sql-database","status":"publish","type":"post","link":"https:\/\/www.newsbeep.com\/ca\/918545\/","title":{"rendered":"Someone got Doom in an SQL database"},"content":{"rendered":"<p>\u201cRendering Doom in a database is obviously a bad idea,\u201d Lukas Vogel writes in <a href=\"https:\/\/cedardb.com\/blog\/sqldoom\/\" rel=\"nofollow noopener\" target=\"_blank\">a lengthy blog post<\/a> explaining how exactly he managed to render Doom using an SQL database.<\/p>\n<p>OK, that\u2019s not entirely accurate. The <a href=\"https:\/\/github.com\/cedardb\/sqldoom\" rel=\"nofollow noopener\" target=\"_blank\">SQLDoom project<\/a> uses a small Python client to handle input and output, drive the game\u2019s timing, and display each frame to the screen. Behind that, a series of CedarDB tables tracks the game geometry and state, while about 1,300 lines of SQL queries spread across 89 <a href=\"https:\/\/www.geeksforgeeks.org\/sql\/cte-in-sql\/\" rel=\"nofollow noopener\" target=\"_blank\">common table expressions<\/a> implement the game logic and generate 35 bitmap framebuffers per second.<\/p>\n<p>In this, SQLDoom is a major improvement over <a href=\"https:\/\/cedardb.com\/blog\/doomql\/\" rel=\"nofollow noopener\" target=\"_blank\">Vogel\u2019s previous DoomQL project<\/a>, which last year set out to build \u201ca multiplayer Doom-like shooter entirely in SQL.\u201d Unfortunately, that effort ended up with raycasting-based, grayscale ASCII graphics that were more akin to the simplistic 90-degree-angled maps of Wolfenstein 3D. The newer SQLDoom, on the other hand, generates full-color 640\u00d7480 frames that look like they could have come from the original Doom executable.<\/p>\n<p>It\u2019s all just data, man<\/p>\n<p>Converting Doom\u2018s classic WAD files to a relational database was relatively simple and straightforward, Vogel writes, because of the way the original game broke levels down into vertices, lines, sectors, and so on. Even Doom\u2018s famous <a href=\"https:\/\/en.wikipedia.org\/wiki\/Binary_space_partitioning\" rel=\"nofollow noopener\" target=\"_blank\">binary-space partition trees<\/a> can be broken down into SQL using a sort_key for objects that\u2019s pre-computed for each position at load time. With this set in your table, a simple \u201cORDER BY\u201d statement can determine every frame which parts of walls to display and which to ignore, vastly improving performance.<\/p>\n","protected":false},"excerpt":{"rendered":"\u201cRendering Doom in a database is obviously a bad idea,\u201d Lukas Vogel writes in a lengthy blog post&hellip;\n","protected":false},"author":2,"featured_media":918546,"comment_status":"","ping_status":"","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[6],"tags":[49,48,61],"class_list":["post-918545","post","type-post","status-publish","format-standard","has-post-thumbnail","category-technology","tag-ca","tag-canada","tag-technology"],"_links":{"self":[{"href":"https:\/\/www.newsbeep.com\/ca\/wp-json\/wp\/v2\/posts\/918545","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.newsbeep.com\/ca\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.newsbeep.com\/ca\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.newsbeep.com\/ca\/wp-json\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"https:\/\/www.newsbeep.com\/ca\/wp-json\/wp\/v2\/comments?post=918545"}],"version-history":[{"count":0,"href":"https:\/\/www.newsbeep.com\/ca\/wp-json\/wp\/v2\/posts\/918545\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/www.newsbeep.com\/ca\/wp-json\/wp\/v2\/media\/918546"}],"wp:attachment":[{"href":"https:\/\/www.newsbeep.com\/ca\/wp-json\/wp\/v2\/media?parent=918545"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.newsbeep.com\/ca\/wp-json\/wp\/v2\/categories?post=918545"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.newsbeep.com\/ca\/wp-json\/wp\/v2\/tags?post=918545"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}