Let's Program Doom - Part 2
HTML-код
- Опубликовано: 5 окт 2024
- I might be the most excited about this video. I really wanted to learn how the original Doom game engine works. l spent a long time learning the basic concepts but created the code myself from scratch and how I wanted to design it. You can follow along or convert this code to any other programming language since I kept it simple in C that draws a pixel at x and y coordinates.
Let me know if you enjoy this series! Thank you for all your great ideas and I hope to see what you make from this tutorial series. Send me a link so I can share it in part 3!
Grid2D overview: 01:22
Save textures: 02:52
Texture walls: 5:41
Shadow & tile: 11:32
Floors: 12:53
Texture surfaces: 17:41
github code: github.com/3DS...
Install OpenGL: • Install Dev C++ and Op...
Part 1 tutorial: • Let's Program Doom - P...
Game textures: poloviiinkin.i...
Image converter: notisrac.githu...
part 1 made by others
• ps3uDo demo
• DoomLikeRenderer demo
• Porting @3DSage ‘s Doo... - Игры
I ain't gonna lie, I almost lost all hope thinking part 2 will never come. I am so happy now, literally out of this world, this is amazing.
Never doubt the 3DSage! 😎👍
I really hope part 3 will not take to long to come out.
@@3DSage i want the program and thanks for the tutorial
the part 2 took a long time to come and now there it is
@@GamerSaga It should take another 8-9 months~
I am waiting for part 3
is there already part 3?
@@diandradeekeno sadly
@@DuyenNguyen-bo7rc yes there is. It's collision detection.
@@muratbayraktar4733proof?
Literally just watched part 1 yesterday, this is a miracle.
And when you are done with part 2, you shall be healed by the second miracle! Hallelujah! *places palm on forehead with gentle shove as you raise your arms to the heavens*
Luckily the RUclips algorithm blessed me, so thankfully I'm able to watch back-to-back.
I waited so long for part two. I got to watch the ray caster tutorials back to back though.
Yesterday I was waiting for part 2, Now am i am waiting for part 3 already!
This "Let's Program Doom" series is so awesome! Thank you a lot. Cant wait to see part 3.
my day has immediately become 5 times better
I'm going to watch it right now! First part was amazing. Thanks for sharing! 😊
It's like watching a Captain Disillusion video but for programming + cats
Nice! I'll take that compliment! Great description and thank you for the nice comment. Btw, I like your great electric channel!
I lost hope 6 months ago when you didn't upload anything. This is an absolute miracle!
I'm glad you still believe in me and I believe in you to program it!
Wow! We need part 3!
18:41 Is it any coincidence that the multiplier you used is so close to 2pi or tau? with the amount of sin and cos functions used, I wouldn't be surprised to see pi crop up here!
I was thinking that as well. Can anyone confirm?
First thing I thought of too. Guessing 6.28 would be a better approximation.
No, it is just FOV / UPDOWN "factor" (the same constant used to compute wz)
I thought is was the golden ratio for a sec.
this tutorial series has genuinely helped with my c and 3d rendering comprehension, thank you king
,,,obligatory part 3 request
Omg, i can't believe this video just released! Im waiting for this for sooooo long, more than half a year
I'm loving this (and the raycaster tutorials previously)... You have managed to pack so much info into a short time, and its nice to see performant code/methods that can be run/ported onto minspec stuff! Looking forward to part 3.
That sure was revolutionary back in the 90's... still amazing how simple it is. I'm glad I foud someone explaining it with the only and best C language :D
I haven’t started the video yet but wanted to say I haven’t been this excited about a new RUclips video in a while!! Thanks for making a part 2! Love your channel btw. A gem of RUclips
Wow that really means a lot to me so thank you so much for the nice comment! :)
@@3DSage Truly, I don't think trenthm and I are the only ones who feel the same - I've wished for something like this since the mid-90's, but never believed that it could be done in such easy to understand way. You really have skills for "tutorializing" stuff like this, I'm quite pleasantly surprised, and I'm glad to hear it means a lot to you (I have the audacity to believe it applies to my comment as well, but not because I want to feel good about myself, but because you truly do deserve it!).
really cool seeing how such common concepts nowadays are programmed from scratch
I've been looking forward to this with an unreasonable level of excitement! Keep up the amazing work
Ditto!
I've been looking forward to this for months!
wow! i learned a lot today! I'm still at 50% Raycaster 3 but I'm really really looking forward to this series! I'm especially interested in the BSP stuff (especially how to generate the tree for the level data), it always fascinated me...
This made my day! Thank you for saying that and I will continue these series! :)
this is awesome, so much cool stuff in here! Can't wait for part 3!
This is one of the best, most fun learning channels on youtube
THIS LOOKS AMAZING, I haven't finished my game boy game but I'm really twitching to start a Gameboy advance game with this engine
Great! I feel that this part 2 will be a tougher one to convert in Java... 😅
Hey man! I believe in you! I hope you can do it! :) If not, just thanks for watching!
I think it's wild you have the level move around the player. That's just so cool.
At this point, you've just made Duke Nukem 3D lol.
It's time to program 3D and chew bubblegum, and I'm all out of gum 😎
@@3DSage 😂
I looked from start to finish, with your help I was able to create an engine). waiting for part 3
this is actually really cool and useful, i will share it with my friends
thank you! :)
Nice! I've been waiting for part two. Thanks, good job 👍
yo sick i love your videos. i love love love your simple computer build with the counter IC. thats so cool that you can actually make a basic computer/cpu out of just those chips
this video is amazing! i wanted to make a doom-like 3d game
after being subjected to 3 days of working with raycasters this being so simple is such a relief
THANK YOU SO MUCH I HAVE BEEN WAITING FOR THIS!!!!
I believe that 6.2 number you came up with is pi * 2 or acos(-1) * 2
And the other 60 value is simply SH/2
Nice tutorial man but my god you need install a formater because your code looks like minimized javascript
very nice, love this series so far
Thank you!
One of the awesomest things on the internetz. Thank you. Didn't start on this yet, very busy with a project, but as soon as it finishes I'm going to dive into this and make stuff.
Twitter mad? I sleep
RUclipsr cancelled? I sleep
3DSage uploaded? **Real $h!t?**
Please make a part 3!
OH MY GOODNES ITS FINALY OUT!!!
I ended up programming my own level editor and save load system for my gamemaker port I did for fun.
I also modified how the level data works, I swapped to using points, walls, and sectors rather than just walls and sectors. That way I can draw points however I want in the editor as walls are composed of two points, texture data, and color data.
This also brings my port closer to how doom actually acts as doom uses vertices, linedefs (and sidedefs), and sectors
This is amazing! Things like this take alot of time so take all the time you need to finish the other parts
Can't wait to see if you continue your raycaster engine. I tried making the maps bigger but i ended up having a procedurally generated hellscape that went to infinite somehow.
I would be even more interested in seeing a tutorial like this, but on creating a *raytracing* engine (in software), even if it's not practical for real-time 3D action (or just plain real-time) game rendering and ends up being much lower res or detail to be useful for more rendering in game (as opposed to pre-rendering stuff, which I wouldn't feel that interested in coding myself).
If that has any practical use - I have lacking understanding of how much can be achieved with modern PC's and real time ray-tracing in software.
But if it's possible to do something useful that way, I would just murder my family for it. I really would, I'm cereal!
I'm ready for part 3 haha!
YES I WAS SO EXCITED FOR THIS OH MY GOD
I like the in-engine editor, a great condensed minimalist display bar. Nice to see the faux view pitching technique get some love. That fog like gradient was something else, very approximate to polygon fog clipping.🙂
OH MY GOD IT CAME OUT AND I MISSED IT! THANK YOU!
I cant believe how cool the stuff you make is! WOW!
you got something wrong, the textures in id tech 1 repeat and not stretch, qlso would be great if yiu could make the resolution bigger
Your so awesome man I've been watching you since your gba vids
Currently stuck trying to get my textures to not look like TV static when i put them on the walls XD Hope there will be a part three by the time I finish, if its too much work though I understand and am still super thankful for this awesome 2 part series. Forreal best tutorial on RUclips.
Great video! Really fun to follow along as you build this. From your texture mapping code it looks like you are linearly interpolating on the X axis which will cause it to be non-perspective correct. Maybe you could update this to perspective correct texture mapping in your next video :)
Awesome video! Thanks for this series. It is one of the best on the subject.
That means a lot to me so thank you!
Thanks for this video! I just finished the first one and made a glitchy hexagon prism.
Gosh, I've been seeing this channel for a while and I thought I was subscribed to it. But, now I am. This channel has been having some great game development content.
Thank you for the sub! More great videos coming soon!
Can't wait for part 3
legend says that never its going to be part 3 im coming from the future
cant wait for the quake series
Omg, thanks so much for making pt2
Cats + programming + DOOM = Perfection
Its insane of what these programming language's can do.
Ooooh part 2 is out. Nice!
I gave you my thanks. This is awesome content! Edit: There is a small bug in the texture mapping, if you check around 14:47, the texture's "dirt boulders" stays the same width on the whole width of the wall, with no perspective applied to the hstep. The more distant the texture should have thinner boulder, the hstep needs to take the wall height ratio in account...
Hey, another amazing video, and t is really easy to follow, just please add some visual indications around 10:45 when the cut is a bit too late, and those casts to (int) appear late and is easy to miss out. I got my video stopped at a bit earlier point while re -typing and when i tested it it was not working, because I missed the cast.
I did the same thing lol, spent like an hour going over the video and different parts of the code to figure out what I'm missing.
I think I found your "Really nice formula" for calculating the surface tile placement and it's basically yours with the last two variables changed:
for "rx =" and "ry =" just change your last two variables to the following:
(P.y/yo*tile) and (P.x/yo*tile)
Or as it looks in my LUA version:
rx=fx*math.sin(math.rad(pA))-fy*math.cos(math.rad(pA))+(pY/yo*tile)
ry=fx*math.cos(math.rad(pA))+fy*math.sin(math.rad(pA))-(pX/yo*tile)
The (pY/yo*tile) and (pX/yo*tile) works to lock the surface textures in place even while moving. I don't know how as I was just poking the code until it did what I wanted.
I'm sure you've probably hashed this one out (or someone already mentioned it) and I look forward to the next tutorial!
Thank you for adding this for people to see! That is a great update. I will be making several little updates in the next tutorial and adding a lot more too! :)
I should've paid attention is school. My brain is gonna 'splode watching this math stuff.
amazing video! love the editor and I cant wait for Part 3 :D
I'm completely a one man show so thank you for the editing compliment! I have a lot of fun ideas for part 3.
@@3DSage how much longer until part 3
I'm making a raycaster in lua using the love2d framework, finally managed to make a single ray shoot! I'm already looking foward the BSP
Oh god no ide refactoring and that code formatting, good job tho
Thanks for this second part it is so amazing like the first ❤
The single space indenting is a baller move.
OMG life made easier!!! im so loving these tutorials!! (does mean im going to have to feature creep on a project tho! LOL -- this is amazing!)
Oh yeah that was something I wanted to suggest for any new sector based engines, 2D approximated leaning in FPP. Kind of like faux pitching but I think it uses column shifting of the whole window to approximate camera tilt, OG Star Fox was a pretty good example.😉
Me, a drop-out from CompSci who chanced into these videos while wandering around the internet and only understands about half of it: Hmmmm. _Fascinating._
I am, however, a doom mapper in my spare time, and at the end of the video you did ask for suggestions, so I have three:
* The map editor doesn't seem to have a way to set different textures for floor/ceiling on the sectors or specific textures for individual wall lines within a sector. This is a feature of the og doom engine that goes a long way into making maps varied and interesting and since you managed to get the hard part (actually drawing stuff with texture mapping) down, it could elevate your engine as well.
* Light levels! Doom had you set a lighting level per sector, with 255 being max and 0 being minimum. Fairly sure it just darkened all the pixels inside that sector by the reverse of that. Also something that makes maps more varied. Later you can even make light levels that change on the fly, for like flashing or flickering lights and such.
* The little fade you did when you were demonstrating the floor rendering with flat colours. You could probably achieve a similar effect by applying a similar formula but to all three colour elements of the pixel while you are drawing the texture, since that, too, is just plotting colour pixels on the screen. If you really wanted to go all out, you could make these controllable parameters stored in the sector array, thus giving the map designer customisation over the fog within a sector, which can make maps more moody. Then again this would probably also call for doing the same to wall textures and we start getting even more complexity.
Looking forward to part 3!
It looks like you're linearly interpolating the texture horizontal coordinates on walls. Won't that look wrong for walls viewed at angle, like the wall of a long hallway, where the halfway point of the texture really should be more than halfway along its length? Or are you just not concerned with that?
And for floors, have you thought about using rows of pixels instead of columns so you don't need to make as many divisions?
You are correct. Planning out a video like this is very tricky and I leave a few things on the cutting room floor but those issues will be brought up in the next part.
Idea:
Use in-facing sectors as rooms, and out-facing sectors as brushes.
hi 3DSage, one of my dreams is for you to make a GBA game with an open world, could you do it?)
I have that dream too! Really. I feel the GBA can be pushed to do so much more and I hope to be apart of that.
First! let's go boiiiiis
Great video.
Could you add voxel objects in a later video?
Similar to voxel objects in the Build-Engine.
I'm curious how they stored the objects and how the software renderer for those worked.
I would like to touch on that topic so I will keep that in mind!
YES
PART 3 PLEASE
You inspired me but I'm already making a 4D game engine which rendering takes too much time
Cant wait to get home and get lost within the first 2 minutes of the first video!
Hello, would you mind covering the Grid2D programming in a future video? Covering as in coding it along with explanation, it would be really helpful!
Thanks for all the hardwork, I wish this stuff was taught in schools.
@3DSage, 6.2 is not as accurate as 6.67. I've observed that using FOV/UPDOWN_FACTOR (which, in this case, is 30, the same value used when computing the wz of the wall) is the correct way to calculate it. Additionally, P.x/60. and P.y/60. are related to the window size, specifically the SH2. You can experiment with adjusting these constants and then make changes to the resolution accordingly!
very freakin cool
this is a nice tutorial also about your computer that you made does it have an microproccesor
Ayy, it's finally back! Now when part 3?
Hey man really love the content! Hoping one day i could get the level where you are at making 3D projects in the GBA :D
Would love to do this tutorial, but sadly it only has 2 episodes. please make more or consider a paid one. I WOULD BUY IT :)
nice to know there are fellow java try hards/stubborn people in the comments who keep insisting on making things like this in java no matter how much they get discouraged and get weird looks.
excellent series! part 3 please...?
let's fucking goooooooooo
О боги это просто потрясающая проделанная работа, огромное спасибо за такую работу. Просто нет слов...
incredible man. doing gods work
Thanks so much!! It would be awesome if you could cover the quake engine one day :D
Damn, nice job! I will download your engine and try to build simple game on it! :D
I kept forgetting to share the port I did in python lol. I figured out texturing on my own, but I never figured out how to get floor texturing to be performant, so instead I did solid color floors for sectors and did some level trickery to make it look better.
I used Tiled to make my level editor, instead of writing my own (I did the same trick where you have to draw the polygons a certain direction because I didn't want to write code to check it lol). Didn't bother doing BSP or portals, so I just designed a level that didn't obviously break as much. No proper collision detection, but just enough to let you walk up stairs.
It's interesting that your sectors are kind of the opposite of what sectors are in Doom/Build. Instead of sectors being interiors (walls are rendered inward), they're just exteriors. More like usual 3d models.
I believe that sectors can actually be used in both ways, but with doom engine, its more optimized for rendering interiors. I don't know this for a fact, but I am just guessing
Thanks for uploading !! Super awesome tutorial! Where can I get Grid2D from?
this god..i mean guy can probably make gba studio if he wanted too, yknow, like gb studio but for gba