Demystifying Soft Object References | Inside Unreal

preview_player
Показать описание
This week Christian Allen will provide an overview of Hard & Soft Object references in Blueprints, why the differences are important to know about, and how you can utilize Soft Object references in your project to help with memory management.

DISCUSSION THREAD

TRANSCRIPT

NEWS

A first look at Unreal Engine 5

Epic Online Services featuring Epic Account and Game Services

With top-notch visuals and design, Lies Beneath pushes the boundaries of the Oculus Quest

Exploring the depths of the new Sky Atmosphere system

COMMUNITY SPOTLIGHTS

The Invitation

Dogfight

Ruth’s Journey

**TIMESTAMPS**
00:00 Countdown Video
04:51 News
07:41 Karma Earners
08:00 Community Spotlights
09:36 Stream Introduction
09:50 Important News
13:09 Epic Online Services
15:33 Demystifying Soft Object Reference Overview
19:50 Demonstration
23:05 Blueprint Example Overview
30:50 Unloading objects and Garbage Collection
33:26 Demonstration and Information
36:01 Hierarchal Nature of Blueprints
40:06 Reducing overhead
47:41 Accessing Data and Workflow
53:00 Questions and Answers
1:24:15 Information and Stream Wrap Up
Рекомендации по теме
Комментарии
Автор

I'm at 34:07 so far and nobody has mentioned it so I did a little reading on the Memory Management Systems, specifically the Garbage Collection. When creating new objects, Unreal adds them to an internal object list like the one seen in the Output Log. Objects can be kept alive by having a Strong reference, adding them to the list of referenced objects or by adding them to the root set. When objects don't meet any of these specifications they are marked as unreachable and will be cleaned in the next Garbage Collection Cycle. The Garbage Collector is also not aware of smart pointers since it is not based on the UObject System. Unreal suggests using TWeakObjectPtr since it will set to null if the object it points to is destroyed. When does Garbage Collection happen? Garbage Collection can be adjusted in the Project Settings. Garbage Collector Clusters are turned On by default. They group similar objects into clusters and treats them as one object to help with reachability. Trying to delete the objects as quickly as possible. Garbage Collection happens at regular intervals. When Garbage Collection occurs, the engine searches through object reference tree starting with root objects. Any unreferenced objects will be marked and removed. You can even set the time between purging purging the kill objects set for GC. So it can eventually happen to whatever objects you mark to destroy or dereference at the set interval in your project settings. I know this is an older video but maybe someone will find my read on Garbage Collection useful or interesting.

John-czfo
Автор

9:35 - Introduction & UE5 Release Talk
13:09 - Epic Online Services
15:32 - Soft Object References

kenanTR
Автор

Always watch, rarely comment. "Hands down the most useful thing to improve your game with" always just kinda ignored Soft Ref and did everything with just Default since it was an unknown factor to me on how to use these". This literally cut my memory usage in half. Cant thank y'all enough for these amazing weekly educational vids.

NAOYFB
Автор

50:00 Knowing that casting to causes a hard object reference i don't beleive is documented anywhere else but here. We found this out the hard way on our project. When the team started work, they would cast to everything everywhere, we had blueprints that loaded almost everything in the content folder.
Also you didn't show the reference viewer (which shows the hard and soft object references) or the size map, so you can see how much stuff a blueprint is bringing in.

DavePoo
Автор

Thank you! Christian is awesome. He did a similar soft object reference presentation a few years ago for our unreal meetup and it was awesome. Hope all is well.

shaqmbile
Автор

1:08:00 - Soft references in data tables work just like soft references anywhere else in blueprint. I have done this in UE4 using a datatable containing softreferences to montages to use on characters. I search for the rows required, and then i loaded all the soft references to the montages found.

DavePoo
Автор

Dauntless is a perfect example for this video. Earlier in the beta phase, moving back to the town hub would always take over 40 seconds of load time with little or many players in the scene all because of so many hard references. Thanks for making this video.

THEAETIK
Автор

Very useful video!
Just in time for my project, thanks! <3

UnrealZii
Автор

26:37 Besides AsyncLoadAsset, there's also LoadAssetBlocking, and ResolveSoftReference. As well as class variations (e.g.: AsyncLoadClassAsset)
I was specifically looking for the blocking variation because I wasn't at the point where I wanted to change the blueprint to check for the completion of loading everywhere else.
The ResolveSoftReference looks like one of those trivial casts (like between different kinds of strings), but returns none if the asset isn't loaded yet... so it'll probably work fine in editor, but complain in builds, unless you have a system in place for pre-loading assets.

(I'm answering a question I had when he mentioned the async version, and I was immediately wondering if I'd have to rewrite a bunch of my class to make use of soft object references)

RC-
Автор

So awesome to see this engine at work. I can't wait to see how well the engine perform in games like Unreal Tourna....I mean Fortnite 2!

saurelius
Автор

its 2020 and Unreal Devs are still using Shinbi as a showcase model, that's some best girl level of dedication lmao

StealthMasterk
Автор

This only explain the simple case of loading a staticMesh with soft reference. I need to know how to load another blueprint actor as component of another blueprint in the construction script (with soft-reference ofc)

andr
Автор

This is really interesting, anything that helps me with better performance is a welcomed subject.

rafalfaro
Автор

Thanks: very clear and straight to the point!

gabrielepardi
Автор

After watching this video my Size map went from 5gb to like 800mb, thank you for helping clear this up for me!!

Dieselbird
Автор

Can you also use soft object reference for actors and also use async load and cast to that actor? I'm having failed cast

marxmarjoneljovellano
Автор

In a few years time is going to pass by in the blink of an eye, and we’ll be looking at an unreal engine 6 demo. I remember when we were still on 3 feels like it was just yesterday lmao.

Abc______
Автор

I wonder if it's the same for C++ like having a raw pointer or a TSubClass

TechNova
Автор

will UE5 receive built-in soft-object physic support?

SupinePandora
Автор

what if the soft reference is done in game instance? how can we unload the reference then? thinking of music.

FF-FAN