Make C++ Games using Godot!!

Поделиться
HTML-код
  • Опубликовано: 21 дек 2024

Комментарии • 64

  • @umen2424
    @umen2424 9 месяцев назад +74

    "Finally, more C++ tutorials, please. Currently, you are the only source of truth for Godot and C++.

  • @loganjones8334
    @loganjones8334 8 месяцев назад +6

    Very well put together. Just the right amount of depth to give a good overview of this development workflow. Subbed!

  • @TJ-fv9vs
    @TJ-fv9vs 9 месяцев назад +12

    Thanks a lot for sharing your experience with C++ in Godot! I'm currently learning GDScript. But I have used C++ in the past, so it's a topic I'm also interested in for computationally intensive calculations within the Godot context. Your introduction to this topic is certainly very helpful to me 😊

  • @robinj6997
    @robinj6997 5 месяцев назад +3

    Worked great! Thank you for sharing. Wishing for more C++ content in the future. I start today, leaving Unreal Engine behind.

  • @sadasd-n2f
    @sadasd-n2f 5 месяцев назад +5

    This feels like open source unreal engine with C++ and I am here for it.

    • @michaeljburt
      @michaeljburt  5 месяцев назад +2

      I might not go that far :) Godot is a very capable 3D engine (although people generally don't know this) but it is nowhere near as heavy, or feature rich as UE. Luckily, there are lots of awesome add-ons (e.g. Terrain3D) to complement it.

  • @sr.g
    @sr.g 8 месяцев назад +3

    Sublime!

  • @CluTrading
    @CluTrading 7 месяцев назад +2

    we need more kings like you❤🙌

  • @WildGrowthJ
    @WildGrowthJ 4 месяца назад

    Dude, I wish there was a stronger form of like button for the amount of pain you have saved me with those tips! Well done!

  • @lehisluguer9300
    @lehisluguer9300 8 месяцев назад +4

    nice tutorial mate... I'm wondering like, what would be the difference in Performance.. of a game made in C++ vs GDScript ? 🤔

    • @michaeljburt
      @michaeljburt  8 месяцев назад +5

      I haven't done benchmarking, but it's going to be significant, assuming you use the same node inheritance and logic. The code is ran natively on whatever machine it's running on rather than through the GDscript interpreter first.

    • @Pabloparsil
      @Pabloparsil 7 месяцев назад +1

      @@michaeljburt It would be an awesome video if you did a benchmark. There is not a single one in the whole youtube that I could find.

    • @aversiac-2
      @aversiac-2 5 месяцев назад +1

      100% depends. Especially C++ vs C#. You can write something in C++ thatll be difficult to match in C#, and vice-versa. This is why people tell you to just pick up a language and stick with it. You have to be a good C++ programmer to write something performant in C++, this is not quite the same in stuff like C# or GDScript; the only advantage C++ gives you is being closer to the hardware which is a double-edged sword (you can very easily write something in C++ that is half as fast as C# code if you are not skilled)

    • @lehisluguer9300
      @lehisluguer9300 5 месяцев назад

      @@aversiac-2 yep,having closer access to low level programming stuff is the idea.. but I think there is a lot of performance losst by using GDScript or C# because it needs to bind the C++ functions inside Godot... It's like you written a book in English, but you translate it to Chinese, and then translate it back to English... (There you lost a lot of performance, by using multiple languages)

    • @aversiac-2
      @aversiac-2 24 дня назад +1

      @@lehisluguer9300 That's not entirely true. The C# is essentially compiled to native code. You could argue that writing your own C++ alongside the native code is inherently more performant. But the thing is, C++ is one of those languages that can vary quite a lot. So it isnt exactly like youre both "speaking English", more like Godot C++ has its own specific dialect, and you, naturally, will have your own. You need to understand your differences and compensate. This is a major reason why many C++ devs stay away from GDExtension or any codebase written in C++ that is not well documented.

  • @GerlachGaming-rt3gj
    @GerlachGaming-rt3gj Месяц назад

    i've added the launch.vs.json to .vs but there's no debugging option

  • @DarkShroom
    @DarkShroom 22 дня назад

    gdextension is a real harsh mistress though lol, two days in i'm still working out how to get around bugs needed to learn pointers and macros to save all the typing.... still have bugs now but 2 days of solid coding for my framework itself.... i had good api knowledge already if that sounds fast, if that sounds slow wow you are a hardcore coder.... for me ths is my first serious cpp, i'm trying to do some fluid simulation
    thanks for the video, i needed a break

    • @michaeljburt
      @michaeljburt  19 дней назад

      No worries! C++ is tough with the use of pointers and references. Luckily Godot has a relatively straightforward use in their code base (and this includes GDextension), namely, that node references use pointers and that resources use RefCounted so that resource management is just handled under the hood.

  • @JasonLothamer
    @JasonLothamer 9 месяцев назад +4

    At the beginning you mention that there was a reason to use VS rather than VSCode, but I didn't catch the reason if it was mentioned later in the video. What's the issue with VSCode?

    • @michaeljburt
      @michaeljburt  9 месяцев назад +8

      Yeah sorry, I wasn't super clear there. It's just extremely slow for debugging in windows, and sometimes it crashes altogether. Stepping through breakpoints is so much better in VS.

    • @puppergump4117
      @puppergump4117 9 месяцев назад +3

      vscode is just notepad with extra steps. I use it to write minecraft coordinates and that's about it.

    • @unlxck3255
      @unlxck3255 8 месяцев назад +2

      @@puppergump4117 why dont you just use notepad lmao

  • @WildGrowthJ
    @WildGrowthJ 4 месяца назад +1

    How did you get your breakpoints working? Ive got debug symbols = yes, but it keeps saying how symbols have not been loaded. Perhaps a mismatch with the msvc compiler and scons which uses a different one?

    • @michaeljburt
      @michaeljburt  4 месяца назад +1

      Just commenting here for posterity - it seems the issue was using the mono version of the engine. You can still build and run, but no breakpoints.

  • @umen2424
    @umen2424 8 месяцев назад

    All working great but when setting breakpoints it doesn't stop

    • @michaeljburt
      @michaeljburt  8 месяцев назад +1

      Likely it means you aren't building your GDextension with debug symbols

    • @umen2424
      @umen2424 8 месяцев назад

      @@michaeljburt scons : -j4 target=template_debug dev_build=yes debug_symbols=yes , the product is gdexample.windows.template_debug.dev.x86_64.dll

  • @DonatemangaCom
    @DonatemangaCom 4 месяца назад

    Amazing video!

  • @aamorous
    @aamorous 9 месяцев назад +1

    is it possible to target different platforms, e.g mobile using gdextension?

    • @michaeljburt
      @michaeljburt  9 месяцев назад +1

      Definitely. It's just the platform you specify in the scons build. Then the .GDextension files points to it. When you export your game, the extension module file gets exported with your game. If you scroll towards the end of this video that's exactly what I'm doing with the web build.

    • @umen2424
      @umen2424 9 месяцев назад

      @@michaeljburt how to initialed the extension from the actual game in the editor ? how do you attach the scripts to the game object ?

    • @michaeljburt
      @michaeljburt  9 месяцев назад +1

      @@umen2424 not sure what you mean. If you extend the node class, then register the class in C++, you can just create a new node in the editor of that type.

  • @Montigorable
    @Montigorable 5 месяцев назад

    What about making a paid/free course on how to make a simple game using c++ in godot?

    • @michaeljburt
      @michaeljburt  5 месяцев назад +1

      That would be a good one to do. If I ever get time I'll consider it :) a little bit too busy these days

  • @ChopinDolphy
    @ChopinDolphy 8 месяцев назад

    What’s your intro music? It sounds sick😮

    • @michaeljburt
      @michaeljburt  8 месяцев назад

      Yeah it's a banger. But honestly it was just a free music clip in ClipChamp, so I have no idea!! Here is the link:
      clipchamp.com/content/cc_a3a6ce43f-Clock/

    • @michaeljburt
      @michaeljburt  8 месяцев назад

      Maybe search "Clock (Intro)"

  • @valden2217
    @valden2217 8 месяцев назад +1

    how do i setup the visual studio project? i've added the launch.vs.json to .vs but there's no debugging option
    Edit: manage to get the godot_debug configuration appear but godot has exited with code 255 (0xff) in an instant
    Edit: previous problem is solved, though got another error message, can't run project: no main scene defined in the project even though the directory included in args contain both project.godot and the .tscn file
    Edit: nvm, fixed by setting the .tscn file as main scene in godot

    • @michaeljburt
      @michaeljburt  8 месяцев назад +1

      Sounds like you figured it out! Happy hunting.

    • @mixer2.0
      @mixer2.0 7 месяцев назад

      how did you fix godot exiting with code 255?

    • @valden2217
      @valden2217 7 месяцев назад +1

      i think it have something to do with missing main scene, make sure that you have a scene selected as main scene or you have a scene at all
      @@mixer2.0

    • @mixer2.0
      @mixer2.0 7 месяцев назад

      @@valden2217 I have.

    • @valden2217
      @valden2217 7 месяцев назад

      @@mixer2.0 sorry i don't know the fix for your problem. I suggest you try to find the solution in stack exchange/godot forum or using AI like gpt

  • @realmcafee
    @realmcafee 9 месяцев назад +2

    uff c++ and unreal is hard to find, but how did i manage to be here?

    • @michaeljburt
      @michaeljburt  9 месяцев назад +10

      Godot is calling for you!!

  • @JebaliJihed-g5c
    @JebaliJihed-g5c 7 месяцев назад

    can you do this other than visual studio like linux vim or any other linux ide

    • @michaeljburt
      @michaeljburt  7 месяцев назад +1

      You can, you just won't get debugging

    • @JebaliJihed-g5c
      @JebaliJihed-g5c 6 месяцев назад

      ​@@michaeljburt srry if im asking but what about VsCode ?

    • @sadasd-n2f
      @sadasd-n2f 5 месяцев назад

      @@JebaliJihed-g5c Even in unreal engine, you either use Rider or Visual Studio if you're serious about C++ pretty much

  • @mixer2.0
    @mixer2.0 7 месяцев назад

    Godot opens projects manager instead of project itself. And after choosing project debugger detaches. Why is that?

    • @michaeljburt
      @michaeljburt  7 месяцев назад

      Hmm, early in the video I go through both options. It really depends on what argument you launch the engine with

    • @mixer2.0
      @mixer2.0 7 месяцев назад

      @@michaeljburt I have everything setup as you have. When I launch Godot game config, godot instantly exits with code 255

  • @igdmarandici4946
    @igdmarandici4946 6 месяцев назад +1

    Nice!!! 👉More C++ tutorials👈

    • @michaeljburt
      @michaeljburt  5 месяцев назад

      I've got a couple ideas for more C++ vids. I'm going to try to gauge the interest in "roll your own" engines, using vcpkg, cmake, and libs like SDL2, bgfx, etc.

  • @MaplewoodStreet
    @MaplewoodStreet 4 месяца назад +1

    When you say to click "use this template" and later you refer to this as "downloading it", do you mean to use "use this template -> create new repository", "use this template -> open in a codespace", or " Code -> Download ZIP"? I am so immensely lost.

    • @michaeljburt
      @michaeljburt  4 месяца назад +2

      Hitting "use this template" is effectively the same as a fork, except it cleans the git history so it doesn't take as much space (you typically don't care about the repos history for template-like repos)