Overview


Component which should be added to actors that we want to optimize, like AI Character.

Can be added by searching for AIOSubjectComponent.

AIOSubjectComponent contains bunch of settings that we can configure to tell the system how it should treat this Subject.
Most imporant one is AutoActivate, if it's enabled then this actor will be registered to the System when game starts.
( it is recommended to set it to true by default )

It could also be registered/unregistered manually by calling Activate/Deactivate function on this component.

In Default Settings of the component there are variables that will help to specify how to treat this subject by the system.

  • Can be Updated by Subsystem - Defines if this Subject can be updated by optimizer subsystem, or if should be ignored
    This may be useful if we don't want to unregister actor from optimizer subsystem
    but only want to disable it temporary, for example AI during combat, or while its doing smth imporant like a quest.
  • Allow Subsystem to Despawn - Should subsystem be allowed to despawn this subject?
    Disable if you want to setup optimization logic by yourself using OptimizationLayers.
    Then this subject will never be despawned by the system and you can do it manually only if needed or not at all.
    ( Example in Usage section )
  • Override Subsystem Despawn Radius - if greater than -1, it overridies default Despawn Radius specified in config of AI Optimizer Subsystem ( Project Settings ).
    ( Allow Subsystem to Despawned must be enabled, otherwise it has no effect )
  • Priority - Defines importance of this subject during Spawn/Despawn while using Queue
    For example if there are 100 subjects waiting to be spawned
    but with each update only 10 can be spawned due to Capacity limit
    Then Subjects with higher priority will be spawned first
  • Data Class - Class of data save object that will be created and stored when this subject will get despawned.
    After being spawned again it can be used to restore data, for example Health of AI Character.
    To create data blueprint use AIOData_Base as a parent class.

    ( Example in Usage section )
  • Optimization Layers - Optimization layers are used to customize optimization settings based on different distance radiuses to Invokers.
    For example change features based on distance to Invoker ( visibility/collision/movement component/behavior tree etc.)
    when subject is far from invoker - disable most of its features to optimize itself
    when subject is in medium range to invoker - disable only some of its features
    when subject is close to invoker -enable all features
  • Should Calculate Is Seen - Should calculate angle to invokers to define whether this subject is currently seen by any of them?
    Disable if not needed to reduce calculations.
    May be useful to optimize subjects that are not visible by Invokers ( Players ).
    For example if Subject is in Layer 2 then we could disable its behavior tree to optimize,
    and additionally if he is not seen by any Invoker, then we could also set him hidden in game to optimize, and set him visible when he is seen again.