r/GameDevelopment • u/Turbulent_Papaya_281 • 1d ago
Question Unity dev figuring out multiplayer server setup for a co-op game
I'm a solo Unity dev planning to make and eventually release a co-op game, but I'm a bit confused about how the whole multiplayer networking works.
Like does a co-op game actually need a dedicated server, or can I just use Unity's P2P connection options and let players connect directly without hosting a server? Also what indie devs do when releasing a co-op game. Are there any hidden costs, server hosting requirements, or things I should know before choosing an approach?
Would love to hear from anyone who's published a co-op game, is currently working on one, or has experience with Unity multiplayer.
2
u/BoundfoxStudios 12h ago
Multiple options:
For a co-op game, you usually don't need a dedicated server setup, client-server is enough and distributed authority is overblown.
So, for Indie, depending on your game, you can get multiplayer 100 % free if you can accept some downsides. For typical co-op games like Stardew Valley the completely free approach is great. But if you have a high paced co-op shooter, you might want to have a dedicated server, but then you have to incorporate monthly costs.
At the end, it highly depends on your game. According to your question, you've never done any multiplayer game, so go with something super super simple and if you think, it's simple enough, make it even more simple, stick to the free options and then have fun.
3
u/blursed_1 23h ago
Use steam for a P2P connection. you can youtube on solutions for it.
2
u/Weak_Yogurtcloset415 11h ago
the stack question is covered above, so a few things that tend to bite on a first co-op project:
put networking into the very first prototype. bolting it onto a finished singleplayer game usually means rewriting most of the gameplay code, because every pickup, door and enemy suddenly needs an owner and a rule for how it syncs.
with host-based p2p the session lives on the host's machine. if they quit or crash, everyone drops, and real host migration is hard to get right. the cheap fix is frequent autosaves on the host plus a fast way to rejoin.
testing takes longer than you'd guess. Multiplayer Play Mode (or ParrelSync on older unity versions) lets you run a few clients from one editor, and steam's test app id 480 lets you try lobbies before you have your own app id, but every so often you still want two real machines on different networks.
turn on latency and packet loss simulation early, unity transport has a network simulator for it. stuff that feels fine on localhost can feel awful at 150ms.
and for co-op, letting the host be authoritative is usually fine. cheating matters a lot less when everyone is on the same team.