The Actor Optimizer plugin is designed for developers to enable the plugin and add a few components to base classes and instantly improve performance in their project.
Example Video:
Easy steps to optimize actors:
Add the Optimizer Source component to something like your player or camera actor. (This is the origin of optimization)
The Actor Optimizer Component is what controls optimizing actors. This component uses set defaults (listed and explained below) to manage when and how actors are optimized. The Actor Optimizer Component requires at least one Optimizer Source component to be present in the world to function automatically.
Automatically Optimize Actor
Type: boolean
Default: True
This variable controls if the component will automatically optimize the actor based on Optimizer Sources or wait for you to manually call the optimization functions.
Optimize Components
Type: boolean
Default: True
This variable controls if the component will automatically optimize the actors components as well as the actor.
Optimized Tick Interval
Type: float
Default: -1.0f
This float number controls the amount of time in seconds to set the tick interval of the actor and owned components of the actor to when in optimized tick mode. Note that keeping this set at -1.0f will automatically cull the tick instead of using optimized tick mode.
Component Update Interval
Type: float
Default: 1.0f
This float number controls the amount of time in seconds that the Actor Optimizer Component will update to check locations of Optimizer Source components.
Distance From Optimizer Source To Optimize
Type: float
Default: 5000.0f
This float number controls the distance in units that the Actor Optimizer Component owning actor must be from all Optimizer Source components to set itself into optimized tick mode. If even one Optimizer Source component enters this distance the actor will resume normal tick mode.
Distance From Optimizer Source To Cull
Type: float
Default: 0.0f
This float number controls the distance in units that the Actor Optimizer Component owning actor must be from all Optimizer Source components to set itself into culled tick mode. Culled tick mode will disable tick for the actor and all components except the Actor Optimizer Component. If this value is set to 0.0f then the actor will never enter culled tick mode. If even one Optimizer Source component enters this distance the actor will resume into optimized tick mode. Note that this number should be larger than the float Distance From Optimizer Source To Optimize.
Distance From Optimizer Source To Hide
Type: float
Default: 0.0f
This float number controls the distance in units that the Actor Optimizer Component owning actor must be from all Optimizer Source components to hide the actor. IF this value is set to 0.0f then the actor will never be hidden due to distance. If even one Optimizer Source component enters this distance the actor be revealed.
Imposter Actor
Type: Actor Class
This variable is set by the user to determine what actor class is spawned when the actor enters imposter mode. Imposter mode hides the actor and spawns another actor in it's place. Ideally, for optimization purposes, your imposter actor should be much more simple than the actor being hidden.
Spawn Imposter Actor
Type: boolean
Default: false
This variable controls if the Actor Optimizer Component spawns an imposter actor. The distance at which the imposter actor is spawned is the Distance From Optimizer Source To Hide variable.
Get Actor In Optimized Tick
Returns: bool OptimizedTick
This function returns if an actor is in its optimized tick state or not. This will also return true if the actor is also tick culled.
Force Toggle Optimized Tick
Arguments: bool bEnable
Returns: float LastDeltaTimeTick (if swapping from one optimization status to another)
This function will force enable or disable optimized tick mode. This will disable automatic optimization. The actors tick interval will be set to float Optimized Tick Interval. In optimized tick mode all components tick intervals will be set to the float Component Update Interval.
Force Toggle Culled Tick
Arguments: bool bEnable
This function will force enable or disable culled tick mode. This will disable automatic optimization. Culled tick will disable tick for the actor and all it's components except the Actor Optimizer Component.
The Optimizer Source component is what the Actor Optimizer Component uses to reference a location in the world to test distances against. If one Optimizer Source is within the Actor's optimize distance then it will resume normal ticking and normal functionality. Based upon the defaults in the Actor Optimizer Component, this component works just by adding it to where you want your origin of Optimizing to be from. This component is not tested for networked multiplayer purposes.