ECS / DOTS support

At the moment of writing, coherence's SDK for Unity is built to work with GameObjects and Prefabs. As such, networking ECS entities requires some work on the developer's side.

Making coherence work with DOTS

To network ECS entities, the main task is to transfer data between a GameObject networked by coherence and a corresponding ECS entity, which holds the gameplay data used and transformed by ECS Systems that are in charge of simulating gameplay.

In essence, gameplay that happens in the ECS space results in data that is saved to specific ECS entities. A system is then in charge of transfering this data onto GameObjects. At this point, coherence is able to synchronise that data, like normal.

This work should be done by an ECS System written specifically for the task, which would operate as a bridge between the world of GameObjects/MonoBehaviours and the world of "pure" ECS.

Because the involved GameObject and its scripts would use non-DOTS API, the ECS System in charge of the transfer needs to be run on the main Unity thread and can't use Burst. For this reason, large scale simulations using this method are not recommended.

ECS entity or network entity?

In coherence's documentation, the term network entity (or even just entity) appears frequently. This is not to be confused with an entity in the ECS sense.

Outside of this page, whenever you see the word entity, it has to be regarded as an instance of a Prefab that has been networked using the CoherenceSync component – not as an ECS entity.

We are exploring including native support for Unity's DOTS and its workflows. This page will be updated to reflect any development.

Last updated