Skip to content

skymeson/MirrorNG

 
 

Repository files navigation

Mirror Logo

Documentation Forum Discord release openupm

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

MirrorNG is a high level Networking API for Unity.

MirrorNG is built and tested for MMO Scale Networking by the developers of Cubica.

MirrorNG is optimized for ease of use and probability of success.

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

Architecture

The Server & Client are ONE project in order to achieve an order of magnitude gain in productivity.

Comparison with Mirror

When migrating a project from Mirror to MirrorNG, these will be the most notable differences.

MirrorNG Mirror
Install via Unity Package Manager Install from Asset Store
Domain Reload
Errors are thrown as exceptions Errors are logged
[ServerRpc] [Command]
[ClientRpc(target=Client.Owner)] [TargetRpc] ass of Synclist
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 IMessageBase
Supports Unity 2019.3 or later Supports Unity 2018.4 or later
Components can be added in child objects Components must be added at root level

If you look under the hood, the code base has some significant diferences based on the core values of each project

  • MirrorNG tries to adhere to the SOLID principles.
  • Mirror uses singletons. MirrorNG avoids singletons and static state in general.
  • MirrorNG has better Test Coverage
  • MirrorNG has much lower Technical Debt
  • MirrorNG values code quality, Mirror values API stability

Installation

If you want to make a game with MirrorNG, the preferred installation method is Unity Package manager.

If you are using unity 2019.3 or later:

  1. Install git
  2. Open your project in unity
  3. Click on Windows -> Package Manager
  4. Click on the plus sign on the left and click on "Add package from git URL..."
  5. enter https://github.com/MirrorNG/MirrorNG.git?path=/Assets/Mirror
  6. Unity will download and install MirrorNG

If you are using unity 2019.2, you can use openupm or you can manually add the url to your packages.json file.

Alternatively you can download it from Download Mirror. You will need to install some dependencies yourself such as cecil.

Development environment

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

Linux and Mac

  1. Install git
  2. clone this repo
  3. Open in unity 2019.4.x or later

Windows

  1. Install git or use your favorite git client
  2. as administrator, clone this repo with symbolic links support:
    git clone -c core.symlinks=true https://github.com/MirrorNG/MirrorNG.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 MirrorNG but Unity will not see the examples.
  3. Open in unity 2019.4.x or later

Transports

MirrorNG currently supports the following low level networking transports:

Contributing

There are several ways to contribute to this project:

  • Pull requests for bug fixes and features are always appreciated.
  • Pull requests to improve the documentation is also welcome
  • Make tutorials on how to use this
  • Test it and open issues
  • Review existing pull requests
  • Donations

When contributing code, please keep these things in mind:

  • KISS principle. Everything needs to be as simple as possible.
  • An API is like a joke, if you have to explain it is not a good one. Do not require people to read the documentation if you can avoid it.
  • Follow C# code conventions.
  • Follow SOLID principles as much as possible.
  • Keep your pull requests small and obvious, if a PR can be split into several small ones, do so.

About

A community replacement for Unity's abandoned UNET Networking System.

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages

  • C# 99.9%
  • Shell 0.1%