LogoLogo
API Status
  • 👋Welcome
  • 🌐What is Morpheus Platform?
    • Interoperability
  • â„šī¸Help
    • 📗Glossary
    • 🆘Support
    • Firewall problems
    • EULA
  • 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
      • 📚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
        • đŸ¤ŧ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"
        • đŸ—ƒī¸User Collections
          • Creating a New Object Definition
          • Accessing from Unreal
            • Creating Objects Definitions
            • Transfer Objects
            • User Collection Views
            • Receiving Updates
        • đŸ“ē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
        • đŸĒŸWeb UI
        • Online Services
          • KV Store Service
        • 💠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
          • đŸ–Ĩī¸Version History
        • âš™ī¸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
      • 📚Useful Reading
        • ⭐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 Reqs
      • đŸŽĨBroadcast
        • 📹OBS Integration
      • Failover
      • 🏁Capacity And Queue Management
  • ADMINS
    • đŸ‘ĒAccess Control
      • Adding metaverse contributors
      • Creating 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
  • Integrations
    • 📊Analytics
      • Sending events from web
      • 🎮Sending Events from Unreal
    • đŸ’ŦChat
      • 🎮Integrating Pubnub with your Unreal Project
      • Adding Moderation to Chat
Powered by GitBook
On this page
  • Arguments
  • Server RPCs
  • Client RPCs
  • NetMulticast RPCs
  • RPC Guarantees

Was this helpful?

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

RPCs

PreviousReplicated PropertiesNextMorpheus Render Targets

Last updated 1 month ago

Was this helpful?

In Morpheus, Remote Procedure Calls (RPCs) are defined the same way as in vanilla Unreal, but have some important differences in behaviour.

As with all Morpheus networking, Morpheus RPCs are restricted to classes that inherit from AMorpheusActor or UMorpheusActorComponent. RPCs on other classes won't work.

Arguments

RPCs can take any number of arguments.

RPC arguments can use the same types as standard Unreal networking, with one exception. Object references must be references to:

  • Morpheus actors

  • Morpheus actor components

Server RPCs

In Morpheus, any client can invoke any Server RPC on any AMorpheusActor. The RPC is executed on the server. The server can also invoke a Server RPC itself, in which case it will be executed locally.

Helper functions

There are four special AMorpheusActor functions you can call from within the handler for a Server RPC:

  1. AuthoritativeClientCalledServerRpc checks whether the RPC was invoked by the client which has authority over the actor. (You can use this to emulate the standard Unreal semantics, where only the authoritative client can call a Server RPC.)

  2. ServerCalledRpc checks whether the RPC was invoked locally, i.e. by the server.

  3. ServerRPCCallerOwnsActor accepts an AMorpheusActor. It checks whether the RPC was invoked by the connection which has authority over the given actor. This is useful for Singleton type actors that need an auth actor passed in to do their work.

  4. ServerGetRpcCallerConnection returns the AMorpheusConnectionwhich invoked the RPC - either a client or the server. (This becomes complicated when working with bots - see .)

There are also corresponding functions with the same names on UMorpheusActorComponent. Please note that if an RPC is called on the component, you should check these functions on the component directly, not the owning actor.

Client RPCs

In Morpheus, the server or any client can invoke any Client RPC on any AMorpheusActor. The RPC is executed only on the authoritative client.

From within the handler of a Client RPC, you can use the AMorpheusActor function ServerCalledRpc to determine whether the RPC was invoked by the server. (You can use this to emulate the standard Unreal semantics, where only the server can call a Client RPC.)

NetMulticast RPCs

In Morpheus, both server and client can call NetMulticast RPCs. A NetMulticast RPC will be executed locally when called and then, if invoked from...

  • the authoritative server: it will also be executed on all clients with this AMorpheusActor in the foreground network level.

  • the authoritative client: it will also be executed on the server and all clients with this AMorpheusActor in the foreground network level.

  • a non-authoritative client: it won't be executed anywhere else.

From within the handler of a NetMulticast RPC, you can use the AMorpheusActor function ServerCalledRpc to determine if the server invoked the RPC. This can be used on the client to determine that the RPC was called by the server as opposed to another client, or on the server to handle the local execution of the RPC. Use the AMorpheusActor function IsOnClient to handle these cases separately.

RPC Guarantees

The Morpheus system has semantics and behaviour that may not be immediately obvious. This is a non-exhaustive list of semantics we offer for external developers to use as a reference, and for internal developers to refer to when making changes.

Salient Ordered Channels

Multicast RPCs from clients and Client Authoritative Entity Data offers ordering when sent from the same client.

Server to Client RPCs and Authoritative Client Entity Deletions offers ordering as both will be sent from the server.

Multicast RPCs from servers, Server Authoritative Entity Data and Server Authoritative Owner Only Entity Data offers ordering as all will be sent from the server.

In other words, in Morpheus, RPCs of the same type on the same actor are guaranteed to be executed in the same order they were called. For example:

  1. The server invokes two RPCs on MorpheusActor_A: first NetMulticastRPC_1, then NetMulticastRPC_2.

  2. The client executes NetMulticastRPC_1 first, then executes NetMulticastRPC_2.

Non-Ordered Channels

An example of a pair of channels that you might think would be ordered but are not is Server Authoritative Entity Data and Authoritative Client Entity Deletions.

In Morpheus, different types of RPCs are NOT guaranteed to be executed in the same order. For example:

  1. The server invokes two RPCs on MorpheusActor_A: first ClientRPC_1, then NetMulticastRPC_1.

  2. The client will NOT necessarily execute ClientRPC_1 first.

Reliability

Morpheus RPCs are always reliable even if you marked them as unreliable.

As long as your client is connected, it will receive all RPCs sent to it.

Morpheus offers some ordering guarantees in order to try and match some Unreal semantics. See in the morpheus-core repository for more information on what these are and how we offer them. Because this repository is available to Improbable developers only, a subset of the doc relevant to Unreal development is exposed here:

🎮
⚡
📡
this doc
Stably named objects
here