Remaking My First Game in C++

Keep exploring at brilliant.org/TheCherno/ Get started for free, and hurry-the first 200 people get 20% off an annual premium subscription.
Patreon ► / thecherno
Instagram ► / thecherno
Twitter ► / thecherno
Discord ► / discord
This video is sponsored by Brilliant.

Пікірлер: 190

  • @TheCherno
    @TheCherno Жыл бұрын

    Thanks for watching! Hope you enjoy this new little series! ❤ Don't forget to check out brilliant.org/TheCherno/ - get started for free and hurry-the first 200 people get 20% off an annual premium subscription.

  • @oamioxmocliox8082

    @oamioxmocliox8082

    Жыл бұрын

    ;)

  • @tsalVlog

    @tsalVlog

    Жыл бұрын

    looking forward to the rest - also, more Breville footage!

  • @xenon7814

    @xenon7814

    Жыл бұрын

    Thank you dude, your series are awesome 👌👌👌by the way what is the name of the theme u are using in visual studio ?

  • @Scotty-vs4lf

    @Scotty-vs4lf

    Жыл бұрын

    you forgot to put the link think for the code review at the start 0:07

  • @GoggledGecko
    @GoggledGecko Жыл бұрын

    Lol, that first sentence caught me off guard

  • @filipm133
    @filipm133 Жыл бұрын

    Making another version with vulkan at the end is a great idea. Hope you finish this series

  • @annoyingman6184

    @annoyingman6184

    Жыл бұрын

    M8 it is vulkan not "Vulcan"

  • @chefaku

    @chefaku

    Жыл бұрын

    Vulkan is the most attractive name ever created. it is heresy to write it with c xd

  • @filipm133

    @filipm133

    Жыл бұрын

    @@chefaku my bad

  • @chefaku

    @chefaku

    Жыл бұрын

    @@filipm133 is ok. I was just kidding🥖

  • @MrHuman-iy5lw

    @MrHuman-iy5lw

    Жыл бұрын

    @@annoyingman6184 no the api called vulkan.

  • @phusicus_404
    @phusicus_404 Жыл бұрын

    Please make >=40 min long videos, 20 min is too short And I'm happy to see all of these series!

  • @pxolqopt3597

    @pxolqopt3597

    Жыл бұрын

    This video is already 40 mins

  • @SENTRY456123

    @SENTRY456123

    Жыл бұрын

    @@pxolqopt3597 technically it's shorter than 40 mins so he makes sense 🤓

  • @pxolqopt3597

    @pxolqopt3597

    Жыл бұрын

    @@SENTRY456123 But its also not 20 minutes long

  • @steakiefrags1866
    @steakiefrags1866 Жыл бұрын

    I remember watching the original series a couple years ago when i first started learning java and coding in school. Through this series you helped me elevate my skills way beyond the required skills to ace the course, just within a month. And now i am a graduated software engineer. Thank you so much for the help! Im really looking forward to this series after so many years of software development and experience

  • @filipm133

    @filipm133

    Жыл бұрын

    what was the original series?

  • @steakiefrags1866

    @steakiefrags1866

    Жыл бұрын

    @@filipm133 kzread.info/dash/bejne/eXqNtpmFodeXmJs.html there you go

  • @SecretX1
    @SecretX1 Жыл бұрын

    I loved this video, please continue. I like the approach where you go solving the issues as they arise oppose to trying to specialize the video solving a single thing, it helps me absorb the thinking process a lot better because that way I get the context around the issue too, which helps a lot a beginner like myself understand the whole picture. I'm always saying to myself that I would make a game but never actually took the time to learn how to make one, this series seems to be exactly what I was looking for, thank you very much.

  • @hugofriberg3445
    @hugofriberg3445 Жыл бұрын

    I watched the original series when I was in 6th grade, and I think it was THE thing that made me interested in programming. Back then I scratched my head on ”public static void main(String[] args)” Now I’m in uni and scratching my head to the OSI model and the winsock API. Thank you so much for all the motivation and education through the years! Both here on youtube and on twitch

  • @techbytefrontier
    @techbytefrontier Жыл бұрын

    I nice thing to have in this kind of series is talk a little about design patterns, maybe even a little draw about how the classes should comunicate with each other.. this is something that i strugle a lot when starting a new project. There as so many ways a could do it that i simply get stuck. Idk just an idea, during the series you could make one video only talking about the design pattern or something that would be very cool. Thanks a lot , your videos are great!

  • @sumikomei
    @sumikomei Жыл бұрын

    I really appreciate all of the commentary and explanations and thought process of what you're doing and thinking, helps me follow along of course but I also learn quite a lot about various things that way.

  • @hayden.A0
    @hayden.A0 Жыл бұрын

    I quite enjoyed this video, definitely nice to see a real look at the thought process behind a project like this. I look forward to the upcoming episodes!

  • @kalleandrejohansson6567
    @kalleandrejohansson6567 Жыл бұрын

    This is one of the best series i've seen on c++ game dev. It is so helpful to "hear you think". Thank you!

  • @kentril5944
    @kentril5944 Жыл бұрын

    I definitely like the longer videos more, especially when they are uncut, because only then I can see the way you approach certain problems, your rationale along the way, and consequently how you solve the problems with all the great commentary around. It provides a very good reflection on my own thought process when I deal with similar problems and not just in C++ with Vulkan and ImGui. That kind of sneak peek in how you really approach the real issues is the most valuable takeaway for me. Keep it up, would definitely like to see more.

  • @dongueW

    @dongueW

    Жыл бұрын

    agreed

  • @SoederHouse
    @SoederHouse Жыл бұрын

    Perfect revamping project for the channel! Looking forward to it.

  • @_CJ_
    @_CJ_ Жыл бұрын

    looks great. This is what I want from tutorials - follow some things a bit into rabbit hole to explain what is happening and what I can try to change and have fun with! Ideally do both longer and more often episodes ;D

  • @DRAGON_FullPower
    @DRAGON_FullPower Жыл бұрын

    Great episode! Please continue this series!

  • @HappyMatt12345
    @HappyMatt12345 Жыл бұрын

    It makes me feel much better to see someone who knows much more about programming than I do struggling with something turning out to be much trickier to do than expected the way I do virtually every time I write new code.

  • @zaxn1234
    @zaxn1234 Жыл бұрын

    Long videos are great! :D Even if it's like a 3+ hour stream VOD upload I'd happily watch

  • @LongestYardstick
    @LongestYardstick Жыл бұрын

    I'm excited about this series! Looking forward to the vulkan optimizations :)

  • @rodrigomarambio3882
    @rodrigomarambio3882 Жыл бұрын

    great idea for a serie!, thanks, looking forward for other episodes

  • @AdanosAdanosu
    @AdanosAdanosu Жыл бұрын

    I think for `m_ImageData` you can use `std::vector` (or whatever dynamic array abstraction you can have) instead of the raw pointer. That way you could avoid doing manual memory management and rely on RAII instead. Above that, whenever the screen resizes you can just call `resize` instead of writing out the deallocation, reallocation, and refilling with data. The pointer to the pixel data can then be obtained by calling `data`. Can't wait for the next episode!

  • @erikabutler6893

    @erikabutler6893

    Жыл бұрын

    This

  • @aodfr

    @aodfr

    11 ай бұрын

    You can. But depending on your platform and compiler stl might not exist. Typically most commercial game engines build a core framework which implements all data structures for this issue.

  • @AdanosAdanosu

    @AdanosAdanosu

    11 ай бұрын

    @@aodfr While this is true, I don't think this project will ever run into problems for using STL.

  • @milasudril

    @milasudril

    9 ай бұрын

    For this case, std::unique_ptr would be more appropriate. You should almost never use naked new.

  • @wxwefr
    @wxwefr Жыл бұрын

    Hey cherno, I get you get this a lot but thank you for making this type of content. It has helped me immensely with my C++.

  • @itsBlendish
    @itsBlendish Жыл бұрын

    I definitely like the idea of "byte sized" videos. This series is gonna be so cool!

  • @roadofcodelord
    @roadofcodelord Жыл бұрын

    Awesome work! I'm going to try this soon! Thx!

  • @carlosdalomba
    @carlosdalomba Жыл бұрын

    Wow.......... I literally just restarted following your Java/Game Programming series this past Dec 2022 (again, but in C++, in part thanks to your OpenGL series). I originally followed about 100/126 of your Java episodes starting in Aug 2014, but I remember quite a bit! This is amazing you're shedding light on how to do this, cause creating graphics-based programs has always been my interest but also my struggle. I know Unity very well, but.. doing it without a game engine? Rendering GUI/window-based applications? Cross-platform support? I've been interested in skills like these for years, but getting started can be so challenging! As always, thanks for helping light the path for people like me :).

  • @konkitoman
    @konkitoman Жыл бұрын

    I want to see a video where you are trying rust with wgpu for the graphics and winit for window initialization! I want to see your reaction to rust and what problems do you encounter!

  • @aashakil4596
    @aashakil45967 ай бұрын

    I exakhly like your videos ❤❤. They are well explained step-by-step. Amazing.

  • @gileadranada2584
    @gileadranada2584 Жыл бұрын

    Our thoughts? Videos like this are amazing! Really let's us see the thought process of a senior developer!

  • @StevenMartinGuitar
    @StevenMartinGuitar Жыл бұрын

    IMHO... Love all the details, love the 50 things in one ep, would like to see not the 'pure' recreation but... if someone *only* showed you the running game, not the java code, how you would remake this and do all the fancy improvements to modernise it.

  • @andrez383
    @andrez383 Жыл бұрын

    I'm so glad that you will show how to port a walnut app to mac.

  • @hamdyaaziz6353
    @hamdyaaziz6353 Жыл бұрын

    A friendly note as I haven’t looked at your framework nor vulkan, but you should grab the new memory first then deallocate the old one, so if you don’t get the memory you can still use the old one. On that note, I would consider just grabbing screen dimensions at the start of the app, allocating that much memory, then whenever you resize your app you just change where you are drawing to that buffer. I guess it’s more robust that way.

  • @szaszm_
    @szaszm_ Жыл бұрын

    In most cases, stack objects or uniquely owned heap objects would be sufficient, instead of shared_ptr. The image data could be stored in a std::vector, or a std::unique_ptr.

  • @-wokhead
    @-wokhead Жыл бұрын

    This was exactly what i needed thanks

  • @-wokhead

    @-wokhead

    Жыл бұрын

    36:35 also small mistake but you didnt use m_ImageScale there

  • @Scrawlerism
    @Scrawlerism Жыл бұрын

    your talking is extremely helpful!

  • @LautaroLosio
    @LautaroLosio Жыл бұрын

    I know this will be the typical shallow question you probably don't want to see on a video like this, but I really like the color scheme you're using and can't find it anywhere... Does it have a name? Great video btw, I love that you go really in depth but still keep it watchable and entertaining!

  • @user-bk8rp9zj6q
    @user-bk8rp9zj6q Жыл бұрын

    Could you please a video comparing OpenGL, Vulkan and DirectX? What graphics API should I bother with? What are their pros and cons?

  • @TurtleKwitty
    @TurtleKwitty Жыл бұрын

    Walnut should have a resize event that fires before update if it was resized, but barring that if update is the first to care about the size of th image it should be checked in update not UI that renders on top

  • @joleif4970
    @joleif4970 Жыл бұрын

    I think adding some improvements on the technical side is okay :)

  • @ultimatesoup
    @ultimatesoup8 ай бұрын

    I would suggest using static_cast instead of old c style casts. They make your intention clear

  • @crystalferrai
    @crystalferrai Жыл бұрын

    The way you are scaling is going to reveal more of the game when you make the window bigger rather than stretching the game. I think it would make more sense to used a fixed size buffer for the game and stretch the resulting image to fit the window. In other words, use a fixed image with a variable scale rather than a variable image with a fixed scale. As an added bonus, making this change means you won't need to reallocate the buffer or even care about window size changes.

  • @khoda81
    @khoda81 Жыл бұрын

    I think this series is perfect for livestreaming. I prefer the long (>40min) videos.

  • @RandomGuyyy
    @RandomGuyyy Жыл бұрын

    I would keep the window at a fixed size, conveniently sidestepping a lot of complexity. I would just do a straight port for educational purposes.

  • @stasdev
    @stasdev Жыл бұрын

    good stuff!

  • @seannolan2120
    @seannolan2120 Жыл бұрын

    I had that exact same problem with imgui images. It is because imgui ignores the samplers you provide. Upgrading to the latest imgui solves it.

  • @Anakom23
    @Anakom23 Жыл бұрын

    Thinking out loud is defining part of this video as educational one, because otherwise we (viewers) might not understand what was the idea behind decisions. Otherwise this is great, thank you a lot)

  • @KJ7JHN
    @KJ7JHN Жыл бұрын

    Update your screen size to screen width /2 and screen height /2. This allows for resizing.

  • @nobodynope2507
    @nobodynope2507 Жыл бұрын

    i think theres some vulkan bug where you have to turn off sampler anisotropy for vk_nearest to work

  • @andreadws7151
    @andreadws7151 Жыл бұрын

    I totally lost the motivation to learn coding but I still really enjoy your videos

  • @Anequit
    @Anequit Жыл бұрын

    would love to see the port to vulkan at the end

  • @jmac217x
    @jmac217x Жыл бұрын

    love and respect

  • @zorex324
    @zorex324 Жыл бұрын

    Well this is going to be interesting

  • @dav1dsm1th
    @dav1dsm1th Жыл бұрын

    I enjoy the longer videos.

  • @icesentry
    @icesentry Жыл бұрын

    i think an episode porting it to hazel-2d would be cool

  • @Scrawlerism
    @Scrawlerism Жыл бұрын

    the longer videos rock for me

  • @ssmith5048
    @ssmith5048 Жыл бұрын

    Really enjoy your videos and am learning much from them. Also, a HUUUUGE thank you that you are not still having background music as you had in many past videos. I find it really distracting, so thank you for cutting that out! Sorry I can´t conribute $ to you at the moment.

  • @useronuralp
    @useronuralp Жыл бұрын

    Def would love to see the Vulkan version of the game.

  • @anthonysteinerv
    @anthonysteinerv Жыл бұрын

    I'll be doing all of this from scratch, wait a minute I''ll be using this entire library made by myself lol.

  • @McShavey

    @McShavey

    Жыл бұрын

    To be fair, that's kind of how programming works.

  • @sebbl580
    @sebbl580 Жыл бұрын

    those long videos are cool yeah

  • @aloorinithin5099
    @aloorinithin5099 Жыл бұрын

    Hey Cherno , i've been thinking about buying Macbook Air m2 , will this be good for opengl and raytrcing programming ??? , let me know your thoughts.

  • @y4ni608
    @y4ni608 Жыл бұрын

    Hi, i have a question about testing, how do u test your game engine and how do u test collisions and physics and stuff

  • @trojan8550
    @trojan8550 Жыл бұрын

    Could you spice up the implementation with some multithreading magic?

  • @BoogeyMan-fu5yn
    @BoogeyMan-fu5yn Жыл бұрын

    Great video! I would like to learn cpp but i am unsure where to start? which one of your series would you recommend? thx

  • @mworld

    @mworld

    10 ай бұрын

    You need a goal. Make something simple.

  • @_StarLordBR
    @_StarLordBR Жыл бұрын

    Add support to DX11 in Wallnut, i'm interesting in working on. I don't have a AMD gpu to support vulkan :/

  • @BAMBAMBAMBAMBAM-
    @BAMBAMBAMBAMBAM- Жыл бұрын

    Cherno pls tutorial Edit: cherno pls "how tobuild ur own fstream library" like ur vectors video

  • @szaszm_

    @szaszm_

    Жыл бұрын

    It's a pain to extend iostreams. Just use std::ifstream and std::ofstream when interacting with files, or write your custom classes with a custom interface if you need new kinds of streams.

  • @guilherme5094
    @guilherme5094 Жыл бұрын

    Really nice👍

  • @sweetib3732
    @sweetib3732 Жыл бұрын

    How are you scaling your screen capture? is it just montage trick or some programm? Thanks in advance

  • @michelchaghoury9629
    @michelchaghoury9629 Жыл бұрын

    What visual Studio Theme are you using?

  • @simonfarre4907
    @simonfarre4907 Жыл бұрын

    If you are using ImGui why not just use Freetype for the font rendering as well?

  • @sunkuz
    @sunkuz Жыл бұрын

    Do you happen to have a video that goes over the concept of Batch Rendering, especially w/ OpenGL? Sorry to ask an unrelated question!

  • @TheCherno

    @TheCherno

    Жыл бұрын

    Yep, I have a whole series on that: kzread.info/head/PLlrATfBNZ98f5vZ8nJ6UengEkZUMC4fy5

  • @Zyhorn
    @Zyhorn Жыл бұрын

    you ask for what I want to see? Long videos? - yes plz Detailed videos? - yes plz Often? - yes plz You can assume that every time you say "let me know in the comments" the answer is always "yes" I really enjoy it all! Thank you

  • @robbo_
    @robbo_ Жыл бұрын

    15:45 "not have huge 40 minute long episodes" well that didn't work out

  • @tsalVlog
    @tsalVlog Жыл бұрын

    resize AND aspect zoom ;)

  • @thenotbaldguy4263
    @thenotbaldguy4263 Жыл бұрын

    You should have names this exodus😂😂

  • @astaghfirullahalzimastaghf3648
    @astaghfirullahalzimastaghf3648 Жыл бұрын

    @12:49 i got cannot open source file vulkan.h e1696 and identifier VkResult is undefined

  • @Basel-ll8fj
    @Basel-ll8fj Жыл бұрын

    very interesting

  • @greg77389
    @greg77389 Жыл бұрын

    At 18:00 why do you call emplace_back() with make_shared() inside? The latter already constructs a new object whereas emplace_back() is intended to create an object in place, so all you're really doing here is copy-constructing a temporary object, as opposed to using push_back which will either do the same thing or initiate a move-construction at the compiler's discretion.

  • @szaszm_

    @szaszm_

    Жыл бұрын

    It's all moved, and probably all moves are elided (i.e. instead of moving temporaries, constructing the same object in place), but push_back would achieve the same. I think it's down to personal preference. I prefer push_back, because it leaves less room for error: you can only pass in T with push_back, as opposed to being able to call all available constructors of T with emplace.

  • @CatzHoek
    @CatzHoek Жыл бұрын

    that you can jump to the explorer adress bar with ctrl+L and that the adress bar accepts commands is the real takeaway here

  • @ty.davis3
    @ty.davis3 Жыл бұрын

    Resizeable, >40 mins, and finish the series please!

  • @Jkauppa
    @Jkauppa Жыл бұрын

    it would be a nice sorting exercise to draw each pixel only once, ie, layered sorted rendering, before going to sorted ray casting 3d rendering, same logic

  • @Jkauppa

    @Jkauppa

    Жыл бұрын

    meta-programming is nice, no have to do anything yourself

  • @Jkauppa

    @Jkauppa

    Жыл бұрын

    meta-programming (design) also reveals all kinds of bugs beforehand, plan well, do less work, ie, right work from the start

  • @Jkauppa

    @Jkauppa

    Жыл бұрын

    walnut is absolute nuts, would you agree?

  • @Jkauppa

    @Jkauppa

    Жыл бұрын

    why, nintendo!

  • @S7ISCO
    @S7ISCO Жыл бұрын

    Hey i am new here tell me which software you are using here for coding c++

  • @ItIsYouAreNotYour
    @ItIsYouAreNotYour Жыл бұрын

    Sex and Link that sounds like a pretty common theme. I'm in.

  • @MrMShady
    @MrMShady Жыл бұрын

    "I got a feeling that we got a chemistry Gimme what's on your mind"

  • @miguelnasarrebudino9005
    @miguelnasarrebudino9005 Жыл бұрын

    I've been trying to install vulkan and getting it running in my computer but i always have driver issues, and its very dissappinting because it would be great if i could use walnut to make some projects i have in mind, my PC runs on intel hd graphics 5500, can anyone help me with this? :c (Im kind of a noob in this ive alwais programmed for console aplications)

  • @RunOfTheWild
    @RunOfTheWild Жыл бұрын

    Dumb question. My graphics card doesn't support vulkan. Are there any options for me to follow along?

  • @michaplucinski142
    @michaplucinski142 Жыл бұрын

    It was a great idea do recreate it Thank tou

  • @orangasli2943
    @orangasli2943 Жыл бұрын

    Man can you make another tutorial video for using macros? in the old video you show how to substitute std::cout into print(x).. But now what if the parameter is a pointer to an abstract class? can we do.. //#define calculateIndex(x) whichTileY(x->GetMouseY())*8+whichTileX(x->GetMouseX()) then anywhere in the source file we can pass the pointer inside the macros int main(){ olc::PixelGamEngine* pge; calculateIndex(pge); return 0; } How can we do we do like this? Of course we need a class that inherits and implement from the abstract class.. But just assume it is a pseudo code ok

  • @LifeOfMohammed
    @LifeOfMohammed Жыл бұрын

    Hi Cherno, Would you ever do anymore work around Java? Would be cool to see I love watching ur content but I am a Java dev haha

  • @lukeolesinski7439

    @lukeolesinski7439

    Жыл бұрын

    I am curious about this question too, as I was wondering why he does not program in Java anymore, and if it would be worth it to still follow those old tutorials...

  • @phusicus_404

    @phusicus_404

    Жыл бұрын

    I think cpp is his dear and only, he doesn't need any other

  • @thanosfisherman
    @thanosfisherman Жыл бұрын

    Has performance improved now?

  • @wjrasmussen666
    @wjrasmussen666 Жыл бұрын

    Is ray tracing series finished?

  • @TheRealZitroX
    @TheRealZitroX Жыл бұрын

    @15:44 you know that you could seperate numbers with _ like 1_000_000 or 1'000'000 to make it readable?

  • @samvodopianov9399
    @samvodopianov9399 Жыл бұрын

    No way Genesis 2 dropped

  • @boriscreativespace
    @boriscreativespace Жыл бұрын

    Was the original game inspired by Notch's Minicraft LD submission?

  • @randompigyt
    @randompigyt Жыл бұрын

    why do you hardcode the scaling factor in scaledWindoWidth and scaledWindowHeight?

  • @randompigyt

    @randompigyt

    Жыл бұрын

    @@TheCherno1 ok

  • @cal847
    @cal847 Жыл бұрын

    What extension do you use to draw over webpages?

  • @cal847

    @cal847

    24 күн бұрын

    For those of you with the same question, it's a program called ZoomIt

  • @kurt7020
    @kurt7020 Жыл бұрын

    Written it in a pure functional style you wouldn't have any bugs! (Or a game. 😂 )

  • @zlobert9877
    @zlobert9877 Жыл бұрын

    What is that Vs code theme?

  • @akarshitbatra1754
    @akarshitbatra1754 Жыл бұрын

    pls show each and every step 🙏 i want to follow it allow and make my first game too with c++

  • @overshifted
    @overshifted Жыл бұрын

    What is your vscode theme?

  • @schmidey6252
    @schmidey6252 Жыл бұрын

    Please show how you debug such things

  • @djrothm
    @djrothm Жыл бұрын

    A name for that could be Genesis++

  • @QWERTIOX
    @QWERTIOX Жыл бұрын

    can you update linux setup video to how to setup project for cpp in vs code?

  • @TRex266

    @TRex266

    Жыл бұрын

    He uses windows

  • @QWERTIOX

    @QWERTIOX

    Жыл бұрын

    @@TRex266 yep, but at the start of cpp series he made 3 videos, setup for windows, linux and mac