{"id":20438,"date":"2026-10-05T12:09:07","date_gmt":"2026-10-05T12:09:07","guid":{"rendered":"https:\/\/news.theck1.no\/?p=20438"},"modified":"2026-10-05T12:09:07","modified_gmt":"2026-10-05T12:09:07","slug":"database-expert-runs-doom-in-sql-with-just-5900-lines-of-code","status":"publish","type":"post","link":"https:\/\/news.theck1.no\/?p=20438","title":{"rendered":"Database expert runs Doom in SQL with just 5,900 lines of code"},"content":{"rendered":"<p style=\"margin:0 0 1em; padding:0.6em 0.9em; border:1px solid #d0d7de; border-radius:6px; background:#f6f8fa; color:#444; font-size:0.9em;\"><strong>AI-rewritten:<\/strong> This is a summary of an article from Tom&#8217;s Hardware, rewritten by AI (Qwen, running locally) to make it easier to read. The facts come from the original article &ndash; read it for the full story.<\/p>\n<div style=\"margin-bottom:1em; color:#666; font-size:0.9em;\"><strong>Tom&#8217;s Hardware &bull;  Bruno Ferreira  &bull; October 4, 2026<\/strong><\/div>\n<hr\/>\n<p>In 2026, Lukas Vogel of the SQLDoom project ported the 1993 game Doom to CedarDB, a performance-focused database compatible with PostgreSQL. While the visual display and sound are handled by Python acting as peripherals, all mathematical logic runs inside the database. The original game&#8217;s data structure was already highly relational, requiring only 1,000 lines of Python to convert entities from the WAD package into database tables.<\/p>\n<p><!--more--><\/p>\n<p>The core gameplay loop consists of 5,900 lines of SQL, which is shorter than the original C source code&#8217;s 9,000 lines. This reduction occurs because SQL allows parallel updates through a single &quot;UPDATE&#8230; WHERE&quot; statement rather than traditional loops. The graphical renderer uses just 1,300 lines but queries 89 tables to handle Binary Space Partitioning (BSP), a method for sorting walls front-to-back using simple sorting commands.<\/p>\n<p>Multiplayer functionality benefits significantly from the database architecture. Maintaining synced states across many tables with complex interdependencies is naturally supported by database transactions. By using &quot;START TRANSACTION,&quot; running the logic, and &quot;COMMIT,&quot; the system ensures everything synchronizes automatically without extra effort for snapshots or access control.<\/p>\n<div style=\"margin-top:2em; padding:1em; border-left:4px solid #0073aa; background:#f5f7fa;\">\n<p style=\"margin:0;\"><strong>Source:<\/strong> Tom&#8217;s Hardware &bull;  Bruno Ferreira  &bull; October 4, 2026<\/p>\n<p style=\"margin:0.5em 0 0;\"><a href=\"https:\/\/www.tomshardware.com\/video-games\/pc-gaming\/database-expert-runs-doom-in-sql-with-just-5-900-lines-of-code-1-300-line-graphical-renderer-spans-89-different-tables-full-featured-sqldoom-is-the-sequel-to-embryonic-doomql\" target=\"_blank\" rel=\"noopener\">Read the original article at Tom&#8217;s Hardware &rarr;<\/a><\/p>\n<\/div>\n","protected":false},"excerpt":{"rendered":"<p>AI-rewritten: This is a summary of an article from Tom&#8217;s Hardware, rewritten by AI (Qwen, running locally) to make it easier to read. The facts come from the original article &ndash; read it for the full story. Tom&#8217;s Hardware &bull; Bruno Ferreira &bull; October 4, 2026 In 2026, Lukas Vogel of the SQLDoom project ported<\/p>\n<p class=\"more-link\"><a href=\"https:\/\/news.theck1.no\/?p=20438\" class=\"themebutton2\">READ MORE<\/a><\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[7],"tags":[],"class_list":["post-20438","post","type-post","status-publish","format-standard","hentry","category-it-hardware"],"_links":{"self":[{"href":"https:\/\/news.theck1.no\/index.php?rest_route=\/wp\/v2\/posts\/20438","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/news.theck1.no\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/news.theck1.no\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/news.theck1.no\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/news.theck1.no\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=20438"}],"version-history":[{"count":0,"href":"https:\/\/news.theck1.no\/index.php?rest_route=\/wp\/v2\/posts\/20438\/revisions"}],"wp:attachment":[{"href":"https:\/\/news.theck1.no\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=20438"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/news.theck1.no\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=20438"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/news.theck1.no\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=20438"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}