I’m a long time Unity developer who is making a first time in Unity multiplayer game as (primarily) a WebGL build. I do have multiplayer game experience, but it was many years ago, and it was Flash with a Smartfox Server backend.
WebGL really is throwing a wrench into my research here, as most of the discussion of networking don’t cover that (even though it does appear to be supported by many options). I’m having a lot of trouble even figuring out which of the (MANY) options are available to me.
Background out of the way, the game plan:
WebGL primarily, other platforms secondarily
Multiplayer with max 20 players per “room”
Realtime but not too fast paced (not designing for twitchy action in webGL)
Not expecting huge traffic, but want to plan for scale
Willing to pay $, free is not a requirement
I’m fine setting up my own servers (on AWS or whatever), but also open to cloud hosting.
Peer to peer/client host networking seems like a poor fit for my game (also security concerns?), so I’m fairly sure I’m looking for an authoritative server to run the game. Feel free to convince me otherwise.
The game server is not going to be doing anything complicated (no physics even), basically only tracking object positions, rotations, and states.
My questions:
Photon/PUN seems like the most recommended solution here and elsewhere, but will it work well for my particular situation?
Was shocked to find SmartFox is still around, since I have used it before that is appealing, any thoughts on SFS versus other solutions?
UNET seem… not ready for prime time, fair assessment?
I would use UNET, it works with WebGL, it’s the native solution and there are several Unity developers that are actively working on it. It will probably be the fastest (as in development time) solution too.
The part of UNET that people keep complaining about is the HLAPI.
The LLAPI (low level api) is the important part that sends packets around. This part works really well.
You could start with the Network Lobby asset from the store, it’s from Unity. Then you already have your rooms and matchmaking set up. It uses the HLAPI, so you can build your game on top of that. If you run into unsolvable HLAPI problems, then you can still throw it out of the window and only use the LLAPI.
Thanks for the thoughts. Pardon my ignorance here, but in this UNET model on the server side I’d be using a headless unity player? That’s certainly appealing as I’m only working in one environment. My big concern is I can’t find anyone using UNET as a production solution on the server side, it’s all people hacking around as far as I can tell.
It sounds great for prototyping, but I feel like I’m already on enough of a cutting edge doing a Unity WebGL game, using unity as my server seems like pushing it. I’m hoping to find something with a longer track record, but maybe I’m being overly cautious.
Well, wouldn’t photon also require unity to run on the server? Unity running headlessly would be the easiest and in my opinion most effective solution for your need - authoritative networking. If there are any visual effects like particles and UI, just check if it is running in headless mode and disable these things. UNet is not used as a production solution on the server side simply because it is not that old. There couldn’t be many games released, started using UNet from the beginning. But UNet seems to be ready for use and with the new transport API it will only get better.
UNET LLAPI can work… although you can probably forget about Unity’s webgl builds making sense on mobile browsers for years yet, sadly. (I just did some tests and … yikes. Slow or broken on everything but machines that can play PUBG basically)
The nice thing is you can easily get webgl + native people (UDP) playing together if need be.
UNET LLAPI multiplayer “game” I did recently, it uses a headless unity project running under linux as the server: