Making my First RAYCASTING Game in C++ - SFML Gamedev - Devlog 1
Вставка
- Опубліковано 2 жов 2021
- I wrote my first ray casting game and 3D in general. I used C++ and SFML.
Next part: • I Used RAYCASTING to M...
Discord: / discord
Github: github.com/Kofybrek
Itch io: kofybrek.itch.io
Patreon: / kofybrek
Subreddit: / kofybrek
Twitter: / kofybrek
Code: github.com/Kofybrek/Raycasting
Raycasting tutorial: lodev.org/cgtutor/raycasting....
#code #coding #programming
Why can I so easily imagine a horror game simply called "Steven"?
I mean after seeing him from backwards and slowly rotating like that it's expected
If you can see him, he can see you. And you can always see him.
because ordinary life is already a nightmare.
He did it
this is great, I love the fast pace of the video, the detail you go into and also the sense of progress - it's like I'm getting the pleasure of programming the thing myself but in a small capsule and all the hours debugging were stripped away
I've just made a simple raycasting engine and I can recommand one thing to all novices that are trying to make it as well: I tried the approach from 3:35 but found it surprisingly difficult. There was a lof of problems with the trigonometric functions that produced 0s and infinities, hence with the range of variables and also with checking cooridnates of walls etc... finally I gave up and used another approach from the channel The Coding Train. He used formulas for fiding intersactions between lines and line segments and
1) I found it a lot of easier - no trigonometric fanctions!
2) This gives much broader range of possibilities - the walls doesn't need to be perpendicular to each other any more. The map doesn't need to be divided to equal squares! :D
By formula, do you mean the Line segment intersection formula (usually used in Finding convex hulls ) ?
@@nishanth6403 I mean formulas provided by the channel. After writing the comment I figured out where they come from. Let me explain here.
(1-t)*A+t*B
is a line segment from A to B for 0=0 and 0
I also developed this solution but it is inferior to the dda algorithm because you check for each line segment for each ray.
UPDATE!!!! I UPLOADED THE NEXT PART: ua-cam.com/video/OpIS1zoz6fU/v-deo.html
This is the longest video I've ever made! So be sure to like it if you enjoyed it. It costs you nothing, but you'll make my day!
Also, consider supporting this channel on Patreon for exclusive content as well as early access to future videos and projects: www.patreon.com/Kofybrek
this is awesome, you explained everything in much more detail than i thought you would… and the code snippets just made it even better. dope video man
This is incredible. Congratulations, it's amazing how entertaining yet informative this video is
Please, let's see a part two! And thank you for posting your code! It is so helpful to a beginner like me.
I love these kind of videos, fast and informative.
I appreciate that you store the rays in arrays
Way to go, cant wait to see you add weapons or a HUD, I'd like to see that
I loved this video man!! I think I might make a devlog now, you have inspired me
wow you cram so much information into these videos and yet still make it entertaining and enjoyable...that can't be said for the majority of programming channels.
You have earned a sub. Great content. Highly underrated.
Just stumbled across ur channel. Great work! Very underrated channel. I will 100% share with friends.
Quality content! Subbed! Good job !
Dude, you're hilarious! Loved the love for SFML
looks awesome! good work
l like the fact he tries to explain every hardcore detail on how this works. You should never stop this channel!!!
Btw an image generator will make this one of the best c++ fps xD
I have never laughed so much watching a programming video 😆
This is the first video of yours I've seen, you earned a new subscriber.
Great video! It looks amazing. I've just made my own raycasting engine, maybe thanks to you I'll learn how to texture the walls and how to refine the math.
the intro lasts literally just 6 seconds and jumps right into the video with no channel introductions or "but first" 's and I respect that
Brother you are so underrated you deserve more, making a 3D game with no game engine is insane
honestly get so many laughs out of your videos, very funny guy!
Thank you for the information.
Great content as always
I am happy to have discovered your channel.
Its very good! Working! Thanks.
Great work! I'd love to see this continued!
YES PLEASE! WITH SLOWER EXPLAINATION
@@haizk I think his point was to showcase what he did, not teach it. He obviously doesn't want a 40 minute video explaining every little thing when his code is linked in the description and there's plenty of material online to learn this stuff.
@@puppergump4117 Maybe🤣😭 Yea, but I'm too dumb to understand his code by myself. I'm trying
@@haizk You're not going to understand it all in one go. True understanding comes from working with each concept many times. What he's showing is just one way of using the concepts. Just take it slow.
@@puppergump4117 Thanks for your advice!
Very good work:)
Great video. Subbed
You are really talented. And I like your avatar, especially eyelids of that guy(us/viewers) that jells at you for using vectors... xD
I love this.
Great video!
That's awesome!
Awesome !
very well explained in a funny way.
Merci beaucoup mon ami.
;)
This shows how hard even the simplest things is to code in C++ and SFML
Thank you very much man
Most excellent work, trying to teach my pre-teen kids game programming and they love your videos. Before you get too carried away in 3D math recreating Quake after Wolfenstein, don't forget 2D Platform games like Donkey Kong / Super Mario Brothers. Like how do you run and jump with realistic momentum and gravity? How do you swap sprites to make the character look like it's walking/running/jumping/smashing? How do you scroll the screen sideways to move thru a level?
in reference to your first two question, I feel I may be able to help.
1. You could make a run function where when active dX AKA direction X's speed is larger. You could make the function be used when a key e.g. shift is A. toggled B. held. For jumping, you could make a variable called gravity and find a good value for it so when you jump it counteracts your jump's speed. For realism you may want to use a method of having a max speed that you can go, yet when that speed is reached, the max speed increases, until you get to a max-max.
2. For the sprites you may want to get a few frames of your sprite in different positions for each animation and loop through the images when the action is happening.
I hope I helped.
You sir, are a genius
Cool bro, I learned programming since 2020, I learned some programming languages such as scratch, python, java, javascript, lua, c and c++. Python is my favorite programming language, I make a game in python using a library called pygame. I learned c++, so I going to learn sfml, so I am a sfml beginner, I hope I can master c++ and sfml too.
This is very very impressive, this is like John Carmack levels of programming
if u keep on doing you can grow your channel to the skies of millions subs
Awesome work lol
Yoo this is so good
Guy, your Gaelic accent just got me.
1:38 is a great mistake. It's like if your character has lost complete control. It reminds me of yandere sim, and of the madness combat series.
this was really interesting! I am looking to do something like this inspired by doom (1993) and arsenal...
Actually Doom did not use Raycasting but rasterization using BSP (binary space paritioning) :D
we need kofybrek subreddit
@Jerard Marcaname?
I can't believe you did it! Thank you!
@Jerard Marca I joined :)
hmmmmmmmmmmmmmm.....(thousand yard long stare )..... i learnt a lot
I realy want to see part 2
Mind blowing video. Great work It’s very impressive. Please suggest some books or courses to gain this kind of knowledge in programming.
I read the book "Beginning C++ Through Game Programming" by Michael Dawson to learn the basics.
Then I watched a bunch of UA-cam videos on topics I was interested in.
@@Kofybrek okay. Thanks for the suggestion.
9:25 This is my favorite part in the video xD
i love steven!! Please make this into a game.... for steven!!
Will you make a tutorial for these games?
Btw your videos are awesome.. Keep it up
Glad you liked it! I'll think about making tutorials.
This is basically a tutorial already, he tells you what to do..
dude, that was amazing... i mean... that simple? just boom... books math... old school 3d... everybody else just cant build a 2d game and make it 3d? you make it look so simple! i cant do it... but thats just magic you know... time is magic too, if you really think about it.
Bro I got a question, whats happen with the second part of the tutorial
Me just copying the raycasting code to make my ray tracer program: 👀👀👀
the dude just explained Doom's code and made the Doom: Friendly Edition
OMG this is soop satisfying
Just a correction, no DOOM doesn’t use raycasting it uses BSP.
I want to see part 2
You're using SFML? It does use OpenGL, doesn't it? I'm asking because I added texturing in my raycaster in SDL and it's unplayabe becuse it's that slow. I'm wondering what you (you and authors of other tutorials) are doing that texturing works so fast for you. :D
I don't use SDL so I can't answer your question. Sorry!
9:26
*His body was never found...*
you should make a part 2 and add weapons or something
You should probably start packing. Steven is coming...
what website do you use for the sfml shape types?
I use the official SFML website: www.sfml-dev.org/tutorials/2.5/graphics-vertex-array.php
@@Kofybrek Thank you so much! this will help a lot in my little 3d project
Please second part 🙏
my head kaput
I will find this as a passage for my own raycaster. Great work! Hope to make multiple wall textures and multi-elevated sectors possible.
EDIT:
There is a tutorial about how to make sectors and such possible but I guess I can't send a link to it here since I did it once and it disappeared.
Slight correction DOOM isnt on a raycasting engine, it divides it's geomentry on a binary tree and walk down to render the scene. It's clled BSP
L like it so much
Do you want to actually not re-casted it looks like it was requested but recasting cannot have walls that are not equal in height and the way they pulled off the 3-D with doom is impressive
lmao steveennn
9:18 I like Steven so calm :)
This video is giving me a panic attack, the jarring intro, the music, the way he talks so fast.
easy way ekonomi yang LOL yang dimaksud window? Xperia Z1 Compact
why did you quit your first channel
Reminds me of scratch
7:16
HM.
blue.
yellow.
HMMMMMMM.
I'm a beginner can recommend me a good raycasting course where everything is explained beginner friendly
3d dda true 3d caster engine, check cherno ray tracing/casting
z-buffer maan
not much more complex than blitting sprites, more pixels, per sprite
entity ray casting, so you have 3d model, of even a 2d character, flat 3d model, in the ray casting grid
You should do make things hard on yourself
Where part two?
Part two?
2:28 no comment
thats ironic
Soring the rays in an array, and then using a vertex array to draw the rays, from the arrays 😆
Can you make chess ? 😁
Maybe...
part 2
3:31 Doom didn’t use raycasting
You mess up here.. you were using Lodev approach from its tutorial as you showed. There is No need to make fisheye correction and rest that voodoo with filling gaps. You took very optimized algorithm and made it.. unoptimized ;-) anyway "correction" means that something is not well done and need fixing, you can make it correct "out of box" as in Lodev tutorial..
Hey I made a raycaster too but I'm not a programmer so yeah it's terrible
the way you handle your mouse input is trash, you can't get subpixel precision and mouse tends to be moved to the wrong pixel on weird revolutions causin inputs to get stuck. You should handle mouse input directly from the Device struct, and just confine/lock cursor to the window and hide it
Day 1 of asking of sonic
Doom was NOT made with raycasting.
Woo, I understand none of that.
Cool stuff tho
Open gl better xD
I know. But I don't know. So, y'know.
I can only code this
Falseff2 .,(2 true)
Rick.(rolls) with - fish
Omg i relized i can code in fortnite!!