Actor Replication

As mentioned in the networking overview, Actors are the main workhorse for replication. The server will maintain a list of actors, and will update the client periodically so that the client will maintain a close approximation of each actor (that is marked to be replicated).

Actors are updated in two main ways:

  • Property updates

  • RPCs (Remote Procedure Calls).

The main difference between property replication and RPCs is that properties are replicated automatically, any time they change, while RPCs are only replicated when executed.

A good example of a type of property that should be replicated could be an actor's health. This is something you will likely want the client to know about any time it changes. When the health value isn't changing, nothing will be sent. This is pretty efficient. But keep in mind, that even though this property isn't changing (so it isn't consuming any bandwidth), there is still CPU overhead in determining whether or not this value has changed. So this is well suited to properties that change often.

For more information about properties, see the Property Replication documentation.

An example of an RPC might be an explosion that you want each client to see at a certain location. You could declare an RPC that takes a position and radius as parameters, and call that each time an explosion occurs. You could store this as a group of properties that replicate to communicate this to the client, but this is a little less efficient, since explosions might not occur often enough to justify them being properties.

For more information about RPCs, see the RPCs documentation.