> For the complete documentation index, see [llms.txt](https://dotsnet.gitbook.io/docs/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://dotsnet.gitbook.io/docs/user-manual/interest-management.md).

# Interest Management

When creating large worlds, we don’t want to synchronize the full world to every single player connection. Instead, we only send nearby state to each player connection.

Each `NetworkIdentity` has observers, which are the player connections that it is synced to. Observers are a `DynamicBuffer<NetworkServer>`.

The `InterestManagementSystem` rebuilds the observers every few seconds.

`InterestManagementSystem` is abstract, so that different games can have different interest management algorithms. For example:

* Brute Force
* Spatial Hashing
* Sphere Cast Checks
* Line Sweeps
* Instance based
* etc.

By default, **DOTSNET** comes with a `DistanceInterestManagementSystem` which runs vector3 distance checks to every player connection for each `NetworkIdentity` in the world.&#x20;

Later on, **DOTSNET** will also implement a Spatial Hashing system which will scale even better.

## InterestManagementSystem API

| Function:            | Description:                                                                                                          |
| -------------------- | --------------------------------------------------------------------------------------------------------------------- |
| `RebuildAll`         | Inherit to rebuild all observers for all NetworkIdentities.                                                           |
| `SendSpawnMessage`   | Call this from RebuildAll after adding an observer to an Entity to spawn the Entity on the observer connection.       |
| `SendUnspawnMessage` | Call this from RebuildAll after removing an observer from an Entity to unspawn the Entity on the observer connection. |
