FuniGameDev
FuniGameDev
  • 10
  • 13 857
3D Debugging In My Own C++ Game Engine
Debugging games can be a complex task. That's why many of us game developers like to debug in 3D directly in the game. Hopefully this video will shine a little light into how 3D debugging renderers work. I'll show you how I implemented a 3D debugging system in my C++ game engine. It's mainly an explaration of singleton structures and how we can use globally accessible functions in C++.
I also made the little tinkerer character to put something visually interesting into my videos, let me know in the comments if you like this :)
00:00 Intro
00:27 How does debugging in 3D look like in game engines?
00:44 How my debugger works in C++
02:09 Why I made the debugger (collision debugging showcase)
Переглядів: 1 166

Відео

Game Engine in C++ Parkour Demo
Переглядів 4773 місяці тому
A little update video showing what the game engine I'm building in C looks like. It's called FuniTinker engine and I'm very proud of it. 00:00 Intro 00:21 Name announcement! 00:43 Why my own game engine 00:57 Struggles 01:30 Game engine showcase! 03:05 Roadmap 03:23 Outro
How I Structure Entities In My Own C++ Game Engine
Переглядів 10 тис.3 місяці тому
How do you structure a game engine? That's one of the first questions we as game developers have. Hopefully you'll find this video informative and maybe a bit helpful too. ENTT C ECS: github.com/skypjack/entt 00:00 Intro 00:06 Entity inheritance 01:25 Entity Component System
Why I Decided To Make My Own Game Engine From Scratch In C++
Переглядів 8694 місяці тому
Alternative title: Man cannot understand simple tools so he has to make one himself. After years of trying to create a cool game I found out that using engines isn't for me, so I decided to make one! A really small one, that'll have only the features needed to create my small game PetCat. Why would anyone do this? That's a great question, it's fun i guess, we'll see how the engine turns out and...

КОМЕНТАРІ

  • @user-if6zq4jz6s
    @user-if6zq4jz6s 3 дні тому

    yooooooooooooooooooo

  • @GGodis
    @GGodis 11 днів тому

    3:21 Instead of using "std::unordered_set<ComponentType> m_componentMask;" I would suggest to try and use a bitmask of 32 (or 64bit) unsigned int (or "std::bitset"), where every bit would represent a component index. Store it like "std::vector<uint64_t> m_componentMask;", every entity will have it's own bitmask. This would save you some memory since in your case with 'unordered_set' you already use 80bytes per entity, where using uint64_t bitmask would just use 8bytes.

    • @funigamedev
      @funigamedev 10 днів тому

      Thank you for your suggestion! I'll definitely look into it, you've explained it really well.

  • @SianaGearz
    @SianaGearz 16 днів тому

    2:57 There is one tiny little aspect that makes me die inside a little - you have 3 dynamic arrays that have an invariant, that they are ALWAYS the same size, but you're left to ensure that manually. If they were to ever grow out of sync, you'd have a massive problem on your hands. Realisticaly all allocation and deallocation of entities is going to happen in a very confined section of code the correctness of which is trivially ensured, so it's not a real problem, and one might sprinkle a handful asserts in a handful of places and sleep secure that the software is correct without some crazy mechanism. But you know how it is. Also whether you want array of structures or structure of arrays... it depends! I think a Component like this is simple enough that you wil always touch at least position and rotation at the same time, so having them in the same structure (array of structures) is going to act as prefetch and be hypothetically more efficient; but likely not by any measurable amount. However size isn't like these two, there are many operations that do not involve size. So perhaps size is worth a separate Component? But yeah structure of arrays is guaranteed good enough, then size doesn't need to be a separate component, and you don't need to closely consider the operations and their relative frequencies.

    • @funigamedev
      @funigamedev 16 днів тому

      You're absolutely correct, is there a way to fix the size of the arrays? Having some way to ensure that all of the arrays have the same size without manually checking? It's also something I'm always afraid of "What if I don't delete one part of the component and then all of the indexes are wrong", so I understand the problem but I'm not sure if there's a nice solution. I've been doing a lot of refactoring lately so I can add this to my checklist of what to fix :) Also you're correct that size isn't always returned, the main way why I'm doing the whole transform is that for the purposes of rendering, for each object every frame we'll have to read all three. I'll think about it since size is different than position and rotation, for movement, physics and all that we don't really need the size. Thank you for sharing your thoughts!

    • @SianaGearz
      @SianaGearz 16 днів тому

      @@funigamedev Well unfortunately C++ doesn't directly support "Design by Contract", a technique where you tag objects and methods with an explicit sanity checking code that is always executed in a validation run. But you can use it as inspiration. Linking three arrays together via a manager that just adjusts their sizes is for one cumbersome looking and potentially inefficient for other doesn't guard against logic bugs related to managing these Components. Various people have done their own approaches to implement Structure of Arrays, you could check them out, they all have something unwieldy and potentially offensive about them.

    • @funigamedev
      @funigamedev 16 днів тому

      I'll look into it thank you!

  • @user-if6zq4jz6s
    @user-if6zq4jz6s Місяць тому

    hi bro

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

      Hi!

    • @user-if6zq4jz6s
      @user-if6zq4jz6s Місяць тому

      ​@@funigamedev hmm i like engine its good❤ is it free to download

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

      Thank you so much! Unfortunately currently it's still in development and I don't know when it'll be ready for public :)

    • @user-if6zq4jz6s
      @user-if6zq4jz6s Місяць тому

      @@funigamedev i subs to you 😀😀 byee see you in you next video

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

    Great video, why do you have that less subs? Please continue you're going to blow up!

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

      Thank you so much! I started releasing videos recently but I'm trying to get better at it with each one. I'm glad you like them!

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

    awesome video.. i love it.. but, even if ECS is super efficient and optimal.. wouldn't it be super confusing in the future?? when you have a loot of stuff your videogames?

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

      Thank you so much! You're correct that this approach will need further work to make it easier to work with, for now this is sufficient enough, but I'm already working on something better and easier to use. I don't want to introduce unnecessary complexity in the whole system since ECS is still new to me and C++ as a whole is really new, but I believe in the future there will definitely be a video on how I made it easier to work with.

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

      That’s when you make a behaviour component that holds a ptr to a scriptable object which can be used as a base class for custom behaviour. That way you can create as many scripts as you like without there being too many components.

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

    Really nice video, straight to the point. I like how you pointed out that today's debuggers don't help in game debugging much and this also has been my pain point. I kind of wanted to take a shot at improving the situation and made an extension for Visual Studio that eliminates the need for logging and shows all variables inline in realtime. It wouldn't help you draw lines/geometry in the renderer obviously, but I think it could help you a lot with removing the need for many breakpoints/log points. Here's a demo on what it does: ua-cam.com/video/5bfUWJYEQCw/v-deo.html. Let me know if it would be useful to you and if you'd be interested in trying it out!

    • @funigamedev
      @funigamedev 14 днів тому

      Thank you for the recommendation I'll look into it, it looks nice!, Sorry for the wait the comment was held for review because there's a link in it, I didn't know youtube does that lol.

    • @donadigotm
      @donadigotm 14 днів тому

      @@funigamedev Ah, that's fine! If you have any questions/issues while trying it, I'm always available to help.

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

    very good video, love it

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

    Its all fun and games, until you have to debug your debugger

  • @korigamik
    @korigamik 2 місяці тому

    This is very cool! Can you share the source code for your engine?

    • @funigamedev
      @funigamedev 2 місяці тому

      Thank you so much! Eventually I want people to get their hands on the source code of FuniTinker engine, but sadly I'm not currently at the stage where I'd be comfortable with sharing the code, but thank you for your interest!

  • @guilhermerodrigues4853
    @guilhermerodrigues4853 2 місяці тому

    Do you already know opengl/computer graphics? Or are you learning as you go?

    • @funigamedev
      @funigamedev 2 місяці тому

      I'm learning as I go, I just know the general stuff from trying to make games like 3d models have vertices, that there are things like shaders, stuff I encountered in unity, unreal or trying to make scenes in blender, but I have no prior knowledge of buffers, or opengl specifically. I've started with www.learnopengl.com and from there I'm trying to expand and fit the renderer into my ECS. I'll be making videos about graphics in the future but currently it's just a pbr shader and simple one directional light shadow :D

  • @guilhermerodrigues4853
    @guilhermerodrigues4853 2 місяці тому

    Always nice to see some custom engines devlogs! How are you structuring the renderer? I'm struggling a lot with my engine

    • @funigamedev
      @funigamedev 2 місяці тому

      Thank you! I currently have a really simple setup. For loop over all entities with a mesh, single texture set loaded from a folder for all of them, and then applied on a really simple PBR shader with model, view, projection matrix, the shadows are really simple too for now it's just a depth check render onto a texture, there will be a lot more content about renderers when I get to actually understand them :D but for now it's mostly just few things from www.learnopengl.com

  • @joedartonthefenderbass
    @joedartonthefenderbass 2 місяці тому

    Great video! I think the component mask could be a little faster if you used a bitset instead of an unordered map but I may be wrong

    • @funigamedev
      @funigamedev 2 місяці тому

      Thank you for the tip! I'll definitely look into that, you might be right that it's faster, I'm still kind of searching for some better way to map and keep track of the entity component relationship, since maybe I want one entity to have more than one mesh and for that the current system isn't enough.

  • @xrazygamez
    @xrazygamez 3 місяці тому

    this is actually sick, i feel like it could be on the level to try to compete with engines like stride, o3de, and and maybe be there one day, im impressed to say the least

    • @funigamedev
      @funigamedev 3 місяці тому

      Thank you so much for your kind words, it means a lot to me. Hopefully one day we can call it a real game engine!

  • @NaniJapaneseForWhat
    @NaniJapaneseForWhat 3 місяці тому

    Looks cool! Looking forward to future developments, and if possible a public release.

    • @funigamedev
      @funigamedev 3 місяці тому

      Thank you so much! I very much expected the question of public release to come up and it's still very early to know for sure. I definitely want other people to get their hands on the project someday, but right now I'm still inexperienced in the business side of things. Thank you for your support, it means a lot to me that people are even interested in this project.

  • @samuel-zagueiro-raiz-de-rua
    @samuel-zagueiro-raiz-de-rua 3 місяці тому

    you can do it

  • @jchaloupka007
    @jchaloupka007 3 місяці тому

    Krásná práce! Composition over inheritance can be applied in all sorts of fields in programming, but explaining it through game dev makes it really easy and intuitive to follow and understand, you did an awesome job!

    • @funigamedev
      @funigamedev 3 місяці тому

      Díky moc! I'm so happy you enjoyed it, composition over inheritance is exactly what I was aiming for so I'm glad it made sense. Thank you for your feedback!

  • @69k_gold
    @69k_gold 3 місяці тому

    I'm a beginner, and the video went really really fast. Can you storyboard more and make your future videos longer, taking time explaining stuff one at a time?

    • @funigamedev
      @funigamedev 3 місяці тому

      I'll try to look into that, thank you for your feedback!

  • @harywhiteproductions
    @harywhiteproductions 3 місяці тому

    Great video and solution! I'm also writing a game engine in C++ and have been tackling a similar problem. In my one, each entity has an array of component indexes where each index in the array represents a component ID. If an entity doesn't have a certain component, the component index is just set to -1. The systems iterate through the entity IDs they are interested in and they access the component data through that.

    • @funigamedev
      @funigamedev 3 місяці тому

      Thank you so much! Your solution sounds great too! It's great to hear different solutions to these problems and to see that I'm not the only one dealing with this :D

  • @Utmanarn
    @Utmanarn 3 місяці тому

    Interesting, I have stumbled upon the problem before where I have tried to make things abstract and follow proper inheritance. But sometimes it just falls flat when my entities suddenly need to have many different variables and functions from one another. It ends up with my base entity only having like 1 or two variables...

    • @funigamedev
      @funigamedev 3 місяці тому

      Thank you! I'm glad I'm not alone, thankfully many much smarter people than me have figured out the way already :D

  • @Utmanarn
    @Utmanarn 4 місяці тому

    I wish you luck in your journey!

  • @OrangeIND-
    @OrangeIND- 4 місяці тому

    i was using opengl ,openal and sfml

    • @funigamedev
      @funigamedev 4 місяці тому

      I've tried only opengl so far :D

  • @keropaci
    @keropaci 4 місяці тому

    Always wanted to do the same. Going to subscribe to see if I can learn something from you. :)

    • @funigamedev
      @funigamedev 4 місяці тому

      Thank you so much for the sub! I hope you will!

  • @aaaaa-oh6dk
    @aaaaa-oh6dk 4 місяці тому

    Wish you good luck and we'll see how this turns out!

  • @creakiap
    @creakiap 4 місяці тому

    Now let's create a game in BASIC !

    • @funigamedev
      @funigamedev 4 місяці тому

      Now that would be a challenge!

  • @endermengalaxy4221
    @endermengalaxy4221 4 місяці тому

    I love this

    • @funigamedev
      @funigamedev 4 місяці тому

      Thank you so much!

    • @endermengalaxy4221
      @endermengalaxy4221 4 місяці тому

      ​@@funigamedevNo, thank you! This has inspired me to try and make my own engin e!

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

    zníš jak čech ale maximálně

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

      to musí být čech

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

    Cool concept!