Code Monkey home page Code Monkey logo

mirage's Introduction

Documentation Discord release openupm

Build Quality Gate Status SonarCloud Coverage Lines of Code Technical Debt Code Smells

What is Mirage?

Mirage is a rolling-release high level API for the Unity Game Engine that provides a powerful, yet easy to use networking API. Be it a online MMO, co-op adventure game or a first person shooter, Mirage improves your networked projects' probability of success significantly. With its modular structure, Mirage lets you unleash maximum performance out of your networking.

Networked objects in the client are mirror images of the objects in the server, and the API provides all the tools necessary to keep them in sync and pass messages between them.

Mirage is a rolling-release network stack. With every update, you get the latest features and bug fixes. You are encouraged to diagnose, report and help fix bugs that you find: Issue tickets will be investigated, feature requests are considered and pull requests are regularly reviewed.

Mirage is built by passionate network engineers and is backed by a friendly community.

Installation

To install Mirage, follow these steps:

  1. Mirage requires at least Unity 2020 LTS. You may install Unity 2020 LTS via the Unity website or via the Unity Hub.
    You may use newer versions, however LTS versions are strongly recommended as newer versions can contain bugs, glitches or just flat out break game projects.
  2. Start a new project or open your existing one. If opening an exsiting one, it is strongly recommended to back it up before installing Mirage.
  3. Add the OpenUPM registry. Click on the Edit menu, then select Project settings..., select Package Manager and add a scoped registry like so:
    Name: OpenUPM
    Url: https://package.openupm.com
    Scopes:
    • com.cysharp.unitask
    • com.openupm
    • com.miragenet Scoped Registry
  4. Close the project settings.
  5. Open the package manager by clicking on the Window menu and selecting Package Manager. Then select Packages, My Registries, select the latest version of Mirage and click install, like so: Install Mirage
  6. You may come back to the package manager at any time to uninstall Mirage or upgrade it.

Migrating from Mirror

If you've got a project already using Mirror and you want to migrate it to Mirage, it's recommended to check out our Migration Guide for a smooth transition. Also check the heading below, as there are some major differences between Mirage and the other network library.

Comparison with Mirror

Mirage has some notable differences from its distant sister, Mirror. The table below briefly details them:

Mirage Mirror
Installs via Unity Package Manager Installs from Asset Store
Errors are thrown as exceptions Errors are logged
[ServerRpc] [Command]
[ClientRpc(target = RpcTarget.Owner)] [TargetRpc]
Subscribe to events in NetworkServer Override methods in NetworkManager
Subscribe to events in NetworkClient Override methods in NetworkManager
Subscribe to events in NetworkIdentity Override methods in NetworkBehaviour
Methods use PascalCase (C# guidelines) No consistency
NetworkTime available in NetworkBehaviour NetworkTime is global static
Send any data as messages Messages must implement NetworkMessage
Supports Unity 2020 LTS or later Supports Unity 2019 LTS or later
Offers simple Socket API to implement new protocols Each protocol requires a new transport

Some notable features that Mirage has:

  • Fast play mode support
  • Clients can connect to multiple servers - for example, be connected to a chat server while connected to a game server
  • Components can be added in child objects
  • Modular API: You only use the components you need
  • Error handling
  • Version defines
  • Server Rpcs can return values
  • Bit packing to help compress values and reduce bandwidth

Peeking under the hood, Mirage is built upon fundamental pillars:

  • Mirage avoids singletons and static state in general
  • Mirage follows the SOLID principles
  • Mirage has high Test Coverage
  • Mirage has low Technical Debt

Development environment

If you want to contribute to Mirage, follow these steps:

Linux and Mac

  1. Install the git client
  2. Clone this repo
    cd /path/to/somewhere/on/your/disk
    mkdir MirageNetworking
    git clone https://github.com/MirageNet/Mirage.git MirageNetworking
  3. Open the newly cloned repo in Unity 2020 LTS or later.

Windows

  1. Install git or use your favorite git client (Fork, SourceTree, etc)
  2. As administrator, clone this repo with symbolic links support using Git Bash:
    cd C:\UnityProjects\DontReallyUseThisExamplePath
    mkdir MirageNetworking
    git clone -c core.symlinks=true https://github.com/MirageNet/Mirage.git
    It you don't want to use administrator, add symlink support to your account. If you don't enable symlinks, you will be able to work on Mirage but Unity will not see the examples.
  3. Open in Unity 2020 LTS or later.

Transport and Sockets

Mirage supports multiple ways of transporting data:

  • Native UDP socket (default on Windows, Mac and Linux) with fallback to C# UDP Sockets (default on other platforms)
  • Steam (Facepunch Steamworks)
  • WebSocket for WebGL clients (SimpleWebSocket)

Contributing

  1. Fork it!
  2. Create your feature branch: git checkout -b my-new-feature
  3. Commit your changes: git commit -am 'Add some feature'
  4. Push to the branch: git push origin my-new-feature
  5. Submit a pull request ๐Ÿ˜ƒ

The team will review it ASAP and give it the stamp of approval, ask for changes or decline it with a detailed explaination.

Thank you for using Mirage and we hope to see your project be successful!

mirage's People

Contributors

paulpach avatar miwarnec avatar james-frowen avatar semantic-release-bot avatar uweeby avatar atlv24 avatar lymdun avatar michalpetryka avatar dragonslaya84 avatar erikas-taroza avatar softwareguy avatar phodoval avatar hertzole avatar mrgadget1024 avatar katori avatar dependabot[bot] avatar timpickup avatar beguiled avatar icezman001 avatar konstantin890 avatar dragonslaya-ss avatar atikadze avatar imerr avatar paulohmattos avatar dmerner avatar rxmarccall avatar shulinnn avatar callumferguson avatar apkd avatar trentish avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.