Performance Bottlenecks in My Game Engine

  Рет қаралды 41,920

The Cherno

The Cherno

11 ай бұрын

Support and get Hazel ► / thecherno
Threads ► threads.net/@thecherno
Instagram ► / thecherno
Twitter ► / thecherno
Discord ► / discord
Hazel ► hazelengine.com
🕹️ Play our latest game FREE (made in Hazel!) ► studiocherno.itch.io/saving-c...
🌏 Need web hosting? ► hostinger.com/cherno
💰 Links to stuff I use:
⌨ Keyboard ► geni.us/T2J7
🐭 Mouse ► geni.us/BuY7
💻 Monitors ► geni.us/wZFSwSK
#Hazel

Пікірлер: 72
@mastershooter64
@mastershooter64 11 ай бұрын
Haha yea who isn't addicted to speed!
@rapidstress2008
@rapidstress2008 11 ай бұрын
"That's what she said" - A wise businessman, maybe
@Th3Y4nnix
@Th3Y4nnix 11 ай бұрын
You can't sleep as a developer
@Zyhorn
@Zyhorn 11 ай бұрын
Really enjoyable video, sad that it ended though. Wanted to see you tackle the bottlenecks and rewrite some code 😊
@Pspet
@Pspet 11 ай бұрын
That probably takes weeks
@sumikomei
@sumikomei 11 ай бұрын
This was really cool to follow along with. I personally like this kind of content a lot, and I don't have anything that I would change about it.
@ChaoticFlounder
@ChaoticFlounder 11 ай бұрын
Very nice video, good to see in depth thought process on detailed topics
@aaronmark3930
@aaronmark3930 3 ай бұрын
14:00 ohhh the aussie "noyyy" never get's old
@cookiecan10
@cookiecan10 11 ай бұрын
For GetWorldSpaceTransformMatrix() if there is a parent, it gets called again because it's recursive, so for every transform matrix it might get called multiple times. Could that be the reason the amount of times the function gets called feels too high?
@Arwahanoth
@Arwahanoth 11 ай бұрын
Yeah and it is counting recursive call but the out of scope is triggered after so maybe it is only counting time for the "leaf" ???
@osys7832
@osys7832 11 ай бұрын
do you consider using valgrind to check the memory allocations/deallocations and/or intel vtune like cpu profiling or gpu profiling tools to check what’s going on and compare them maybe for unreal and/or unity?
@hawks3109
@hawks3109 11 ай бұрын
I'd love a video on how the compiler and other components work to actually package and ship the game itself. How is the exe built? How are the assets "cooked and packaged"?
@emilemil1
@emilemil1 9 ай бұрын
Moving loads from the GPU to the CPU or vice-versa is useful, but if you're already hitting your target framerate then there's no real benefit to doing so. In that case you could also use the "free" resources to do lower priority work. For example: - Precomputation for future operations, which can smooth out framerates. - Preloading of assets that might be used in the near future. - Updates that normally only run every few ticks, but can benefit from being real-time. - Improving existing operations, for example physics accuracy. - Perform heavy computations that you would prefer happen now rather than when resources are scarce, such as garbage collection. And the good thing about many of these is that they can be aborted as soon as the GPU is done and simply resumed the next tick.
@arsenbabaev1022
@arsenbabaev1022 11 ай бұрын
Do you plan to support custom shaders / scriptable pipelines ? Or Hazel renderer is fixed to the PBR pipeline?
@ThyTrueNightmare
@ThyTrueNightmare 11 ай бұрын
Hazel is getting to the point I could see myself using it for actually releasing games, question is what would the price be? I don't have a studio at the moment but it is a goal, with that being said I am very interested in VR and mod support for games within an engine
@arrowsdev
@arrowsdev 11 ай бұрын
much love man
@vineilan
@vineilan 11 ай бұрын
Awesome video like always!
@redafakih12
@redafakih12 11 ай бұрын
Awesome! However can we also see the asset pack binary format stuff? Would be also a nice dev log to watch.
@m00nshoes
@m00nshoes 11 ай бұрын
good vid! do you plan on making a hazel profiler similar to UEs?
@kirammanenjoyer
@kirammanenjoyer 11 ай бұрын
Great video. PLEASE TALK ABOUT THE ASSET SYSTEM AND THE ASSET BINARY FILES PLEASSSSSSE 🙏
@Omar-mm6ms
@Omar-mm6ms 11 ай бұрын
I cache the world matrix and have a flag that indicates whether it needs to be recomputed. That way it only gets recomputed if you try to access it and it needs updating. Most entities don’t move, so setting the flag on all descendants when an entity moves is relatively cheap.
@mascit
@mascit 11 ай бұрын
we want more!
@nuttolum
@nuttolum 11 ай бұрын
i just found this series because ive been working on my own game engine and wanted to see how other people did stuff, ive learned so much from it! will the vulkan renderer ever be put on the github?
@cankarkadev9281
@cankarkadev9281 11 ай бұрын
It already is, but you have to be a patreon supporter to see it :D
@ShermanDev
@ShermanDev 11 ай бұрын
"mmm, is too fast, something is wrong" 🤣
@andy9999andy
@andy9999andy 11 ай бұрын
Only mark object matrices (local and world space) as dirty, and only recalculate matrices when the matrix is requested. Recursive make child ws matrices dirty if needed, ie not already dirty or not dependent on parent matrix (world space object)
@zacharymiller7573
@zacharymiller7573 11 ай бұрын
Would you ever use a library like OpenMPI to partition tasks across CPU cores or is multi-threading sufficient for a game engine?
@Mnmn-xi6cj
@Mnmn-xi6cj 11 ай бұрын
Cool video! I use Tracy myself and would be very interested in how you created these frame timers (HZ_SCOPE_PERF) 🙂
@imaymakesomevids
@imaymakesomevids 11 ай бұрын
They're covered in one of the really early hazel videos, maybe the logging one.
@GameSmilexD
@GameSmilexD 11 ай бұрын
Addiction to speed sounds like a paraphrasing for doing coke xD
@gamedev4432
@gamedev4432 11 ай бұрын
It's actually what they call meth.
@JohnSmith-ze7sv
@JohnSmith-ze7sv 11 ай бұрын
Cool video. If you want to trade memory for speed - you can always cache. Not sure if this is useful - but i'll share just incase it is. In my implementation of ECS i just return entity components by ref as opposed to by value. In the transformation objects themselves, I store the world matrix so that I update the matrix only when the transforms position,scale or rotation has changed. glm::mat4 Transform::GetWorldMatrix() { if (m_isDirty) { UpdateWorldMatrix(); } return m_mtxWorld; } I have an ECS-lite approach. I couldn't quite ditch OOP .... Components hold behaviour for manipulating the data they hold. It just makes sense to have that logic there.
@infiteri6030
@infiteri6030 11 ай бұрын
Hes back
@luigidabro
@luigidabro 11 ай бұрын
Why is Minecraft under the game category in the description?
@goodecheeseburgers6320
@goodecheeseburgers6320 11 ай бұрын
THREADS!! ICANT😂 you do realise threads is going to be an echo chamber?
@user-sl6gn1ss8p
@user-sl6gn1ss8p 11 ай бұрын
Is that the stanford bunny in the background?
@andersonklein3587
@andersonklein3587 11 ай бұрын
The thing I wonder is why not focus on optimizing the code running on the GPU? It might be bottlenecked by something silly even, like updating the textures every frame or sending tons of unnecessary buffers every draw? Because the Render Thread was waiting for the GPU, and the Main Thread was waiting for the Render Thread. The bottleneck was about 2 to 1 between the GPU and the CPU threads.
@martinlarsson6621
@martinlarsson6621 11 ай бұрын
I have a FPS Tracker package in my game which I knew was slow, and I know I could've optimized it myself. When deep profiling it took roughly ~3ms. Copied that block and pasted it into GPT and asked it to optimize it for me, worked on the first try and now it runs ~0.02ms during deep profile, everything worked the first time around, the AI made no glaring errors, I just refactored it slightly. It all took like 20-30minutes.
@MrHuman-iy5lw
@MrHuman-iy5lw 11 ай бұрын
i wish to have vulkan series chernooooooooooo
@eggmeister6641
@eggmeister6641 11 ай бұрын
Wasn't the previous bottleneck because you turned memory streaming on and the gpu wasn't using vram, but system ram instead?
@Asdayasman
@Asdayasman 11 ай бұрын
That per-frame memory graph is fascinating - if the engine/game needs to allocate that stuff in one frame, then by the looks of things allocates it all again in the very next frame, why is it discarding it instead of reusing it? Would love to see words on that.
@rasmadrak
@rasmadrak 11 ай бұрын
A guess - The entities were re-evaluated per frame due to the nature of the game - a game jam one. :) Any proper game would utilize cache and early out's to avoid allocating new memory.
@bagel7860
@bagel7860 10 ай бұрын
You forgot to add the annotation for your latest game jam game... 😭
@Bodzilla001
@Bodzilla001 6 ай бұрын
Can you do a gaphics/engine react video on the GTA 6?
@user-tz4tl1zw7j
@user-tz4tl1zw7j 11 ай бұрын
hey Cherno. when are you going to switch vulkan in 2d hazel
@absorbingdude
@absorbingdude 11 ай бұрын
there’s no way I think, lots of things to cover, but if you are a little experienced with vulkan it’s not a problem to implement hazel with it, like I’m doin
@user-tz4tl1zw7j
@user-tz4tl1zw7j 11 ай бұрын
@@absorbingdude where can i learn vulkan-hpp
@GamerPlaya12
@GamerPlaya12 11 ай бұрын
@@user-tz4tl1zw7jvulkan-hpp is not needed. But if you want to learn it there are githib repos with samples
@absorbingdude
@absorbingdude 11 ай бұрын
@@user-tz4tl1zw7jWhat about these great resources that helped me a lot: 1) vulkan-tutorial (base-база) 2) vkguide dev (there’s pretty good abstraction around descriptors) 3) Dustin H Land’s site fasterthan life (he ported doom to vulkan) also he explains what it costs to port something to vulkan 4) This year I saw lots of vulkan videos on YT, so just explore If I remember something useful maybe I’m gonna edit this comment. Edit1: I also remembered, there’s an indie developer (cakez) he has game series vulkan c++ on YT, I advise you to look at them. Edit2: Sascha willems samples && vulkan samples Edit3: also some extremely helpful theory videos are called “Vulkan lecture series”
@user-tz4tl1zw7j
@user-tz4tl1zw7j 11 ай бұрын
@@GamerPlaya12 thank you
@nerdastics3987
@nerdastics3987 11 ай бұрын
Cherno, what you are missing is SPEED IS KEY. also, one way to really speed stuff up is (if its available on your hardware) enabling intrinsics, like simd replacements for memcpy, memmove, etc. (i don't know if thats an option in msvc)
@fatsu
@fatsu 9 ай бұрын
superluminal?
@randomWork111
@randomWork111 11 ай бұрын
Is it possible to use c++ to transfer huge volume(10 gb or more) of data from one system to another. system..will it support? Thanks Cherno
@charlielarson1350
@charlielarson1350 11 ай бұрын
our ancestors have used C++ to transfer large data between systems for millennia
@yanko694
@yanko694 11 ай бұрын
anyways gamefromscratch could do a review on hazelengine?
@not_herobrine3752
@not_herobrine3752 11 ай бұрын
can relate to the advice for optimizing for pc; i may have a mid range graphics card (for 2016), but theres no telling what the game is going to get run on though id personally work on the weakest hardware i find so as to cater to the greatest common denominator
@bobdagamer640
@bobdagamer640 11 ай бұрын
When you're developing you need better hardware because the debug versions normally run slower
@not_herobrine3752
@not_herobrine3752 11 ай бұрын
@@bobdagamer640 thats literally the physical reminder to create software that doesnt run like treacle on underperforming hardware
@bobdagamer640
@bobdagamer640 11 ай бұрын
@@not_herobrine3752 the debug version will run slower when you're developing than the release version that will go to users
@not_herobrine3752
@not_herobrine3752 11 ай бұрын
​@@bobdagamer640 it is true that the debug version of some software will run slower on underperforming hardware than the release version that is expected to run on more performant hardware however if the developer ensures that this slow debug version runs fast enough on said underperforming hardware then surely there wont be any problem regarding performance because the user will logically only see a performance *increase*
@keptleroymg6877
@keptleroymg6877 11 ай бұрын
Show us most important parts of engines source code
@mrthomaschannelearth
@mrthomaschannelearth 11 ай бұрын
So nobody is going to mention the cuteness at the start.. OK we live in a cold world I got it
@mastershooter64
@mastershooter64 11 ай бұрын
Nah lol you're the one who missed out and didn't see the cute baby editor, we all finished talking about it!
@alec_almartson
@alec_almartson 11 ай бұрын
Really... Need For Speed 💯🎮👌🏻💻
@xXkelseyXx1
@xXkelseyXx1 11 ай бұрын
I am speed
@Jkauppa
@Jkauppa 11 ай бұрын
need for speed hmh
@debonairrose
@debonairrose 11 ай бұрын
3:10 i know that hazel is the game engine. but you saying "huge thanks to hazel for sponsoring this video" triggered my fight or flight response and i had an impulse to skip this part of the video.
@MuhammadHosny0
@MuhammadHosny0 11 ай бұрын
Hazel website is dead
@crazycdn8327
@crazycdn8327 11 ай бұрын
Sadly no one is using threads. Just stick to something like twitter. I'm not willing to download another app but wouldnt mind following you.
How I Made My Game Engine MUCH Faster...
24:29
The Cherno
Рет қаралды 100 М.
Making a Game in ONE HOUR Using MY ENGINE AGAIN!!
34:34
The Cherno
Рет қаралды 181 М.
Haha😂 Power💪 #trending #funny #viral #shorts
00:18
Reaction Station TV
Рет қаралды 15 МЛН
Вечный ДВИГАТЕЛЬ!⚙️ #shorts
00:27
Гараж 54
Рет қаралды 12 МЛН
NERF WAR HEAVY: Drone Battle!
00:30
MacDannyGun
Рет қаралды 29 МЛН
Automated testing using GitHub Actions... easier than I thought
24:29
How New Game Engine Features are Implemented
21:25
The Cherno
Рет қаралды 25 М.
The Secrets Behind AAA Wind Simulation in OpenGL | Indie Devlog
9:08
Gajatix Studios
Рет қаралды 6 М.
BETTER Header Files and Preprocessor Debugging
24:26
The Cherno
Рет қаралды 68 М.
BEST WAY to understand graphics and rendering code
34:46
The Cherno
Рет қаралды 35 М.
LIGHTS! // Hazel Engine Dev Log
12:36
The Cherno
Рет қаралды 31 М.
I Optimised My Game Engine Up To 12000 FPS
11:58
Vercidium
Рет қаралды 565 М.
ALL IT TAKES... A Vulkan Story
29:10
The Cherno
Рет қаралды 126 М.
The Future of Game Development
8:58
Brackeys
Рет қаралды 1,1 МЛН
Ultra Engine -- 10x Faster Than Unity?
16:51
Gamefromscratch
Рет қаралды 43 М.
Haha😂 Power💪 #trending #funny #viral #shorts
00:18
Reaction Station TV
Рет қаралды 15 МЛН