UE5 Understanding hard and soft references - Be a better game dev

  Рет қаралды 28,176

LeafBranchGames

LeafBranchGames

5 ай бұрын

In this episode of be a better game dev, we will be looking into hard and soft references.
Be a better game dev playlist: • Be a better game dev
Join the Discord server here: / discord
Support the work of LeafBranchGames on Patreon here: / leafbranchgames

Пікірлер: 280
@maiworld_
@maiworld_ 4 ай бұрын
lmao i just realized the shade to "gorka games" and "matt aspland" in the thumbnail im dying lmaooooooooooo
@LeafBranchGames
@LeafBranchGames 4 ай бұрын
:)
@TheModExperiment
@TheModExperiment Ай бұрын
In fact, Gorka and Matt are good for beginners. You won't teach string theory in first grade, but will start with simple mathematics?
@LeafBranchGames
@LeafBranchGames Ай бұрын
@@TheModExperiment In fact, they are not.
@TheModExperiment
@TheModExperiment Ай бұрын
@@LeafBranchGames So what are you thinking about Ryan Laley?🎩🎩🎩
@LeafBranchGames
@LeafBranchGames Ай бұрын
@@TheModExperiment Why do you ask?
@Ares9323
@Ares9323 5 ай бұрын
Dissing two channels with a picture: Done
@LeafBranchGames
@LeafBranchGames 5 ай бұрын
Should be an achiement unlock for it or something, right?
@Zlevir
@Zlevir 5 ай бұрын
The first 4 seconds are 10/10 xD I don't need tutorials, but I like to scroll through some of them to see 'what they teachin' over there' from time to time, and I see im not the only one pissed off by hundreds of tutorials that kinda make sense in isolated and limited tutorial environment, but demonstrate overall bad practices on a regular basis without mentioning it :D
@LeafBranchGames
@LeafBranchGames 5 ай бұрын
Well then, thank you for the visit. :)
@Zlevir
@Zlevir 5 ай бұрын
I am a regular visitor here and I am subscribed to your channel as well :P One of the best unreal tutorial channels. Good content, calm and reasonable creator, no bs practices. Keep up the good work! :D
@LeafBranchGames
@LeafBranchGames 5 ай бұрын
@@Zlevir Thank you very much! I very much appreciate that!
@steve_rico
@steve_rico 5 ай бұрын
As someone getting into this as a hobby these in depth best practice videos are gold. Thank you
@LeafBranchGames
@LeafBranchGames 5 ай бұрын
Glad to be of help!
@LuizFernandoSC
@LuizFernandoSC 5 ай бұрын
So, having a variable referencing a actor or casting to it directly in the blueprint consumes more memory but is faster, while soft referencing that same object consumes less memory but takes some time to access it. After all this time, I finally learned how to use soft references, thank you.
@LeafBranchGames
@LeafBranchGames 5 ай бұрын
Glad to hear it!
@YoutubeAccountMan
@YoutubeAccountMan 2 ай бұрын
I can't imagine a time when I'd want to load something slowly in a game that isn't turn based.
@jacobfoster
@jacobfoster Ай бұрын
​@@KZbinAccountManmaybe for character or weapons skins? You may have hundreds in a game and so they are loaded from a soft reference. There may be a fuzzy transition texture to show the skin is updating if it takes a second to load?
@matthewspencer2837
@matthewspencer2837 5 ай бұрын
A lot of of tutorials fail to show best practices. If you were to do some of the stuff you see in these tutorials in a professional setting, you'd generate so much tech debt, and spend more time refactoring than you would developing.
@LeafBranchGames
@LeafBranchGames 5 ай бұрын
So true. The technical debt would be immense.
@halfbakedproductions7887
@halfbakedproductions7887 Ай бұрын
I've seen some awful tutorials. They all start with "just open the Third Person template", then it's Blueprint spaghetti with an empty Details tab covering half the screen. They never use C++ either. Some of them even fire up UE5 and then use the old Input System. That's criminal. Other things like "Get all objects of class" every time rather than using a data structure and storing these things once. Perhaps Blueprint has been well optimised by Epic and that's not a problem, but it smells bad. It's certainly a disaster in Unity and leads to a noticeable performance drop. What you get is a very basic and poor implementation of the "what", without explaining the "why". Things like wanting to use Event Dispatchers, but having a hard reference to the source of the event. That's pointless, it doesn't scale and it breaks the Observer pattern.
@joel6376
@joel6376 3 ай бұрын
This video is great. When starting I never understood casting because all the tutorials were so simple and manually targeted. You know the ones, connect door to trigger by directly referencing it from the map (this is not scalable) rather than building a door + trigger that can be retargeted etc. Because of this I learnt interfaces and event dispatchers before I understood how to use casting. Turns out this was a pretty good move. You explain things very well.
@LeafBranchGames
@LeafBranchGames 3 ай бұрын
Thank you! Yes, I know exactly what you mean. :)
@StBlueFire
@StBlueFire Ай бұрын
There is a mistake @11:51. This will cause an error or crash in a packaged game (or on a restart of the editor). It only works in your example because the editor has it loaded in memory due to GC not having been run yet. If you use Async you MUST use completed to ensure no errors. If you Load Asset Blocking you can avoid and async call and just delay in the frame (useful for very small actors or customizable actors). Other than that, this is a great explanation!
@LeafBranchGames
@LeafBranchGames Ай бұрын
Yes, that is correct. Thank you for sharing!
@KevinRyborz
@KevinRyborz 5 ай бұрын
Thank you so much for this explanation! I always hate when they just cast in tutorials and never explain what the drawbacks are and how to do it better because "it works for now".
@LeafBranchGames
@LeafBranchGames 5 ай бұрын
Happy to hear it is appreciated, and I fully agree with you. :)
@azaelue5
@azaelue5 5 ай бұрын
That thumbnail instantly triggered me, but it's true! Good video 👍
@LeafBranchGames
@LeafBranchGames 5 ай бұрын
Thank you!
@mattlox3981
@mattlox3981 5 ай бұрын
i really don't like talking bad about other UE channels but those gorka "tutorials"... lol
@azaelue5
@azaelue5 5 ай бұрын
@@mattlox3981 I consider that specific tutorials (such as horror game tutorials, rpg tutorials, survival tutorials) have no value... You only really learn with actual engine tutorials (learning about blueprints, references, interfaces and the different tools) Matt has some good tutorials but yeah Gorka... Meh... I've been on their Discord and reported the over use of casting (he used casting in components which beats the purpose of it)... And the answer I got from a mod was like "Oh yeah he knows he'll fix it in a later episode" And it hasn't been fixed yet lmao... One I do recommend is Ryan Lalley, he has really good tutorials on global engine systems
@UNDERKING_UDK
@UNDERKING_UDK 5 ай бұрын
It's a lecture that you can't even listen to in paid lectures! Tutorial Thank you for the high quality tutorial :)
@LeafBranchGames
@LeafBranchGames 5 ай бұрын
Thank you, appreciate it!
@Sgt_Killersnow
@Sgt_Killersnow 3 ай бұрын
Subbed when I found this, wanted to say I wish the school I'm finishing a bachelors in game design would show this specifically but I'll make sure it becomes a signature that I showed someone this video when soft refs show up all over assignments.
@LeafBranchGames
@LeafBranchGames 3 ай бұрын
High praise. Thank you! Please do share among your learning peers. :)
@ACouchpirate
@ACouchpirate 5 ай бұрын
I had just been thinking I know soft references are better for memory but didnt really know how to make use of them, and then this video popped up in my feed and answered all of my questions, great video as always 🎉
@LeafBranchGames
@LeafBranchGames 5 ай бұрын
I nsensed a disturbance in the force and knew this would be an issue you would be running into. I am glad I was able to make it in time!
@stephananemaat
@stephananemaat 5 ай бұрын
Bit of a spicy thumbnail there
@LeafBranchGames
@LeafBranchGames 5 ай бұрын
Credit where credit is due.
@jevinscherries
@jevinscherries 5 ай бұрын
Just to add a bit to the conversation, casting in and of itself is not inheritly bad, it just depends on how you use it. If you have to cast, then its best to cast to the base class rather than some extended child class that contains a ton of art references or other references to weapons, etc. For example, if you need access to some base variable of a character, such as data about its movement component, you can just cast to the base character class and get the component reference from there to access what you need. Or if you need to check if an overlap detection was of a certain class, you could cast to the base class that you need. There are other ways of knowing some data, like using gameplay tags to identify types of enemies, or actors; but I wouldn't say casting is something to completely avoid. Perhaps in Blueprint only projects this is something to be more careful of, but if you are using a C++/BP hybrid, you have more flexibility of where you could hold data, and ensure you store crucial data inside of the base class rather than some extended child class. Interfaces and soft-references are always a good thing and should be a part of a developers suite of tools depending on the job they need to do, so kudos for sharing the knowledge, and awesome video/channel :)
@LeafBranchGames
@LeafBranchGames 5 ай бұрын
Thank you! Of course there is always nuance to how and when to use certain approaches. That is true for almost all solutions, there are pros and cons to them all. I tried showing off the example with a lower base class example for the interface, using an actor instead of a heaver child class.
@user-vf6eh1fo5u
@user-vf6eh1fo5u 4 ай бұрын
at timestamp @3:38 the OP shows the size map. But you can also see other things and how they are being "reference". For me I enjoyed the guided explanation, since Im relatively new to unreal(coming from Unity). While your(jevinscherries) explanation has some textual examples, seeing the visuals is a much better way for new people to grasp this subject. When I saw the output of the size map, I knew this was going to be an indispensable tool, especially in my niche of dev'ing- mobile development.
@dorondavid4698
@dorondavid4698 3 ай бұрын
You're talking about polymorphism and virtual methods... One of the most powerful tools in C++ ❤
@inxendere
@inxendere 5 ай бұрын
DAMN what was the music in the beginning??! The melody was so good
@LeafBranchGames
@LeafBranchGames 5 ай бұрын
I think so too! It is called "Borderless" by Aakash Gandhi.
@Dafnstory
@Dafnstory 5 ай бұрын
Interesting and well explained. I think part of the problem is that Unreal training often uses casting as a way to teach (maybe because it's quick and easy?) and so many people, depending on what they are trying to do, never learn or even know what's going on deeper under the hood and in many cases, can't even find a decent explanation anywhere! I have found errors in Unreal own docs and many tutorials are out of date and don't even work. So that's what's good about this video... it takes a deeper look with clear examples. I do feel like we are all struggling at some levels to figure Unreal out and so I'm mindful of what I hear and just factor that in, even with Unreal's own training materials.
@LeafBranchGames
@LeafBranchGames 5 ай бұрын
For sure, Epic does show the faster and easier way at times to allow to focus on what point they want to drive home but not always. They have held shows on their KZbin where they talk about this issue as well. But many don't have the time to look at streams for hours, and some might not realize all the valuable things they teach at times. So it is a bit of an unfortunate situation. They do not consistantly point out the pitfalls, and that might be why it slips by.
@macxike
@macxike 5 ай бұрын
I watched a couple of videos about this before and never really understood how this can be beneficial until now. Thank you!
@LeafBranchGames
@LeafBranchGames 5 ай бұрын
My pleasure!
@Skaro1412
@Skaro1412 5 ай бұрын
Good to know! learning so much of just connections and blueprints never realized the tax of soft vs hard referencing this has to be why some indie games even small ones run so bad because everything is stored in memory and not soft referenced. Very important info!
@LeafBranchGames
@LeafBranchGames 5 ай бұрын
Glad to hear you like it!
@johnny1up
@johnny1up 2 ай бұрын
This video was the best I’ve found regarding this topic! Thanks! 🎉
@LeafBranchGames
@LeafBranchGames 2 ай бұрын
Thank you, glad to hear you like it!
@feralz_vox
@feralz_vox 5 ай бұрын
Thank you for these great tips. It is really appreciated and well done!
@LeafBranchGames
@LeafBranchGames 5 ай бұрын
My pleasure! Glad to hear you found them useful!
@ilarinikkarikoski4765
@ilarinikkarikoski4765 5 ай бұрын
Thank you. I sort of knew that casting is something to be careful, and not-to-be-overdone - but I never knew like the logic how to follow its consequences. Very useful video, thank you.
@LeafBranchGames
@LeafBranchGames 5 ай бұрын
Glad to hear it was informative. :)
@irusu.
@irusu. 3 ай бұрын
Great concepts, thank you sir. Subbing and attentive to all best practices you post for us 🎉
@LeafBranchGames
@LeafBranchGames 2 ай бұрын
Thank you for the support. :)
@emirisik
@emirisik 5 ай бұрын
Very well explained! Great video as usual.
@LeafBranchGames
@LeafBranchGames 5 ай бұрын
Thank you!
@borisaceski6401
@borisaceski6401 5 ай бұрын
That intro tho xD haha Good one lol... Great video as always. Mate I have a question for you or maybe a tut request >.>. You seem like a smart guy that can give me some insights. I am making a FPP mele game using swords etc. I searched and can't seem to find any info or guidance about recoil of mele weapons. So for example you hit a wall and the weapon bounces back, or maybe hit an enemy with a hammer and the animation stops and recoils back to idle and not going thru the enemies. Or even when the enemy blocks or swing. Stay awesome! Cheers!
@LeafBranchGames
@LeafBranchGames 5 ай бұрын
Thank you! There are probably a few different approaches you can go about this. One way is physical animations. If you want to delve into that aspect, then the youtube channel prismaticadev has some informative tutorials around that. Alternatives that I can think of immediately would be upon identifying a hit result, you could use something akin to a hit stop like effect for the animation, essentially pausing it, and then refersing it a few frames before blending back to the normal animation state. I think either of these should give a decent result.
@borisaceski6401
@borisaceski6401 5 ай бұрын
@@LeafBranchGames Yeah I figured. Checked the Prismaticadev physic anim video a while ago. Tbh looks way complex and hard to tweak. The animation hit stop effect sounds more easy >.>. What do you mean by refreshing it for few frames before blending back?
@LeafBranchGames
@LeafBranchGames 5 ай бұрын
@@borisaceski6401 Sorry, typo, meant "reversing" it for a few frames, sort of like a recoil.
@borisaceski6401
@borisaceski6401 5 ай бұрын
@@LeafBranchGames Oh reversing XD... that was my initial idea I tried , however I was unable to find a way to pick a starting position to play the animation in reverse from.. I was not able to figure a way to get the exact frame position the animation was in when the "collision" happened and to play it from reverese from that point in the animation. Hope this makes sense >.>
@LeafBranchGames
@LeafBranchGames 5 ай бұрын
@@borisaceski6401 You could try and see if you can alter the current montage playing and let it be at the position it is in, and adjust the play rate to -1 to reverse.
@galagast3d
@galagast3d 5 ай бұрын
thank you for this video~ i love how this was explained, with lots of examples that make sense! what to do, and what not to do.
@LeafBranchGames
@LeafBranchGames 5 ай бұрын
Glad to hear it. :)
@khushtrivedi14
@khushtrivedi14 5 ай бұрын
These are the legends KZbin often misses to push out You my sir are a legend for these videos! Would really love to have more of these tutorials considering the way of explanation is just so good!❤ Keep up the good work!❤️🔥
@LeafBranchGames
@LeafBranchGames 5 ай бұрын
Thank you, appreciate that! There are a total of three episodes on the series so far and a fourth on the way soon. So hopefully those are useful to you as well!
@ryanrobertsii
@ryanrobertsii 5 ай бұрын
Thank you for this, it clears up a lot for me!
@LeafBranchGames
@LeafBranchGames 5 ай бұрын
Happy to hear it!
@unrealdevop
@unrealdevop 5 ай бұрын
I've been learning unreal for over 2 years now and I didn't know a lot of this, great job on this video.
@LeafBranchGames
@LeafBranchGames 5 ай бұрын
Thank you!
@raccoon_05
@raccoon_05 5 ай бұрын
Great video! Learned so much 👍
@LeafBranchGames
@LeafBranchGames 5 ай бұрын
Really happy to hear that. :)
@fhajji
@fhajji 5 ай бұрын
Thank you. That was really useful, and very well explained. Subscribed.
@LeafBranchGames
@LeafBranchGames 5 ай бұрын
Thank you for the praise and the support!
@pulkit1437
@pulkit1437 5 ай бұрын
binged through your blueprint tutorials last year, I was feeling like it needed some dusting after UE5 but look at this hard and soft refs debunked in 20 mins GGEZ! Thanks as always teach ^^
@LeafBranchGames
@LeafBranchGames 5 ай бұрын
Thank you. :)
@Mohit_N.R
@Mohit_N.R 5 ай бұрын
This is one of the Best Video, Thank you !! ✨
@LeafBranchGames
@LeafBranchGames 5 ай бұрын
Thank you kindly!
@wilismatrix9847
@wilismatrix9847 5 ай бұрын
This is very instructive, now I understand why in a previous project when the world loads in a server it was struggling and was taking a lot of memory. it was all because of the casting !! Thank you !
@LeafBranchGames
@LeafBranchGames 5 ай бұрын
Indeed!
@QuickPixls
@QuickPixls 5 ай бұрын
Be a better game dev Is the serious devs need. Thank you so much
@LeafBranchGames
@LeafBranchGames 5 ай бұрын
My pleasure!
@BROCKSGAMING
@BROCKSGAMING 5 ай бұрын
poor gorka and matt haha
@LeafBranchGames
@LeafBranchGames 5 ай бұрын
Avoid those cast to nodes!
@BROCKSGAMING
@BROCKSGAMING 5 ай бұрын
haha Yea@@LeafBranchGames
@carlosrivadulla8903
@carlosrivadulla8903 5 ай бұрын
@@BROCKSGAMING not only them. Uisco and Ryan have never used a soft reference in their lives. Ryan knows some shit but he gets lazy when it comes to show good practices every time. I need some quality channels or patreons to follow in 2024.
@BROCKSGAMING
@BROCKSGAMING 5 ай бұрын
@@carlosrivadulla8903 yea totally you can do watch beardgames he shows some good practices or CodeLikeMe he has longer videos but are detailed , i suggest to combine good from all of them
@4ORESIGHT
@4ORESIGHT 5 ай бұрын
Thank you very much for the tutorial! Great one, subscribed for future videos!
@LeafBranchGames
@LeafBranchGames 5 ай бұрын
Thank you for the support!
@UE5TutorialPL
@UE5TutorialPL 4 ай бұрын
As I said earlier, this is a war 😅. You're tutorials is very useful and helping to understand better basics of unreal engine. No one explains it correct as like You!
@LeafBranchGames
@LeafBranchGames 4 ай бұрын
Thank you, appreciate that!
@maiworld_
@maiworld_ 5 ай бұрын
More of these for sure good stuff Ty
@LeafBranchGames
@LeafBranchGames 5 ай бұрын
Thank you for the feedback. :)
@lospe85
@lospe85 5 ай бұрын
really good explanation! thank you! (I laughed so hard from 00:00 to 00:04 , I understood the reference xD )
@LeafBranchGames
@LeafBranchGames 5 ай бұрын
@SandeepKumarP
@SandeepKumarP 5 ай бұрын
Please continue making your how to be better game dev playlist series
@LeafBranchGames
@LeafBranchGames 5 ай бұрын
Will do!
@unknownrh155
@unknownrh155 5 ай бұрын
Actually, if you just use the hard reference only it doesn't affect so much. It just increase the load times. It's not bad performance issue to start with, that's why Epic didn't emphasize this so much. It was an issue back then with hardware limitation but now with SSD and DDR5 ram it doesn't affect much.
@kenalpha3
@kenalpha3 5 ай бұрын
Can you post a comparison load-time in a vid or pic? You may be right that load time isnt an issue (but I need to see). But still hard refs are bad when migrating assets. If I just want to migrate someone's character but not all heli textures etc.
@unknownrh155
@unknownrh155 5 ай бұрын
​@@kenalpha3That's because hard references are stored in an object variable. When migrating, the engine might miscalculate this. Regarding your question, I don't have any with me to show. I just learned it from experimenting and C++ knowledge. Also, you know when you put something in your level let it be static meshes/actors/Niagara/Sk mesh/ it always creates hard references. You can access them directly by drag and drop in the level blueprint if you don't believe me.
@unknownrh155
@unknownrh155 5 ай бұрын
@@kenalpha3 You can learn more by researching about memory leak in c++ they have handlers for this
@LeafBranchGames
@LeafBranchGames 5 ай бұрын
Yes and no. Hardware keeps improving but so does graphical fidelity. For example, before 4K textures were the high end of texture resolution, now we have 8K, and it will likely continue. Since this arms race between hardware imporving and developers trying to get more out of their graphics, having to load in larger and larger amounts of data in memory will be significant.
@Erxv1
@Erxv1 5 ай бұрын
its not just load times, its in-game memory usage. If you hard reference too much you can easily reach some ridiculously high numbers that will mean you run out of memory which means the game has to constantly shuffle stuff between SSD and memory and even on a high speed SSD that will cause massive stutters.
@sqwert654
@sqwert654 5 ай бұрын
very concise explanation.
@LeafBranchGames
@LeafBranchGames 5 ай бұрын
Thank you!
@alexanderkartashov8776
@alexanderkartashov8776 5 ай бұрын
great explanation.
@LeafBranchGames
@LeafBranchGames 5 ай бұрын
Thank you!
@meta.hariharan
@meta.hariharan 3 ай бұрын
This helps to optimize my game
@linezgames3893
@linezgames3893 Ай бұрын
Love it.
@LeafBranchGames
@LeafBranchGames Ай бұрын
Thank you!
@alexanderlinderson2655
@alexanderlinderson2655 5 ай бұрын
damn that was super useful! Been a dev for a while but never understood this properly, man tackar!
@LeafBranchGames
@LeafBranchGames 5 ай бұрын
It was my pleasure!
@l_t_m_f
@l_t_m_f 5 ай бұрын
great video!
@LeafBranchGames
@LeafBranchGames 5 ай бұрын
Thank you!
@haxcrossoverit
@haxcrossoverit 5 ай бұрын
You’re a life saver!
@LeafBranchGames
@LeafBranchGames 5 ай бұрын
Thank you, apprecaite it!
@Foxcoder
@Foxcoder 5 ай бұрын
thx, get to the point and well explained , i think make an parent abstract helicopter class and only expose nessassary function, child helicopter class can refer to heavy memory resource third person only get hard reference to abstract helicopter it possible can do similar as soft reference, and get type safe compare to interface. i didn't check yet, I will check it when i work on my game, apology if i'm wrong.
@LeafBranchGames
@LeafBranchGames 5 ай бұрын
The concept is correct. You can have a light weight placeholder that you load in as the need arises/or by having children with more complexity and by doing so, you could have hard references that are still not very demanding memory wise.
@dennywu5331
@dennywu5331 5 ай бұрын
well explained! Nice!
@LeafBranchGames
@LeafBranchGames 5 ай бұрын
Thank you!
@adamsimonds6184
@adamsimonds6184 5 ай бұрын
Like others, it was the thumbnail about Gorka and Aspland that made me watch this. I've just started seriously sitting down after having watched or gone through a couple full tutorial series (like Ryan Laley's) to get a basic understand of BP and all I've been doing is very simple, (movement, damage interaction, hit reaction, dodge), and, so far, I've avoided bloating my memory drain, but this video showed me something that I hadn't even known about. So, thank you. I actually was worried about optimizing memory long term, but if I can take care of it while doing stuff that's much better. I do have a question, though. My character is using a mixamo rig w/mixamo animations, not the built in one, but the BP is a child of the default one. Default is calling references to manny and quinn. I don't know how heavy those are, but is there a way to remove them without breaking things? I used the default so I could put common actions since I intend to have at least one more playable character with some different actions, but neither is using the default rig so I don't know if I need to keep those.
@LeafBranchGames
@LeafBranchGames 5 ай бұрын
It depends a bit. If you are for exanple only going to use Mixamo characters and animations, you could just create your own blueprint inheriting the character class and create and setup an animation blueprint. Or you could achieve the same by just not making use of the manny animation blueprints and and meshes but use your own assets. So you can for sure get rid of them, but if you are retargeting animations and want to make an easy way of using multiple different rigs, then you can benefit from the existing setup for convenience.
@Agachack
@Agachack 4 ай бұрын
I really like this serie of "Be a better game dev", which shows through nice example how things work in UE. I had no idea about the map size, that's very interresting! A quick question tho: so we have cast and interface to make a reference (or to process some actions) to another instance. The last stuff that comes to my mind is the Event Dispatcher. What are the cost when you do the call / binding ? Is it like an interface (soft), or actually like a cast (hard)? Or even something else?
@LeafBranchGames
@LeafBranchGames 4 ай бұрын
Glad to hear you like the series! You can not bind an event dispatcher to a class without having a reference of that specific type, because just like functions, events and variables the event dispat her is now known to exist unless it is of a reference of the specific type that has it.
@Agachack
@Agachack 4 ай бұрын
@@LeafBranchGames Oh yes, now that I think about it, you're right!
@brpcgamer
@brpcgamer 5 ай бұрын
Parabens otimo conteudo, era esse tipo de video que eu precisava 👍
@LeafBranchGames
@LeafBranchGames 5 ай бұрын
Thank you, glad to hear it!
@johnrex7108
@johnrex7108 3 ай бұрын
In the first five minutes you described hard and soft references 100x better and more to the point than it took Epic's own rambling, idiotic "Demystifying Soft Object References" video. Earned yourself a subscriber.
@LeafBranchGames
@LeafBranchGames 3 ай бұрын
Thank you for the kind words as well as teh support. :)
@zengd
@zengd 3 ай бұрын
Thanks for the video, it's really cool. Though, any suggestions on actual player blueprint size, for example? I mean, let's say I have an ULTRAKILL-sized game (in terms of mechanics and code complexity). Is there any recommended player blueprint size for a game like that? Right now, in my prototype, the player blueprint weighs ~150MB (of which most of it is taken up by the UI), and I don't know if that's a good or bad result. P.s. I use hard references in some places, and soft references in other places, according to the situation.
@LeafBranchGames
@LeafBranchGames 3 ай бұрын
Not really. It depends on the situation and what you are trying to accomplish. A really light weight game has the benefit of being able to be loaded very quickly. A game with a lot of dependencies will take a long while to load but on the other hand you have those assets available for quick use now. It also sets the minimum requirement of your player base.
@tuwumuch
@tuwumuch Ай бұрын
Would casting be optimal on anything to do with network and replicated values?
@3zzzTyle
@3zzzTyle 3 ай бұрын
Just came here from a Gorka tutorial where he was setting a bool to false if it's already false. Good channel, this one.
@LeafBranchGames
@LeafBranchGames 3 ай бұрын
Simply fantastic!
@ZeptionT
@ZeptionT 3 ай бұрын
can you send a link to that one or tell me the name I want to see that
@revan9903
@revan9903 Ай бұрын
Nice video. very helpful. :3
@LeafBranchGames
@LeafBranchGames Ай бұрын
My pleasure!
@vladdimitrov819
@vladdimitrov819 5 ай бұрын
Would you say that casting to something thats already loaded into memory isnt a huge deal then? Like if triggers, or actors that are already visible in the level cast to the player character? If the player is already loaded because youre playing the game, then casting to it should be fast and have minimal overhead. Or is there something else to be careful of in these situations?
@LeafBranchGames
@LeafBranchGames 5 ай бұрын
No, you are correct. If something already is in memory, or something that is very likely to be in memery anyway - like the main weapon of a character, then the hard reference won't cause any larger of a memory footprint, so then having the reference will make it easier to work with. In that case, it is not an issue to reference it.
@roadtoenviromentartist
@roadtoenviromentartist 5 ай бұрын
One question Guy... 13:27 time.. Do you consider the bad use "Get Actor of Class" or you´ve used these one in this case to understand the main reason that is the right use of soft/hard references only???. Thanks you anyway.. Because Iam very worried and I have terrible questions when I invoque "get actor of class"... Only this thing. Very nice content, Congratulations!!!.
@LeafBranchGames
@LeafBranchGames 5 ай бұрын
Get actor of class is bad in the sense that it will need to go through all the actors to find the matching ones of your query. So as you have larger worlds with more actors, this will be slower. So it is mainly something you don/t want to see happening often, like in loops in ticks and such. But if you have it as a "one off", like there is a very specific actor (or actors) you need to gather and you do it once in a begin play in an object or something to gather the references - then it will not happen often and is not likely to be a problem.
@linxsr
@linxsr 5 ай бұрын
Thanks man, I figured out the general use, but this async load is new to me. As i understand it, an async loading would produce less hitches when loading into memory more complex stuff, as it's a lower priority load in comparison to standard spawning. Or am i wrong?
@LeafBranchGames
@LeafBranchGames 5 ай бұрын
Well, sort of. Instead of using the game thread to load in an object, which would cause the game to halt until that is done, it is done in a different thread, so technically a parallell process.
@Greenman4890
@Greenman4890 5 ай бұрын
Thanks for sharing good practices something that can be rare among tutorials haha
@LeafBranchGames
@LeafBranchGames 5 ай бұрын
My pleasure. You are not wrong!
@affair2k
@affair2k 5 ай бұрын
First of all, thanks for this really nice and needed resource. I would love to ask you something. When you show the size map, the default option shown is the Disk Size, but you keep reffering as the space in memory. Should we change the tab from disk size to Memory size (or whatever name it is, sorry, I am not in UE right now) to really see what is going on? Or with Disk Size is more than ok? Again, many many thanks.
@LeafBranchGames
@LeafBranchGames 5 ай бұрын
Both disc size and memory size will both increase with references. If you are looking to really min max how much is used by your RAM, then the memory size is what you want to look at as a measure. If you are just looking to reduce dependancies of assets, then either view is ok to look at because you are just looking to decrease references as much as you can, maybe not shooting for a specific target value.
@affair2k
@affair2k 5 ай бұрын
@@LeafBranchGames Thank you so much!!!
@PixelsLaboratory
@PixelsLaboratory 5 ай бұрын
At 11:29 when you got rid of the class casting and used the conversion pin instead, you actually re-routed the wrong Exec pin (instead of the Completed one, the immediate one). Was that just a slip, or intentional? Asking because I was expecting the Spawn Actor node to give you a runtime error as it tries to immediately spawn the still-not-loaded helicopter, but for some reason it did not fail... 🤔 Maybe some caching mechanism from the previous Play run has helped loading the asset super-fast instead?!
@Zlevir
@Zlevir 5 ай бұрын
It did not fail because the assets are already loaded in editor environment so it was able to just convert from soft to hard, and in a cooked game this would be an undefined behaviour - the crash might happen or not, depending on how fast the asset is gonna be loaded (but most certainly would crash)
@LeafBranchGames
@LeafBranchGames 5 ай бұрын
Like @Zlevir said. You most likely want to hook your execution pin from completed to be assured that you asset is loaded in memory before you try to spawn it. The other pin is for code you may want to run in the meantime before it is fully loaded, if that is a need that you have.
@jevinscherries
@jevinscherries 5 ай бұрын
@@LeafBranchGames - It would be to good amend the video with this correction because it will lead to confusion for people just learning the topic.
@peevee5588
@peevee5588 5 ай бұрын
Totally relevant for my current project….i’m slighlty scared of what i might find when doing a ref map or size map 😅 thanks!!
@LeafBranchGames
@LeafBranchGames 5 ай бұрын
Haha. Denial is always one approach as well!
@arrowarcher01
@arrowarcher01 Ай бұрын
If I have 2 assets with hard references to a third asset, will that third asset still only be loaded once? Also, if I have a small one-room game (ie something quick for a game jam) and almost every asset has been placed in the room from the start, is there a benefit to not using hard refs outside of trying to use best practice?
@LeafBranchGames
@LeafBranchGames Ай бұрын
Not really, no.
@gokuvinod2850
@gokuvinod2850 5 ай бұрын
So in short using interfaces instead of direct casting is a good practice right sir? and always try to use soft reference while development got it. Thanks a lot keep more of these videos coming it helps a lot and now im going to remove cast and implement interface where necessary
@LeafBranchGames
@LeafBranchGames 5 ай бұрын
Interfaces are great for sure. But not all hard references are bad. If you have a character that always have a specific sword, is never without it, then it would always be loaded in memory regardless. So a hard reference there may not be bad. So there are some circumstances that are not as black or white. But as a rule of thumb, it is a good start!
@gokuvinod2850
@gokuvinod2850 5 ай бұрын
@@LeafBranchGames yeah again thanks a lot for make it easier for everyone keep more of these videos coming. Who knows what other deal breaking mistakes I have made in my game 😂😂😂
@LeafBranchGames
@LeafBranchGames 5 ай бұрын
@@gokuvinod2850 Ha ha, will do. :)
@dorondavid4698
@dorondavid4698 3 ай бұрын
So basically, if I can associate this with C++ class instantiation, making hard references is akin to calling multiple new calls (or however you create your objects), which means that every time you make your original class, the memory usage of the class will be created, along with every other class you create in the constructor or wherever at initialization time. Whereas a soft reference, is akin to creating objects ONLY when needed.
@LeafBranchGames
@LeafBranchGames 3 ай бұрын
Essentially, yes. That is correct.The dependancy chain causes a increasingly larger footprint.
@UnstoppabIe
@UnstoppabIe Ай бұрын
I have a question... When I use a hard reference to something that is already loaded into memory (etc. GameMode class), is it harmless?
@zzzmobilelegend9871
@zzzmobilelegend9871 5 ай бұрын
Hi since we're on the topic of references could you do a tutorial on when to use interface and event dispatcher to call event/function on different blueprint..i mostly use interface because i cant grasp the idea of when to bind and unbind event dispatcher. I find it easier just to implement interface on the blueprint i want to call on then just do interface call on the other bluerint.. however i just wondering if event dispatcher is less resource intensive or could be more useful than interface..thanks
@LeafBranchGames
@LeafBranchGames 5 ай бұрын
I use dispatchers in many of my tutorials. Like this one for example: kzbin.info/www/bejne/mJXWg4KebdKEkM0 It is a bit dependant on who knows of who, meaning who can reference whom. If you have two objects, A and B. Both have references to eachother, then you can just use direct communication, like interfaces. But if A knows of B, but B does not know of A. You can still have B communicate with A, because A can use a bind to an event in B. Also, if you have a large amount of objects that all know A and A knows all of them, you may want to just say in A that "thing X happened" with an event dispatcher and let everyone who is interested do their thing, instead of calling each object with an interface. But that is more a matter of preference. I will likely do so more tutorials on the topic in the future for sure.
@zzzmobilelegend9871
@zzzmobilelegend9871 5 ай бұрын
@@LeafBranchGames thanks for the reply..i actually started unreal around the time when you were making the rpg series. Couldn't understand a thing back then but have no problem following the tutorial few months ago. Thank you so much for your hard work in educating everyone
@LeafBranchGames
@LeafBranchGames 5 ай бұрын
@@zzzmobilelegend9871 Thank you, glad to hear of your learning progress. :)
@ATomCzech
@ATomCzech 5 ай бұрын
I would like to see some real game worl example. For example in the level you need to have a lot of object, but most of them are conditional, player need to do something special before they appear there. How to this? You can put there blueprint wihh the logic, but without mesh itself and mesh itself can be loaded only when needed right? But I need to see that mesh in the editor to be able to position it correctly. How to that?
@LeafBranchGames
@LeafBranchGames 5 ай бұрын
The usage would vary very much from game to game because they have different needs and different behaviors. But I can make a note of showing something larger in a future tutorial that should hopefully be more in depth.
@oscarlindstrom1387
@oscarlindstrom1387 4 ай бұрын
Throwing some shade with that thumbnail? lol It's also worth mentioning that casting to a C++ class from a blueprint is free from a memory standpoint. So say that you have your character largely defined in your C++ class for example, casting to it from Actor/Pawn whatever in a blueprint does not increase the memory footprint of the blueprint where the cast is performed.
@LeafBranchGames
@LeafBranchGames 4 ай бұрын
Is that true? That feels like it should not be the case from an objective stand point. I will have to check that out. Thanks for sharing regardless! Shade where shade is due!
@RedekerEleven
@RedekerEleven 5 ай бұрын
i knew hard references were bad, but now i know *why* they are bad. thank you sir
@LeafBranchGames
@LeafBranchGames 5 ай бұрын
My pleasure!
@renisrrenis9225
@renisrrenis9225 3 ай бұрын
What about if i use C++ only and the reference viewer is entirely hard references... (i use just simple * pointers in c++) now i should convert some of the parts into soft references in c++? Another question, maybe you would know since i can't truly find answer on this, do i have to clear DECLARE_MULTICAST_DELEGATE() macro delegates on object destruction which have delegate? for example i use static delegate in enemy class when enemy dies it broadcasts to certain functions like WaveManager update UI: DECLARE_MULTICAST_DELEGATE(FOnEnemyDeath); static inline FOnEnemyDeath OnEnemyDeath; AEnemy::OnEnemyDeath.AddUObject(instance, &UWaveManager::updateEnemiesAmount); and clear like this: void AEnemy::EndPlay(const EEndPlayReason::Type EndPlayReason) { Super::EndPlay(EndPlayReason); OnEnemyDeath.RemoveAll(this); }
@DailyPaily
@DailyPaily 5 ай бұрын
And the worst part, you are wiring your brain with a wrong methodology using castings, karma will back in a dark coat. " I have seen things you people wouldn't believe...casts on tick events, casts on collision boxes without use it...3 casts inside anim class...."
@LeafBranchGames
@LeafBranchGames 5 ай бұрын
It could be costly, for sure. Especially if used frivolously. But being aware of it is half the battle won.
@xelusprime
@xelusprime 5 ай бұрын
Having started out a few months ago, I knew that both hard and soft references have their use cases, but the one thing I still struggle with in general is implementing blueprint interfaces, and when to use what, where. Specifically with interfaces, how do you implement them on something like an ammo pickup, where it should add a set amount of ammo and ammo type to a specific weapon that is a child component of the character it is attached to. How do you pass along the data from the ammo pickup to the weapon when the weapon isn't the one interacting directly with the pickup, rather the character? Most tutorials just work with simple examples like using a button to open a door, nothing more complex. Would it be better to have ammo pickups have a hard ref to the character, or soft ref to the character, or should I be using interfaces to communicate with the character pawn/actor. So many questions, so few can or want to answer. Thanks for the tutorial, gave some context on how to make use of the types of references.
@LeafBranchGames
@LeafBranchGames 5 ай бұрын
The optimal case for an interface is when you have commonality of functionality of classes that does not share inheritance. So lets say you have a gun in your hands, a lamp in front of you and a garage door next to the lamp. If left click was your "interact" button, it would turn on the lamp if you used the lamp, open the garage door if you used the door and fire bullets with the gun. They would all implement an "interactable" interface, but behave specific to the object. If you had an orange and an apple, both would inherit from a food class and when you "use" either one, they would be destroyed(consumed) which you could put in the food class and not in the children. Other than that you can use interfaces to just seperate dependencies between classes for the sake of decoupling.
@GiulianoVenturo
@GiulianoVenturo 5 ай бұрын
I remember I was trying to do the invoker from dota into unreal engine... and omg I was like why is my game soooo laggy.. I'm pretty sure all the balls like in invoker I made them have a hard reference to the player and also reference to the meshes for the skills hahahha and you multiply that by 3 and it get worse. I think lately I'm trying to have most of the logic into the player controller because I can used the "get pawn controlled" also for things like in the widgets I use those functions. I didn't know about the "cast to..." also count as a hard ref so that's good to know thanks :D. Another thing I do is that because using interfaces it gets a bit messy and then you don't know if you are adding the correct function to the interface, what I do is making all custom events first and when I get all clean and looks nice I have a better picture to then created the blueprint interfaces and then I just update the custom event calls, a bit long work but the thing is that you work faster in the first part Edit: damn... so I just realized if you have different cast to different blueprints... that means you're basically adding hard references for all those blueprints?
@LeafBranchGames
@LeafBranchGames 5 ай бұрын
That is indeed what could happen. You can have a cascading effect of hard references causing all of the assets to be loaded despite not even using them at all. Doing custom events and then replacing with interfacing is fine. We don't always know how things will turn out code wise, so refactoring the code is a good thing.
@HyraxGames
@HyraxGames 5 ай бұрын
I rarely see tutorials use Interfaces or the Get actor of class note, they all rely heavily on casting and that's horrible long term. Thanks for taking the time to make this video, it's proberly gonna save a lot of games
@LeafBranchGames
@LeafBranchGames 5 ай бұрын
You are very welcome, thank you for the kind words. :)
@HyraxGames
@HyraxGames 5 ай бұрын
No worries! You for sure got some of the be UE tutorials on KZbin! :D@@LeafBranchGames
@Erxv1
@Erxv1 5 ай бұрын
Get Actor of Class is also a very bad node though :) It should only really be used for debug stuff and not for the proper game, since it has to go over all actors in the entire level to find the right one(s), its a very slow operation the bigger the levels get.
@HyraxGames
@HyraxGames 5 ай бұрын
It's for gameplay statistics such as getting amount of players, enemies, objects ect in the gameworld or getting the first actor of a specific class within the gameworld@@Erxv1
@Akazki_
@Akazki_ 5 ай бұрын
@@Erxv1 Is it true with a specific class ? if I use "get all actors" of the class "Character" it will go over all actors in the level or only the class and his childs ?
@elaboratebagel
@elaboratebagel Ай бұрын
Does it make much difference if you're hard referencing say the player, who is always going to be loaded regardless?
@miragegrc
@miragegrc 26 күн бұрын
if something exist on the map and you have a hard reference does it store it self twice in memory ? an analisis on how the system works as total based on this question would be really useful ^^ For example if the helicopter was already in the world before our character spawned or if two things have a hard ref to something does it mean its loaded twice ?
@LeafBranchGames
@LeafBranchGames 26 күн бұрын
The question exist multiple times in the comment section.
@graylandlowry8763
@graylandlowry8763 2 ай бұрын
Lol. 😂. This thumbnail is like the Katt Williams interview.
@VELIR-jw4bb
@VELIR-jw4bb Ай бұрын
Is there a way to "Unload" the Async Loaded Asset when no longer needed in memory and then be able to soft reference it and load again? I see that when it is once Async Loaded it will become forever the hard reference for the Player on the moment it is fully loaded from the soft to hard reference, even when later actor is no longer needed it stays loaded in memory
@LeafBranchGames
@LeafBranchGames Ай бұрын
If something isn't referenced by any other object, garbage collection will handle it eventually.
@uavisionx
@uavisionx 4 ай бұрын
So if an asset/actor is already in the map, theres no issue with casting to it right since that asset is already in the memory? thanks!
@LeafBranchGames
@LeafBranchGames 4 ай бұрын
On that specific map it will not be an issue no. If you also have another map where it is not in, then that would be an issue.
@uavisionx
@uavisionx 4 ай бұрын
Thanks @@LeafBranchGames
@LeafBranchGames
@LeafBranchGames 4 ай бұрын
@@uavisionx No problem
@dani3d_b
@dani3d_b 2 ай бұрын
theres a way to make a soft reference in the material graph? with textures maps
@LeafBranchGames
@LeafBranchGames 2 ай бұрын
I don't know. I am not as good with material as I would like to be. I would guess no.
@LimitedPerfection
@LimitedPerfection 5 ай бұрын
Does multiple references to a single actor multiply the memory use? Or is this information stored as a global variable of some kind once its cached?
@LeafBranchGames
@LeafBranchGames 5 ай бұрын
If you have one actor that is referenced from different places, that should not be causing it to be loaded multiple times.
@LimitedPerfection
@LimitedPerfection 5 ай бұрын
Excellent. Thanks for clarifying. @@LeafBranchGames
@LeafBranchGames
@LeafBranchGames 5 ай бұрын
@@LimitedPerfection No problem.
@camelotvfx
@camelotvfx 5 ай бұрын
I've been doing a fair amount of interfaces instead of casting, but one thing I do is have my enemy cast to my player to store a reference to him on begin play. Is there a better way to do that?
@LeafBranchGames
@LeafBranchGames 5 ай бұрын
Seeing as your player is likely going to be loaded into memory at all times regardless, this should not likely be an issue.
@camelotvfx
@camelotvfx 5 ай бұрын
@@LeafBranchGames That makes sense! Thank you
@LeafBranchGames
@LeafBranchGames 5 ай бұрын
@@camelotvfx No problem.
@BigDaddy-zq1cq
@BigDaddy-zq1cq 20 күн бұрын
Agreed
@ethanwasme4307
@ethanwasme4307 5 ай бұрын
Do you need to unload the assert or does garbage collection do it for us?
@LeafBranchGames
@LeafBranchGames 5 ай бұрын
Could you elaborate?
@erksp7961
@erksp7961 Күн бұрын
Thank you! I am realizing more and more that most tutorials don't give you the tools to manage your game well. Do you have a video on player states(or states in general)? Like managing IsSprinting, IsFalling, IsLandingIntoSliding, etc. I am making a system with enumeration. It seems like a good way. Better than boolean spaghetti..?
@LeafBranchGames
@LeafBranchGames Күн бұрын
Not spcifically, not yet. You may want to look into my tutorial on gameplay tags: kzbin.info/www/bejne/m5WteHhmls6XkLs and even if you are not making an RPG, my free RPG course teaches you a bunch of useful things: kzbin.info/aero/PLNBX4kIrA68lz8GSxTQKX_0B23tHP6Bl9
@erksp7961
@erksp7961 4 сағат бұрын
@@LeafBranchGames Have been wondering about gameplay tags. I am not starting with an RPG, but I love RPGs:) Thanks mate!
@LeafBranchGames
@LeafBranchGames 3 сағат бұрын
@@erksp7961 No problem
@euunul
@euunul 5 ай бұрын
Help me understand something, say ActorA references ActorB, ActorC references B also. When A is loaded B is loaded, when later C is loaded will B be loaded again having 2 B in memory or is using the previously loaded actor B?
@LeafBranchGames
@LeafBranchGames 5 ай бұрын
It depends, but generally no.
@alejandrodoradom
@alejandrodoradom 5 ай бұрын
First of all, many thanks for sharing your knowledge in general and in particular this video, because it's a must-watch. The icing on the cake would have been to include an example of a soft object reference in addition to the soft class reference, other than that, nice job! I think I'll be taking this video from the opposite point of view of most people watching it because I've been trying to avoid casting like oil and water. Still, this video has proved to me that you don't need to do always the workaround if something is already in memory. There is one thing that bothers me and I would like to ask you what approach would you follow about it. Let's say you have object A and object B. Object A has some dispatchers and object B wants to bind/subscribe to them but they don't know anything about each other. How would you bind object B to object A's dispatchers without having to cast A within object B? Do you need a third party that knows about them both? Do you create an Interface for object A that just returns itself whenever it is used? How? Any tips on the subject would be much appreciated.
@LeafBranchGames
@LeafBranchGames 5 ай бұрын
Glad to hear you like it, and that is the correct understanding. If you don't know what will be in memory you should avoid casting to make sure you don't load unecessary things. But if you know what will be in memory, then you can of course work around that. Regarding dispatchers, it depends on the event you are trying to subscribe to. If it for example is a onDestroy event, then that is something that exist on the actor level, so you only need an actor type reference. If it is a specific event that only exist on a specific class, then there is no way around it, you need to cast to know the type to know the event is there to setup listening to.
@memeproductions4182
@memeproductions4182 5 ай бұрын
@@LeafBranchGames Great Video!what i have some trouble understanding is: let's say we always have an object A loaded in the map and its size is 20MB, if other 2 actors cast to it, will memory footprint increase linearly for each (so +40MB) or it won't because that actor A was already loaded in the map from the beginning?
@LeafBranchGames
@LeafBranchGames 5 ай бұрын
@@memeproductions4182 It depends, but generally no it will not linearly increase.
@memeproductions4182
@memeproductions4182 5 ай бұрын
@@LeafBranchGames thx for clarifying!
@lespaul1507
@lespaul1507 4 ай бұрын
Love the tutorials, but i tried doing this and as soon as i got a soft class reference to my main character from a basic cube BP, the cube BP junped up to 400mb from my character. Any idea what i did wrong or can you not ref a character this way to pass a bool?
@LeafBranchGames
@LeafBranchGames 4 ай бұрын
Presumably you made the soft reference of the main character class type.
@lespaul1507
@lespaul1507 4 ай бұрын
@LeafBranchGames I must have, I'm new so I followed what you did but for my main character. Is there a way to get a main character ref using a soft reference?
@LeafBranchGames
@LeafBranchGames 4 ай бұрын
@@lespaul1507 There is not really any difference between two different classes, even if it is a main character. Everything still applies to it the same. But a main character may be something that is supposed to be loaded all the time, since it is a main character. It may be the references you have in the main character that you need to look at.
@lespaul1507
@lespaul1507 4 ай бұрын
@@LeafBranchGames I'm sorry to bother you, 1 last question and thanks again!. If my main character(400mb) is loaded all the time and I have a small BP (10mb) for another actor, if I get reference to my main character from the small actor, is it really costing more memory since my main character is already loaded? Thank you again.
@LeafBranchGames
@LeafBranchGames 4 ай бұрын
@@lespaul1507 It depends. The general answer will be no, it will not load into memory multiple times because of the reference.
@TheFlyingEpergne
@TheFlyingEpergne 8 күн бұрын
So just so im 100% clear, on the reference viewer: If an object is on the right hand side of the viewed object (downstream), it will get loaded by the currently viewed object But if its on the left hand side of the currently viewed object (upstream) it won't get loaded by the currently viewed object?
@rickfuzzy
@rickfuzzy Ай бұрын
so @11:51 you are skipping the async load altogether since you are not using the completed pin anymore or even the output of the load, so what the point of even doing it?
@LeafBranchGames
@LeafBranchGames Ай бұрын
Use the completed pin or the other pin depending on what your need is, just like explained.
@b4ttlemast0r
@b4ttlemast0r 5 ай бұрын
If several classes have hard references to a specific class, it won't get loaded multiple times though, right?
@LeafBranchGames
@LeafBranchGames 5 ай бұрын
If it is the same class, or an identical one. But a class can theoretically have different textures for example, which means different ones cause those to load.
@PhilipPetrunak
@PhilipPetrunak 4 ай бұрын
I've been operating under the assumption that it's kind of free have a reference to things that will always be loaded like the game mode and the player controller. That's right, right?
@LeafBranchGames
@LeafBranchGames 4 ай бұрын
A game mode will always be loaded in, a player controller almost always. So those specifically, sure. But that is disregarding that they have any references inside of them.
@memeproductions4182
@memeproductions4182 5 ай бұрын
I'm not sure i understand the example with the interface, you are doing all that to execute code on the helicopter that is already loaded on the level anyway, so what's the benefit?
@LeafBranchGames
@LeafBranchGames 5 ай бұрын
Because the interface does not say it is a helicopter. So the helicopter will be loaded from existing in the level, not from a cast or hard reference in a different blueprint - but they are still able to communicate.
@memeproductions4182
@memeproductions4182 5 ай бұрын
@@LeafBranchGames yeah but it would be loaded anyway right?i guess if you are executing code on any actor it has to exist in the world first so it will always be loaded anyway?
@LeafBranchGames
@LeafBranchGames 5 ай бұрын
@@memeproductions4182 No, because the interface can exist in the game without the helicopter, and it will still load the helicopter into memory.
@justaadhdgamerwesley6244
@justaadhdgamerwesley6244 5 ай бұрын
Ive watched this 3 times but I'm still confused and have so many questions It almost feels like what Ive learned about ue5 was a lie for the past 2 years What do I do if I want to call a event in another blueprint? Or a function? Ive tried using interfaces but I can never get it to work sometimes. Why spawn an actor when its already in the level? Like when I turn a valve and the water sprinker (which is a different blueprint) to activate a particle? I just got my game design major and there is still so much to learn about ue5
@LeafBranchGames
@LeafBranchGames 5 ай бұрын
Calling an interface is essentially teh same as calling an event or function in a different blueprint. It is just a bit decoupled. When you create something, let us say you make a game where you sneak your way to some objective. Then you have guards walking around. It makes no sense to spawn them, because you want to, in design time - in the editor, see the amount of guards and where tehy are. Something that you cant't grasp if all of your guards spawn at the start of the mission. But if you have something like a zombie game where at some point hordes of zombies will appear to assault the base, it makes little sense to have them all in the level taking up performance until the point they are supposed to attack. Then it makes more sense to just have a place where you spawn these zombies in. Learning is a journey, it never ends.
@dark11demon11
@dark11demon11 5 ай бұрын
oh god, I did a customizable character, now I see all parts, all clothes all textures, and materials like hundreds of them are hard references...
@LeafBranchGames
@LeafBranchGames 5 ай бұрын
The first step is knowledge. Now you can choose how to use it for good. :)
UE5 Understanding Tick - Be a better game dev
21:35
LeafBranchGames
Рет қаралды 9 М.
SOFT Object References in Unreal Engine EXPLAINED
11:58
The Game Dev Cave
Рет қаралды 7 М.
MOM TURNED THE NOODLES PINK😱
00:31
JULI_PROETO
Рет қаралды 18 МЛН
ПООСТЕРЕГИСЬ🙊🙊🙊
00:39
Chapitosiki
Рет қаралды 14 МЛН
Тяжелые будни жены
00:46
К-Media
Рет қаралды 5 МЛН
WHY IS A CAR MORE EXPENSIVE THAN A GIRL?
00:37
Levsob
Рет қаралды 15 МЛН
UE5 Understanding Delay - Be a better game dev
13:29
LeafBranchGames
Рет қаралды 6 М.
I solved Unreal Engine's Package Size Problem...
14:35
Cobra Code
Рет қаралды 52 М.
Mastering Events in Unreal Engine with C++
5:17
Scripted Adventure
Рет қаралды 4,8 М.
Demystifying Soft Object References | Inside Unreal
1:27:51
Unreal Engine
Рет қаралды 83 М.
5 Tricks you (probably) don't know about Unreal Engine 5
10:44
Cinecom.net
Рет қаралды 347 М.
Master Unreal Engine: Understanding Hard and Soft References
13:30
Dan Goodayle
Рет қаралды 4,9 М.
The Most Common Mistake Beginners Make in Unreal Engine | UE5
12:17
Ali Elzoheiry
Рет қаралды 87 М.
Unreal Engine Materials in 6 Levels of Complexity
44:12
pwnisher
Рет қаралды 118 М.
MOM TURNED THE NOODLES PINK😱
00:31
JULI_PROETO
Рет қаралды 18 МЛН