Tools to make a Game Engine in C++
Вставка
- Опубліковано 22 тра 2024
- This video is a summary of my favorite C++ libraries and dependencies to create a game engine from scratch.
Game development has always been a great helper to get my students motivated to learn more about more advanced computer science topics. Creating a game engine is a great opportunity for us to grow as programmers.
Links:
Create a 2D Game Engine with C++: courses.pikuma.com/courses/2d...
Should You Make Your Own Game Engine?: pikuma.com/blog/why-make-a-ga...
Game Loop (Glenn Fiedler): gafferongames.com/post/fix_yo...
EnTT ECS: github.com/skypjack/entt/wiki
Flecs ECS: github.com/SanderMertens/flecs
Learn OpenGL: learnopengl.com/
Basic Game Math: gamemath.com/
Chapters:
00:00 Introduction
00:57 What is a Game Engine?
05:47 Should You Write a Game Engine?
08:11 Game Development & Computer Science
11:01 Classic Game Engines
14:19 How to make a C++ Game Engine?
16:31 Windowing System and Multi-platform Libraries
20:18 The Game Loop
21:17 Input & Event Handling
22:47 Representing Game Objects in Memory
24:12 ECS
28:14 2D Rendering
29:50 3D Rendering
32:01 Importing 3D Mesh Files
33:36 Physics
35:51 Dear ImGui
40:00 Scripting
42:27 Conclusion
45:50 Useful Resources
Thumbnail illustration by @WesleySales3d (thanks, Wesley!)
Hopefully, these recommendations are useful for you to create a good roadmap on how to start coding your own game engine using C++.
For comprehensive courses on computer science, programming, and mathematics, visit:
www.pikuma.com
Don't forget to subscribe to receive updates and news about new courses and tutorials:
/ @pikuma
Enjoy! - Наука та технологія
Cara pulei de ponta nesse "rabbit hole" já faz 2 meses e nunca me senti mais motivado pra continuar, muito bom finalmente sentir que encontrei a área que quero trabalhar/estudar. Canal sensacional, parabéns pelo trabalho!
I like the fact that albeit having your own lessons about all the topic you talk about in this video, you don't push them until the end, and yet, you are really cautious into saying, this is just the start of a journey, if you want to compete with X or Y, you are probably thinking it wrong. This is really honest from you and quite wholesome actually!
Very cool. One of my biggest mistakes when I tried to create a game engine with c++ in the past (in all 2 or 3 attempts iirc) was the endless "feature creep". I always got stuck implementing more and more systems and overcomplicating things instead of focusing on what was really important and forgetting what the end goal was in first place (make a simple space shooter).
Don’t try to understand every thing, just forward till hit wall, hit it again and your mind start moving and work.
Cool video. I would like to point out that a game engine is actually "the part of a games code that can be shared with other similar games". It is often called the 'Engine' or 'Core' library. This is why certain games from studios will use a particular engine over others - depending on which gameplay aspects and features they are trying to achieve (and other decision making, such as ease of use and capability for streamlined collaboration of its editor). Some studios (who may release different unique type of games) may own and manage more than a single engine.
Next up, you will have your game code. This code (project) will extend/implement the core/engine library (which often contains the majority of functionality). It will then extend upon the engine code with features and functionality that will be unique to the particular game.
Lastly, you will have the editor. The editor does not need to be written in the same programming language as the engine is. After all, it will be mostly managing asset files. It therefor needs to understand how to create and modify the proper file formats for assets, as the code (engine + game code) will need to read into memory. This program will contain the majority of tool necessary for the creatives (and programmers alike, inc. others) to create and manage project assets, visualize and place items into the scene, and much more.
Post lastly, sometimes a studio will create one or more specialized tools for particular tasks. The editor will have many bells and whistles in regard to what it can do and how it does it. Sometimes, a simple tool (could even be created in a webpage) can be used for specific complex tasks.
Wow! You talk with so much passion that I almost want to start writing my own game engine! Thanks for great lecture!
Awesome video, I watched it all the way until the end and I’m looking forward to taking all of your courses!
I watched it all and finally realised its past one hour. Great video i learned a lot!
Thank you !
This is a fabulous explanation of what and why.
Thank you sir!
Awesome and very valuable content.
Thank you!
well done. that is one of the topics that like to follow more as a unity/unreal developer!
Very informative, thank you !
Great overview Gustavo! So your preference would be 'unmanaged' languages like C/C++/Object Pascal vs 'managed' languages such as Java and C# which have a layer of abstraction.
I have no real preference. Different problems require different tools. I just think that in this case, since the goal is to learn something, most students will benefit from using a language that forces them to think lower-level. Different people might disagree, and that's fine.
Muito bom! Aproveitar as férias da faculdade para fazer uma game engine como side project
Yes, thank you I want to make a game engine. You have helped!
wow..i found you on youtube after you respond me on quora..nice tutorials man
Nice to see a fellow Brazilian here! In any case, maybe I'm being too honest, but for me the answer to "Should you write a game engine?" is a simple no. There's a very simple way to see this. First, pick any game and try to implement something similar to a very small part of it, like a menu to select the items. Try to implement just that from scratch. You will see that you'll struggle a lot, it will look very bad. Now try the same with an engine and you'll see that it will take you just a couple of days.
Now pick the tool you used in the engine and try to implement it. With a few months of work and some knowledge you might be able to do it, but at least this is a problem you can attack. If you succeed then you can wonder if you have enough time in your life to actually implement the rest.
In any case, you're right that it teaches a lot of programming concepts, but there are much more efficient ways to understand them...
Really nice video! Thanks Gustavo
Thank you! :)
Thank you 👍
I was really helped by your tutorial
Good lucky Bro
very underrated video, literally cleared everything that i was having hard time with
Love this video and bookmarked the engine course you have so I can buy it should I ever have the expendable income to get it.
13:02 Ayyyy shoutouts to Ken Silverman
Imgino que seja Brasileiro, valeu pelo video é um baita começo, estou escrevendo uma engine em c++ usando sfml e tentando utilizar o ECS na mão.. vamos ver no que dá kkk obrigado pelas dicas abraço!
Opa Tauan, que legal. 😉
@@pikuma acabei comprando seu curso por que tinha tudo que precisava, sensacional parabéns por reunir tudo que um iniciante precisava, muito legal mesmo..
Thanks
Can I use SDL for 3D rendering instead of choosing OpenGL or Vulkan or DirectX. Also thanks for this great video explanation.
That's a good question. It's one that many beginners get confused.
You'll see many people use SDL to open an operating system window, read mouse, keyboard, etc. But when it comes to rendering 3D content, you still need a graphics API to communicate with the GPU. OpenGL, Vulkan, Direct3D, etc. are these graphics APIs.
One interesting thing is that SDL itself will sometimes recognize that you have a graphics card and it will open a window and display graphics using OpenGL or Vulkan behind the scenes. But you still need OpenGL or Direct3D to create a proper hardware-accelerated 3D game.
I hope this helps.
GDI and GDIPlus is good for graphics or too much slow?
Do you plan to make more courses?
If it's the case, what topic will these courses cover?
Of course. I have lots of ideas. But I'm focusing on retro programming, since there's a lack of good content on it oht there. Maybe PS1? 🙂
Gustavo, apesar de falar um inglês perfeito eu suspeitei de ser compatriota e escrevo esse comentário em português mesmo kkkk. Muito bacana seus videos! +1 inscrito.
Grande Gabriel. 👍🙂
o 'tchoo' ao invés de 'too' sempre entrega um brasileiro, não tem jeito kkkkkkkk
@@skyfallz6464 Ou "fink" ao onvés de think, e "tings" ao invés de things.
Mas lembrem... se eu falar inglês perfeito, eles ganham. 😅
@@pikuma kkkkkkkk não sei se ja viu um canal chamado Bisqwit. Zoaram tanto o sotaque norueguês dele que ele decidiu fazer uma aplicação text-to-speech do 0 que fala com sotaque igual o dele
@@skyfallz6464 Claro. Bisqwit é clássico.
You forgot to mention audio - a seriously overlooked part of game development.
Ah, so true. 🙂 Thanks for tge heads up.
Hi, what font did you use at 40:59(lua code)?
Hermit
Is there a udemy course about this, I can buy? Do you know ENTT and ever used it?
Ah, found it in your video description! Nice, I am a huge fan of your stuff. Already did your Lua course!
Yes! EnTT is great. I like Flecs as well with my C projects. They are really good ECS frameworks.
do AAA games use the physics library or they implement it from scratch?
Good question. Most AAA studios use some *tested* library (purchased 3rd party or something they have been working for a long time). The only real reason to write one from scratch is if your "physics problem" is very unique/niche or simple enough that you can get away by writing yourself. But again, most studios use something complex and heavily tested, meaning that they don't really need to understand all the math that goes behind every physics computation, and they can be productive only by using the library and its API as a black-box.
I noticed at 18:22 you mentioned SDL, GLFW, and SFML. What are your thoughts on Raylib?
Raylib is a super cool library. I just saw that the author published a comparison:
gist.github.com/raysan5/17392498d40e2cb281f5d09c0a4bf798
@@pikuma oh wow this was posted just an hour ago!
tldw:
engines are hard, use whole of computer science and are build up from important parts.
Since you want to make an engine and not an renderer (for example), you should use libraries for pretty much all the parts and "just" wire them together.
There are a few libraries mentioned throughout the video, but I'll just add that I would go with BGFX for the rendering (instead of using dx/vulkan directly).
Or WGPU for doing the same thing as BGFX
Im 15 and trying to make a 3d runners vs trappers game. Never used unity or unreal just now learning c++. Seems out of my scope to make a game engine. I should probably just use an existing one first.
Oh for sure. Really, if somebody just wants to make games then you most likely don’t have to make an engine. BUT, if you’re interested at all, it will never hurt you to take a swing at it
First several games I want to make their custom engines more akin between classic Id software engines with a few of modern stuff like the ECS and such.
I think more than ECS, which I agree should not be treated as a one-size-fits-all, is the idea of data-oriented programming and really thinking about data locality and data layout for performance.
Lots of fancy words but all these ideas were there back in the day when every CPU cycle counted.
@@pikuma
Indeed.
The classic engines and the modding and source ports communities done for them fascinate me so much more than most modern engines in honesty.
@@darkzeroprojects4245 I like them a lot as well. 🙂
I’m going for this with Rust
I like this idea a lot! 💪🏻🙂
Thank you! Your video is a good resource.
The check WGPU, It is a cross platform Rust rendering abstraction layer on top of many platform specific rendering APIs.
44🥰4
This is Clickbait😂
...How?
I DID NOT MEAN TO CLICK THE DISLIKE I'M SORRY.