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
  • Introduction
  • Morpheus Array
  • When to use a Morpheus Array vs normal Arrays?
  • Using a Morpheus Array in Blueprints
  • Example Blueprint Usages
  • On About to Apply Update Delegate
  • Limitations

Was this helpful?

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

Morpheus Array

This feature is currently in Beta.

Introduction

This document covers when and how to use a UMorpheusArray in Blueprints and the current limitations it has.

Morpheus Array

A UMorpheusArray is a generic replicated container that can be used to efficiently replicate array updates.

UMorpheusArray is only replicated in Foreground and supports any type that a replicated TArray supports.

When to use a Morpheus Array vs normal Arrays?

A Morpheus Array is preferred to be used when:

  • You expect your array to contain 1000s of elements with frequent changes.

  • You need to know when a specific index has been updated in the array.

An example use case can be when you want to keep track of some data for each actor in the game and that data can change during runtime. (e.g Super Emotes)

Using a Morpheus Array in Blueprints

In order to start using a Morpheus Array in Blueprints you do the following:

  • Open your Blueprint that derives from either a MorpheusActor or a MorpheusActorComponent

  • Add a variable to your Blueprint and give it the type Morpheus Array

  • In the variable Details Panel on the right, select the Morpheus Array Inner Type to be your desired type of that Morpheus Array variable.

  • Don't forget to set the Morpheus Array variable to be Replicated

  • Now drag and drop the variable into the BP graph to start using your Morpheus Array using the Morpheus Array specific nodes shown under the Morpheus Array category.

Example Blueprint Usages

Since UMorpheusArray is a replicated type it also supports rep notifies and they do fire even if a single element was updated.

But additionally UMorpheusArray has a couple of helper functions that you can use in the OnRep to know the exact replication changes that we received.

  • UMorpheusArray::OnRepUpdatedIndices() which returns an array of the indices that have been updated by the last replication event.

  • UMorpheusArray::OnRepDeletedIndices() which returns an array of the indices that have been deleted by the last replication event.

With these functions, users can be aware of the changes that happened to the array, rather than having to figure out any changes manually

Example usage:

On About to Apply Update Delegate

Morpheus Arrays has a delegate OnAboutToApplyUpdate that is fired before the OnRep . This delegate can be used to react to incoming element updates/deletions before they are applied to the Morpheus Array itself and losing the old values. See example below:

Notice that the delegate gets called with Keys instead of Indices so you will need to use GetIndexFromKey to retrieve the about to be updated/deleted index in the Morpheus Array.

There is also another helper function GetKeyOfIndex that retrieves the Key of a given index.

Keys vs Indices

A Key in a Morpheus Array is a unique identifier for a Morpheus Array element.

Since elements in the Morpheus Array can get added or removed the Index becomes insufficient to represent the element as it could now be pointing to a different element.

Every Key is mapped to an Index in the array and whenever an Index is removed, its Key will also get removed but the remaining keys will still point to the same elements despite having their indices changed.

An update to an element doesn't affect the Key nor the Index of that element.

Limitations

  1. AMorpheusActors that own a UMorpheusArray and aren’t in Foreground will still need to checkout the whole array once they enter Foreground. In which case, a UMorpheusArray will not be replicated efficiently.

  2. Using the Get node and the ToArray nodes in Blueprints will currently return copies of the values inside the UMorpheusArray so bear in that in mind if performance is a concern.

  3. Debugging a UMorpheusArray may not be trivial as the data is stored internally as a raw byte buffer so you might need to write extra code to view the contents of the UMorpheusArray while debugging it.

PreviousMorpheus Render TargetsNextNetworking FAQ

Last updated 7 months ago

Was this helpful?

🎮
⚡
📡