LogoLogo
What's New?API StatusOur Website
  • Morpheus Platform Documentation
  • What is Morpheus Platform?
    • Glossary
    • Interoperability
    • Support
    • EULA
  • Firewall Problems
  • CREATION
    • Unreal Development
      • Get Started
        • Download the Editor
        • Upload Content
        • Creating your Own Map
        • Morpheus Base Project
        • Differences from Unreal
          • Character Configuration
        • Morpheus Networking
          • Introduction to Morpheus Networking
          • Network Levels
          • Replicated Properties
          • RPCs
          • Morpheus Render Targets
          • Morpheus Array
          • Networking FAQ
          • Replicating Sublevels
      • Editor Versions
      • Performance Guarantees
      • Features & Guides
        • Example Plugin
          • Nameplates
          • In-Game Roles
          • Resizing
        • Actor Pooling
        • Audio
        • Avatars
          • Creating an Avatar
          • Attachments
            • MML Attachments
          • Custom Animation Variables
          • Importing an NFT Collection
          • Capsules and Mesh Transforms
        • Bots
        • Chat
          • Unreal Text Chat
        • Control Panels
          • Control Panel Configuration
          • DJ Booth Mission Control
          • Observer Controls
        • Crowd Audio
          • CrowdAudioComponent advanced configuration
        • Crowd Rendering
          • Legacy Animated Crowd
            • Animated Crowd Console Commands
            • Attaching static meshes to crowd members
          • Crowd Materials
          • Performance Parameters
          • Live Config Settings
          • Crowd Animation
            • Crowd Anim Blueprint
              • User Guide - Crowd Anim Blueprint
              • Reference Guide - ABP Nodes
                • Animation Playback
                • States and State Machines
                • Variables
                • Transitions
                • Special
                • Blends
                • Additional Notes
        • Helpers & Extras
          • "Instanced Objects" in Blueprints
          • Objects with "world context"
          • Making DataAsset classes
          • Duplicate Objects
          • The Bootflow Subsystem
          • The "Wait For Condition" System
          • Advanced Graphics Settings
          • Listening to Inputs on UObjects
          • Morpheus UserID
          • World Services
          • M2Extras: Skins System
        • Loading Screen
        • Live Config
          • Editing for a World
          • Editing Locally
          • Default Settings
          • Accessing via Blueprint
          • Adding New Settings
          • Overriding Defaults
          • Using Arrays
        • MML
        • Motion Capture
        • Networking
        • Notifications
        • Raycastable Crowd
        • Singletons
        • Streaming & Multiplatform
          • GFN on Mobile
        • UI
          • "UI Mode"
        • Video Players
          • Embedded Video Player
          • Millicast video streaming
            • How to Setup an In-Game Video Stream
            • Picture-in-Picture mode
          • Streaming Video Player
            • How to Setup a URL Video Player
            • Picture-in-Picture mode
        • Visual Debugging
          • Inspector
        • Online Services
          • KV Store Service
        • Web Browser
          • Setup the browser widget
          • Viewport browser
          • In-world browser
          • Loading embedded pages
          • Game <--> Browser Communication
          • Debugging issues
        • Web Requests
          • Http Requests
            • Legacy HTTP Nodes
          • JSON Handling
          • WebSockets
          • Identity Validation
          • Allowed External URLs
          • Walkthrough Example
            • Example Counter Service
        • World Travel
          • World Travel in the Editor
        • Avatar Physics Assets
        • Action Gameplay Helper Components
      • Workflows
        • Upgrade the Editor
        • Editing Project Settings
        • Profiling
        • Marketplace Importing
        • Extra Workflows
          • Setup Play-in-Editor
          • Setup Local Asset Validation
          • Adding Gameplay Tags
          • Validating Game Assets
          • Custom Connection Modes
          • Connect Editor to a World
          • Common Issues
      • Best Practices
    • Worlds
      • Invite Players
        • Setting Role Groups
      • Persistent Worlds
      • Always on Worlds
    • Running Events
      • Large Scale Events - Checklist
      • Anti-Cheat (EAC)
      • Player Entry
        • React Native
        • Steam
        • Hardware Requirements
      • Broadcast
        • OBS Integration
      • Failover
      • Capacity and Queue Management
  • ADMINS
    • Access Control
      • Add Metaverse Contributors
      • Create a New Project
    • Pricing
      • Development Support
      • Included Usage & Overages
      • Cloud Streaming
      • Access Modes
      • War Room Support
      • Platform SLA
    • Settings
      • Projects
  • APIs and Tooling
    • API Reference
      • Accounts
      • Events
      • Key/Value Store
      • Organizations
      • Realtime
      • User Profile
      • World Builder
      • Worlds
    • Template Web App
      • Moderation
    • Pixel Streaming
    • Launcher
  • Dashboard
    • Assets
      • Assets Versions
      • Engine Plugins
      • Project Plugins
      • Templates
    • Releases
  • Integrations
    • Analytics
      • Send Events from Web
      • Send Events from Unreal
    • Chat
      • Integrate Pubnub with your Unreal Project
      • Add Moderation to Chat
Powered by GitBook
On this page
  • What is Morpheus Networking?
  • Morpheus Actors
  • Changes to Core Unreal Classes
  • Replication
  • Network Levels
  • Authority
  • Variable Replication
  • RPCs
  • Morpheus Actor Components
  • Spawning and Destroying
  • Spawning an AMorpheusActor
  • Destroying an AMorpheusActor
  • Lifecycle Events

Was this helpful?

  1. CREATION
  2. Unreal Development
  3. Get Started
  4. Morpheus Networking

Introduction to Morpheus Networking

PreviousMorpheus NetworkingNextNetwork Levels

Last updated 1 month ago

Was this helpful?

What is Morpheus Networking?

In MSquared, we replace Unreal's standard networking with our own custom implementation, called Morpheus.

Morpheus is the technology that enables thousands of players and objects to be networked together in the same space, in real time, whilst using the bandwidth of a standard battle royale game.

The fundamental concepts of Morpheus networking are the same as :

  • A single server coordinates multiple clients

  • The basic unit of networking is the actor

  • Actors are synchronised ("replicated") between server and client using two mechanisms:

    • Variable replication

    • RPCs

This document assumes a rough familiarity with these concepts, and focuses on Morpheus's essential differences from Unreal.

Morpheus Actors

In a Morpheus game, only actors that inherit from AMorpheusActor are networked. All other actor types are local-only. If you spawn an AMorpheusActor on the server, it will be replicated to all clients immediately. AMorpheusActors should only be destroyed on the server, and the actor's destruction will also be replicated to all clients immediately.

Each client sees every AMorpheusActor in the world; there is no concept of 'net relevancy' or 'checking in and out' an actor.

Changes to Core Unreal Classes

Since only Morpheus Actors are networked, a number of the core Unreal classes behave slightly differently when using Morpheus networking:

  • GameMode - Functionally the same as native Unreal, except that it adds a default Morpheus Actor class, similar to the Default Pawn Class, and it replaces the normal GameState with a MorpheusGameState.

    • Note that the GameMode is also created on the local client, rather than exclusively existing on the server, since a client using Morpheus networking is configured to be a "standalone" game, rather than a "client", since it does not use native Unreal networking.

  • GameInstance - same as in native Unreal networking. It exists on all machines, but is not networked.

    • NOTE: This cannot be modified by downstream projects. Due to our Worlds setup where a base Morpheus Platform build is launched, and user content is loaded in as a Mod, the game instance used will be the MSquared default, not what is provided by the user's content. This is required to support interoperability between different worlds built on the same platform.

  • GameState - Not used in Morpheus networking. Replaced with a replicated MorpheusGameState (a Morpheus Actor that is replicated, and can be used functionally like a GameState.)

  • GameSession - Not used in Morpheus networking. We handle online services and player connection separately.

  • PlayerController - This is only present on the local client's machine. It is not replicated, and does not exist on the server.

  • PlayerState - This is not networked. It is largely unused and untested with Morpheus networking - if you want replicated player data, you can use the Morpheus Actor.

  • Pawn/Character - This is not networked. For the local player, this works the same as native local-only games. For other players, their in-game representation is determined by their morpheus actor's render target. (See Morpheus Render Targets).

    • If other players' characters are represented with actors, they are also subject to pooling (see Actor Pooling)

Replication

Network Levels

Although every client sees every AMorpheusActor in the world, it may not hold the full state for all of them. On each client, each AMorpheusActor is present at one of three network levels:

  • Background

  • Midground

  • Foreground

Only actors in the foreground are fully replicated.

Authority

Unlike in standard Unreal, a AMorpheusActor may have an authoritative client. This is an immutable property assigned when the actor is spawned. An actor's client authority affects both variable replication and RPCs.

(For how to assign a client authority to an actor, see "Spawning and Destroying" below.)

Variable Replication

RPCs

Morpheus Actor Components

In order to be networked, a component must:

  • Inherit from UMorpheusActorComponent

  • Belong to an AMorpheusActor

  • Be created in its owning actor's constructor, using CreateDefaultSubobject. Components added to existing actors won't be replicated.

Authority and network level are delegated to the component's owning actor.

Variable replication and RPCs work the same way as for AMorpheusActor.

Spawning and Destroying

Spawning an AMorpheusActor

Only the server can spawn replicated AMorpheusActors. You can spawn them from server blueprints, using Unreal's standard SpawnActor functions. In addition, Net Startup Actors that are AMorpheusActors will be automatically spawned and replicated when their level starts up or their sublevel streams in.

By default, an AMorpheusActor has server authority. To spawn an AMorpheusActor with client authority, you must call SpawnMorpheusActorWithClientAuthority on the server. You identify the authoritative client by passing in an AMorpheusClientConnection; this is typically obtained by calling the AMorpheusActor function ServerGetRpcCallerConnection from within the handler for a Server RPC.

Morpheus does not support authority transfer. If a client disconnects, the server destroys any AMorpheusActors which that client had authority over.

Destroying an AMorpheusActor

Only the server can destroy replicated AMorpheusActors, using the standard Unreal Destroy functions.

Lifecycle Events

The call to MorpheusBeginPlay marks the point at which networking functionality becomes available. RPCs sent from within MorpheusBeginPlay are queued up and sent later, once the actor has completed initialization.

For a detailed description of how network levels work, see .

In Morpheus, you can mark blueprint variables for replication the same way you would in Unreal. However, existing Unreal replication features such as RepNotify behave differently in Morpheus. For more information on how these features work and how to apply them in your variable definitions, see .

Morpheus supports the three main types of Unreal RPC: Server, Client and NetMulticast. However, the semantics of these differ from standard Unreal networking. For further information, see .

For AMorpheusActors and UMorpheusActorComponents, there's a single change to the standard . Instead of the standard BeginPlay event, you need to use MorpheusBeginPlay. (BeginPlay still exists, but shouldn't be used - it will print warnings in the blueprint compiler if you do use it.)

in Unreal
Network Levels
Replicated Properties
RPCs
Unreal actor life cycle