Page 1 of 2

How to make a doom-like engine/game?

Posted: Sun Aug 20, 2017 1:15 pm
by Jsin
Hello! I have been working on an arena shooter in the GZDoom engine, and I thought to myself "If doom is just projected 2D, why don't I make my own engine to suit the game?" (Yes, I know GZDoom is actual 3D, but I was meaning the original doom). So I got to work on a renderer, and I have made a simple ray-caster inside of love2D (file attached). However, all I have managed to do is draw walls (all uniform height) and have 2 rectangles for the ground and sky. So, if anybody would be able to help me, how would I go about implementing any of the following:
  • Projected floors with textures
  • Multiple types of walls
  • Sector lighting (like in doom)
  • BSP (for optimisation, as it isn't too well optimised)
  • Multiple heights (or heights like doom)
  • Simple weapon sway
  • Sprites with coords on the map, that will be displayed as sprites in 3D
client.love
Game
(20.1 KiB) Downloaded 372 times
EDIT: According to you guys, doom wasn't a raycaster and relied solely on BSP. I researched and you were right, so I changed the name of the question to be more fitting.

Re: How to make a doom-like raycaster?

Posted: Sun Aug 20, 2017 2:23 pm
by raidho36
Take a look at Zdoom source code.

Re: How to make a doom-like raycaster?

Posted: Sun Aug 20, 2017 2:28 pm
by MasterLee
Doom isn't an raycaster. Doom use BSP tree traversion for rendering and hidden surface removal.
Also attached file is missing.

Re: How to make a doom-like raycaster?

Posted: Sun Aug 20, 2017 2:34 pm
by Jsin
--REMOVED AS I WAS WRONG AND WAS AN IDIOT--

Re: How to make a doom-like raycaster?

Posted: Mon Aug 21, 2017 7:42 am
by MasterLee
Jsin wrote: Sun Aug 20, 2017 2:34 pm
MasterLee wrote: Sun Aug 20, 2017 2:28 pm Doom isn't an raycaster. Doom use BSP tree traversion for rendering and hidden surface removal.
Also attached file is missing.
It is still, for all intensive purposes, a ray caster. Raycasters can use BSP in the same way full 3D engines can
But i does not
https://www.doomworld.com/forum/topic/7 ... raycaster/

Re: How to make a doom-like raycaster?

Posted: Mon Aug 21, 2017 8:38 am
by zorg
That thread there is the best example why we, here, should not have this discussion;
let it be known that the thread title should be edited to either
"How to make a doom-like engine/game"
or
"How to make a simple raycaster engine/game"
instead.

Re: How to make a doom-like raycaster?

Posted: Mon Aug 21, 2017 1:20 pm
by MasterLee
Look here and watch in slowmo how the screen is actually rendered:
http://fabiensanglard.net/doomIphone/do ... nderer.php
Well there is the same for Duke3D
http://fabiensanglard.net/duke3d/build_ ... ernals.php

Re: How to make a doom-like raycaster?

Posted: Mon Aug 21, 2017 1:59 pm
by zorg
All the spelling errors in those articles are slowly killing me, but otherwise, both of them are a neat write-up.
Also, just for the record i was agreeing with you, though i still think it'd be better to focus on what the original question was intended to ask, not the issues that arose from terminology related stuff (like whether doom is or is not a ray-whatever)...

Re: How to make a doom-like raycaster?

Posted: Mon Aug 21, 2017 3:21 pm
by MasterLee
I didn't put the links there to oppose you. I was curious of how Doom really did it. I have read many about Build engine. They got cars, well moving sectors, and only think i knew about Doom was that that is not possible there because of the BSP tree. So i searched for article that described how it worked.
Also Pie in the Sky looks interesting. But i never heard about before.

Re: How to make a doom-like engine/game?

Posted: Mon Aug 21, 2017 6:32 pm
by Davidobot
There have been plenty of raycasters made in LOVE over the years, including mine (feel free to look around that one's source code). It's not particularly hard if you follow a tutorial.