realvirtual.io
  • Building Digital Twins with Unity and realvirtual.io
  • Basics
    • Installation
    • Demo Model
      • Old Demo Model
    • Editor User Interface
      • Hierarchy Window
      • 3D Views
      • Quick Edit
      • Move Pivot Points (Pro)
      • Selection Window (Pro)
      • Material Window (Pro)
      • Measurement (Pro)
      • Kinematic Tool (Pro)
      • Model Checker
    • Runtime UI
      • Group Manager
      • Debug Console
      • Responsiveness
      • Runtime Persistence
    • Importing and exporting
    • Folder structure
    • Tutorial
    • Physics
    • CAD import (Pro)
      • CADLink (Pro)
      • CAD Checker (Pro)
      • CAD Updater (Pro)
    • Reusable Components (Prefabs)
    • Cadenas parts4cad
    • Publishing the Digital Twin
    • Revision management
  • News
  • Login & Download Updates (Pro)
  • Components & Scripts
    • Realvirtual
      • Environment Controller
    • MU, Source and Sink
      • Source
      • Sink
    • Motion and Kinematic
      • Drive
      • Kinematic
      • Group
      • Joint
      • CAM
      • TransportSurface
      • Guided Transport
      • Drive behavior
      • Chain
      • Chain element
      • Motion for developers
    • Sensors
      • Sensor
      • Measure
      • MeasureRaycast
    • Picking and Placing MUs
      • Grip
      • Gripper
      • Fixer
      • Pattern
    • Changing MUs
      • MaterialChanger
      • PartChanger
      • Cutter
    • Scene Interaction
      • 3D Buttons
      • Screen Overlay Buttons
      • Scene Selectables
      • Lamp
      • Interact3D
      • UI components
      • HMI components (Pro)
        • Start your own HMI
        • HMI Tab
        • HMI DropDown
        • HMI Puschbutton
        • HMI Switch
        • HMI Value
        • HMI Text
        • HMI Slider
        • HMI Message
        • HMI Marker
      • ModelZoo (Pro)
    • Interfaces
      • Interface Tools
        • Signal Manager
        • Signal Importer Exporter
        • Signal Catcher
        • OnValueChangedReconnect
      • Signal Importer / Exporter
      • ABB RobotStudio (Pro)
      • Denso Robotics (Pro)
      • EthernetIP (Pro)
      • Fanuc (Pro)
      • FMI
      • Igus Rebel
      • MQTT (Pro)
      • Modbus (Pro)
      • OPCUA (Pro)
      • PLCSIM Advanced (Pro)
      • RoboDK (Pro)
      • RFSuite (Pro)
      • SEW SimInterface (Pro)
      • Siemens Simit Interface (Pro)
      • Simit Shared Memory (Pro)
      • Simulink (Pro)
      • S7 TCP
      • TwinCAT (Pro)
      • TwinCAT HMI (Pro)
      • UDP (Pro)
      • Universal Robots (Pro)
      • Wandelbots Nova (Pro)
      • Websocket (Pro)
      • Windmod Y200 (Pro)
      • Custom Interfaces
    • Performance Tools
      • Combine Meshes (Pro)
      • Create Prefab (Pro)
      • Hierarchy Cleanup (Pro)
      • Mesh Optimizer (Pro)
      • Performance Optimizer (Pro)
    • Defining Logic
      • Unity Scripting
      • Behavior Graph
      • Logicsteps
      • Unity Visual Scripting
      • Recorder
    • Robot Inverse Kinematics (Pro)
    • Volume Tracking (Pro)
  • Multiplayer (Pro)
  • Extensions
    • ModelZoo
      • Beckhoff TwinCAT
      • Siemens S7
      • Denso Cobotta 1300
      • Wandelbots Nova Fanuc CRX
      • Universal Robots UR10
      • Fanuc Roboguide
    • realvirtual.io AIBuilder
      • realvirtual.io AI Builder Overview
      • Generate AI Training Data
      • AI Training
      • Testing AI in a Digital Twin
      • Deploying the AI
    • realvirtual.io Simulation
      • Conveyor Library
      • Path System
        • Path finding
        • Line
        • Curve
        • Workstation
        • Catcher
        • Pathmover
    • realvirtual.io Industrial Metaverse
      • Setup Guide
      • VR Modules
      • AR Modules
      • Multiuser
    • AGX Physics
    • VR Builder
    • CMC ViewR
  • Advanced Topics
    • Render Pipelines
    • Mixed Reality with Meta Quest3
    • Upgrade Guide
      • Upgrade to 2022
    • Open Digital Twin Interface
    • Usefull Addons
    • Improving Performance
    • Supported Platforms
    • Compiler Defines
    • For Developers
      • Important Classes and Interfaces
      • Assembly Definitions
      • Starting your development
      • Class documentation
      • realvirtual Init Sequence
      • realvirtualBehavior Lifetime Methods
      • Testing
    • Newtonsoft JSON
    • Troubleshooting
  • Release Notes
  • AI Digital Twin Assistant (GPT4)
  • License Conditions
Powered by GitBook
On this page
  • Overiew
  • First steps with the demo model
  • Multiuser components
  • Multiuser Connection
  • Imverse Components
  • Multiuser Connection Status
Edit on GitHub
  1. Extensions
  2. realvirtual.io Industrial Metaverse

Multiuser

Multiuser Functionality in realvirtual.io

PreviousAR ModulesNextAGX Physics

Last updated 10 months ago

Overiew

realvirtual.io offers multiuser functionality, enabling seamless collaboration and synchronization across multiple computers or running Unity instances. This feature synchronizes drive positions, signals, and multi-user (MU) positions between a designated host and connected clients. Here’s how it works:

Key Features:

  • Synchronization: All drive positions, signals, and MU positions are synchronized between the host and clients in real-time.

  • Host Configuration: There is always one designated host in the system responsible for physics simulation, including collision detection and resolution.

  • Networking Setup: Currently utilizes Mirror networking framework (visit ) for local network communication, ensuring efficient data exchange within local environments.

Development is underway for a Socket.io-based communication layer, expanding connectivity capabilities beyond local networks. This upcoming feature will enable cross-boundary communication, facilitating connections across different networks and environments.

First steps with the demo model

For a quick start, we recommend using the demo model located at Assets/realvirtual-XR/DemoMultiuser.unity. Follow these steps:

  1. Compile the Demo Model to Build:

    • Add the demo scene to the build settings in Unity.

    • Build the project as a Windows executable.

  2. Connecting to Unity Editor:

    • Start the built executable.

    • Switch to client mode using the UI at the bottom of the screen by selecting "Client".

    • The scene will operate in standalone mode until a host joins.

Now start the same scene in your Unity editor and switch, if necessary, to "Host" mode. Once the client is connected, you will see a message similar to this:

Now you can control the scene in the Unity editor. For instance, move some MUs using your mouse in scene mode, and you will see that the client exactly follows these positions.

Multiuser components

Multiuser Connection

The main component of the multiuser functionality is the "MultiuserConnection," which is available as a prefab located at Assets/realvirtual-XR/MultiuserConnection.prefab.

Imverse Controller

Within this prefab, the "ImverseController" automatically adds "Imverse" components to all necessary components in the scene that require synchronization. This process occurs dynamically based on whether the client is entering as a host or when clients are connecting to the host.

Imverse Communication Mirror

The "ImverseCommunicationMirror" component within the Multiuser Connection handles the Mirror connection setup. Here's how you can configure it:

  • IsHost: Set this to true if you want this instance to act as the host. Set it to false if it should act as a client.

  • AutoConnect: When enabled on the client side, it automatically attempts to connect to a host when the application starts.

  • Network Address: On the client side, specify the network address where the host is running. For example, use "127.0.0.1" for localhost. This setting is ignored on the server side.

Imverse Components

Once the connection is established, components such as Drives in the scene are equipped with an additional "ImverseDrive" component. These components manage key information including an ID (e.g., /ConveyorBox) and a Status (e.g., "Owner"). The ID uniquely identifies synchronized components based on their path within the scene. It's crucial to maintain unique naming conventions within each path to avoid conflicts. This uniqueness is automatically verified at the simulation's start, and any issues with non-unique naming are logged in the console.

When a component acts as an owner, it sends information to all connected clients. Conversely, if a component acts as a consumer, it receives information from the owner.

The following Imverse Components are available:

  • ImverseDrive: Added to all Drives for syncing their position, represented as a float value.

  • ImverseMU: Added to all MUs (Moving Units) for syncing their position (Vector3) and rotation (Quaternion).

  • ImverseUser: Added to the User, syncing their position and rotation. The position of the local User is always synchronized to the camera's position in the local instance. For other users, their positions are synchronized to their respective positions.

  • ImverseSignal: Syncs signal values across connected instances.

These Imverse components facilitate seamless synchronization of positions, rotations, and signals across the networked environment, ensuring consistent simulation experiences for all connected users.

Multiuser Connection Status

The "MultiuserConnectionStatus" prefab, found at Assets/realvirtual-XR/MultiuserConnectionStatus.prefab, serves as a UI display element for managing Client and Host modes within your scene. To integrate this prefab, simply drag it into your scene where required.

This prefab is responsible for managing Host and Network settings within the "ImverseCommunication." If you opt not to use this prefab, you'll need to manually configure these settings within the Multiuser Connection component.

For more advanced users and custom development, consider using Parallelsync, available on GitHub at . Parallelsync allows running multiple Unity instances on the same project simultaneously. However, for basic functionality, compiling the build as instructed above is sufficient.

Mirror
ParrelSync
Demo scene as windows build in client mode, waiting for a host connection
Message on the host after client is connected