Тёмный

UE5 | Interfaces & Casting - Hierarchy 

Michael Pattison
Подписаться 1,9 тыс.
Просмотров 717
50% 1

In this informative video, delve into the fundamental concepts of hierarchy, casting, and interfaces within Unreal Engine 5 (UE5).
Unlock the power of organizing actors and objects in hierarchical structures, master the art of casting to interact between different classes and blueprints seamlessly, and explore the versatility of interfaces for efficient communication between disparate components of your UE5 project.
Whether you're a beginner or seasoned developer, this video provides essential insights to enhance your understanding and proficiency in UE5 game development.
Want to continue the discussion? Why not join my discord.
Discord: discord.gg/CyUZjNMhcr
If you want to support me, why not conciser making a donation?
ko-fi.com/pattym

Опубликовано:

 

7 сен 2024

Поделиться:

Ссылка:

Скачать:

Готовим ссылку...

Добавить в:

Мой плейлист
Посмотреть позже
Комментарии : 13   
@sonic55193
@sonic55193 3 месяца назад
Very good video. Thank you. Learned a lot.
@epicminecrafter69
@epicminecrafter69 4 месяца назад
I wish you were my gamedev teacher at my university. I learned a lot. Thank you.
@Wauzy
@Wauzy 4 месяца назад
Thanks for this video and the good explanation of hierarchy and how casting works. I was on the path of avoiding casting as much as possible because it "supposedly" costs a lot of memory, but so do interfaces if you use them wrong. But now I know better; use both, but use them right! Danke für dieses Video und die gute Erklärung der Hierarchie und wie Casting funktioniert. Ich war auf dem Weg, Casting so weit wie möglich zu vermeiden, weil es "angeblich" eine Menge Speicher kostet, aber das tun Schnittstellen auch, wenn man sie falsch benutzt. Aber jetzt weiß ich es besser; benutze beides, aber richtig!
@vladdimitrov819
@vladdimitrov819 4 месяца назад
Great video and well explained on the concepts! Just some feedback on the audio for the video itself. There's a high pitched whine throughout the whole thing which makes it pretty difficult to listen to. Can be easily removed with Audacity or some of Nvidias new audio processing tools. Would make for a better experience!
@mpattym
@mpattym 4 месяца назад
Thank you, I'm glad you found it helpful. :) As for the pitched whine, I never actually noticed it so thank you for pointing it out. I currently use NVIDIA to record and audacity to normalize the volume so I'll be sure to check out some of the audio setting to hopefully removing it in any future videos.
@dobrx6199
@dobrx6199 4 месяца назад
Great video, thanks!
@fwannmacher
@fwannmacher 4 месяца назад
Sorry but I think you are wrong because the objects are references. So, as soon as you have a high level object - like Thirdperson Character - instanced in memory you won't be adding its size footprint to memory again. In your example the size map changes because there is no value in ExampleVar, so the UE doesn't know how to calculate it. But, as soon as you are running the game and the character is already in memory, the memory usage won't change. The cost related to casts is related to interpreting memory blocks and not memory usage. You have to dig C/C++ to understand it :)
@mpattym
@mpattym 4 месяца назад
In terms of casting, it's the class that is forced to be loaded if its not already loaded. Each object spawned from the class itself will then have additional data that is related to its unique instances variables. (different from the class default) This is why using base classes and hierarchy is important. Chances are you're core base classes would be loaded anyway so keeping them light weight (void of heavy assets such as textures, sounds etc) is vital to help ensure only what is actually been used is actually loaded. Plus it gives you more control on when something should be loaded when using soft references, of which can only really be utilized when you have good hierarchy. If I have an actor references (such as the example var) whilst I can store anything in it that is a child of actor, as long as I don't cast to anything, it means this specific class with the var inside won't have to force the class to be loaded. This instead would be off loaded to the class that actually spawns the actor. The third person character is probably a bad example as most people probably only have one character, meaning it would be loaded anyway.
@fwannmacher
@fwannmacher 4 месяца назад
@@mpattym either way the class is already loaded in memory so there is no reason for it to consume more memory. Like I said, the problem of using the size map is that the application is not running so it will calculate everything needed but that is not necessary the final memory usage. It has to be used as reference and not as the final value. I'm sure that if you run the game with either cast to the final class or cast to a base class then the memory usage will be the same.
@mpattym
@mpattym 4 месяца назад
@@fwannmacher the size map shows you what it has to load just to exist in the world whether it's being used or not. This is without specific instance data. This is how people can get into a situation where they have a single actor that loads everything in their game. (It's why casting is seen as bad) But this is resolved through good hierarchy. In essence, a class will load everything it thinks it'll need so it's ready.
@crazyguy7585
@crazyguy7585 4 месяца назад
bro who said that is interface is a replacement of casting both have their own use cast is bit expensive and it makes ur memory size bigger and that's why good developer try to avoid as much as can. both thing is here for us its up us which side we go for optimize way
@ricardo22448
@ricardo22448 4 месяца назад
because some people think that they have to ban casting and only use interfaces because it is heavy but they just don't know how to use it properly. Thats why he made this video :D
@mpattym
@mpattym 4 месяца назад
The difference between the act of casting and using an interface is negligible. As I mentioned in the video, the only thing to consider with casting is it's asset footprint it can create. And by asset footprint I mean assets that get forced to be loaded when they aren't actually being used. All of which is mitigated through using good class hierarchy. Adding to this, if you're not using interfaces correctly (using them to avoid casting), you can actually end up in a worse position than if you had just used casting to begin with. Being pretty active on various UE related discord channels, I've encountered many people (usually beginners) who end up doing convoluted interface setups just to try and avoid casting which is unnecessary.
Далее
Stop Casting! use blueprint Interfaces Instead!
11:56
UE5 | Actor Manager System - Tutorial
24:41
Просмотров 1,3 тыс.
Я ж идеальный?😂
00:32
Просмотров 81 тыс.
ПРИКОЛЫ НАД БРАТОМ #shorts
00:23
Просмотров 2,5 млн
Why Solo Developers Should Use Unreal
9:51
Просмотров 372 тыс.
Quake Movement - Unreal Engine Tutorial
8:28
UE5 | Epic Fixed Camera System - Tutorial - Pt1
30:15
Просмотров 1,9 тыс.
Why Slopes are Shockingly Difficult for Indie Game Devs
17:20
The Best Game You'll Never Play - Steel Battalion
28:59