Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
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.
Fast authority transfer and remote commands allow different authority models, including Client authority, Server authority, distributed authority and combinations like Client prediction with input queues.
The platform handles scaling, synchronization, persistence and load balancing automatically.
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.
Fast authority transfer and remote commands allow different authority models, including Client authority, Server authority, distributed authority and combinations like Client prediction with input queues.
The platform handles scaling, synchronization, persistence and load balancing automatically.
Peer-to-peer support (without a Replicator) is planned in a future release. Please see the Peer-to-peer page for updates.
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.
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
Floating Origin for extremely large virtual Worlds
TCP Fallback
Support for Client hosting through Steam Datagram Relay
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)
Extendable object spawning strategies (Resources, Direct References, Addressables) or implement your own
Per-field compression and quantization
Per-field sampling frequency adjustable at runtime
Unlimited per-field levels of detail
Areas of interest
Accurate SimulationFrame tracking
Network profiler
Brand new developer portal for management and usage statistics
Automatic server deployment and scaling
Multiple regions in the US, Europe and Asia
Player accounts with a persistent key/value store
Matchmaking and lobby rooms
Float64 support
Permissions and roles system for clients and simulators
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
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
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
ExtensionOfNativeClass
attributeReimport assets via menu item Assets / Reimport All
.
There is a bug in some early versions of Unity 2022 LTS that causes Prefabs to be corrupted on reimport, leading to all sorts of issues like scripts losing references, or the CoherenceSync
component showing a button to "Fix Serialized Data" (which cures the problem, but only temporarily).
The real solution is to upgrade to a newer version of Unity 2022. Unity claims they fixed the bug in version 2022.3.5f1
(note the specific patch number, .5
).
The current workaround to avoid this issue is to open your CoherenceSync prefabs in prefab mode.
Check that all your clients are using the same Schema ID.
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. You can prune within the Configure window.
If you are instantiating a Prefab from a coherence event (such as a Command, OnValueSynced, OnStateAuthority, OnLiveQuerySynced...) and then changing its bindings in the same frame, the remote Clients will not instantly get updated values. Instead, if the binding has interpolation enabled, the value of the binding will be interpolated from the original value (from the instantiation step) to the updated value (from the change later in the frame).
The current recommended workaround is to make sure that the Prefab has initial values set before instantiation. Or in the case of position and rotation, those could be directly supplied to Instantiate()
instead of setting them later in the frame.
The source generator relies on an auto-generated configuration file to inject the baked code into Unity's Assembly-CSharp.dll. Such file will not be available on a fresh, non-cached project (i.e., no Library
), such as a Continuous Integration setup.
The SDK doesn't offer yet an API to initialize the source generator from code.
If you experience issues, switch to Assets strategy in your CI setup. You can keep using the source generator to develop locally, since either baking strategy can be used interchangeably, and the generated code is the same.
Make sure you allow HTTP connections in Editor to avoid InvalidOperationException: Insecure connection not allowed
errors. Find out how to enable HTTP connections in Unity's InsecureHttpOption article.
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 .
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, but can be increased up to 65535 in local development or client-hosted scenarios.
There is no UI button for increasing the supported player count, so you need to work through our Rooms API.
When creating a room viaReplicationServerRoomsService.CreateRoom
you can pass SelfHostedRoomCreationOptions
as creation options.\
To change the Entity limit just set the SelfHostedRoomCreationOptions.MaxEntities
to a desired value.\
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.
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.
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.
See .
See .
Read about new features, important changes and fixes for version 1.0
Published 06.10.2023
Added
Extrapolation: Max Overshoot Allowed range increased to [0, 20].
Extrapolation: Expose stale factor (defaults to 2).
Changed
Highly reduced GC allocs made while serializing.
Fixed
WebSocket request timings.
OnValueSynced not triggering when the update packet came with a parenting change.
Shifting the floating origin now correctly shifts rigidbodies in the same frame without kicking in the physics interpolation.
Published 05.09.2023
Added
Descriptor Providers: two new properties were added to Bindings, called OverrideGetter and OverrideSetter. Setting this to true will allow you to write custom code blocks in your getters and setters, as opposed to being limited to "UnityComponent.{myCustomCode}".
CoherenceBridge API: TranslateFloatingOrigin(Vector3d) overload.
Fixed:
Floating Origin: fixed entities jittering on remote clients when Floating Origin is changed.
Published 11.08.2023
Tutorial Project: Released the Campfire Tutorial Project where you will be able to delve into more advanced aspects of how to use coherence.
Published 10.08.2023
CoherenceNode: Reset on OnDisable.
Reset entity reference when destroying the entity.
Force re-cache SchemaID after writing Gathered.schema to disk.
Published 25.07.2023
Commands: fixed trying to send a command from an inherited class that is bound in the parent class.
Bindings: fixed rare cases where RectTransform bindings would be reported as missing.
Client Connection Prefabs: fixed Client Connection instances duplication when changing Physics scene.
Coherence Profiler: fixed count of messages received.
ReplicationServerRoomsService: fixed RemoveRoom methods.
Optimize window rendering issue where rows would disappear.
Published 04.07.2023
Still, nothing beats Release Notes for a quick and comprehensive review of the changes, so go ahead!
If you're updating from version 0.10, please check out our Upgrade Guide.
Minimum supported version is now Unity 2021.3 LTS.
Lobby Rooms
Unity multi-scene support
TCP Fallback
Client-hosting
Profiler: a coherence Profiler module for basic networking information.
Added support for object pooling and a default pooling implementation.
Protocol: added support for ordered components so parenting component changes always arrive with related position changes.
CloudService: non-static public API to communicate with your coherence Cloud project.
Samples: Explore Samples window.
Samples: New Connection Dialog Samples for Rooms and Worlds.
Enter Play Mode Options (No Domain Reload) is now fully supported.
CoherenceSyncConfigRegistry: Added new ScriptableObject to soft reference CoherenceSync assets in runtime and serialize how they are loaded and instantiated.
INetworkObjectProvider: Added runtime interface to be able to customize how CoherenceSync assets are loaded, with three default implementations (Resources, Direct Reference and Addressables)
INetworkObjectInstantiator: Added runtime interface to be able to customize how CoherenceSync prefabs are instantiated, with three default implementations (Default, Pooling and DestroyCoherenceSync)
CoherenceSyncConfigUtils: Editor public API to be able to add, delete and browse CoherenceSync assets, aswell as start or stop syncing variables via scripting.
CoherenceSync Objects Editor Window: New Editor window to be able to browse CoherenceSync assets, found under coherence => CoherenceSync Objects menu item.
UniquenessManager: Encapsulated uniqueness logic under CoherenceBridge.UniquenessManager, where you will be able to register unique IDs at runtime.
AuthorityManager: Encapsulated authority transfer logic under CoherenceBridge.AuthorityManager, where you will be able to send authority transfer requests without accessing the CoherenceSync directly.
ReplicationServerRoomsService: non-static public API to be able to create, delete and fetch rooms from self-hosted Replication Servers.
CoherenceSync: Rigidbody Update Mode.
CoherenceSync: Advanced Uniqueness Options.
CoherenceSync: CoherenceBridge resolver API.
Coherence.Editor.UploadBuildToCoherence API.
CoherenceSync: CoherenceSync instances are now automatically synced and unsynced with the network in the OnEnable/OnDisable methods, instead of Start/OnDestroy.
CoherenceSync: CoherenceSync instances can now be disabled and reused for different network entities, which allows for object pooling to happen.
CoherenceSync Baked Scripts: Baked scripts for CoherenceSync prefabs are no longer MonoBehaviours.
Uniqueness: Improved handling unique IDs for Unique CoherenceSyncs when creating serialized scene Prefab instances.
Updated JWT to 10.0.2.
Reworked AutoSimulatorConnection component.
ParrelSync/symlink support: avoid read exceptions on Gathered.schema.
CoherenceSync: Initialization of disabled objects.
CoherenceSync: adding the component to a Prefab no longer deselects it.
Source Generator: avoid running on IDEs, to avoid IO-related exceptions.
Simulator Slug not being encoded correctly.
CoherenceNode: race condition when setting parent.
PrefabMapper has been removed in favor of CoherenceSyncConfigRegistry.
NetworkTime.Time
PlayResolver API: Play, PlayClient and PlayResolver have been deprecated in favor of CloudService API.
Sample UI: the old Sample UI that depended on the PlayResolver API has been deprecated in favor of the new Unity Package Samples.
CoherenceUUID: This Component is no longer needed and it has been deprecated, the functionality has been baked into the Editor and now works automatically. Prefabs that use this Component can stop using it.
CoherenceMonoBridgeSender: This Component is no longer needed and it no longer has any functionality, it can be safely removed.
Client Connection Prefab References: References to the Prefabs in CoherenceBridge have been deprecated. Please use CoherenceSyncConfig references instead.
There's a lot to say about hitting the coherence 1.0 milestone, so we did that in a dedicated . It also provides fuller descriptions of the highlight features that come with 1.0.