PREFABS in Game Engines

  Рет қаралды 17,786

The Cherno

The Cherno

Күн бұрын

Пікірлер: 65
@jocamar15
@jocamar15 3 жыл бұрын
Godot actually just uses nested subscenes, and it's an approach I like and have used in my engines. To keep the reference I just have an owner property for each entity that points to the prefab resource that instantiated it (or null if no prefab) plus an isPrefabRoot bool that the scene writer checks to serialize that subtree as a prefab reference to the original resource (with any property overrides that it detects are different from the ones in the template). From my experience, most issues with implementing prefabs come when implementing prefab instance overrides and their serialization/deserialization. Detecting when some property of an instance is different from the template and adding those as overrides. Looking forward to seeing how you implement this and I'd love to see a breakdown video once you have everything working.
@kgaming7599
@kgaming7599 3 жыл бұрын
Mm, Godot is the best :) And so is Hazel yaya
@Willyuum
@Willyuum 3 жыл бұрын
I remember you having an epic hand gesture every-time you greet us on the start of the video:p
@Futureblur
@Futureblur 3 жыл бұрын
Unity flashbacks
@SupernaturalBBI
@SupernaturalBBI 3 жыл бұрын
"Cherno" means "black" in bulgarian("черно", "cherno"[english spelling]), so when you say "The Cherno" that means "The Black" in bulgarian :D
@obinator9065
@obinator9065 3 жыл бұрын
Same with Russian ;) чёрное
@vast634
@vast634 3 жыл бұрын
@@obinator9065 so what does Chernobyl mean then?
@insignia201
@insignia201 3 жыл бұрын
It would be cool to see a technical doc about how you make the prefabs, obviously not with all the exhaustive details, just to see how you thought about the problem and how you solved it! In any case, great video!
@hsvfanjan17
@hsvfanjan17 3 жыл бұрын
If you just want to see the code you could always go to the github. The code of course doesn't explain why he implemented it in a certain way or how and why it works, though (apart from comments maybe)
@insignia201
@insignia201 3 жыл бұрын
@@hsvfanjan17 Oh for sure Jan, I shouldnt discount that the code is available to be seen but I think there is something really nice when the author of said code clearly understands it from a high level and can explain the overall logic and maybe provide their thought process and reasoning when implementing a feature. That being said, of course he is a busy guy and making such blog posts probably takes a lot of time and effort so I don't think he should feel compelled in anyway to do a write up, but it would be great, especially for us who wants to learn a little more about the nitty gritty details of software engineering.
@emi6aston
@emi6aston 3 жыл бұрын
Would be cool to have prefabs that mantain also scripted functionallity. So i can make a door and just use that prefab in all of my buildings, obviusly if they are instances better to play with diferent materials or even sizes, etc. Its cool to be talking about this kind of things in Hazel already. Great work!
@kennethcox6895
@kennethcox6895 3 жыл бұрын
Lmao forgot its winter in the Southern Hemisphere.
@geraltt1455
@geraltt1455 3 жыл бұрын
Your scene looks magic with this bloom)
@figloalds
@figloalds 3 жыл бұрын
9:11 and that's how Godot actually calls it's Prefabs, it's "Scene", you put a Scene inside the other
@korpos8833
@korpos8833 3 жыл бұрын
Inception in all its glory n.n
@maximechambefort8012
@maximechambefort8012 3 жыл бұрын
Yes, you should stay with scene like Godot does. Unity's prefabs are a bit limiting IMO.
@bloodredtape
@bloodredtape 3 жыл бұрын
Am i the only one noticing global illumination at 7:30?
@falxie_
@falxie_ 3 жыл бұрын
Hazel is super interesting, trying to understand the inspiration to make it
@jonathansandusky7446
@jonathansandusky7446 3 жыл бұрын
"cherno" == so drunk off "sterno" you can no longer say sterno.
@AgentM124
@AgentM124 3 жыл бұрын
Prefabs are scenes? - Always have been.
@pequod4557
@pequod4557 3 жыл бұрын
You're a god! creating your own engine+ helping others do the same and at the same time teaching normal creators really enlightening things. thank you!
@tomcat_1484
@tomcat_1484 3 жыл бұрын
Hey Cherno! What are your thoughts on the way the Source 2 engine handles prefabs and instances?
@notanenglishperson9865
@notanenglishperson9865 3 жыл бұрын
0:02 From Russian cherno (черно) stands for black
@netpeggle4458
@netpeggle4458 3 жыл бұрын
"Any friendly in Cherno?" For me Cherno is a City in DayZ :)
@aXYZGaming
@aXYZGaming 3 жыл бұрын
What *_is_* a cherno?
@askeladden450
@askeladden450 3 жыл бұрын
everybody asking what is cherno, no one asking how is cherno.
@Futureblur
@Futureblur 3 жыл бұрын
@@askeladden450 true 😞
@kartheekvajrala2487
@kartheekvajrala2487 3 жыл бұрын
@@askeladden450 why is cherno?
@zxuiji
@zxuiji 3 жыл бұрын
Question, why not use a scripting language like Lua to store the vertex generation scripts, they could fill a provided "mesh" & vertex buffer with needed indices and vertices then fill a boolean that states the "mesh" is static or dynamic, if dynamic then the script is run every time to change the vertices being used, if static the switch from C/C#/C++ to the scripting language and back is skipped, as a side benefit of using the scripting language it is possible to avoid platform specific binaries, alternatively if there's a way to do it then just have all vertices generated in the texture shaders or something since they deal with meshes, would just need to generate a program per "mesh" type for that scenario, should be the most portable after a scripting language, does have the benefit of faster processing too.
@LS-cb7lg
@LS-cb7lg 3 жыл бұрын
Finally i know what prefabs are xD when i used unity for the first time this was a big point of confusion :)
@Revin2402
@Revin2402 3 жыл бұрын
Unreal engine actually uses the word blueprint for both their visual scripting and their prefab since it's pretty tight together.
@T0mT4yl0r
@T0mT4yl0r 3 жыл бұрын
Blueprints are not prefabs. Blueprints are classes.
@aboaljod59
@aboaljod59 3 жыл бұрын
Is it something like factory pattern design?
@videojeroki
@videojeroki 3 жыл бұрын
I'm wondering if it would be a good idea to use a game engine to make a 3D point cloud viewer/editor. - the point cloud would be loaded from a file that the user would choose from a storage location - number of points could go up to 50 millions What kind of primitive to use to represent a point and is there any game engine feature to natively handle point cloud ?
@HAWXLEADER
@HAWXLEADER 3 жыл бұрын
I don't know if instancing primitives is the way to go, IMO a signed distance field( see CGmatter video on it) that simply tells the screen "hey draw here" should be better suited for that.
@satindar31
@satindar31 3 жыл бұрын
what about the game engine series?
@fluxx2875
@fluxx2875 3 жыл бұрын
What about a new podcast? Hope you enjoyed the last days, thanks for your videos! 😃👍🏻
@IchigoFurryModder
@IchigoFurryModder 3 жыл бұрын
you forgot prefabs are used for gpu instancing to save memory, lots of it in some cases *cough cough* yandere simulator *cough cough*
@drewgrey7830
@drewgrey7830 3 жыл бұрын
Do you use srand(time) in your code and if not what do you prefer?
@GonziHere
@GonziHere 3 жыл бұрын
Speaking of which - is there an upside to the UE way? I kinda hate it that the Actor is only one level deep, that you cannot (easily) have an Actor of Actors. That the Level is something else and so on. Compared to the Godot, where everything is a scene and your game is scene of scenes - same with nodes in unigine. Thoughts?
@sleep3017
@sleep3017 3 жыл бұрын
hey are you still doing code review?
@eddyk564
@eddyk564 3 жыл бұрын
Isn't that what a class is for?
@naphipps28219
@naphipps28219 3 жыл бұрын
Aka, flyweight design pattern
@keyvanmehrbakhsh4069
@keyvanmehrbakhsh4069 3 жыл бұрын
a bit off topic but :why should the term "game engine" be taken too much of a big thing while it could be considered just a construction of codes .just as the rest ?
@beProsto
@beProsto 3 жыл бұрын
Ah yes, identity crisis
@Diamonddrake
@Diamonddrake 3 жыл бұрын
I think “I am the Cherno” might sound better lol
@CYXXYC
@CYXXYC 3 жыл бұрын
i think "the" is unnecessary
@NickEnchev
@NickEnchev 6 ай бұрын
In Bulgarian you're just "The Black".
@developerethan4593
@developerethan4593 3 жыл бұрын
Is it me, or does the HazelDev UI reallly look like unity?
@danialjumagaliyev
@danialjumagaliyev 3 жыл бұрын
Yeah, in terms of the layout of the tab and the UI elements in general.
@HAWXLEADER
@HAWXLEADER 3 жыл бұрын
So basically you were sick of Unity bugging out and said, Hmm I can do this better! Same as I did with Rocket Jockey remakes...
@martonkos5775
@martonkos5775 3 жыл бұрын
Hey Cherno! I have a great idea that you can put in the engine with prefabs! You said in the video, that there will be an option to enable or disable that if you change somewhere the prefab, that will update every single instance of it. I think it would be better if you make two different type of prefab: one is dynamic prefab, the other is a static prefab. If you use the dynamic prefab then it will dynamicly update its every instance, if you choose the static one, then it will just act like a template that you can use. Its just an a idea of mine, that I think it would be a usefull feature.
@T0mT4yl0r
@T0mT4yl0r 3 жыл бұрын
How could you use it as a template? It's not possible like that, because instances are based on classes. A template like you say would mean that you create a completly new class for every copy of that. A copy of the class. I think of holding 2 sets of data for each prefab. One it the data of the default class and if you change it, all are changed. But you have another dataset which you can overwrite and make the prefab different to all others but they are still connected to the same base class. How about that?
@martonkos5775
@martonkos5775 3 жыл бұрын
@@T0mT4yl0r That could be an issue, but I thought the attached scripts just stayed connected as a component as usuall, they dont get cloned. I didn’t mean that every class gets cloned. But that is a fair pont that you’ve pointed out.
@strbn9215
@strbn9215 3 жыл бұрын
Ну ты конечно юморист
@danielesquivel3155
@danielesquivel3155 3 жыл бұрын
cherni bonito owo
@arsnakehert
@arsnakehert 3 жыл бұрын
In the engine I'm making, I'm doing ECS with EnTT. I recently created a "Factory" namespace, which contains functions that receive a reference to the registry and create some kind of "object" with certain components in the registry, finally returning the entity ID of that object. I guess conceptually these objects as created by these functions are kind of like the prefabs in, say, Unity. I'm not sure if this is good design or not but I guess it's what I'm sticking with for now.
@T0mT4yl0r
@T0mT4yl0r 3 жыл бұрын
I was going to make prefabs out of Blueprints in UE. But Blueprints are NOT prefabs. They are classes. But we want that visual editing and property windows. If you change the Blueprint, all instances are updated, because the base class changed. But what we want is that we can overwrite an instance to be unique to all others that are an instance of the same Blueprint. So we need the template Blueprint and a virtual copy of the data that will can be overwritten. I made this working but it's very a complex topic.
@李冬瓜
@李冬瓜 3 жыл бұрын
Yep
@lokiandere2518
@lokiandere2518 3 жыл бұрын
we do care
@SeanLumly
@SeanLumly 3 жыл бұрын
Whatever you are doing now, stop, and concentrate on integrating visibility buffers into your engine. They are more efficient than forward renders for small triangles, as well as deferred rendering, and is the major future trend for rendering realtime graphics. It's the technique that UE5 has renamed as "Nanite" for their implementation of the aforementioned technique in UE5. And there are neat things that you can do with visibility buffers beyond increased efficiency for small triangles. They are worth checking out.
@frosty7674
@frosty7674 3 жыл бұрын
First, hahahahah cherno
LIGHTS! // Hazel Engine Dev Log
12:36
The Cherno
Рет қаралды 32 М.
Creating a Scene System for my Game Engine | Hazel Dev Log
12:44
The Lost World: Living Room Edition
0:46
Daniel LaBelle
Рет қаралды 27 МЛН
"Идеальное" преступление
0:39
Кик Брейнс
Рет қаралды 1,4 МЛН
My Game Engine can now PLAY GAMES
10:38
The Cherno
Рет қаралды 62 М.
HDR + BLOOM + EMISSION in my Game Engine
16:19
The Cherno
Рет қаралды 32 М.
I Made the Same Game in 8 Engines
12:34
Emeral
Рет қаралды 4,3 МЛН
My Game Engine can now SHOOT THINGS!
10:27
The Cherno
Рет қаралды 25 М.
I Made a Wave Function Collapse Castle Generator in Godot
25:30
RachelfTech
Рет қаралды 93 М.
Every 2D Node Explained in 9 Minutes !
9:19
Lukky
Рет қаралды 394 М.
Making Game Engines is hard.
21:14
The Cherno
Рет қаралды 103 М.
3D Physics! // Hazel Engine Dev Log
16:26
The Cherno
Рет қаралды 72 М.
Unity Prefabs - The Complete Animated Guide  | Game Dev Classroom
10:43
Lost Relic Games
Рет қаралды 41 М.
The Lost World: Living Room Edition
0:46
Daniel LaBelle
Рет қаралды 27 МЛН