r/itrunsdoom • • 22d 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.

600 Upvotes

19 comments sorted by

37

u/Amazing_Peach_6690 22d ago

Cool! How does it work?

55

u/grubbyplaya 22d 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 22d ago

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

86

u/HadetTheUndying 22d ago

Thanks I hate it

46

u/roguebananah 22d ago

Jesus Christ…. Is the code like…

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

14

u/Hexecutioner_exe 22d ago

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

5

u/DoomTay 22d ago

I wonder why the period is top-aligned

1

u/Careless-Accident-49 20d 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 20d 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 22d 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 19d ago

This is wild 

1

u/Lazy_Accident_8561 19d ago

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

1

u/Hellow2 19d ago

This is insane

1

u/AccomplishedSugar790 19d 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 18d 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 17d ago

Industry standards