GDK for Unreal
If you're using the GDK for Unreal, this page does not apply to you. See the GDK documentation on authority.
A worker instance with write access authority over an entity component is the only worker instance that can update the value of that entity component.
A worker instance’s write access authority over an entity component depends on two things:
Write access permission
Its worker type must have write access permission to that component type. Write access permission is controlled by a dedicated component on each entity. This component is called
Area of authority
The entity that the component is on must be within the worker instance’s area of authority. The SpatialOS Runtime calculates the worker instance’s area of authority based on the load balancing strategy for its worker type. However, in some cases, you might want to control which worker instance computes a particular component. For more information, see the EntityAcl documentation (in particular Control which worker instance computes a particular component).
The area of authority for a worker instance defines the set of entity components that the worker instance has write access authority over within a layer. For a worker instance to have write access authority over a particular entity component, the entity that the component is part of must be within the worker instance’s area of authority.
The Runtime decides this area for each worker instance based on the load balancing strategy that you set up for its worker type.
An example of a load balancing strategy for a worker type is the rectangle grid. In this strategy, the area of authority for each worker instance of that worker type is one of the rectangles of the specified grid.
The rectangle grid strategy is an example of a spatial load balancing strategy, where the areas of authority are rectangular sections of the area of the SpatialOS game world, a bit like a patchwork quilt. In each rectangular section, one worker instance has write access authority over the entity components in that section (but only if it has write access permission to those component types).
The rectangle grid strategy is useful for worlds where entities are evenly spatially distributed or concentrated at known points. However, you can set up other load balancing strategies, including non-spatial ones, based on entity IDs, for example.
However, worker types can be non-spatially load balanced as well. For example, if your worker type uses the entity ID sharding load balancing strategy, the area of authority for its worker instances depends on entity IDs rather than positions.
For more information on load balancing strategies, see Load balancing.
Updated about a year ago