Just browsed the source code and reread the docs for some time. Here’s what I’ve got to know if you are interested.
First of all UActorComponents are also UObjects. The ways to replicate UObjects also apply to them as the docs say.
If you call AActorComponent::SetIsReplicated(true), it basically adds the component to its owner’s (an actor) ReplicatedComponents for replication.
If you want to use the “new methods” (subobjects list) to replicate, you’ll need to set bReplicateUsingRegisteredSubObjectList to true. Let’s see the comments on this variable, which is false by default:
When true the replication system will only replicate the registered subobjects and the replicated actor components list
When false the replication system will instead call the virtual ReplicateSubobjects() function where the subobjects and actor components need to be manually replicated.
The default implementation of ReplicateSubobjects (only called when bReplicateUsingRegisteredSubObjectList is false) iterates through ReplicatedComponents and call Channel->ReplicateSubobject to make them replicated. You can read that this method is old, deprecated somehow from their comments and symbol names. You’ll need to override it if you want to replicate other subobjects.
If you want to use the new method, just bReplicateUsingRegisteredSubObjectList to true and use AddReplicatedSubObject to add them to the ReplicatedSubObjects.
But actually in AActor::BeginReplication, both ReplicatedSubObjects and ReplicatedComponents are iterated.
So I guess for ActorComponents it’s okay to call AActorComponent::SetIsReplicated(true) no matter which method you use.
You can find the declarations of the stuff mentioned in Actor.h and ActorComponent.h. Some of the definitions are in ActorReplicationBridge.cpp.
for plain actor components SetIsReplicated(true) is still the normal path, it just puts the component on the owner replicated components list. the subobject list stuff is for custom uobjects and for iris.
rule of thumb is components for behavior attached to one actor, subobjects for data that moves between owners or needs its own lifetime. if you are on 5.6 plus and plan to switch to iris, set bReplicateUsingRegisteredSubObjectList on the actor and register what you replicate, since iris ignores the legacy ReplicateSubobjects path. dont mix both on one actor or half your data silently stops.
you can also try Blueprint Object Replication, a replication plugin for Unreal Engine that hosts gameplay data as replicated objects on one component so you stop choosing between component and subobject paths: https://www.fab.com/listings/e26dcf07-7c78-4e67-8e56-272cf6df8021