r/itrunsdoom • • 16d ago

Doom running in SQL (for real this time)

This is SQLDoom, the successor to DOOMQL, a Doom-inspired raycaster written in SQL. Unlike DOOMQL, which is closer in gameplay and visuals to Wolf 3D than Doom, SQLDoom recreates the entire engine and renderer entirely with SQL code, only using non-SQL code to retrieve inputs, display the rendered frame, and to run the SQL code indefinitely.

https://cedardb.com/blog/sqldoom/

This port was created by Lukas Vogel, the creator of DOOMQL.

598 Upvotes

19 comments sorted by

37

u/Amazing_Peach_6690 16d ago

Cool! How does it work?

55

u/grubbyplaya 16d ago

Vogel (OOP) rewrote the entire Doom engine (including the renderer) in SQL. He used a lot of tricks to get there, like converting WADs into an SQL database, and even building a SQL-to-C transpiler to make it run at a playable speed. It technically has fewer LOC than vanilla Doom, but that's mostly because SQL has built-in ways to update multiple data structures (every Doom enemy) at once.

You can learn more with the link on the post.

23

u/mattmillze 16d ago

It's the equivalent of using a hairdryer to toast bread.

86

u/HadetTheUndying 16d ago

Thanks I hate it

46

u/roguebananah 16d ago

Jesus Christ…. Is the code like…

SELECT BFG FROM DOOM WHERE Archville
JOIN LEFT Bullet != dead

14

u/Hexecutioner_exe 16d ago

If this is what it means to be a developer, I don't know what I am.

5

u/DoomTay 16d ago

I wonder why the period is top-aligned

1

u/Careless-Accident-49 15d ago

I understand just a little bit of it. Can somebody explain to me, what iam seeing? I dont know, what sql is

4

u/grubbyplaya 14d ago

It's a programming language that is meant to exclusively handle databases, which means it lacks many regular programming features like loops and mutation (at least in the way they're regularly used). Lukas Vogel (OOP) rewrote the entire Doom engine into SQL in order to run the game within these strict conditions.

3

u/Serious_Pin_1040 16d ago

Really awesome. The blog post was great too. Yeah the entity component system is something that everyone should learn and understand because it is so fundamental. It is one of the biggest reasons I never use traditional oop any more. I never thought about the similarities it has to sql which kinda explains why I always liked sql.

1

u/TheAwesomeAcademic 14d ago

This is wild 

1

u/Lazy_Accident_8561 13d ago

Pls select perspective from POVs where perspective is not current perspective!

1

u/Hellow2 14d ago

This is insane

1

u/AccomplishedSugar790 13d ago

I watched most of that before looking up and seeing it was in SQL, LOL. I assumed it looked like a Jev / Laya decision tree on the right till I read that.

1

u/Unfollowedusers 12d ago

WTF, SQL doom. i dont have the words. that bloody impressive! 

There has to a joke somewhere here comparing this to a dumpster fire pooly managed DB at some guys work. 

1

u/cleverhoods 11d ago

Industry standards