Mirror
  • Mirror Networking
  • API Reference
  • Development Blog
    • A Brief History of Mirror
  • User Manual
    • General
      • Getting Started
      • Script Templates
      • Change Log
        • 2024 Change Log
        • 2023 Change Log
        • 2022 Change Log
        • 2021 Change Log
        • 2020 Change Log
        • 2019 Change Log
      • Deprecations
      • Migration Guide
      • Integrations
      • Timestamp Batching
      • TCP and UDP
      • CCU
      • SyncDirection
      • Round Trip Time (RTT)
      • Connection Quality
      • Lag Compensation
      • Client Side Prediction
      • History Bounds
      • Tests
      • NetGraph
    • FAQ
      • Execution Order
    • Transports
      • KCP Transport
      • Telepathy Transport
      • WebSockets Transport
        • Reverse Proxy
          • Windows
            • IIS
          • Linux
            • NGINX
            • Caddy
            • Apache
            • HA Proxy
        • SSL
      • Multiplex Transport
      • Latency Simulation Transport
      • Ignorance
      • LiteNetLib Transport
      • FizzySteamworks Transport
      • FizzyFacepunch Transport
      • Encryption Transport
      • Edgegap Transports
        • Edgegap Relay
        • Edgegap Lobby
    • Components
      • Network Animator
      • Network Authenticators
        • Basic Authenticator
        • Device Authenticator
      • Network Behaviour
      • Network Discovery
      • Network Identity
      • Network Manager
      • Network Manager HUD
      • Network Ping Display
      • Network Profiler
      • Network Rigidbody
      • Network Lerp Rigidbody
      • Network Room Manager
      • Network Room Player
      • Network Start Position
      • Network Statistics
      • Remote Statistics
      • Network Transform
        • Snapshot Interpolation
      • Deprecated
        • Network Proximity Checker
        • Network Scene Checker
        • Network Match Checker
        • Network Owner Checker
    • Interest Management
      • Spatial Hashing
      • Distance
      • Scene
      • Scene + Distance
      • Match
      • Team
      • Custom
      • Legacy
    • Guides
      • Authority
      • IDs
      • Attributes
      • Time Synchronization
      • Data types
      • Serialization
      • Synchronization
        • SyncVars
        • SyncVar Hooks
        • SyncEvent (Obsolete)
        • SyncLists
        • SyncDictionary
        • SyncHashSet
        • SyncSortedSet
      • Communications
        • Remote Actions
        • NetworkManager Callbacks
        • NetworkBehaviour Callbacks
        • Network Messages
      • GameObjects
        • Player Game Objects
        • Custom Character Spawning
        • Custom Spawn Functions
        • Scene GameObjects
        • Pickups, Drops, and Child Objects
    • Examples
      • Additive Levels
      • Additive Scenes
      • Basic
      • Billiards
      • Multiple Additive Scenes
      • Pong
      • Room
      • Tanks
      • EdgegapLobby
  • Server Hosting
    • The Pragmatic Hosting Guide
    • Cloud Hosting Guides
      • AWS
      • Google Cloud
      • Oracle Free Tier
    • Hosting with a Remote Desktop
    • Edgegap Hosting Plugin Guide
  • Security
    • Security Overview
    • Cheat Protection Stages
    • Cheats & Anticheats
  • Community Guides
    • Community Translations
    • Video Tutorials
    • Resources
    • Mirror Quick Start Project
    • Unity for MMORPGs
    • Unity Canvas HUD
    • Odin Inspector Support
    • Ready Up And Die!
    • iOS AppStore
    • Mirror Docker Guide
    • Gitbook Guide
    • Mirror Branding
    • Contributors Agreement
    • Documentation License
Powered by GitBook
On this page
  • Interest Management
  • Built-in Systems
  • Final Remarks
  1. User Manual

Interest Management

Documentation for our new global Interest Management system.

PreviousNetwork Owner CheckerNextSpatial Hashing

Last updated 4 months ago

Interest Management

When making multiplayer games, the first obvious approach is to simply broadcast the world state to every player. By default, that's what Mirror does when you don't use any Interest Management components.

Instead of sending the full world state to every player, it's worth considering sending only what's around a player to the player. There are a few major reasons for interest management:

  • Scale: imagine World of Warcraft. Sending the whole world to every single player would be insane. In order to scale to thousands of connections, we need to only send what's relevant to any given player.

  • Visibility: in a MOBA game like DotA/League of Legends, not everyone should see everyone else all the time. A player should only see his own team and monsters around him. Not only that, but players shouldn't see behind walls etc.

  • Cheating: in games like Counter-Strike, players naturally don't see enemies behind walls because the camera wouldn't render them. But if the whole world state is known in memory, then hackers could exploit that by showing players behind a wall anyway.

In other words, interest management is almost always a good idea.

Built-in Systems

Select the Network Manager and add one of the built in Interest Management components.

Final Remarks

The new Interest Management API is fairly simple and allows for heavy customization. We walked through it with the distance based example, which is easy to understand.

You may have noticed that this is a global component, yet all the functions seem to work locally around one Network Identity at a time. There are two reasons for that:

  • Our legacy Interest Management system worked on a per-Network Identity basis (or locally if you will). For the global system, we simply moved those functions into one global component.

    • This allows for global solution like Spatial hashing, while also guaranteeing feature pararity and easy upgrades from the old systems.

    • It's really just the old system moved to a different place. Don't fear it :)

  • Interest Management can be quite complicated with all the spawning and despawning at the right time. Mirror has a whole lot of interest management code in NetworkServer, which simply calls the three functions above.

    • The idea is to shield you from all the complexity. All you need to do is worry about one Network Identity at a time. That's fairly easy to think about.

is the reason why we moved from the legacy per-Network Identity system to a global system and uses one global Vis Range setting that is the same for everything in the scene.

is a parity replacement for Network Proximity Checker.

allows for visual and physics isolation across additive scenes.

is a combination of Scene and Distance above.

isolates players for non-physics card, board, arcade games.

provides for restricting visibility of networked objects to members of a team. This can also be used for owner-only items, replacing Network Owner Checker.

Interest Management provides a template that you can use to create your own system.

Interest Management - Deprecated.

Spatial Hashing
Distance
Scene
Scene Distance
Match
Team
Custom
Legacy
Source: https://www.dynetisgames.com/2017/04/05/interest-management-mog/