Prediction & rollback
Client-side prediction, server reconciliation with rollback & re-simulate, snapshot interpolation and lag compensation — the headline of competitive netcode, built in.
One C++20 core · every engine
Photon-Fusion-class prediction & rollback, a custom encrypted UDP transport, and both authority models — wrapped idiomatically for Unity, Unreal, Godot and the web. Write your simulation once and ship it self-hosted native or on our managed WASM hosting.
Why Lattice
Prediction, rollback, congestion control and serialization are subtle and expensive to get right. Lattice implements them once, in a portable C++20 core behind a stable C ABI — then hands you natural per-engine concepts on top.
Client-side prediction, server reconciliation with rollback & re-simulate, snapshot interpolation and lag compensation — the headline of competitive netcode, built in.
Server/host-authoritative and shared/distributed authority are first-class — per-object ownership and authority transfer in the same data model. Objects can even mix modes in one session.
One core, idiomatic wrappers: Unity via P/Invoke, Unreal as a UE module, Godot as a GDExtension, web as WASM. Your gameplay engineers never touch a raw pointer.
A custom UDP transport with four reliability/ordering channels, congestion control, fragmentation and X25519 + ChaCha20-Poly1305 encryption. Sub-MTU packets, tuned for tick-rate traffic — not bulk throughput.
STUN-style reflexive discovery and UDP hole punching connect most peers directly; our own TURN-like relay guarantees connectivity when it fails — the backbone of P2P hosting and host migration.
Server authority and Ed25519-signed session tokens raise the bar. Violations flagged by the anti-cheat core are forwarded to the platform and surface live in your dev portal.
Write once, dual-target
Your game-sim is a shared library compiled into both the dedicated server and the client. A client can act as a P2P host with byte-for-byte identical logic. Topology is injected at runtime — dedicated, listen-server or P2P-relayed all run the same tick.
Ship it your way: self-host the native binary for cost, data-residency or control — or push the exact same module to our managed WASM hosting and let us run the fleet.
Write-once guide →Batteries-included platform
A lightweight .NET control plane handles authentication, matchmaking & fleet orchestration, and social. A global friends & presence graph spans your titles with per-game visibility controls; analytics and a live-ops debug console come built in.
At a glance
Headline differentiators that motivate the design — not a point-in-time feature audit.
| Dimension | Lattice | Photon Fusion | Mirror | FishNet |
|---|---|---|---|---|
| Engines | Unity, Unreal, Godot, Web | Unity | Unity | Unity |
| Core language | C++20 core + C ABI | C# | C# | C# |
| Authority models | Server/host and shared, per-object | Host/server + shared | Server | Server (+ client-auth) |
| Prediction / rollback | Yes + lag comp | Yes | Limited | Yes |
| Transport | Custom encrypted UDP (4 ch) + QUIC/WebTransport | Proprietary | Pluggable | Pluggable |
| Relay / NAT traversal | Own relay + STUN + hole punching | Photon Cloud | 3rd-party | 3rd-party |
| Social & auth | Built-in | Separate products | DIY | DIY |
| Self-hostable | Fully — source-available core | Hosted-leaning | Open source | Yes |
A networked object
Declare what replicates, decide who has authority, send an RPC over the right channel. The core handles prediction, delta-compression and the wire.
using Lattice;
// A networked player: predicted locally, reconciled against the server.
public class Player : NetworkBehaviour
{
// Replicated, delta-compressed, quantized on the wire.
[Networked] public Vector3 Position { get; set; }
[Networked, OnChanged(nameof(OnHealthChanged))]
public int Health { get; set; }
// Runs every fixed tick (60 Hz). Prediction + rollback are automatic.
public override void OnNetworkTick()
{
if (!HasInputAuthority) return;
Position += ReadInput<MoveInput>().Move * Runner.TickDelta;
}
// Server-authoritative RPC, routed over a reliable channel.
[Rpc(LatticeRpcTarget.Server)]
public void RpcFire(Vector3 dir) => SpawnProjectile(dir);
}
// The same logic compiles into the dedicated server AND the P2P host.
struct Player {
Vec3 position; // replicated & quantized
int32_t health; // delta-compressed against last ack
};
// Fixed 60 Hz tick — authoritative on server, predicted on the owning client.
void player_tick(Player* p, const MoveInput* in, float dt) {
p->position = vec3_add(p->position, vec3_scale(in->move, dt));
}
// Register the type so replication knows its POD layout.
lattice_register_type(runner, "Player", sizeof(Player), &player_tick);
Illustrative of the intended idiom — see the API reference for the exact shipped surface.
Coming from Photon Fusion?
fusion2lattice is a Roslyn-based codemod that rewrites the
high-confidence parts of the Fusion 2.1 API surface to Lattice and produces a precise,
per-file to-do list for everything that needs a human. On an idiomatic project it
mechanically handles around 75–80% of detected constructs — honestly
flagging the hard parts (spawn model, input routing, RPC payloads) rather than guessing.
Register a game in the developer portal, drop in the binding for your engine, and run it self-hosted or on managed WASM.