Multiplayer Project Setup

By multiplayer project I mean using the Listen Server or Dedicated Server network modes of Unreal Engine.

The supported replicated variables are using push based model for networking.

If you extend the plugin's classes I would recommend doing the same, even tho you can mix both replication methods.

Mandatory configuration

Globally

  • Set bUseNetworking to true in the Project Settings.

For types

  • Use the correct multiplayer Prefab Reference Component class (Net Prefab Reference Component).

  • Use the correct multiplayer Prefab Source Component class (Net Prefab Source Component).

  • Use the correct multiplayer Prefab Properties Object class (Net Prefab Properties Object).

More on Prefab Source Component

  • Be sure that your Net PSC (and the owning actor) is set to replicate.

  • For optimization purposes the default NetDormancy of the owning actor will be set to DORM_Initial (you can change that in the Project Settings, see bOverrideNetDormancyForOwningActor and OverrideNetDormancyValue).

Optional configuration

I highly recommend adding the following cvars in your DefaultYourProjectName.ini file (located in YourProjectFolder/Config). To do so, simply add a new line with [ConsoleVariables] then add a new line for each of these.

Example:

DefaultYourProjectName.ini
[ConsoleVariables]
net.AllowAsyncLoading=1
net.DelayUnmappedRPCs=1
Name
Value
Description

net.AllowsAsyncLoading

1

Allow async loading of unloaded assets referenced in packets. If false the client will hitch and immediately load the asset, if true the packet will be delayed while the asset is async loaded. net.DelayUnmappedRPCs can be enabled to delay RPCs relying on async loading assets.

net.DelayUnmappedRPCs

1

If true delay received RPCs with unmapped object references until they are received or loaded, if false RPCs will execute immediately with null parameters. This can be used with net.AllowAsyncLoading to avoid null asset parameters during async loads.

Last updated