DefaultUpdateOverlapsMethodDuringLevelStreaming
DefaultUpdateOverlapsMethodDuringLevelStreaming
#Overview
name: DefaultUpdateOverlapsMethodDuringLevelStreaming
The value of this variable can be defined or overridden in .ini config files. 2
.ini config files referencing this setting variable.
It is referenced in 3
C++ source files.
#Summary
#Usage in the C++ source code
The purpose of DefaultUpdateOverlapsMethodDuringLevelStreaming is to control how and when overlap states are initialized for actors during level streaming. It serves as a default setting for the UpdateOverlapsMethodDuringLevelStreaming property when set to ‘UseConfigDefault’.
This setting variable is primarily used by the Unreal Engine’s collision and level streaming systems within the Engine module. It affects how actors handle overlap updates when they are loaded into the game world through level streaming.
The value of this variable is set in the config file for the Actor class or its subclasses. For example, it can be specified in DefaultEngine.ini for the Actor class or in specific config files for subclasses like BlockingVolume.
DefaultUpdateOverlapsMethodDuringLevelStreaming interacts closely with the UpdateOverlapsMethodDuringLevelStreaming property of the Actor class. When UpdateOverlapsMethodDuringLevelStreaming is set to ‘UseConfigDefault’, the engine uses the value of DefaultUpdateOverlapsMethodDuringLevelStreaming.
Developers must be aware that this variable can significantly impact performance during level streaming. By carefully choosing the appropriate update method, they can potentially achieve large performance savings, especially for actors that don’t immediately need overlap state information.
Best practices when using this variable include:
- Consider the specific needs of each actor class when setting the default value in the config file.
- Use ‘NeverUpdate’ for static objects that don’t need immediate overlap information.
- Use ‘OnlyUpdateMovable’ for objects that might move but don’t need immediate overlap information with static objects.
- Use ‘AlwaysUpdate’ only for actors that critically need immediate and complete overlap information.
- Be consistent with the settings across related actor classes to maintain predictable behavior.
- Test thoroughly with different settings to find the optimal balance between performance and necessary functionality for your specific game requirements.
#Setting Variables
#References In INI files
Location: <Workspace>/Engine/Config/BaseEngine.ini:2859, section: [/Script/Engine.Actor]
- INI Section:
/Script/Engine.Actor
- Raw value:
OnlyUpdateMovable
- Is Array:
False
Location: <Workspace>/Engine/Config/BaseEngine.ini:2862, section: [/Script/Engine.TriggerVolume]
- INI Section:
/Script/Engine.TriggerVolume
- Raw value:
AlwaysUpdate
- Is Array:
False
#References in C++ code
#Callsites
This variable is referenced in the following C++ source code:
#Loc: <Workspace>/Engine/Source/Runtime/Engine/Classes/GameFramework/Actor.h:560
Scope: file
Source code excerpt:
/**
* Condition for calling UpdateOverlaps() to initialize overlap state when loaded in during level streaming.
* If set to 'UseConfigDefault', the default specified in ini (displayed in 'DefaultUpdateOverlapsMethodDuringLevelStreaming') will be used.
* If overlaps are not initialized, this actor and attached components will not have an initial state of what objects are touching it,
* and overlap events may only come in once one of those objects update overlaps themselves (for example when moving).
* However if an object touching it *does* initialize state, both objects will know about their touching state with each other.
* This can be a potentially large performance savings during level loading and streaming, and is safe if the object and others initially
* overlapping it do not need the overlap state because they will not trigger overlap notifications.
*
* Note that if 'bGenerateOverlapEventsDuringLevelStreaming' is true, overlaps are always updated in this case, but that flag
* determines whether the Begin/End overlap events are triggered.
*
* @see bGenerateOverlapEventsDuringLevelStreaming, DefaultUpdateOverlapsMethodDuringLevelStreaming, GetUpdateOverlapsMethodDuringLevelStreaming()
*/
UPROPERTY(Category=Collision, EditAnywhere)
EActorUpdateOverlapsMethod UpdateOverlapsMethodDuringLevelStreaming;
public:
/** Get the method used to UpdateOverlaps() when loaded via level streaming. Resolves the 'UseConfigDefault' option to the class default specified in config. */
ENGINE_API EActorUpdateOverlapsMethod GetUpdateOverlapsMethodDuringLevelStreaming() const;
private:
/**
* Default value taken from config file for this class when 'UseConfigDefault' is chosen for
* 'UpdateOverlapsMethodDuringLevelStreaming'. This allows a default to be chosen per class in the matching config.
* For example, for Actor it could be specified in DefaultEngine.ini as:
*
* [/Script/Engine.Actor]
* DefaultUpdateOverlapsMethodDuringLevelStreaming = OnlyUpdateMovable
*
* Another subclass could set their default to something different, such as:
*
* [/Script/Engine.BlockingVolume]
* DefaultUpdateOverlapsMethodDuringLevelStreaming = NeverUpdate
*
* @see UpdateOverlapsMethodDuringLevelStreaming
*/
UPROPERTY(Config, Category = Collision, VisibleAnywhere)
EActorUpdateOverlapsMethod DefaultUpdateOverlapsMethodDuringLevelStreaming;
/** Internal helper to update Overlaps during Actor initialization/BeginPlay correctly based on the UpdateOverlapsMethodDuringLevelStreaming and bGenerateOverlapEventsDuringLevelStreaming settings. */
ENGINE_API void UpdateInitialOverlaps(bool bFromLevelStreaming);
/** Describes how much control the remote machine has over the actor. */
UPROPERTY(Replicated, Transient, VisibleInstanceOnly, Category=Networking)
TEnumAsByte<enum ENetRole> RemoteRole;
public:
/**
* Set whether this actor replicates to network clients. When this actor is spawned on the server it will be sent to clients as well.
* Properties flagged for replication will update on clients if they change on the server.
* Internally changes the RemoteRole property and handles the cases where the actor needs to be added to the network actor list.
* @param bInReplicates Whether this Actor replicates to network clients.
* @see https://docs.unrealengine.com/InteractiveExperiences/Networking/Actors
#Loc: <Workspace>/Engine/Source/Runtime/Engine/Private/Actor.cpp:189
Scope (from outer to inner):
file
function void AActor::InitializeDefaults
Source code excerpt:
bGenerateOverlapEventsDuringLevelStreaming = false;
UpdateOverlapsMethodDuringLevelStreaming = EActorUpdateOverlapsMethod::UseConfigDefault;
DefaultUpdateOverlapsMethodDuringLevelStreaming = EActorUpdateOverlapsMethod::OnlyUpdateMovable;
bHasDeferredComponentRegistration = false;
bHasRegisteredAllComponents = false;
#if WITH_EDITORONLY_DATA
bIsInEditLevelInstanceHierarchy = false;
#Loc: <Workspace>/Engine/Source/Runtime/Engine/Private/Actor.cpp:4165
Scope (from outer to inner):
file
function EActorUpdateOverlapsMethod AActor::GetUpdateOverlapsMethodDuringLevelStreaming
Source code excerpt:
{
// In the case of a default value saying "use defaults", pick something else.
return (DefaultUpdateOverlapsMethodDuringLevelStreaming != EActorUpdateOverlapsMethod::UseConfigDefault) ? DefaultUpdateOverlapsMethodDuringLevelStreaming : EActorUpdateOverlapsMethod::AlwaysUpdate;
}
return UpdateOverlapsMethodDuringLevelStreaming;
}
void AActor::DispatchBeginPlay(bool bFromLevelStreaming)
{