What are the pros and cons of available network solutions/assets

[EDIT 04/04/23] WARNING: This list hasn’t been updated in a few years so a lot of information is missing and outdated.

This is a simple list of the best solutions and assets and their pros and cons so that I (and others) can make the best choice for their multiplayer projects.

Here’s a link to a similar google doc where you can get more information on some of the solutions listed here, and general networking terms:

Here’s a spreadsheet with even more information. thanks @F-R-O-S-T-Y and @Jamster !
Link to the excel sheet

https://forum.unity.com/threads/ben…dgren-miniudp-hazel-photon-and-others.512507/

Cheers

Fish-Networking
Pros:

  • Free, and no concurrent user limits.
  • Original code base.
  • TCP and UDP support; can be swapped out. Other supported transports are Epic Online Services, Steam, and more.
  • Good documentation, consistently named and commented API.
  • Regularly updated, fast bug fixes.
  • Long-term support and scheduled/limited API changes.
  • Released games on product proven to scale to hundreds of CCU.
  • Advanced Area of Interest system with condition stacking, and Network Level of Detail.
  • Client-side prediction.
  • Lag compensation.
  • Scene manager for scene instances, global scenes, connection scenes, match scenes and more.
  • Network object pooling.
  • Most features of any free solution.
  • Encryption layer.
  • Addressables support for Scenes and Prefabs.
  • Allows for custom sync types, serializers, AOI conditions and more.
    Cons:
  • Unity dependent.
  • Match making requires a third party service.
    Model:
  • Client/server, or peer to peer with third party transports such as Steam.

Photon PUN2
Pros - matured with plenty of examples and tutorials

  • free 100 CCU making it easy to test your game
    Cons - Difficult to implement cheat prevention
    Model - Client to client via cloud server

Mirror
Pros - UNET + 940 bug fixes and improvements.
Cons - No Lobby and only one client per Connection. which were native UNET HLAPI features that have been stripped out.
Model - Client/Server

Netcode for GameObjects
Pros - Supported by Unity

  • Integrates well with Unity Multiplayer services
  • Official project samples provided
  • Good tutorials out already (see codemonkey multiplayer)
    Cons - made for small scale co-op games. No client side prediction
  • Parenting network objects to child gameobjects is painful
    Model - Client/Server

SmartFoxServer
Pros:

  • Fully authoritative
  • Fully extensible with custom server-side logic
  • very mature (available since 2004) with a lot of examples of increasing difficulty
  • exhaustive documentation
  • integrated HTTP tunneling
  • protocol cryptography
  • specific MMO-oriented API
  • extended lobby features: rooms, buddies, messaging, match making, etc
  • database integration
  • free 100 CCU edition
  • both perpetual and elastic licenses
  • fast update cycle in case of bugs
    Cons (?):
  • different approach with respect to other solutions listed above
    Model:
  • client/server

MLAPI
Pros - similar structure to UNET but with many more features and greater stability.
Cons - No Custom Messages or SyncedEvent
Model - Client/Server

MLAPI, Mirror and UNET HLAPI Comparison Matrix

LiteNetLib
Pros:

  • No dependency on Unity
  • Gives you all the control
  • It works
  • Included writer and reader objects for managing data in packets
  • Auto packet fragmentation
  • Reliable, unorder, fragmented and non-fragmented flags
  • Do it yourself

Cons:

  • Do it yourself
  • Expects you to know how networking works
  • Have to setup an ownership handshake procedure yourself
  • Connection IDs are longs and arent garuanteed to be unique (0.8 rectified this)

Model: Reliable UDP transport library

DarkRift Networking 2
Pros:

  • TCP and UDP support, or can be swapped out for any other protocol or network library you fancy

  • No dependency on Unity

  • Very low level and gives you massive amounts of control

  • Fully authoritative and extensible

  • Unlimited users for free!

  • Very well optimized

  • Pretty good documentation

  • Runs on .NET Core * /.NET Framework/Mono

  • Includes source code *

  • Includes matchmaking system *

  • If you purchase the Pro version

Cons:

  • Only one developer (me!)
  • Requires mid tier C# skills

Model - Client/Server

TNet
Pros:

  • Unique “make multiplayer and receive save load for free and without efforts” feature
  • Battle tested on games Windward and Sightseer (created by developer of these games)
  • Almost out of box support for huge multiplayer open worlds (more than 100x100 km)

Cons:

  • Out of box does not supports parenting of one networked object into another (but with commenting a few line of code it became possible)
  • Some kind limited \ inconvenient for games which have many hand-made levels (scenes) with manual level design (but very powerful for open world procedural games)
  • Not free (95$) and demo \ free version is not available
29 Likes

Network library benchmarks.

5 Likes

Photon PUN actually built on a custom enet for reliable UDP (allowing TCP and other options transparently, which enables support for more platforms) and it’s best described as “client to client via server”. The connections are not direct (so no NAT and no problems when the “host” drops out of a match) but the server is agnostic to the specific game’s logic. It’s also not just a relay, as it can buffer messages and store custom properties.

4 Likes

SmartFoxServer
Pros:

  • Fully authoritative
  • Fully extensible with custom server-side logic
  • very mature (available since 2004) with a lot of examples of increasing difficulty
  • exhaustive documentation
  • integrated HTTP tunneling
  • protocol cryptography
  • specific MMO-oriented API
  • extended lobby features: rooms, buddies, messaging, match making, etc
  • database integration
  • free 100 CCU edition
  • both perpetual and elastic licenses
  • fast update cycle in case of bugs

Cons (?):

  • different approach with respect to other solutions listed above

Model:

  • client/server
1 Like

Cheers, I haven’t seen that one. I’ll add it to the list and check it out!

2 Likes

UNET + 940 bug fixes and improvements.

3 Likes

MLAPI, similar structure to UNET but with many more features and greater stability. Written from scratch. Here is a comparison:
https://midlevel.github.io/MLAPI/features/

2 Likes

Mirror is getting a lot of traction as it builds on the culture and community centered around UNET. It is under constant development and the authors are accessible via discord.

Whichever solution you go for, as you know, it has to be understood inside and out. I’d advise placing the level of available support and existing examples at the top of your criteria.

Edit: UNET / mirror is not peer to peer. You have the flexibility to integrate with a myriad of hosting services like Amazon Game lift, AWS cloud compute, Digital Ocean etc…

My UNET development servers authenticate via Steam and run dedicated instances on Amazon Web services. I have the flexibility to move it to just about any other hosting provision I like without being locked into a particular SDK.

4 Likes

Mirror Cons: No Lobby and only one client per Connection. which were native UNET HLAPI features that have been stripped out.

1 Like

@TwoTen Does MLAPI have any demo projects? Does it support a hybrid TCP/UDP system where we can use TCP for things like chat/inventory/file transfer etc… and UDP for player movement/actions etc…?

And made easy ?

Socket Class Pros:

  • Create your own custom implementation that is optimal for what your game needs
  • No waiting on 3rd parties for bug fixes
  • No black box code you can’t investigate while troubleshooting networking issues
  • No worries that your network API will get deprecated, leaving your project in limbo

Socket Class Cons:

  • Requires more time investment to develop your higher level API than using a premade API
  • Requires at least mid tier C# skills
  • Includes more fiddling with byte arrays than you may be interested in
  • Less available help than going with an established network API with a community around it
1 Like

Forge Networking: GitHub - BeardedManStudios/ForgeNetworkingRemastered: See various forks, also please join the Forge Community fork of Forge Alloy! -> https://github.com/ForgeAlloyCommunity/ForgeAlloy

I’m currently debating about switching over to this networking solution. I was hoping some people had some pros / cons for this as well.

LiteNetLib

Pros

  • No dependency on Unity
  • Gives you all the control
  • It works
  • Included writer and reader objects for managing data in packets
  • Auto packet fragmentation
  • Reliable, unorder, fragmented and non-fragmented flags
  • Do it yourself

Cons

  • Do it yourself
  • Expects you to know how networking works
  • Have to setup an ownership handshake procedure yourself
  • Connection IDs are longs and arent garuanteed to be unique (0.8 rectified this)

Model: Client-Server

The fact that this networking middleware is external and doesnt rely on Unity means that I dont need to worry if its deprecate or experimental (like the current twilight zone of the networking APIs in Unity). It also helps that I’m able to use this API in an external application in order to host my networking process when using the editor, which allows me to compile and keep the active connections running after a hot reload.

1 Like

Demo projects are not really available. It can use hybrid TCP/UDP yes, but it’s not supported out of the box. By default, we instead use a channel based approach where you can set the QoS.

yeah sorry updated demo projects are an essential to me, networking isn’t easy and trying to make sense of another multiplayer framework without a quick demo project to see what it has as features to see it working and then look at the working code is a huge help. I did notice you had pretty old demo project for mlapi that was the github account but again should ideally be an example project folder that just comes bundled with the latest releases that way it works with the latest source and can be removed in the project, probably helps if the example project doesn’t need any changes to project settings aswel.

It seems no framework is really supporting it out of the box or providing a example project of it working, I wouldn’t know how it could be supported going by the fact it isn’t already supported makes me think it’s not that easy to add in the framework otherwise it would already be.

1 Like

SmartFoxServer 2X provides TCP and UDP out of the box and you can decide which requests use either of the two.
Demos are available for multiple platform, Unity included. The FPS demo specifically uses both TCP and UDP.
http://docs2x.smartfoxserver.com/ExamplesUnity/fps

Cheers

I don’t see why you want TCP? What’s wrong with RUDP?

As for figuring out how the lib works. That’s what we have the wiki for https://midlevel.github.io/MLAPI/wiki/

1 Like

Will give that a look at then.

the comment was more about the example demos… RUDP might be fine overall.

Had a bunch of conflicts with Websockets with Smartfox because every framework wants to use the freaking names for things and not use namespaces… not really good seeing as it’s a bunch of dll’s

And the Unity examples are downloading at 130kb/s :frowning: