Cooking while doing analogies with programming and c++, would love that content !
@cyqry2 жыл бұрын
@@bandolero818 "Now we're going to dice this here and its kind of like making a shared pointer"
@mrhidetf25 жыл бұрын
cherno really stepping up his metahphor game in this series. Honestly tho i think you are getting better and better at communicating
@Daniel-zr4pkАй бұрын
7:10 Counter-Strike 1.6 is single threaded and works amazingly well. it's a masterpiece - long time ago i had made a Mod called Alien Invasion where it spawns aliens from the sky and they had a Think() function to make them seek you around the map and hit you when they are close to you. It had the capability to spawn more than 100 aliens that were thinking every milisecond. it was starting to lag at around 200 aliens. huge lag at 300. but i think it's increadible performance for single threaded engine and server.
@mario75014 жыл бұрын
Just made a patreon account to support your channel! This is by a mile the best C++ and game dev content on KZbin!
@jdev64025 жыл бұрын
Now i'm curious how that asset manager will look. Thank you for your dedication to this series, it's really motivating and informational.
@felipecarlin85404 жыл бұрын
9:29 I was not prepared for that, now I'm concerned about memory ownership and management. Thanks Cherno!
@carlosgarciavigoa79375 жыл бұрын
Guys & Girls, this is a simple tip. If anyone here goes to the beginning of the series and watch the first episode again, it will increase watching time, popularity, ranking and many other things that will help the Series. Of course, it will help Cherno too. More view more ranking and at the same time more subscriber than eventually will become Patrons. Remember now is a FULL-TIME JOB. We need to keep that. TY in advantages.
@colorcookie60885 жыл бұрын
Love you Cherno!!! Your C++ series has helped me a lot. Thankk you
@robertocabiddu60084 жыл бұрын
0:10 nah m8 EVERY SINGLE episode is EXCITING
@__jan5 жыл бұрын
he's getting funnier every episode
@SandFoxling3 жыл бұрын
2021 and still no "Cooking with Cherno". In the mean time, patreons should get access to a shared pointer to his kitchen
@davencharity5 жыл бұрын
Cooking with Cherno? It's been over four years since Sparky, and I don't think you've ever remembered to take the turkey out of the oven! ;)
@thecookiegeneration5 жыл бұрын
You can check if the sharedptr is lock free, most atomic increment and decrement operations can be done threadsafe without a lock (single cpu instruction for read increment write)
@misterbenjamin78452 жыл бұрын
Cooking With Cherno - Episode 1: The Perfect Cup of Coffee
@simonbaxter80015 жыл бұрын
I'm still waiting for the 'Cooking with Cherno' series ! ;)
@ZyklonV5 жыл бұрын
Man, last time I heard the word "ownership" so many times was during a talk presenting the Rust programming language. Love C/C++, love Rust more
@stanleythehandsome54025 жыл бұрын
Boy I Love this guy
@TriNity-GER5 жыл бұрын
Whenever I need a pointer, I always ask myself: who is the owner? Are there multiple owners? Using this though massively helped me to choose between unique_ptr and shared_ptr. Also my favorite replacement for raw pointer is object_ptr :D
@MirralisDias3 ай бұрын
In the current code base (Hazel2D), what is the point of using std::shared_ptr, if you're passing it as a const reference basically everywhere, therefore not incrementing the counter, and not avoiding the same things you are concerned about. I wonder if this is the same for the dev branch.
@colorcookie60885 жыл бұрын
Cooking with chernoooooooo!!!!!! Let's go babyyyy!!!!
@jamesdadabo4 жыл бұрын
"all cool and hip and trendy"
@FurtoMega2 жыл бұрын
I was having a big problem with a dangling pointer in my code. Weak pointer saved my life. Every since then I use shared pointers only..
@quanghong39225 жыл бұрын
Great job
@alopmemes19642 жыл бұрын
nice new haircut :D
@sam_is_people11703 жыл бұрын
thanks!!!
@MieysoFelix2 жыл бұрын
I live in sad 2022 😔. Can i get a reference to *"Cooking with Cherno"* ? Or at least a pointer address?
@Thiago13375 жыл бұрын
Great tutorials.
@engsayed20075 жыл бұрын
I Am developing a program which I draw objects using the mouse I draw a point _ line and polygon with any number of sides I save each created object (line or point or polygon) as a mesh having its own vba_vbo_ibo Till now I can select each object and individually without any problems My problem is I want to create large number of objects say 2 millions When I create more objects the program becomes too slow in rendering I tried to make all vertices coordinates in one buffer and all created objects share this buffer according to its indices How can I handle such a huge number of objects ?????? Thanx in advance
@gracicot425 жыл бұрын
What I do usually is to decouple the refcount to the asset. I have the asset object that contains only the minimum necessary to use it, and a refcount. For example, the asset object for a shader program would contain the id and the refcount. But having a refcount of some sort, whether it's with a shared pointer or something like I do is absolutely necessary. Keeping resources around from scene to scene makes the engine not loading things over and over. We don't know when we will destroy the texture or when it won't be needed anymore. So shared ownership is ideal.
@GalaxySoftwareStudio5 жыл бұрын
What do you using about using glad2 instead in the future ? As it supports Vulkan too, multiple GL contexts, internal loader and you can even generate a header only version ! ^^
@jakobfriedl30984 жыл бұрын
all of us crying xD
@popplestones8862 жыл бұрын
Still waiting for cooking with cherno, 3 years later :-(
@theo-dr2dz Жыл бұрын
What he says at minute 3 is not correct. std::unique_ptr can't be copied (if it could, it would not be unique anymore), but it can be moved. Moving a std::unique_ptr transfers the ownership. But of course, if you need shared ownership, use a shared_ptr
@fryderykst5 жыл бұрын
Great video as always, thanks! :) Could you (or someone else) explain the difference between atomic count and regular one? How it works? Thanks.
@mytech67795 жыл бұрын
I was trying to slog through a bunch of the CPPcon videos, mind blown. Getting down to manipulating L2 and L3 to achieve better atomic multi-threading; actually considering the physical time to transmit an electric pulse between cores and predictive fetching from memory. And they always say "use vectors", I'm not sure if this is an old running joke or actual advice for better general performance.
@reductor_5 жыл бұрын
'better general performance' : no, get a few more ns with micro optimizations : yes essentially don't prematurely optimize
@daleowens76952 жыл бұрын
As you are aware, it's a consequence of cache. "Everything" is probably a vector, and now with cache, this is doubly so. @ReDucT0r; 'better general performance' : yes. I sugges you research cpu cache. vectors are beating out linked lists, even for tasks classically thought of as optimized for linked lists, like midpoint insertions and deletions because cpu cache is orders of magnitude faster than going to RAM.
@mytech67792 жыл бұрын
@@daleowens7695 2 years on and I know a good deal more about c++. The vector referenced was the std library dynamic array, not the SIMD hardware or math concepts. And yes they were mostly comparing it to [linked] list performance, but it was also about moving away from old style C and improving code quality both in reading the logic and in avoiding memory leaks associated with deleting manually allocated dynamic memory for classic arrays. (Though if done just right a classic array can be a hair more optimized if needed for some very critical corner case, but in most cases the payoff isn't worth the effort and would need a lot of profiling and testing to proove. In many cases careful use of vec1.reserve(n) will close most of that gap without the hassle. )
@_Omni5 жыл бұрын
24:26 you didn't say what you will do in the next episode 🤷♂️
@raffallo3 жыл бұрын
textures :)
@clodgozon39685 жыл бұрын
I love dealing with refs and pointers. Not an irony.
@cubefish23205 жыл бұрын
Give me lapsis episode 9 i'm still waiting after all these years I've become nothing, dedicating every second of my waking time to trying to solve what episode 9 would be. I lost my job, my wife, my family outed me, and I lost all my friends. I live on the streets, wandering with my phone, theorizing about how the Minecraft Machinima 'Lapsis' episode 9 would have ended. I need this. please.
@bies_moron44045 жыл бұрын
401 patrons !!
@aarondraws76993 жыл бұрын
i destroyed my entire code base with the replace all function I basically have to start over
@mjthebest72942 жыл бұрын
This is why you want to use git and commit often. :)
@jdev64025 жыл бұрын
9:35 lmao
@graph2001 Жыл бұрын
ChatGPT3.5 Generated: - The transcript is from a video in a game engine series. - The video discusses references and smart pointers for the engine's core system. - Shared pointers are being used to encapsulate objects on the heap to control their lifetime. - The issue of ownership is important for smart pointers as they automate the deletion of objects. - The renderer of the engine needs to hold references to assets such as shaders and vertex arrays for deferred rendering.
@billclinton49135 жыл бұрын
"We have a very exciting epesode" says without anny emotion.
@nextlifeonearth5 жыл бұрын
Somehow in the poll people imply 2D would be a stepping stone to 3D.. If you look at any given 2D or 3D engine editor you see they're almost nothing alike. "use the feedback from 2D for 3D" That's not how it works. Outside of some scripting, the UI feedback will be of no benefit in the 3D editor. There are fewer materials in 2D, so no material editor except for its texture and maybe some filters, that's out. The world editor, is vastly different in 3D again, that's out. Will it be faster? Yes, you can look at 100+ tutorials to make 2D engines online today and see for yourself it can be pretty easy. If you'd like to compare it a a PBR capable 3D engine tutorial, good luck, there's about 5 of which most are behind a paywall and/or abstracted from the code. Then what it the purpose of this engine? Making it modern. Is 2D modern? Pretty much every modern effect only applies to 3D.
@Sevo779Gaming5 жыл бұрын
2D and 3D both have modern developments, new rendering technics are always being developed, now that is not to say that 3D is not more complex, or different but you seem to be heavily biased because it is obvious that building a simpler engine is a stepping stone to a more complex and demanding one. Also, I have made a UI that works in both 2D and 3D so I am not sure what you mean there.
@nextlifeonearth5 жыл бұрын
@@Sevo779Gaming Works doesn't mean work well. An optimal workflow in either are little alike. I don't doubt you can make it more complex, but we don't want complexity, we want sophistication without it being complex. That's mainly it, you COULD make an editor for 2D and modify it for 3D later, but it would not work as well as if you were designing it for 3D from the beginning. It's a compromise and "compromises are the enemy of success", to quote someone.
@DovydasV25 жыл бұрын
He's not going to make a full on 2D editor at first, nor a 3d editor. I hope you do understand that. (By the way, you can totally use a 3d editor for 2d games, that's what unity does, they only make the camera orthographic) He is going to create a 2D Renderer at first which will do sprite batching and stuff like that, and then after that he will continue on to 3d PBR renderer which will take a lot of episodes and time to make. There is no debate, what kind of engine it is going to be. As he said, he will do both, but he's asking which one should come first. Also, I think that world editor is not coming anytime soon, since what is the reason to make an editor right now? I will repeat myself again, but he's not going to build a 3d renderer on top of a 2d renderer. They are going to both eventually come and the poll is a debate whether 3D rendering or 2D rendering should come first.
@nextlifeonearth5 жыл бұрын
@@DovydasV2 "you can totally use a 3d editor for 2d games, that's what unity does" And it's terrible. I have used it and I'd rather use Gamemaker than that for 2D games, because unlike Unity, Gamemaker was actually designed for 2D. I have too much of a bad experience with people saying "X will come later even though it's the primary purpose of the software, we'll do Y first" and then it vastly compromises what can be done with X. That's why I have a big aversion of what's essentially a sidetrack that has little to do with 3D and could actually get in the way of the final product and at the very least delay it simply to sate some people who weren't into this series for its purpose in the first place.
@jarekmyszko33322 жыл бұрын
Thread pool system is better than dividing engine into specialized threads. 1) Easy to add to existing engine structure. 2) Easy to synchronize(you don't need to use double buffering) 3) Memory efficient(look above) 4) Scales better for computers with more than 4 cores. 5) Great for ECS pattern.
@Rekongstor5 жыл бұрын
I love smart pointers and especially shared ones, the main idea of this video is good. But what's the point of renaming std::shared_ptr into Hazel::Ref or std::unique_ptr into Hazel::Scope? You still have to type a bunch of letters but new Hazel users will not intuitively understand what Hazel::Ref stands for without peeking on the code or reading the documentation. Like maybe it would be better to remain std library without Hazel aliases because there're more people familiar with std naming, not Hazel's.
@madeso4 жыл бұрын
Premature refactoring. At 14:03 he says it's because he might want to implement a shared_ptr for "assets" with the same exact api as std::shared_ptr and changing it then would be too hard.
@jamesmnguyen5 жыл бұрын
Would delaying the rendering cause noticeable input lag for the user?
@nielsvs22035 жыл бұрын
Generally not
@denisbalcom14295 жыл бұрын
loving the metaphors and cooking with cherno statement lol. ~^_^~.
@bensettiabderrahmane18015 жыл бұрын
Hello, World!!!
@bensettiabderrahmane18015 жыл бұрын
First Vue!!!!
@vitaliiseptember2665 жыл бұрын
Hey, Yan - its a russian name, and Chernikov - its like russian surname, isnt it?
@jamespong65885 жыл бұрын
So it's either ugly code or cryptic code Plus you still have to manage when things get deleted but in an abstract way instead of shouting to the world HERE IN THIS VERY MOMENT I AM RELEASED FROM MEMORY New and delete is fine.
@ricardopieper115 жыл бұрын
It's fine, but we forget to do it all the time. No matter how genius of a C++ programmer you are, you are bound to forget it at some point. Or you'll double-free, or dereference a dangling pointer, or return a pointer to a stack value... so much can go wrong. It's no surprise they created Rust because of this very problem.
@jamespong65885 жыл бұрын
Ricardo Pieper yeah people forget to call delete, but you can follow the code and figure out if you forgot it, also we have powerful tools to trace memory leaks, it's orders of magnitude harder to figure out when something is released by code structure, than Ctrl+F and find "delete xyz"