Skip to content

Multiplayer

Replicated multiplayer setup

Coming in 1.1

On this page

Version 1.1 adds built-in, fully replicated, server-authoritative multiplayer. It runs on Unreal Engine’s own networked physics (Physics Prediction), so you only switch on a few project settings.

How it works

  • The server decides. It simulates every kart, and its result is final.
  • Your own kart reacts instantly. Your machine predicts it from your input, so there is no input lag. When the server disagrees, the engine rewinds and replays your kart, including its drift and boost state.
  • Other players’ karts run the same simulation on your machine, with the inputs their players send through the server. Their steering, drifts and bumps show on your screen too.
  • Corrections are smoothed. Unreal blends the rendered kart toward the corrected position instead of snapping it.

You write no replication code for the kart itself. Your own game features (boost pads, items, race logic) follow two simple rules, explained in Blueprints in multiplayer.

Setup

The kart switches to multiplayer by itself when the game runs as a server or client and Physics Prediction is enabled. It also needs the other two settings below. The example project already has all three. The kart’s C++ class also adds its own Network Physics Component and sets the physics replication mode, so your kart Blueprint needs nothing extra.

Step 1: Async physics at 60 Hz

In Project Settings > Physics > Framerate, tick Tick Physics Async and set Async Fixed Time Step Size to 0.016667. If you followed Getting started, this is already done. Why the kart needs it: async physics in Unreal Engine.

Step 2: Enable Physics Prediction

In Project Settings > Physics > Replication, open Physics Prediction (Experimental):

SettingValue
Enable Physics PredictionOn
Enable Physics History CaptureOff (not needed)
Max Supported Latency Prediction1000 (the default is fine)

Step 3: Add one line to DefaultEngine.ini

Open Config/DefaultEngine.ini in your project folder and add this section. If the file already has a [ConsoleVariables] section, add only the second line under it.

[ConsoleVariables]
p.Chaos.AccelerationStructureCacheOverlappingLeaves=0

Why: Unreal Engine 5.7 does not refresh this physics cache while it replays a correction, so without the line two karts can drive into each other and one climbs onto the other.

In development builds, a networked kart prints a red message on screen when this line is missing.

Testing in the editor

You can test multiplayer without a second computer. Unreal opens one window per player.

  1. Click the three dots next to the Play button. Set Number of Players to 2 or 3 and Net Mode to Play As Listen Server.
  2. In the same menu, open Advanced Settings… (Editor Preferences > Level Editor > Play). Under Multiplayer Options, tick Enable Network Emulation, set Emulation Target to Server Only and Network Emulation Profile to Average.
  3. Press Play and check the real ping with the console command stat net in a client window.

What to test

  • Bump a standing kart, push a moving kart, then drive apart again.
  • Turn, drift, and bump each other next to a wall.
  • Do this from each client, and watch both your own kart and the other one.

Good to know

  • A fixed physics tick is required. It keeps server and clients simulating alike. Keep 60 Hz, or re-tune the kart and enable Tick Rate Independent Acceleration (Kart Base Settings > Acceleration).
  • Single player is unchanged. Offline play uses the original simulation. Enabling Physics Prediction does not change single-player handling.
  • The example project also sets a 30 ms input buffer (np2.TickOffsetBufferTime=30 under [ConsoleVariables], the engine default is 90 ms). It is a test value: a smaller buffer means less delay but less room for late packets, so test it with your player count before you copy it.
  • Iris replication is not supported yet.
  • Seamless travel with kept pawns is not supported. Destroy and respawn the karts on a map change (the default behavior).
  • Boost pads cause a short correction for the driving player, because the server applies the boost and the client could not predict it.
  • Moving platforms may cause slightly more frequent corrections for karts riding them. Static tracks are not affected.
  • Checking the mode: IsUsingNetworkedKartPhysics returns true when a kart runs networked and false in standalone play.

Next steps

Not using the plugin yet? Get it on Fab.