I'm confused, what replaced Unet?

How can I implement multiplayer for a simple game and can I do it for free?

One of many options is mirror.

2 Likes

Wow this is very new, I’ll have a look into it thanks alot buddy

There is an ECS-based networking framework included with the FPS Sample.

https://unity.com/fps-sample

Beyond that though there isn’t an official replacement for Unet.

Mirror is older than you think it is. It just wasn’t available for anything other than non-commercial use until recently.

1 Like

Don’t hold your breath for Unity. If you liked UNET mirror is probably the way to go, but there are lots of other options if you want to go low level.

It’s now been 5 months since the transport layer repository has had a significant update and the transport team has been strangely quiet about progress. The only information that they’ve deigned give, is that they are awaiting changes to Unity before they release any updates.

When you contrast this with the forthright communication coming from the ECS/Jobs group at Unity Engine - Unity Discussions it becomes even more puzzling.

1 Like

Do not ever suggest that, please.

1 Like

Care explain why? Isn’t an option, which fits to OP requirements?

+1.

Mirror by far is the easiest to migrate over from UNET, but others like MLAPI and even TinyBirdNet (which aims to be a UNET-like environment on LiteNet) exist.

https://discussions.unity.com/t/636221 page-23#post-4238383
https://discussions.unity.com/t/636221 page-23#post-4237225

The developer blatantly deletes his posts from the topic. Nonsense.

"
The Mirror project proudly announces itself as ā€œMMO Scaleā€. When it comes to memory management, it’s some of the worst I have seen. Just to send a single message, the message is copied and reallocated multiple times too using .ToArray() methods. Everything to save a few lines of code while taking a huge hit on performance. Both GC pressure and CPU usage are ignored for the sake of saving a few lines of code.

Another great example is the Telepathy transport which is Mirror’s default transport. It spins 2 threads per client just for a read/write loop as opposed to having a general read/write thread that dispatches to each client. By having 2 threads be created per client, at anything close to MMO scale this will cause CPU exhaustion and also require more expensive servers. On a smaller scale, it can impact game performance and require higher requirements than sanely needed. Even Microsoft has said that the ā€˜one thread per client model is well-known to not scale beyond a dozen clients or so’, so imagine two threads per client.

Looking over the source code you can find many decisions that align with a lack of consideration for performance. LinQ, which is VERY known to be generous with the amount of garbage it generates, is used in many places instead of a simple for loop in order to save lines. This is clearly documented in Unity’s guide Optimizing garbage collection in Unity games.

Memory is never reused. It’s copied and reallocated multiple times per message and is then at the end thrown away.

"

Source: https://mlapi.network/blog/2019/03/13/the-current-state-of-unity-networking-a-critique-of-mirror/#specifics

3 Likes

Thank you for detailed explanation.
I know you work with networking solution, so you have solid understanding on the topic.
I agree, that taken approaches, are representing poor, or rather lack of optimization. Hence, you have raised valid concerns.

However, as per OP requirement and potential basics capabilities, I don’t expect OP writing own solutions.

I could perhaps suggest FPS sample based networking, as good alternative, but I am afraid, it may be beyond OP knowledge yet, to understand its implementation. I may be wrong tho.

Sure, there are other solutions too, free with basics features/capacity, then need pay respectively.

Yet, despite all that, for free and very basics features, I believe still, mirror is something that can be good to beginner to start of. It gives at least opportunity, to learn principles, without getting too deep into networking.

Eventually when hit the wall, or pocket are deeper, better solutions can be considered.

Thoughts?

1 Like

I actually talked to the MLAPI developer about that article and cleared a lot of things in that post. Actually had quite a good chat about it and came out with a constructive outcome.

But this is going off topic and we’re not here to do politics. Let’s keep it on track, bringing up the same arguments that are seen in your other posts in other threads is pointless here, wobes. The OP wanted to know what replaced UNET, there’s a lot of options, they can pursue on their own.

@Antypodish You are more than welcome to stop by the Mirror Discord. We’re a friendly community and we’ll be glad to help point you in the right path. Heck, we’ve even got a FPS Sample in the works. I’m using Mirror for my own third person shooter title and internal tests have been going really good.

Where is the fps sample located? sounds like a much better example project for newbie to pick apart than pong etc

Here https://unity.com/fps-sample
But is far beyond anything simple, specially for someone starting. It also uses ECS.

No not that bloat, the mirror fps sample, should be something lightweight and easy to explore all the parts that make it run

1 Like

I just released a new asset that I think qualifies as a replacement for UNet. It’s called Noble Connect, and it provides relays and punchthrough for UNet (and other networking systems very soon). This means that even though UNet’s relays are going away you can still use the UNet API with the Noble Connect relay services. This also has the advantage of adding built in punchthrough, which UNet never even had.

Additionally, if you purchase the Starter Pack it comes with our Match Up asset which completes the set-up by adding matchmaking to replace the UNet matchmaking that is also going away.

Unfortunately I don’t think you’ll find a true replacement for UNet that is free, because UNet included relays and those are always going to cost you.

Hopefully anyone who is looking to keep using the UNet API finds it useful.

The MLAPI also has a free relay. But don’t expect the same finish as something from @thegreatzebadiah , it’s much more DIY and more proof of concept. But it does work just fine and is performant (no copies, protocol suffixing and such)

As for replacing UNET HLAPI, I suggest checking out MLAPI

1 Like

You seem to be knowledgeable about network programming in Unity. What solution would you recommend that is both easy-to-use and performant?

LiteNetLib with an abstraction of MLAPI would be far enough performant and easy to use. Be careful with GC though. DarkRift also seem to be a good solution.

Reference to some benchmarks: https://github.com/nxrighthere/BenchmarkNet/wiki/Benchmark-Results

2 Likes

The MLAPI will almost not generate any garbage. We reuse almost all memory.