How easy / difficult it is to set up some form of game hosting

Hey guys, i’m just wondering how easy / difficult it is to set up some form of game hosting. I’m looking at making a co - op game where a player can play on their own with the option of a friend joining the game. From my limited experience of multiplayer I know how to create a lobby and have people join pre game but the issue I have with that is that once the user shuts down the lobby then whatever you have done is irrelevant ie save data or progress through the game.

I just want to make a simple linear rpg type game with a story that allows users to have their friends join in but with the option of doing it single player as well. From the small amount of research I have seen thus far it seems I would have to have a dedicated server to do this but I’m not looking to pay money for hosting as I doubt many people if any will play the game.

If somebody could point me in the right direction I would appreciate it, so again just a single player game that allows friends to join / leave without the user having to restart the game with a lobby system.

Thank you.

Unfortunately, on the web, nothing is free unless you throttle access once you hit monthly data caps. It is possible to hit limits with just a handful of players per month, depending upon your architecture. This will be true on any platofrm you choose to host.

You can host on AWS, Azure, GCP, or many other smaller cloud providers, or you can use a number of services that provide a wrapper API/SDK around one of the big three for an extra monthly fee/usage premium.

Typically, if you do 1000s of reads/writes per month (a very easy line to cross even if you’re debugging a simple prototype), then you’re likely to incur some non-zero cost.

Depending on your design and architecture, you’ll want to choose a cheaper versus more expensive solution. For instance, if your game is mostly turn-based or asynchronous (card games, digital board games, etc.) then a headless architecture will probably be cheapest. See Unity’s Relay service (Relay: Free P2P Networking & Connection Solution | Unity) to easily integrate their lobby/matchmaking template.

According to Unity’s current docs, 40,000 writes will cost $0.01. Think of that as information passed from one player to all others. For instance, if I’m playing 1-on-1 with a friend across the world, and I make a move, the server relays data from me to Player2. If my game supports 16 players at once, multiply that data propagation by 16X. Unity estimates that you’ll be able to let ~50 players onto your relay server continuously before incurring costs, but they charge you based on the data, so that number could be very generous, depending upon your architecture.

If you need extremely low latency real-time interaction (League-style battles, FPS, etc.) a headless config won’t be good enough. You’ll need to implement either server-authoritative or client-authoritative prediction to hit latency targets. Either way, the server will do a lot more work than a headless config, which is very likely to cost less than $0/month even if you have a very small number of active players.

You would typically implement this as a client-hosted game. No dedicated server needed, although you will have to use a Relay service for players to be able to connect - otherwise the host would have to configure port forwarding on his router, and fail due to technical ineptness. You could also implement a NAT hole punching solution for clients to connect directly to each other but this will also fail for some (or many) users due to technical issues.

Therefore a Relay service is required either way but this is much cheaper than dedicated server hosting and Unity’s free plan is rather generous.

The progress is saved on the host’s computer. To continue a game, the same host would have to re-host the game so everyone can continue with their progress. Since the game is coop you won’t have to worry about cheating.