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

КОМЕНТАРІ • 131

  • @Test-iv4pm
    @Test-iv4pm 2 роки тому +197

    Why can I so easily imagine a horror game simply called "Steven"?

    • @xhenryx14
      @xhenryx14 2 роки тому +8

      I mean after seeing him from backwards and slowly rotating like that it's expected

    • @pixelrunner2775
      @pixelrunner2775 Рік тому +5

      If you can see him, he can see you. And you can always see him.

    • @magnuswootton6181
      @magnuswootton6181 Рік тому

      because ordinary life is already a nightmare.

    • @VGCCCCC
      @VGCCCCC 7 місяців тому

      He did it

  • @markoftheland3115
    @markoftheland3115 2 роки тому +43

    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

  • @plrc4593
    @plrc4593 2 роки тому +26

    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

    • @nishanth6403
      @nishanth6403 Рік тому +2

      By formula, do you mean the Line segment intersection formula (usually used in Finding convex hulls ) ?

    • @plrc4593
      @plrc4593 Рік тому +2

      @@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

    • @burzum_
      @burzum_ Рік тому +1

      I also developed this solution but it is inferior to the dda algorithm because you check for each line segment for each ray.

  • @Kofybrek
    @Kofybrek  2 роки тому +83

    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

  • @DeathAtYourDoorStep
    @DeathAtYourDoorStep 2 роки тому +1

    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

  • @CamiloGomezDev
    @CamiloGomezDev 2 роки тому +2

    This is incredible. Congratulations, it's amazing how entertaining yet informative this video is

  • @scottpinkston5571
    @scottpinkston5571 Рік тому +2

    Please, let's see a part two! And thank you for posting your code! It is so helpful to a beginner like me.

  • @bob-zb3ed
    @bob-zb3ed Рік тому +2

    I love these kind of videos, fast and informative.

  • @Test-iv4pm
    @Test-iv4pm 2 роки тому +8

    I appreciate that you store the rays in arrays

  • @bioman1hazard607
    @bioman1hazard607 2 роки тому +2

    Way to go, cant wait to see you add weapons or a HUD, I'd like to see that

  • @SpencerYonce
    @SpencerYonce Рік тому

    I loved this video man!! I think I might make a devlog now, you have inspired me

  • @acatisfinetoo3018
    @acatisfinetoo3018 2 роки тому +2

    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.

  • @saadahmed688
    @saadahmed688 2 роки тому +2

    You have earned a sub. Great content. Highly underrated.

  • @toksic424
    @toksic424 2 роки тому

    Just stumbled across ur channel. Great work! Very underrated channel. I will 100% share with friends.

  • @NightFoxPt08
    @NightFoxPt08 2 роки тому

    Quality content! Subbed! Good job !

  • @strawberrypancake3253
    @strawberrypancake3253 2 роки тому +1

    Dude, you're hilarious! Loved the love for SFML

  • @tekkvega
    @tekkvega 2 роки тому +1

    looks awesome! good work

  • @ChrisVideosGreek
    @ChrisVideosGreek 2 роки тому

    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

  • @jammincoder
    @jammincoder 2 роки тому +1

    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.

  • @plrc4593
    @plrc4593 2 роки тому

    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.

  • @pixelrunner2775
    @pixelrunner2775 Рік тому +1

    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

  • @houcinechammakh4789
    @houcinechammakh4789 Рік тому +1

    Brother you are so underrated you deserve more, making a 3D game with no game engine is insane

  • @Anonymousewizard
    @Anonymousewizard 8 місяців тому

    honestly get so many laughs out of your videos, very funny guy!

  • @loszhor
    @loszhor Рік тому +1

    Thank you for the information.

  • @logicprojectsspeed2023
    @logicprojectsspeed2023 2 роки тому

    Great content as always

  • @amosnimos
    @amosnimos Рік тому

    I am happy to have discovered your channel.

  • @thatmcguy1799
    @thatmcguy1799 2 роки тому

    Its very good! Working! Thanks.

  • @Flippo731
    @Flippo731 2 роки тому +11

    Great work! I'd love to see this continued!

    • @haizk
      @haizk 2 роки тому

      YES PLEASE! WITH SLOWER EXPLAINATION

    • @puppergump4117
      @puppergump4117 2 роки тому +1

      @@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.

    • @haizk
      @haizk 2 роки тому

      @@puppergump4117 Maybe🤣😭 Yea, but I'm too dumb to understand his code by myself. I'm trying

    • @puppergump4117
      @puppergump4117 2 роки тому +1

      @@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.

    • @haizk
      @haizk 2 роки тому

      @@puppergump4117 Thanks for your advice!

  • @domon41c
    @domon41c Рік тому +1

    Very good work:)

  • @Ezdiess
    @Ezdiess 2 роки тому +1

    Great video. Subbed

  • @RootsterAnon
    @RootsterAnon 2 роки тому

    You are really talented. And I like your avatar, especially eyelids of that guy(us/viewers) that jells at you for using vectors... xD

  • @emperor8716
    @emperor8716 22 дні тому

    I love this.

  • @arivanhouten6343
    @arivanhouten6343 2 роки тому

    Great video!

  • @mrlucky974
    @mrlucky974 2 роки тому

    That's awesome!

  • @ra1n_
    @ra1n_ 2 роки тому +1

    Awesome !

  • @shaweewishissime6718
    @shaweewishissime6718 2 роки тому

    very well explained in a funny way.
    Merci beaucoup mon ami.
    ;)

  • @KingOfMadnesss
    @KingOfMadnesss 5 місяців тому

    This shows how hard even the simplest things is to code in C++ and SFML

  • @elhadede6
    @elhadede6 2 роки тому +1

    Thank you very much man

  • @stevenmitchell7697
    @stevenmitchell7697 2 роки тому +43

    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?

    • @lapto4676
      @lapto4676 2 роки тому +4

      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.

  • @antomegaytb
    @antomegaytb 9 місяців тому

    You sir, are a genius

  • @fdevstudio5692
    @fdevstudio5692 2 роки тому

    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.

  • @CloudlessStudio
    @CloudlessStudio 2 роки тому

    This is very very impressive, this is like John Carmack levels of programming

  • @felusion6290
    @felusion6290 2 роки тому +4

    if u keep on doing you can grow your channel to the skies of millions subs

  • @burzum_
    @burzum_ Рік тому

    Awesome work lol

  • @prodbytukoo
    @prodbytukoo 2 роки тому

    Yoo this is so good

  • @otistically
    @otistically 2 роки тому

    Guy, your Gaelic accent just got me.

  • @Test-iv4pm
    @Test-iv4pm 2 роки тому +3

    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.

  • @le9038
    @le9038 2 роки тому +1

    this was really interesting! I am looking to do something like this inspired by doom (1993) and arsenal...

  • @deepvertic
    @deepvertic 2 роки тому +1

    Actually Doom did not use Raycasting but rasterization using BSP (binary space paritioning) :D

  • @birbylikesfox1032
    @birbylikesfox1032 2 роки тому +5

    we need kofybrek subreddit

    • @birbylikesfox1032
      @birbylikesfox1032 2 роки тому +1

      @Jerard Marcaname?

    • @Kofybrek
      @Kofybrek  2 роки тому +1

      I can't believe you did it! Thank you!

    • @WinterNox
      @WinterNox 2 роки тому +1

      @Jerard Marca I joined :)

  • @124k3_
    @124k3_ 6 місяців тому

    hmmmmmmmmmmmmmm.....(thousand yard long stare )..... i learnt a lot

  • @mindaugassvajoklis3072
    @mindaugassvajoklis3072 Рік тому +1

    I realy want to see part 2

  • @akshatrai1800
    @akshatrai1800 2 роки тому +1

    Mind blowing video. Great work It’s very impressive. Please suggest some books or courses to gain this kind of knowledge in programming.

    • @Kofybrek
      @Kofybrek  2 роки тому +1

      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.

    • @akshatrai1800
      @akshatrai1800 2 роки тому

      @@Kofybrek okay. Thanks for the suggestion.

  • @negai_
    @negai_ Рік тому +1

    9:25 This is my favorite part in the video xD

  • @2dapoint424
    @2dapoint424 Рік тому

    i love steven!! Please make this into a game.... for steven!!

  • @hassanbo8200
    @hassanbo8200 2 роки тому +4

    Will you make a tutorial for these games?
    Btw your videos are awesome.. Keep it up

    • @Kofybrek
      @Kofybrek  2 роки тому +2

      Glad you liked it! I'll think about making tutorials.

    • @nikkiofthevalley
      @nikkiofthevalley Рік тому

      This is basically a tutorial already, he tells you what to do..

  • @sebastianwardana1527
    @sebastianwardana1527 Рік тому

    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.

  • @user-dn3pn1uw7h
    @user-dn3pn1uw7h 8 місяців тому +1

    Bro I got a question, whats happen with the second part of the tutorial

  • @edithfigueroabarros5571
    @edithfigueroabarros5571 Рік тому

    Me just copying the raycasting code to make my ray tracer program: 👀👀👀

  • @ClooverDev
    @ClooverDev 2 роки тому

    the dude just explained Doom's code and made the Doom: Friendly Edition

  • @treyhenry4796
    @treyhenry4796 2 роки тому

    OMG this is soop satisfying

  • @BasedGamer12
    @BasedGamer12 6 місяців тому +1

    Just a correction, no DOOM doesn’t use raycasting it uses BSP.

  • @msmalik681
    @msmalik681 2 роки тому

    I want to see part 2

  • @plrc4593
    @plrc4593 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

    • @Kofybrek
      @Kofybrek  2 роки тому

      I don't use SDL so I can't answer your question. Sorry!

  • @psychotank6577
    @psychotank6577 2 роки тому

    9:26
    *His body was never found...*

  • @SabeDoesThingsChannel
    @SabeDoesThingsChannel Рік тому

    you should make a part 2 and add weapons or something

  • @effdotsh
    @effdotsh 2 роки тому +4

    You should probably start packing. Steven is coming...

  • @amop2250
    @amop2250 2 роки тому

    what website do you use for the sfml shape types?

    • @Kofybrek
      @Kofybrek  2 роки тому

      I use the official SFML website: www.sfml-dev.org/tutorials/2.5/graphics-vertex-array.php

    • @amop2250
      @amop2250 2 роки тому

      @@Kofybrek Thank you so much! this will help a lot in my little 3d project

  • @dtalaverin889
    @dtalaverin889 2 роки тому

    Please second part 🙏

  • @woff5
    @woff5 Місяць тому

    my head kaput

  • @meerjel0120
    @meerjel0120 Рік тому

    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.

  • @oddity1769
    @oddity1769 Рік тому

    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

  • @chuotpado7592
    @chuotpado7592 2 роки тому +2

    L like it so much

  • @cjgamesstudios3289
    @cjgamesstudios3289 2 роки тому

    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

  • @ModdinMC
    @ModdinMC 10 місяців тому

    lmao steveennn

  • @WinterNox
    @WinterNox 2 роки тому +2

    9:18 I like Steven so calm :)

  • @HalfAsleepSam
    @HalfAsleepSam 2 роки тому

    This video is giving me a panic attack, the jarring intro, the music, the way he talks so fast.

  • @khafidzridho-
    @khafidzridho- 2 роки тому

    easy way ekonomi yang LOL yang dimaksud window? Xperia Z1 Compact

  • @thelanguagegeek6207
    @thelanguagegeek6207 Рік тому

    why did you quit your first channel

  • @honlt4678
    @honlt4678 Рік тому

    Reminds me of scratch

  • @nitrogenez
    @nitrogenez 2 роки тому

    7:16
    HM.
    blue.
    yellow.
    HMMMMMMM.

  • @rayyanhaider8593
    @rayyanhaider8593 Рік тому

    I'm a beginner can recommend me a good raycasting course where everything is explained beginner friendly

  • @Jkauppa
    @Jkauppa Рік тому

    3d dda true 3d caster engine, check cherno ray tracing/casting

    • @Jkauppa
      @Jkauppa Рік тому

      z-buffer maan

    • @Jkauppa
      @Jkauppa Рік тому

      not much more complex than blitting sprites, more pixels, per sprite

    • @Jkauppa
      @Jkauppa Рік тому

      entity ray casting, so you have 3d model, of even a 2d character, flat 3d model, in the ray casting grid

  • @Junkman
    @Junkman Рік тому +1

    You should do make things hard on yourself

  • @DE012471
    @DE012471 2 роки тому

    Where part two?

  • @RemotelyHuman666
    @RemotelyHuman666 Рік тому

    Part two?

  • @Test-iv4pm
    @Test-iv4pm 2 роки тому +1

    2:28 no comment

  • @ncot_tech
    @ncot_tech 2 роки тому

    Soring the rays in an array, and then using a vertex array to draw the rays, from the arrays 😆

  • @ninebysixteen222
    @ninebysixteen222 2 роки тому

    Can you make chess ? 😁

  • @jasm0_0
    @jasm0_0 2 роки тому

    part 2

  • @zappafurious
    @zappafurious Рік тому

    3:31 Doom didn’t use raycasting

  • @tedeusz83
    @tedeusz83 Рік тому

    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..

  • @WinterNox
    @WinterNox 2 роки тому +1

    Hey I made a raycaster too but I'm not a programmer so yeah it's terrible

  • @v0xl
    @v0xl Рік тому

    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

  • @Spymixiu
    @Spymixiu Рік тому

    Day 1 of asking of sonic

  • @easylemon6640
    @easylemon6640 Рік тому +2

    Doom was NOT made with raycasting.

  • @bailey2652
    @bailey2652 7 місяців тому

    Woo, I understand none of that.
    Cool stuff tho

  • @shrippie-4214
    @shrippie-4214 2 роки тому +1

    Open gl better xD

    • @Kofybrek
      @Kofybrek  2 роки тому

      I know. But I don't know. So, y'know.

  • @Whatabcdef
    @Whatabcdef 2 роки тому

    I can only code this
    Falseff2 .,(2 true)
    Rick.(rolls) with - fish

    • @Whatabcdef
      @Whatabcdef 2 роки тому

      Omg i relized i can code in fortnite!!