HomeModule plugins › AFM_Replication
Module

AFM_Replication

Adaptive transform replication with interpolation, tolerance thresholds and owner-skip, for whole actors or tagged components.

What it gives you

  • Smooth replicated movement for carried objects
  • Adaptive sample rate that costs almost nothing at rest
  • Authority that follows whoever picked the object up

Requires

None

Required by

AFE_Showroom AFS_Core_Pawn AFS_UX_Grip AFS_UX_Laser AF_Examples

3 assets20 API members

Description

Transform replication in a VR project has a specific problem: objects are moved by hand, constantly, in ways that do not compress well. BPC_Replication addresses it with three decisions.

It replicates with SkipOwner, so the player manipulating an object is never corrected by their own data. It applies a Tolerance threshold so sub-threshold jitter is not sent at all. And it switches sample rate based on movement — roughly 0.06 s while moving, 0.5 s at rest — so idle objects cost almost nothing.

Authority follows possession. CheckIfOwnerChanged re-evaluates ownership so the player holding an object drives it.

Setup

  1. Enable AFM_Replication.
  2. Add BPC_Replication_Actor to replicate a whole actor, or BPC_Replication_Component with a Component Tag to replicate one component.
  3. Confirm AFPNetDriver is the active net driver.

Usage

Replicating a carried object

Add BPC_Replication_Actor. Nothing else — the grip system and the replication component coordinate authority between them.

Replicating one component

Add BPC_Replication_Component and set Component Tag to the component you want driven. Add several instances to replicate several components of the same actor independently.

Tuning

Raise Tolerance for objects that jitter. Raise Tick Interval Without Movement for objects that rarely move.

Key properties

PropertyWhen to change
Interp SpeedRaise to track authority more tightly, lower for smoother motion
ToleranceRaise to cut traffic from jittery objects
Tick Interval During MovementLower only for fast objects where lag is visible
Tick Interval Without MovementRaise for objects that rarely move

Extending

Derive from BPC_Replication and override getControlledSceneComponent, GetCurrentTransform and SetNewTransform to replicate something other than an actor or tagged component.

Performance notes

Performance

The two tick intervals are the main bandwidth lever. Defaults suit hand-held props; a scene with many replicated objects benefits most from raising the resting interval.

Example map

Map_Examples_Grip run with two PIE clients demonstrates carried-object replication.

Troubleshooting

Remote clients do not see movement. The component is missing, or AFPNetDriver is not active so the server RPC is dropped.

API reference

Every blueprint asset in this plugin. Expand an asset to see its members.

Components

BPC_Replication13 members
extends ActorComponent
KindNameSignatureDescription
varEnabledSettingsboolTurns transform replication on or off at runtime without removing the component.
varInterpSpeedSettingsfloatHow quickly remote clients interpolate towards the replicated transform. Higher values track the authority more tightly at the cost of looking less smooth.
varToleranceSettingsfloatMinimum movement required before a new transform is sent. Raising this reduces network traffic for objects that jitter slightly.
varTickIntervalDuringMovementSettingsfloatHow often the transform is sampled while the object is moving. Lower values give more responsive replication at higher bandwidth cost.
varTickIntervalWithoutMovementSettingsfloatHow often the transform is sampled while the object is at rest. Kept deliberately high so idle objects cost almost nothing.
fnSetNewTransformTransform(ref const NewTransform: Struct_Replication_Transform)Applies a received transform to the controlled object, preserving relative attachment when the parent matches.
fnGetCurrentTransformTransform() → Struct_Replication_TransformReturns the current transform of the controlled object together with whether it is worth replicating this frame.
fngetControlledSceneComponentScene Component(out MainSceneComponent: SceneComponent)Returns the scene component this component replicates. Override in a subclass to target something other than the actor root.
eventServer_UpdateRoot(DesiredTransform: Struct_Replication_Transform)Sends the locally computed transform to the server so it can be relayed to the other clients.
eventUpdateTickIntervall()Switches between the moving and resting sample rates based on whether the object has moved recently.
eventCheckIfOwnerChanged()Re-evaluates which client owns this object, so authority follows the player who picked it up.
eventSetPhysicsHandle(PhysicsHandle: PhysicsHandleComponent, AttachedComponent: PrimitiveComponent, Set: bool)Registers or removes a physics handle driving this object, so replication accounts for physics-based manipulation.
eventSetEnabled(Condition: bool)Enables or disables replication at runtime.
BPC_Replication_Actor3 members
extends BPC_Replication
KindNameSignatureDescription
fngetControlledSceneComponent(out MainSceneComponent: SceneComponent)Returns the owning actor's root component; this variant replicates the whole actor.
fnGetCurrentTransform() → Struct_Replication_TransformReturns the owning actor's current transform and whether it needs replicating.
fnSetNewTransform(ref const NewTransform: Struct_Replication_Transform)Applies a received transform to the owning actor.
BPC_Replication_Component4 members
extends BPC_Replication
KindNameSignatureDescription
varComponentTagComponentnameTag identifying which component on the owner should be replicated. Lets several instances of this component each drive a different part of the same actor.
fnGetCurrentTransform() → Struct_Replication_TransformReturns the tagged component's current transform and whether it needs replicating.
fnSetNewTransform(ref const NewTransform: Struct_Replication_Transform)Applies a received transform to the tagged component.
fngetControlledSceneComponent(out MainSceneComponent: SceneComponent)Returns the component on the owner matching Component Tag.