WHAT
is joining us for this livestream to help ease new programmers into using UE4’s personal flavor of C++. Over the past couple of years that UE4 has been available to the public, Epic has released a lot of C++ content and tutorials that are specifically built for people familiar with coding to begin with, but now we’re getting back to basics! What is up with Garbage Collection? How do I make and expose a function to Blueprints? How do Blueprints fit into all of this anyway? These questions and much more will be answered! Also make sure to throw in your beginner questions below so we can answer them live. Be sure to also check out our documentation and wiki articles on C++!
Feel free to ask any questions on the topic in the thread below, and remember, while we try to give attention to all inquiries, it’s not always possible to answer’s questions as they come up. This is especially true for off-topic requests, as it’s rather likely that we don’t have the appropriate person around to answer. Thanks for understanding!
My question is:
What I always found a little confusing and very difficult to find good information on is memory management. For example, I know that objects that inherit from UObject are managed by the Unreal memory manager, but what about C++ objects that don’t inherit from it? When do you free those, and when they are part of (encapsulated) by a UObject do you have to free them yourself or not and once again when/where, or is it simply enough to use things like an std::unique_ptr<> to handle this automatically.
Of course any additional tips/tricks or tools regarding Unreal memory management would also be very much appreciated!
The title looks promising, but the description breaks the hype. I would love to see more C++ and Unreal Framework specific stuff, instead of focusing on exposing functions to Blueprints or the connection with Blueprints in general. I think all the keywords are already explained very well in the documentation and used in Tank game tutorial series. My dream for a full C++ project tutorial will probably never come true. I will still post my hopes even though I can already see they won’t get answered :3.
Pointer Protection: I see a lot of pointer checks on GetWorld(), GEngine, heck in my project I couldn’t even use GetViewportSize from the controller without using a Delay, because something in the background was not already loaded into the engine (and the UnrealMatch3 tutorial is also using this little ‘hack/ trick’). I know it’s literally impossible to explain how all the engine pieces bring me into my level, especially since PIE and actual game also differ + if the game should implement multiplayer things get even worse. However, a really rough explanation about the most common things that are executed before any BeginPlay() fires would clear some minds.
(*edited: I also see some confusion about smart pointers, so that one seems to be another talk you could add Pointer Protection)
(Something more specific about Pointer Protection in my project. I’m using ConstructorHelpers::FObjectFinder in my project a lot. I see people are using checks or even Succeed (which just gives a bool back) after this, but when does this even fail. It never failed on my project, but do I assume correct that if it fails, my game doesn’t crash, but instead just won’t load the asset and the worst case is (if used for a character mesh for example), my character mesh is not showing?)
I’m like 90% sure how other actors, components work if I look up their .h and .cpp files (talking about basics like Timers, Delegates etc.), but it’s the lack of knowledge about what happens behind the curtains that makes me working with Unreal super unsure and uncomfortable if I’m actually doing stuff right. I would love to work with the engine and not around it :3.
This is off the top of my head, and I’m sure there have been posts about this but I aeem to have missed them:
There have been times when FORCEINLINE functions could work with BlueprintCallable / BlueprintPure, and other times where I got errors attempting it. What’s the catch there?
Wish you guys would dedicate a whole series to writing editor extensions. There are types of games that are just a total pain in the butt to do in UE without extending the editor, particularly creating custom importers and asset types and so on.
Very nice. I think a good evolution of this would be to cover what seem like the basics for any game. Movement(creating your own custom movement or manipulating/extending the current existing ones to your benefit), Interaction(player/world), Gameplay Loop.