Unsure which networking solution to choose, Fish-Net or DOTSNET

Hi guys,

I for the first time am adamant to implement multiplayer into my ambitious project. I am currently torn between the implementation of either Fish-Net or DOTSNET.

My game’s main theme is basically a horde shooter with PvP as a minor part of the game.

My general requirements are:

  • Minimum 12 Players
  • Maximum 32 Players
  • Able to deal with HUGE hordes of enemies estimated around 500+ simultaneous enemies on screen at once.

Some things to consider, I have had limited experience with networking but know some idea of to make sure data is optimised but I have no idea the true limits of Fish Net or DOTSNET are. My game is a mecha shooter and to make it authentic, it must absolutely be able to accommodate the requirements listed above, and potentially high volumes of gun fire. Not sure how relevant those details are as I am new to how unity handles networking and am not sure if something like that would be trivial.

With the things I’ve seen about FishNet I’d hope that its able to accommodate DOTS too. I’m not even sure if DOTSNET has been updated to Unity 6, or updated in general…

Thanks and any suggestions and advice would be appreciated.

Why not Netcode for Entities?

For this number of networked objects - either because they are all networked or deterministic (recommended) - you need a networking framework that works with Unity’s Entities package.

This instantly rules out Fish-Net because it’s based on the classic GameObject and MonoBehavior pattern. No idea about DOTSNET or what versions of Entities it supports or whether it provides its own ECS.

But with NfE available and battle-tested I would use that because it’s going to be much better integrated with Entities.

PS: be sure to pull out your pocket calculator and measure the amount of traffic per entity to assess how well it can scale. For instance, if one entity sends 10 KiB/s of traffic, then 500 would amount to … 5 MiB/s - clearly at least five times too high. Most current online multiplayer games hover around or just above 1 MiB/s per client at most.

1 Like

DotsNet has been removed from the asset store by owner; I believe it’s no longer maintained and has not been for awhile now.

So your probably looking at FishNet vs Netcode for Entities.

I’m the creator of FishNet and while I would typically offer objective input I cannot in this instance, as I don’t know a whole lot about Netcode for Entities.

With that said, if you do have exploratory questions about FishNet specifically feel free to ask!

2 Likes

For this sort of thing you’re likely looking to roll your own solution. The biggest hurdle you face will be bandwidth followed closely by syncronization.

You might consider looking in to Riptide. It’s designed to work for C# ingeneral but can work fine in Unity. It’s mostly just a medium-level library that can package up and send data but that’s perfect for this sort of thing since you’ll likely want to use all kinds of tricks to figure out how to reduce bandwidth and increase determinsm.

Before my current project pivoted this was exactly the question I faced and Riptide was looking to be the best option. It free on github so you don’t have anything to loose just taking a few days to demo it and see.

1 Like

Thanks for you input, I wanted to see if FishNet was compatible because of its boasting of high and efficient performance with data transmission. I will have to look at implementing NfE then which is a little disappointing because my unity project is a port from else where and will need rebuilding, but my project isn’t in the state to bench marking entities just yet so I guess the optimisation will all be on me on this one.

I don’t plan on the projects requirements to be for competitive gameplay so I’m not too fussed about things that might induce lag, and for PvP I don’t plan on having those horde-like elements so I doubt it would be a problem there. I’m also guessing NfE would also natively support game objects when required?

I appreciate your input but I don’t feel like id be qualified to build my own networking solution even if I do have a few years of experience with coding, I don’t think I’m ready to spend another 2-3 years on building such a bespoke solution. At least that’s how long I imagine it to take.

1 Like

I do have a lot of interest in fishNet for its capabilities, would you be ever considering writing perhaps an add-on for DOTS/ECS at some point?

Or would it be more like a matter of waiting until Unity 7 comes out with “Entities for all” being assimilated into the engine level?

@Kiyodio1 welcome to the start of a deep and hopefully rewarding journey into multiplayer gamedev!

An immediate thing to know about game networking is without proper optimization techniques you quickly run into quadratic computation scaling concerns that can make a game experience dead on arrival. So in your case with 12-32 players under non-optimized implementations you’ll be sending 144-1024x the output and servers/clients will need to process all that at the defined tick rate (typically somewhere along 5-60hz). This is because each player update needs to update every other player e.g. n^2 Big-O rearing its head. The first rule of optimization for multiplayer then becomes, don’t send over the network what you don’t need to send. Second, minimize what you send over the network. Many techniques can be used to eliminate or reduce network utilization and compensate for the desynchronization caused by the pesky physics constant of the speed of light. Compression, delta compression, bit packing, interest management, network level of detail, interpolation, extrapolation, client side prediction, lag compensation, rollback, and more are all used to create a playable distributed simulation experience. Any netcode library you choose will use a variety of these techniques, some more than others. A number of these techniques are overkill for certain genres and player scale. So like anything in life, it depends on your needs.

It sounds like cheat-prevention / competitive integrity is not the highest priority for your title. Usually that entails reducing costs by using a listen server topology (Unity Relay, Steam Relay, etc.) often categorized as peer to peer (p2p). However, in such a topology a client-hosted model requires one of the players to act as the server and therefore will bear the largest burden of computation and network transmission. Given 12-32 players and hundreds of horde like entities it’s possible, but will be challenging, particularly when you don’t know what client device and network capabilities will be. Is your game 2D or 3D? Which almost certainly adds an extra dimension of resource utilization and impacts scalability of your multiplayer solution. As such, dedicated game servers (DGS) usually end up being the solution of choice for scalability needs. That leads you down a further path of needing proper hosting orchestration (Unity Multiplay, MSFT PlayFab, AMZN GameLift, etc.).

Given your game is clearly GameObjects based, Netcode for Entities is not an option. The announced unified netcode solution is also not an option, the timeline on that is too far out. FishNet doesn’t support ECS either and clearly the author can speak to whether a version ever will, but you need something now. So, my recommendation is to experiment with multiple GameObject based netcode libraries. Work through their samples and documentation to get a feel for what multiplayer game development requires. There will be many similarities, but the most important thing is learning to think in the multiplayer domain.

Unity Netcode for GameObjects (free, Unity Companion License) and Photon Fusion (paid) likely have the most robust documentation and samples to explore and accelerate your learning. Coherence (paid) is a newcomer on the scene with a robust end to end offering that “just works”. KinematicSoup Reactor (paid) has the best demonstrable performance for any GameObjects based solution. FishNet (freemium) and Netick (freemium) are well rounded and might be your final destination if you need scalability features and relative lack of vendor lock-in. Mirror (free, open source) is a mature community project it’s not known to scale as well as many of the other offerings, but with recent feature improvements that’s changing. All of that comes with tradeoffs in ease of use, near and long-term support, features, pricing, etc. So it’s worth taking a couple weeks to rapidly ramp up on a few solutions and then make a more clear decision for your specific needs instead of fully relying on us forum posters.

Good luck!

6 Likes

Hey, Thanks for your incredibly detailed response. I appreciate all the given tips and cautions, actually my current plan is to have the player characters function on a GameObject based functionality and use Entities for the enemies. Would it be possible to then mix Netcode for Entities while still using game objects for the players? I would think that would significantly reduce the load on any server, but I am not really opposed to converting players into entities as well. And yes, my game would be in 3D.

Possible yes, recommendable no.

It’s sort of like writing your enemies code in C++ but leave your player code in C#. :wink:
It works but bridging the boundaries is often troublesome and could even become a bottleneck.
It might be a good choice (tradeoff) if you already have working code and don’t want to rewrite everything.

Any interaction between a player and an enemy would have to bridge worlds. Consider the case where enemies need to find the nearest player and such. You’d have to at least synchronize some state to the Entities world every Update and you may have to add additional pre-Update and post-Update hooks to sync data at the right point in time.

It’ll be best to have your players be Entities as well, perhaps with a thin GameObject layer for event handling (eg to allow the GUI to update) and input handling (although Input is just as easy to do with Entities). You could also use the Character Controller package for Entities.

1 Like

I’m in agreement with CodeSmile, mixing tech like this is a painful exercise and you’ll get very little if any assistance in attempting to do so. Commit to GameObjects netcode (lots of options previously mentioned) or ECS netcode (Netcode for Entities is the only option I know of).

Converting a game from MonoBehaviours to ECS will have a learning curve. Converting a single player game to multiplayer will have a learning curve. Doing both simultaneously will be enlightening, but very challenging.

I’m not here to tell you don’t bother, but my previous advice still stands… Tackle several sample projects in the various libraries to get a feel for things until it starts to click (check out CodeSmile’s signature link as another option I didn’t mention before) and here’s some stuff for ECS -

1 Like

Understatement of the year. :grin:

Converting an existing, non-trivial (specifically: realtime action) game to online Multiplayer is tantamount to rewriting all gameplay code.

2 Likes

There are currently no plans to officially add support for DOTS/ECS. It’s very rarely needed and it wouldn’t be worth the time to essentially rebuild our framework.