Unity Networking Frameworks - Feature List
Unity Networking Frameworks - Feature List
UPDATE: Added a table of comparison, which can be found at the following link (still
a work in progress): link.
Important Concepts
High and Low level Frameworks. Backend services.
High Level
Low Level
Backend Services
Server
Authority /
Authoritative
Dedicated Servers
Listen Servers / Client Hosted
Master Servers / Matchmaking / Listing Servers
Relay Servers
NAT (punchthrough)
CCU
Backend Services
Important Concepts
Netcode 101: https://www.youtube.com/watch?v=hiHP0N-jMx8
High Level
High level frameworks abstract away some aspects of the networking. An example of this
would be a framework that allows you to place an object that runs the game, and handles
the game state without you needing a detailed description.
Low Level
In contrast, Low level frameworks will give you much more detailed information. An example
would be attaching a script to a gameobject that requires you to setup the IP you’re trying to
connect to, what the port is, etc.
Backend Services
Todo
Server
Usually a computer, which is dedicated to receive and send information from and to other
computers (other players). If the server also simulates the game world (running physics,
moving characters etc) it is commonly referred to as a Dedicated Server. If the server exists
only for sending and receiving information (without doing any game simulation such as
physics, AI etc) it is commonly referred to as a Relay Server (Relay Service). There are also
master servers, which are used to provide information to clients about all the dedicated
servers currently online.
Authority / Authoritative
Authority means having the rights to dictate how things should be. It also means the subjects
of the authority oblige to the commands given by the authoritative figure. When people talk
about authoritative dedicated game servers they usually mean dedicated servers, which
decide the current state of the game. In this model every other client agrees with the
dedicated server.
Dedicated Servers
Dedicated servers usually refer to authoritative dedicated game servers. These are servers,
which receive data from clients and send data to clients. They also process the data
received. For example if a player sends a request to open the door then the server will open
the door (unless the request from the player was invalid) and will propagate that change to
every other player (including a confirmation that the door was opened, to the player who
requested the door to be opened).
While players can use their own computers to host these servers so others could join (see
Listen Servers / Client Hosted), the usual use case is to rent a server somewhere online
(monthly or annual fees). On these rented machines, the game server (an executable server
program) will run. These servers can be reached with a public IP, and NAT (see below)
won’t be a problem. Also, the service providers (companies that run the computers/servers)
are the ones who make sure that their computers/servers actually run (management costs).
NAT (punchthrough)
Excellent video that explains the concept of NAT.
NAT stands for “Network Address Translation”. In simple terms this means converting a
given IP address to another IP address.
TODO: add more...
CCU
CCU is a numerical integer value, which stands for concurrent users. This is the amount of
users that are currently, at this specific time, playing your game and using whichever
network service you provide. The more players that are currently playing your game and
thus using the networking solution you provide them, the more resources have to be used by
the networking solution. The more resources are used, the higher the cost of providing the
networking solution. Several frameworks and their versions (Photon, Mirror ListServer) use
the count of CCU to determine the cost of monthly fees or the initial buying price. The higher
you expect the maximum player count to be at any given time, the higher the resource usage
of the hardware, and thus the more you have to pay.
High Level Frameworks
Mirrormir
Links
Home: https://mirror-networking.com/
Documentation: https://vis2k.github.io/Mirror/
Discord: https://discordapp.com/invite/N9QVxbM
Description
Mirror is an open source networking solution whose concepts are very similar to a soon-to-
be deprecated UNET (Unity’s old networking solution). These concepts are easy to grasp
and thus make development with Mirror a breeze. With Mirror it is possible to easily switch
between different Transport layers (RUDP, TCP, Sockets). While it does not have many
built-in comfort features compared to some other networking solutions, it is possible to get
some of these features by using certain assets from the Unity asset store.
Pricing
Purchase cost: Free
Monthly license payments: None
Source code: Open source
Connection options
Connection model: Client/Server
Offline LAN support: Yes
Multicast for discovering LAN games: Built-in
Offline mode: Yes
Built-in matchmaking: No
Built-in NAT punchthrough: No
Relay: Requires self development or easily added with 3rd party assets.
Direct IP: Yes
P2P: No (supports listen server)
Cross-platform: Desktop, Mobile, Web, Console
In order to get matchmaking, NAT punchthrough and relay service, a good option would be
to use a combination of Mirror + List Server + Noble Connect. List Server provides the
matchmaking service and Noble Connect allows players to actually connect if a player
hosted game is behind NAT. And if that fails, Noble Connect will use a relay server to
connect the players.
An Alternative to List Server would be Match Up.
Due to NAT punchthrough, the relay service etc. not being available by default, Mirror leans
toward public dedicated servers than self hosted home servers.
Additional Services
Used for listing game servers, which other people can join. You have to host the list server
on a dedicated server on the internet (additional monthly/annual fees for the dedicated
server).
Move networking load out of Unity. Low level networking is not handled in Unity but in
a standalone executable, which is used to handle large scale TCP connections.
Learning material
TODO
Photon Bolt
Links
Home: https://www.photonengine.com/en-US/BOLT
Documentation: https://doc.photonengine.com/en-us/bolt/current/getting-started/overview
Discord: https://discordapp.com/invite/0ya6ZpOvnShSCtbb
Forum: https://forum.photonengine.com/categories/bolt-engine
Description
Bolt networking is a feature rich networking solution, which has gotten its inspiration from
Tribes Networking, Halo Reach Networking and Source Engine Multiplayer Networking. It
supports 4 main architectures (dedicated servers, listen and client hosted servers, P2P,
LAN/WLAN). It is developed by Photon and its price is based on CCU.
Pricing
Purchase cost: Free or Paid (What is the difference?)
Monthly license payments: CCU based (Pricing)
Source code: Closed source (might get access with special requests)
Connection options
Connection model: Client/Server
Offline LAN support: Yes, but for extra fees
Multicast for discovering LAN games: Built-in
Offline mode (single player): Yes
Built-in matchmaking: Yes
Built-in NAT punchthrough: Yes
Relay: Built-in
Direct IP: Yes, but for extra fees
P2P: Yes (2 players. Still counts CCU)
Cross-platform: Desktop, Mobile, Web, Console
Photon Bolt allows users to host dedicated servers, both public and private (local). It is also
possible to host a Listen Server and a Client Hosted server. P2P is also an option with NAT
punchthrough and relay fallback. Unless you pay for an extra license (Arcade mode or a
special offline mode) the CCU is always counted. The exception is single player mode (you
can use the code written for multiplayer in a single player offline environment). Even in the
case of direct connection CCU is counted. If no dedicated servers are used and NAT
punchthrough fails, Photon’s relay service is used to ensure connection between players.
It is easy to build Authoritative game logic with built-in features such as hitbox rewinding, lag
compensation, client side prediction with reconciliation and more (see the Feature Table for
additional information).
Bolt is capable of handling many such use cases regarding client and server authority: link.
Learning material
Photon Unity Networking V2
Links
Home: https://www.photonengine.com/en-US/PUN
Documentation: https://doc.photonengine.com/en-us/pun/current/getting-started/pun-intro
Forum: https://forum.photonengine.com/categories/unity-networking-plugin-pun
Description
Photon Unity Networking is a powerful yet easy to use networking solution, which is most
commonly used for room based (short play time and small amount of players) multiplayer
experiences. Its strongest selling points are ease of use and guaranteed connectivity
between players. It is a semi-authoritative solution, which uses relay servers to keep players
connected, while one of the players acts as a host (an authoritative figure; players are
connected via the relay server and not the player considered the “host”).
Pricing
Purchase cost: Free
Monthly license payments: CCU based (Pricing)
Source code: Low level dll (de/serialization and network protocols on top of sockets) closed
source. High level open.
Connection options
Connection model: Client/Client (Client hosted)
Offline LAN support: No
Offline mode (single player): Yes
Built-in matchmaking: Yes
Built-in NAT punchthrough: No (Not needed)
Relay: Built-in
Direct IP: No
P2P: No
Cross-platform: Desktop, Mobile, Web, Console
In PUN one of the players acts as a host and thus is authoritative over the game state. All of
the connection happens via the Photon relay. This ensures over 99% connectivity (fails only
if Photon’s relay servers fail) with no NAT problems. Compared to Photon Bolt, PUN does
not have an option to directly connect players. This means players will always use the relay
service even if direct connection and NAT punchthrough would be possible. With its built-in
matchmaking, people can easily discover games created by other players (filters are also an
option in matchmaking). LAN play is not possible and for people to play with each other,
internet connection at all times is a must. PUN offers an offline mode for using the code
written around PUN to be used in single player experiences. The relay service also provides
a very simple host migration implementation.
Learning material
Forge Networking Remastered
Links
Home: https://developers.forgepowered.com/
Documentation: http://docs.forgepowered.com/
Discord: https://discordapp.com/invite/yzZwEYm
Forum: https://forum.unity.com/threads/no-ccu-limit-forge-networking-now-open-
source.286900/
Description
Forge is an open source networking framework, which in its hosting implementation is similar
to Mirror. There are no CCU costs as you have to host your own dedicated servers or let
your players do it. In addition Forge provides methods for NAT punchthrough, setting up a
master server, lan discovery and a Steamworks P2P integration. Similarly to Bolt it also has
a network wizard, which allows you to set up networked entities quickly and without code.
Pricing
Purchase cost: Free
Monthly license payments: None
Source code: Open source
Connection options
Connection model: Client/Server
Offline LAN support: Yes
Multicast for discovering LAN games: Built-in
Offline mode (single player): Yes
Built-in matchmaking: Yes
Built-in NAT punchthrough: Yes
Relay: Requires self development.
Direct IP: Yes
P2P: Steamworks P2P
Cross-platform: Desktop, Mobile, Web, Console
Unity NetCode (Formally MLAPI)
Links
Home: https://mlapi.network/
Documentation: https://mlapi.network/wiki/home/
Discord: https://discord.gg/FM8SE9E
Forum: https://forum.unity.com/threads/mlapi-hlapi-replacement.511277/
Github: https://github.com/MidLevel/MLAPI
Description
A high level open source framework with many features available (and many on the
roadmap). Its high level components are very similar to UNET and Mirror. Developed by a
very active (both when writing code and helping on Discord) one person team. At the time of
writing, compared to other frameworks, this one is less popular, as it was introduced by the
developer only lately, and with the lack of example projects, minimalistic documentation and
lack of tutorials online, it has yet to gain traction. However, with the features currently
offered, the tempo of development and if examples and tutorials were to be added, MLAPI
has the potential to become a choice for many developers.
Pricing
Purchase cost: Free
Monthly license payments: None
Source code: Open source
Connection options
Connection model: Client/Server
Offline LAN support: Yes
Multicast for discovering LAN games: Yes
Offline mode (single player): Yes
Built-in matchmaking: No (in development)
Built-in NAT punchthrough: Available as a free asset (link). Requires self hosting.
Relay: Available as a free asset (link). Requires using UNET low level transport (built-in).
Requires self hosting.
Direct IP: Yes
P2P: Steamworks P2P
Cross-platform: Desktop, Mobile, Web, Console
Low Level Frameworks
Dark Rift 2
Links
Home: https://darkriftnetworking.com/DarkRift2
Documentation: https://darkriftnetworking.com/DarkRift2/Docs/
Discord: https://discordapp.com/invite/cz2FQ6k
Forum: https://forum.unity.com/threads/darkrift-networking-2.516271/
Description
Considered as a low level network with high performance. Compared to the solutions above,
it will most likely require more development time, as the high level features available in other
solutions have to be developed on your own. This framework exposes minimal functionality
(connected/disconnected events and messages received events), which can be used to
develop your own high level solutions. Great for customization, as writing server plugins is
easy. Supports running both graphical and headless instances built from Unity, but also a
command line instance of the Dark Rift server. The latter removes any overhead that comes
with building from Unity (the downside is that you lose the ability to work with Unity’s physics
or navmesh system on the server). Harder to get started and recommended for more
experienced users. Though, for learning low level networking concepts, this framework
provides an excellent base.
Pricing
Purchase cost: Free + Pro (~90 euros)
Monthly license payments: None
Source code: Comes with Pro (~90 euros)
Connection options
Connection model: Client/Server
Offline LAN support: Yes
Multicast for discovering LAN games: Requires self development
Offline mode (single player): Yes
Built-in matchmaking: Yes (Pro version only)
Built-in NAT punchthrough: Requires self development.
Relay: Requires self development.
Direct IP: Yes
P2P: Steamworks P2P
Cross-platform: Desktop, Mobile, Web, Console
Due to missing built-in features such as the List Server, NAT punchthrough, easily
attachable relay services and Multicast, connecting players is considered more difficult
compared to other solutions. Easy to achieve connection in a local network (via direct IP.
Though remember, it has no built-in multicast for lan discovery) and a little bit more difficult
to connect via dedicated server (requires dedicated server setup and possibly a list server).
Harder to connect players directly as this will most likely require NAT punchthrough but if the
punchthrough fails, the players won’t be able to connect. A workaround for punchthrough
failure would be to add relay servers but this might take way more time to setup as there are
no 3rd party relay solutions that are aimed for Dark Rift 2.
Learning material
Link: https://lestaallmaron.github.io/EmbeddedFPSExample/guide/introduction.html
Building an FPS game. An excellent tutorial for setting up Dark Rift 2, a simple login system,
room system, lobby system, player movement with client side prediction and reconciliation
and lag compensation. If your aim is to build Unity based servers (headless or not), definitely
start from here.
Link: https://materiagame.com/2019/02/06/darkrift-2-networking-for-unity-3d-part-1-concepts
Building an FPS game. Again, uses a Unity build for hosting the Dark Rift server. While this
tutorial should not be used as a learning material for setting up your netcode architecture, it
is pretty good at covering certain topics and functions that DR2 has to offer. Provides a
simpler implementation of player reconciliation, which is a great learning material.
Link: https://darkriftnetworking.com/DarkRift2/Docs/2.3.1/html/b2e42bf1-afb0-43ec-8e84-
da08b3527d61.htm
Building an Agar.IO game. Dark Rift 2-s official tutorial for setting up a console based server
(not one built from Unity). Teaches you how to write plugins and follows a pretty good coding
standard. Installation and setup might be more difficult as this deviates from other methods
of implementing a networking library. Instead of having 1 project in Unity, you will create a
Unity project and a Visual Studio project (independent from Unity). You will need to set some
references (adding .dll files to the project in order to access their classes, methods and
variables). However, this provides an excellent example of how to build a networked game
where server-side code and client-side code is completely separated.
SmartFoxServer
Links
Home: https://www.smartfoxserver.com/products/sfs2x#p=intro
Documentation: http://docs2x.smartfoxserver.com/ExamplesUnity/introduction
Forum: https://forum.unity.com/threads/smartfoxserver-multiplayer-games-engine.568357/
Description
Pricing
Purchase cost:
Monthly license payments:
Source code:
Connection options
Connection model: Client/Server
Offline LAN support: Yes
Multicast for discovering LAN games:
Offline mode (single player):
Built-in matchmaking:
Built-in NAT punchthrough:
Relay:
Direct IP: Yes
P2P: Yes
Cross-platform: Desktop, Mobile, Web, Console
Learning material
LiteNetLib
Todo
SocketWeaver
Todo
Backend Services
https://docs.google.com/spreadsheets/d/
1x0eok6EZzigar_K3QNdzTYNhp5NLywLGqBuopKiVzao/edit#gid=0