UNet vs Photon

Hello,

The question is in the title. With the recent updates to Unity networking I was wondering, which one should I use and why? I have a project that is currently made using Photon technology but I am wondering if I should change it to UNet.

And if I made a new project, which one should I go with? Seeing as Unity developers are putting more effort into upgrading their networking system lately, maybe I should start using UNet instead. Both have great communities, both do the job. But what are the differences?

From your answers I’ll create a list and update it with anything new you reply that is valid information.

Cheers,
Frosty

2 Likes

If you consider to cover consoles at some point, then choose UNet, it will be compatible with all platforms for sure. I have to completely redesign my game now, removing Photon as it does not work on Xbox One.

There are lots of differences but sadly most of them are kind of sneaky.
Most notably: Unity hosts games in Unity instances. If the host is gone (network loss, crash, close) the game is over for all players in that game. Definitely.
You can host on random player’s devices or you can host and manage instances for them. Random devices include those with crappy net or minimum CPU.
If the random host is behind a firewall, you need the relay service. It will be cheap most probably but not free. And it will cause some extra hops for every message.

UNet knows the scene and has physics running in the host. This is good for checking hits, areas where you can move, etc.

Photon uses dedicated servers. It shares them for many rooms and does not run physics or anything Unity related. The game can continue, no matter who drops our and with a few tricks, you can do a lot of gameplay without extra logic.
The matchmaking is quite elaborate and fast. It makes sure not everyone tries to join the very same game at the same time when your players are most active.
Photon is paid per CCU and you can adjust your subscription anytime: Grow and shrink it. You will know how much you pay at the end of the month, when you set a subscription.

2 Likes

I was going to start a new thread but since I found this one I might as well just bump it and keep it going.

Is it possible for you @tobiass or someone at Unity to draw a comparison chart of the differences between both networking solutions? I think tobiass provided some differences above but I don’t think that’s everything, and since the thread is 2 months old I think UNet has since added more features or made some improvements not 100% sure.

Anyhow, it would be nice to understand what the differences are between the two networking solutions ongoing as i’m sure a lot of users looking for networking are going to come across both as being top choices.

I’m sticking with Photon for now with my current WebGL project, but I have to admit that using networking solution that’s built into Unity sounds attractive. Although I do realize that Exit Games probably has more experience with Networking at this point in the game and probably have tackled alot of issues that UNet will have to overcome as well. So from my perspective I think Photon remains as the best choice. (at least for me)

Although even with that UNet will keep being pushed and I won’t stop hearing or reading about it lol… so it would be nice if there is an updated comparison chart to show us Photon Subscribers that we are in fact making the right choice for your game going forward.

This is true, and I considered picking Photon for that reason. However, host migration is coming in 5.3 (Source: Roadmap), and since my project is still very early, I think I can wait with that.

One more difference, too: UNet is obviously more Unity-like. Not saying that is directly good (I myself have own programming habits and strongly dislike some Unity ways).
What makes me lean towards UNet currently is out-of-the box integration, and, most importantly, running as Unity instances. This means I can make server fully authorative. In Photon I’d need to make own version of game just for server stuff If I want security.

I am thinking about trying both to my current game project. However, I’ll need to decide when to try other one at correct time - if it’s too early, I won’t have full experience to compare, and if it’s too late - it’ll be just too much effort to be worth it.
I also considered using both at once. One would be used for global chat, and other one for game itself. Yet all are just initial thoughts.

I imagine that Unity is going to try and add all of the same features that Photon has into UNet plus more… being Built-in to Unity is going to make UNet an easy choice for a lot of new users, or anyone starting a new multiplayer project. I’m curious what Photon is planning to do to stay competitive.

Yes. And competition is good, for us - end users.

2 Likes

I thought UNet has a dedicated server for matchmaking already. What do you mean if the host is gone then the game is over? Isn’t that the same within Photon? Unless behind the scenes Photon selects another client to be the host if available?

I think there’s like a failsafe for matches (unet). But I can’t say anything about how matches work.

I just moved to Photon from UNET because of lagging and disconnect issues with UNET. Is anyone experiencing lag/disconnect issues?

I really want to stay with UNET cuz it has LAN support, but lag and disconnect is just bad.

Photon doesn’t have LAN support? Hmm maybe I should move to Photon too.

I haven’t used Photon but I wouldn’t recommend UNET at the moment. It is really buggy and seems unfinished/unrobust. UNET could be awesome if it got cleaned up… but it’s not usable at the moment (in my opinion).

If you guys are looking for alternatives, have a look at Bolt. It’s still labelled “Beta” but stable, supports LAN and has a one-time fee. For an idea how developers rate it, check out the reviews in the Asset Store.

Keep in mind that uNet and Bolt host games in a client on a player’s machine. It’s great for LAN and standalone builds but it’s hard to connect mobile players with one another. Also: When you have a game with 4 and more players, it can be annoying when the host drops out and the game ends. Those are negatives of hosting in-Unity.

Photon (as in PUN) does not have LAN support, aside from hosting a Photon Server in a LAN for the players. The clients always need a machine that’s connecting them.

Neither solution is a simple replacement for uNet, so you will have to re-do some of your game.

I am interested in seeing a comparison chart still if someone knows the two.

For Xbox One, does Unet still host the game on a player’s machine? I didn’t think they worked that way.

Doesn’t uNet work same as Photon? I mean it uses cloud service.
And with Bolt, I could create a headless build of my game, after which a player might rent a server to host a game. Something similar to Wolfenstein: Enemy Territory and Unreal series. Clans rented servers and hosted games there, which players would then join. If there were problems with the server, all players suffered.

Btw, Tobias, isn’t it possible to create a system similar to which I just described? Make a headless version of my game, using PUN networking, execute it on a server somewhere, list it in the room’s list and let other players join it. How difficult would it be to create such a system? And if not possible with PUN, then with uNet perhaps?

Also noticed, that there’s a thing coming up labelled “Thunder” on PhotonEngine webpage. What makes it different from the rest?

Thanks!

uNet may use a cloud service for relay. But no matter if relayed or not, the players connect to a host (another player).
If you don’t want a user to host the game, you have to run Unity on the server (as host).
Bolt does about the same: Games get hosted in a Unity instance. Photon (PUN) has a “room” on a dedicated server. It’s not running Unity logic and scenes but a Photon server does more than just relay between two clients.

Running Unity on servers to host games (no matter if PUN, Bolt, uNet or anything else) is a bit tricky and quite expensive but of course you can do it. Everything is possible. It’s software :slight_smile:
Why is it costly? You need machines and traffic to actually offer any hosting and Unity is more demanding than a leaner no-physics approach.
Why is it tricky? You need a way to offer enough games (Unity instances) but not too many for the amount of players. You need to adjust your number of hosted games and servers to the player-count.

Thunder is running uNet through Photon, instead of using Unity’s relay service. We think we can bring a few nice features to the mix and still keep the price low(er). It’s not yet done though as the distribution is quite tricky.

Do you still have plans to support XBox One? Or were those dropped completely?

Unet doesnt support webgl

You mean for Thunder? We’re not there yet. We have to figure out if that’s a good idea.
PUN supports consoles.