full image - Repost: Multiplayer Networking Solutions (from Reddit.com, Multiplayer Networking Solutions)
Mining:
Exchanges:
Donations:
I've been researching multiplayer for the last month. I compiled everything I learned together so you don't have to go through what I went through. Here is what I learned. If I missed anything or got anything wrong, please comment and I'll edit the post.Networking setups:P2P: Peer to peer allows clients to be masters of their own game who broadcasts their actions to all connected peers.0 upkeep costs0 lag for client inputall players must punch through NATall player IPs are visible to everyonevery difficult to prevent players from cheatingreliability and desyncing issues. The player with the slowest computer/internet tends to dictate the speed of the game. If you don't wait for the slowest player, you will have to deal with desync issues.unpopular choice because of the above consPlayer Host: Player Host allows 1 player to become the server, with all players directly connecting to the host.0 upkeep costs0 lag for host, input lag for other players (peer -> host -> peer)only the host must punch through NATthe host can see all IPs, players only see the host's IPvery difficult to prevent the host from cheatingreliability issues. If the host has slow internet or disconnects, it disrupts the game.popular choice due to 0 upkeep costsRelay: A relay is a variation of the player host setup, where you have a dedicated server that relays the details from the player to the host.minor upkeep costs. Ideally, you just have a simple server that relays information0 lag for host, input lag for other players (peer -> relay -> host -> relay -> peer)no players need to punch through NATno players can see the IP of other playersvery difficult to prevent the host from cheating. Note, there is a hybrid model where the relay server does basic anti cheat.reliability issues. If the host has slow internet or disconnects, it disrupts the game. Furthermore, the host being far from the relay causes problems. This is generally offset by having the host connect to a nearby relay.popular choice. I'm almost certain this is how Steam's network API functions.Client Server: A dedicated server acts as a host instead of a player taking the role of a host.medium upkeep costs.input lag for everyone (client -> server -> client). This is mitigated by having multiple servers around the world.no players need to punch through NATno players can see the IP of other playerscan prevent most kinds of cheatsmost reliable of the setup optionspopular choice.Netcode:Details regarding netcode are hard to find. If you know any extra details, please let me know and I'll add it in. I've researched Unity netcode so I'm missing a lot of details regarding Unreal.Mirror: Free and battle tested. I heard this is the best general choice when making a multiplayer game due to its price and documentation available.Fish-Net: Free and a promising upstart. It's currently lacking documentation. People who talk about it online do seem to like it a lot though.Photon (Fusion and PUN): The easiest netcode to setup. They do servers for you as well. The problem comes in pricing, I hear it's much cheaper to use a free networking library and to purchase a server instead. That being said, if you monetize your game well, Photon is probably the easiest netcode to work with.Unity networking for gameobjects: Unity's official networking library. Compared to mirror, this is specialized for smaller room sizes (like around 10 players per room). It's rather new so I don't have too many details regarding what people think of it.Hazel: An open-source low-level networking library for optimizing UDP connections. From what I hear, Photon and Mirror are much easier to use. Hazel, however, gives you finer control, allowing you to reduce the amount of data you need to send over the network.Steamworks: A free steam networking library for steam-based games. From what I'm aware, this library handles servers for you in a Relay networking model. Probably the best option for steam games since steam covers server costs in the 30% split. Steamworks does not allow for crossplay with phone and other non-steam users.Server:Details regarding servers are hard to find as well. I'd like some help figuring this out. I'll keep this section updated with details from the comments.AWS or GC or Azure: The big three of cloud computing. It provides everything you want and more, though the more part tends to be a con. You end up paying more for features you'll never use. Their biggest advantage is fantastic scaling between low and high player counts. Make sure to set limits and reports, so you don't wake up to an expensive bill. Please correct me if I'm wrong, but from what I'm getting, the big three aren't recommended for indie multiplayer games due to pricing. However, they can work well for non-realtime networking such as scoreboards.Vultr, DigitalOcean, Linode or OVH: These seem to be the 4 virtual private servers that are talked about the most. Compared to the big 3, they are cheaper but also offer many less features. I hear that these 4 are the most popular choices for indie games because of pricing. I see a lot of people recommending Linode out of the 4 options, so it might be the best for game dev. I'm having a lot of trouble deciding which is best. Which one do you recommend?Unity Multiplay: A Unity hosting solution. I hear it's easy but expensive compared to the other solutions.Buying your own hard metal server: In theory, the best bang for your buck. Cloud servers are essentially someone else owning a hard metal server. Compared to cloud servers, you have to maintain your own machines. The biggest con seems to be downscaling. If you have a machine that supports 2k players at launch, you can't really sell half of your machine if the player count halves. In contrast with cloud servers, you buy more or less depending on what you need.Estimate costs:Among Us (thank you fwfb):Network Setup: Relay Server, Netcode: Hazel, Server: Linode$5 per month supports 50 lobbies of 10 players, aka 500 players.fwfb mentioned among us started with 1 relay server, and upgraded to 3 matchmaking servers, 1 database server and 10-100 relay servers. This setup costs $160 a month to support 25k concurrent players.Seeing how Unity Multiplay is showcasing Among Us, I suspect that they switched from Linode to MultiplayCuriously, I think modded among us clients are using the same relay servers as everyone else. An interesting case where "cheating" and modifications are good.Practical player counts:Networking load tends to increase quadratically to player count within the same room. At a certain point, the price becomes unfeasible. This is the main reasons why games tend to split players into smaller rooms instead of one large room. Existing games had to figure this issue out, so we can use them to get a ballpark estimate.Albion: 400 players max per zone.WOW: at least 272 players max per zone. No official sources, but I counted 272 players on the same screen. The max is likely much higher.Foxhole: 150 players max per regionFall guys: 60 players max per roundLost ark: at least 53 players max per channel. No official sources, but I counted 53 players on the same screen. The max is likely 60.
Social Media Icons