Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
coherence is a network engine, platform and a series of tools to help anyone create a multiplayer game.
Fast network engine with cloud scaling, state replication, persistence and auto load balancing.
Easy to develop, iterate and operate connected games and experiences.
SDK allows developers to make multiplayer games using Windows, Linux or Mac, targeting desktop, console, mobile, VR or the web.
Game engine plugins and visual tools will help even non-coders create and quickly iterate on a connected game idea.
Scalable from small games to large virtual worlds running on hundreds of servers.
Game-service features like user account and key-value stores.
At the core of coherence lies a fast network engine based on bitstreams and a data-oriented architecture, with numerous optimization techniques like delta compression, quantization and network LOD-ing ("Level of Detail") to minimize bandwidth and maximize performance.
The network engine supports multiple authority models:
Client authority
Server authority
Server authority with client prediction
Authority handover (request, steal)
Distributed authority (multiple simulators with seamless transition)
Deterministic client prediction with rollback ("GGPO") - experimental
coherence supports persistence out of the box.
This means that the state of the world is preserved no matter if clients or simulators are connected to it or not. This way, you can create shared worlds where visitors have a lasting impact.
The coherence SDK only supports Unity at the moment. Unreal Engine support is planned. For more specific details and announcements, please check the Unreal Engine Support page. For custom engine integration, please contact our developer relations team.
A lean and performant server that keeps the state of the world and replicates it efficiently between various Simulators and Game Clients. The Replicator usually runs in the coherence Cloud, but developers can start it locally from the command line or the Unity Editor.
A build of the game. To connect to coherence, it will use the coherence SDK.
A version of the Game Client without the graphics ("headless client") optimized and configured to perform server-side simulation of the game world. When we say something is simulated on the server, we mean it is simulated on one or several Simulators.
A text file defining the structure of the world from the network's point of view. The schema is shared between the Replicators, Simulators and Game Clients. The world is generally divided in components and archetypes.
Code generation
The process of generating code specific to the game engine that takes care of network synchronization and other network-specific code. This is done using a CLI tool called Protocol Code Generator that takes the schema file and generates code for various engines (e.g. C# for Unity).
The process of making sure the state of the world is eventually the same on the Replicator, Simulators and Game Clients, depending on their areas of interest.
coherence works by sharing game world data via a Replication Server in the cloud and passing it to the connected Clients.
The Clients and Simulators can define areas of interest (LiveQueries), levels of detail, varying simulation and replication frequencies and other optimization techniques to control how much bandwidth and CPU power is used in different situations.
The game world can be run using multiple Simulators that split up simulation functions or areas of the world accordingly.
The platform handles scaling, synchronization, persistence and load balancing automatically.
Fast authority transfer and remote commands allow different authority models, including Client authority, Server authority, distributed authority and combinations like Client prediction with .
Peer-to-peer support (without a Replicator) is planned in a future release. Please see the for updates.
coherence provides two types of online replication services: Rooms and Worlds. Read about the different uses cases for each
Rooms are best for session-based gameplay where the match between players takes place in a short-lived environment.
A good example is a first person shooter multiplayer match. The match takes place between two teams in a single game session, and players enter through a lobby and matchmaking. When the match is concluded, the multiplayer environment the match took place in is closed and players return to a lobby.
This is one example of how Rooms can be used, but it is by no means the only use case. The important distinction between Rooms and Worlds (see below) is that Rooms are relatively short-lived and are meant to be created and closed by the Game Client through the coherence SDK.
See Rooms API.
Current limits for Rooms are as follows: Players
The default setting is 10 players hosted, but you can specify your own value anywhere between 2 and 100 players.
To support more than a 100 players per room, write to devrel@coherence.io
Entities
1000 by default, currently up to a 65535.
Worlds, as opposed to Rooms, are long-lived and permanent multiplayer environments provided by coherence. Using the Developer Portal, your project will easily define and manage your World configurations.
See Manage Worlds.
A good example of a World is a permanent environment for an Massively Multiplayer Game (MMO). Regardless of the number of players connected, the environment is always available, and players can connect and disconnect at will.
Entities can be permanently saved in the World so that even if there are no active connections, they still persist when players do connect.
See Worlds API.
Your project does not have to choose one-or-the-other. A project in coherence can contain both World and Rooms.
A good example of this scenario is again, our MMO. Although players connect to a permanent and persistent World, they may enter a dungeon instance with other players. These dungeon instances can be Rooms.
The primary difference in the configuration and usage of Room and Worlds is that Worlds are managed in the Developer Portal, whereas Rooms are created and managed through the SDK.
Custom UDP transport layer using bit streams with reliability
WebRTC support for WebGL builds
Smooth state replication
Server-side, Client-side, distributed authority
Connected entity support
Fast authority transfer
Remote messaging (RPC)
Persistence
Verified support for Windows, macOS, Linux, Android, iOS and WebGL
Support for Rooms and Worlds
Unity SDK with an intuitive no-code layer
Per-field adjustable interpolation and extrapolation
Input queues
Easy deployment into the cloud
Multi-room Simulators
Multiple code generation strategies (Assets/Baking, automated with C# Source Generators)
Multiple object spawning strategies (Resources, Prefab Mapper, Addressables)
Per-field compression and quantization
Per-field sampling frequency adjustable at runtime
Unlimited per-field levels of detail
Areas of interest
Accurate SimulationFrame tracking
Developer portal with server and service configurator
Automatic server scaling
Multiple regions (US East, EU Central)
Player accounts
Key-value store
Matchmaking
Float64 support
Permissions and roles system for clients and simulators
World origin shifting
Input queue UX improvements
More logging and diagnostics tools
Built-in network condition simulation
Additional server regions
Support for multiple Simulators and Replicators in a single project
Dashboard with usage statistics
Paid plans with more CCU and credits
Network profiler
Support for lean pure C# clients and simulators without Unity
Peer-to-peer (without replication server) with NAT punch-through
MTU detection
Packet replay
Ability to deploy multiple Simulation Servers per environment
Player analytics
Developer portal graphs and analytics
Simulator authentication
Bare-metal and cloud support
Misprediction detection support
SDK library that can be used in C++ and other languages
More starter/sample projects and helper scripts
Ability to embed WebGL games in web portals
Global KV-Store
Complex data types/entities in the KV store
More GGPO support for specific game genres
Misprediction detection support
Unreal Engine SDK
JavaScript SDK
TCP fallback support
Advanced matchmaking
Multiple Replication Servers per game world
Customer-specific serialization
User-space load-balancing (SDK framework)
Game world map with admin interface
Advanced anti-cheat functionality
Advanced transaction logs (audit trail)
Schema versioning (hot updates)
Console-specific updates
Player analytics
Tips on how to handle common problems
Ubuntu 22.04 suffers from a GLIBC version mismatch, resulting in coherence baking failure. The current solution is to downgrade by one version of Ubuntu.
Revert all your Prefab Instance Overrides
Check that all your clients are using the same Schema ID.
On macOS, some versions of the Unity Hub don't install platform modules properly. This issue is fixed on version Unity Hub version 3.3.0. If you want to use a prior version, install one module at a time.
SDK 0.9 release removed dependency to the experimental package Platforms. As a result, your existing BuildConfiguration assets will have its defining script missing. To recreate the Simulator build configuration with the new pipeline, you can do it from the Simulators Module in coherence Hub.
When networked Entities are added by loading a scene additively, mind that the CoherenceMonoBridge
must be set to a singleton mode. In case of a non-singleton MonoBridge the Entity will search for a MonoBridge instance within its scene, and if none is found it will be created in that scene. This applies to both CoherenceSync
and LiveQuery
objects.
For a complete control over CoherenceMonoBridge
resolving you can use either CoherenceSync.MonoBridgeResolve
instance event or MonoBridgeStore.MonoBridgeResolve
global event. A CoherenceMonoBridge
instance provided by the MonoBridgeResolve
event takes precedence over the scene and singleton ones.
Sometimes the package cache gets stalled and after updating the coherence package you might find Unity still uses the old package version. Try Reimport all
or closing the project, deleting the Library
folder, and reopening the project again. It will clean and update packages cache, and use the version of coherence stated in manifest.json
.
Currently, coherence doesn't support networking prefabs with the same name. Doing so can yield duplicated definition errors. Best course of action is to rename your prefabs so they have different names.
We will support networking prefabs with the same name in the future.
If you have issues building Clients or Simulators, refer to troubleshooting.
When working with Prefab Variants, Unity leaks managed references (fields marked with [SerializeReference]
). This can make your prefab grow big and use more memory than necessary. Until Unity fixes this issue, we provide you with the ability to prune the leaked references. Pruning is only available for Unity 2021.2+.
Unity does not build WebGL because Python 2 is missing on latest macOS and Ubuntu 22. This is fixed on Unity 2020.3.40f1 and onwards.
Dots (.
) are not supported as part of WebGL build names.
There's a known bug preventing the removal of session-based objects from the scene after the Client disconnects. We're working on it.
LOD levels are not properly updated when queries move or resize.
When upgrading older projects to 0.9, you may get the following error after trying to connect to a Room/World:
System.Collections.Generic.KeyNotFoundException: The given key was not present in the dictionary.
If this happens, you should manually select your CoherenceSync Prefabs in the Inspector to trigger an OnGUI call.
If you have any problems after trying this, please let us know on our Discord so we can help you out.
Read about new features, important changes and fixes for version 0.10
Published 02.06.2023
This is a maintenance release.
Child entities of duplicate unique entities are no longer destroyed.
TCP fallback removed until it receives a rework in the next major version.
Published 27.04.2023
This is a maintenance release.
Permissions issue while executing baking or a Replication Server on macOS.
Published 26.04.2023
This is a feature release!
Published 24.04.2023
This is a maintenance release.
Compilation on Unity 2022.2+ works now.
Reverted a warning on the CoherenceSync inspector where the object is not in the Prefab Mapper.
Published 11.04.2023
This is a maintenance release.
Added a warning about Prefabs not being addded to the Prefab Mapper when baking from the CoherenceSync inspector.
Log settings are now stored in Library/coherence/logSettings.json
.
Improved coherence Hub performance.
BakeUtil.Bake method return value.
LogSettings saved on fresh imports.
Multi-Room Simulators no longer attempt to serve more than one HTTP server.
Published 28.03.2023
The main benefits of this release involve schema. Gathered.schema is now stored in the project and as such, became fully versionable. This and some other choice improvements below have dramatically improved SchemaID stability.
BakeUtil.OnBakeStarted and BakeUtil.OnBakeEnded events.
Multi-Room Simulators: reconnection timeout.
CoherenceNode: fixed order of execution. Now, updates are applied before parenting is resolved.
Gathered.schema moved to Assets/coherence/Gathered.schema (from Library/coherence/Gathered.schema).
Can no longer disable Toolkit/Reflection/Generic Schema on Settings. It's required now.
RuntimeSettings' SchemaID property now warns about outdated schemas.
Optimize window: added statement that it is an experimental feature for now.
Sample UI hanging when there's no connection.
Reduced allocations made by the SDK.
Auto-update RuntimeSettings after bake.
Entering Play Mode is now faster on big projects.
CoherenceInput: now works with Prefabs containing spaces in their name.
Faster synchronization of Transform's position.
Connection: packets filtered by roomID to prevent cross-room data contamination.
Users no longer receive a prompt to bake before entering Play Mode.
Bake Window button removed from the Optimize window UI.
macOS builds uploaded to coherence Cloud now keep the Application Bundle (.app) structure intact.
When a simulator fails to build, the scripting define symbol COHERENCE_SIMULATOR
is properly removed.
Faster assembly reloads, since coherence no longer tries to load your project Prefabs (was done to inform about possible issues or misconfigurations).
WebGL won't crash when failing to create a WebSocket.
TCP fallback when UDP connections fail or are blocked. Useful in heavily firewalled/restricted environments.
CoherenceSync: ability to trigger authority transfers from within the inspector while in Play Mode.
CoherenceSync: when adding CoherenceSync to a Prefab Instance, it's possible to apply CoherenceSync to the original Prefab instead of creating a new one.
Sample UI: layout.
Sample UI: watermark shows current Room/World ID, region and schema ID.
Replication issues when commands or inputs are being sent right after instantiation.
CoherenceSync: moving to Assets/Resources won't fail if the folder doesn't exist yet, and it's possible to issue from within a Prefab Stage.
CoherenceSync: adding a CoherenceSync inside a Prefab Stage resolves 'Load via' properly now.
Sample UI: highly reduced GC allocations in watermark.
Sample UI: refreshing was performed multiple times. Now, it also takes less time to get the state updated.
New PlayResolver.RemoveRoom API.
Sample UI: detect available local Replication Server.
CoherencePlayerName component to ease networking the player name set on the Sample UI.
Bake automatically defaults to false.
Sample UI: improved layout and better state management.
CoherenceSync: tooltips have been rewritten and improved.
PlayResolver.FetchWorlds takes optional region and simulator slug as arguments.
Connection Dialog defaults to rooms.
Baking automatically on building a Unity Player no longer updates Prefabs.
Texture-loading related issues (Editor).
Packets received from incorrect endpoints are ignored.
Build uploading on macOS.
Hub: improvements to the Overview section.
Hub: Multi-Room Simulators Wizard no longer reopens.
coherence now waits for the AssetDatabase to be ready before performing changes to Prefabs.
CoherenceSync: No Duplicates resolves uniqueness properly now.
Uploading schemas from CI using COHERENCE_PORTAL_TOKEN.
CoherenceSync: with rigidbody, parented under an object without CoherenceSync, now correctly syncs its position.
The first thing you'll notice is that our Documentation has gotten a thorough overhaul to its structure. We hope you find the new layout of topics more usable and logical.
Play.IsLoggedIn to wait before interacting further with the Play API.
Authority-side sample interpolation that removes jitter for bindings that are sampled at high frequencies.
CoherenceSync: now fully configurable in Prefab variants. Prefab overrides can be visualized both in the CoherenceSync inspector and the Configure window.
PlayResolver: Option to create or join existing room with matching tags.
DescriptorProvider custom data object added for extended binding support.
Play.IsLoggedIn now waits before interacting further with the Play API.
Authority-side sample interpolation that removes jitter for bindings that are sampled at high frequencies.
CoherenceSync: a new 'Preserve Children' option to prevent connected entities (CoherenceSyncs in hierarchy) from being destroyed if the parent entity is destroyed.
CoherenceSync: [Sync] and [Command] attributes now allow you to specify the old name of the member to migrate it in place (example: [Sync("myOldVar")] public float myVar;
).
CoherenceMonoBridge: onLiveQuerySynced exposed in the inspector (OnLiveQuerySynced deprecated).
Build sharing: improved build path validation.
Baking: now informs users about the current limitation of 32 schema components.
Source Generator: improved reports so that it's clear when there's a failure.
PlayResolver: Option to create or join existing room with matching tags.
DescriptorProvider custom data object for extended binding support.
CoherenceSync: polymorphic bindings using serialized references. Upgrading from older coherence versions requires migration (done automatically, can trigger manually via menu item 'coherence > Reimport coherence Assets').
CoherenceSync: configurable rigidbody component action. You can decide when isKinematic should be (un)set.
CoherenceSync: authority transfer UI label changed from 'No' to 'Disabled'.
CoherenceHub: last tab opened is now persistent when closing and opening the window again.
Networked Prefabs are now instantiated with their original rotation if the rotation is not synced.
Truncated floating point precision in the 'Optimize' window.
Losing latest changes when transferring authority.
Overshooting and overflowing of integers while interpolating.
WebGL Client automatically disconnecting after Replication Server shutdown.
Recycling of EntityIDs caused by a double delete of an ID when an Entity is destroyed because of a parent moving out of the query.
Negative latency calculations during CPU spikes.
Fixed ConnectionSettings.PingOnConnect causing a timeout when connecting.
Editor getting stuck in an infinite loop when trying to import packages that reference missing types.
CoherenceNode script is now executed before CoherenceSync to mitigate parenting validation warnings.
Entities that exceed the Room's max Entity count are destroyed and a warning is logged.
Cloning GameObject instances with baked bindings using Instantiate would result in binding errors due to missing GUIDs (globally unique identifiers).
Warnings spammed when exiting Play Mode in Unity Editor.
Baking: process running longer than expected.
Baking: gather bindings from inactive GameObjects in hierarchy.
Baking: fixed NullReferenceException by skipping missing scripts.
Hub: don't show synchronous fetch organization progress bar.
Hub: improved scene setup instructions.
Hub: improved Multi-Room Simulators setup.
More coherence components implement a custom editor now, showing the logo and a brief description.
Source Generator: allow on 2020.3.
Source Generator: first time import failing due to directories not yet existing.
CoherenceSync: binding the same method as a command multiple times in the same Prefab is now supported.
CoherenceSync: fixed issue with parenting and interpolation which would result in a few frames of the connected Entity being in the wrong place.
CoherenceSync: use the method SendCommandToChildren to send a command to every bound component in the hierarchy.
CoherenceSync: new overload for the SendCommand method that accepts an Action, you can use it to send a command to a specific Component instance, if a method is bound to more than one component in the hierarchy.
CoherenceSync: disabled prediction controls on reflection (non-baked) mode.
CoherenceSync: set default interpolation.
CoherenceSync: fixed error on cancelling interpolation asset creation.
CoherenceSync: opening the inspector should not load additional assets (noticeable speedups on bigger projects).
CoherenceSync: binding to generic members is no longer allowed.
CoherenceSync: collapsed 'Custom Events' section by default.
CoherenceSync: 'Steal' authority transfer type on persistent Entities is no longer forced.
CoherenceNode: executed before CoherenceSync to mitigate parenting validation warnings.
Sample UI: don't auto-generate EventSystem, but inform when it's missing.
Sample UI: fixed default room name.
Sample UI: fixed Refresh button throttling (too many requests).
PlayClient: fixed missing Client version header.
Analytics: Exception thrown due to threading error.
PlayResolver: Cached rooms not filtered by tags.
CoherenceMonoBridge: OnShutdown event.
Added Floating Origin support. It's now possible to move the whole world underneath an entity and position game objects precisely even in very large virtual worlds. For more information, see the article.