u/Aisuhokke

I'm curious if anyone has any feedback or experience for my situation below. I also welcome all general advice for an indie with the curse of wanting to make a multiplayer game :-D

I'm building a digital card game in Unreal Engine. My game itself is not super complicated or pushing the limits of anything. But there's something pretty critical I need to decide on here pretty damn soon, and I'm seeking the advice of you folks who are much smarter and more experienced than I am.

Some high levels:

  • Multiplayer 4 player card/strategy game
  • Unreal Engine 5
  • PlayFab for backend infra & item/inventory/database
  • Azure functions for calls to do backendy stuff with PlayFab
  • I have the above "functional". The game is not finished, obviously. But I'm at the point where I need to figure out the dedicated server part. So I've been experimenting with running servers on PlayFab, locally with LocalMultiplayerAgent, and trying to estimate costs of running these servers for this 4 player multiplayer game.

The game can absolutely be played for casual fun. And can absolutely be played single player against bots. But I'd like to fully support competitive play & ranked ladder because that's what I'm passionate about when it comes to card games. That of course comes with a curse. Making a card game is simple. But making a multiplayer card game requires a lot more complexity. I'm trying to decide how to architect my backend server infrastructure. Below are some ideas. Please keep in mind I'm fairly new to Unreal and game development, but not new to software development or deploying software to production.

Option 1.) Typical Unreal engine & PlayFab dedicated server backend. Matchmaking will match up 4 players, spin up a dedicated server VM with PlayFab/Azure. Connect the clients. So I basically have 1 unreal dedicated server running per 4 concurrent players. I'm concerned this won't scale well in terms of infrastructure cost. And could be very cost inefficient because the actual CPU & Memory usage required to process my server's game logic is low where as the Memory foot print of just simply running an Unreal Server will be relatively high.

Option 2.) Make my own custom server in some programming langauge i'm very comfortable with. Make it as lean as possible, no heavy unreal stuff. I could even potentially make the game server "serverless". I have written many servers and pushed them to production in traditional software. That's easy. I can hand waive the actual server development. But then taking my server and integrating it with an Unreal Engine game client seems like a lot of work and reinventing the wheel all to save money on backend infrastructure expenses. I'd have to reinvent the wheel on things like GameState/PlayerState/PlayerController/Replication/etc. I'm not sure that's worth it for an indie game. That seems like something I'd hire one person to do and have that be their full time job. Making an indie game is hard enough, let alone making a multiplayer indie game. I think this adds complexity I don't want to scope in right now. But it's probably the right thing to do...

Option 3.) A modification of Option 1 above. Use the typical Unreal engine & PlayFab dedicated server backend but make a relatively small architectural change. Instead of having 1 unreal dedicated server running per 4 concurrent players. I could have ~40 or ~100 players all connecting to the same unreal dedicated server and basically having that one server manage many games. I may need to write my own custom Matchmaking service instead of just using PlayFab's matchmaking service. Because I'd need to be able to route players to the right dedicated server with custom logic. Matchmaking will be more complex but it sounds completely do-able. I'd also need to refactor exactly what and how is replicated to which player/clients. I think that sounds very reasonable. There might be a gotcha I cannot see right now though. Basically, if there are 100 players connected to the server, the individual player only knows about the 4 players (themselves and 3 others) sitting at their "table" playing their match. And they don't know about the other 96 players. So i'd just make sure replication abides by that logic. So the server sees all 100 but the player only sees their 4 at their "table". So to speak.

Option 4.) I should also mention the option of not having dedicated servers at all and having players host their own games and joining other player's games. This is okay but I feel like this undermines the competitive nature of the game I'm trying to make. I have to worry about player friction trying to join/find games. I have to worry about hosts quitting or, manipulating or cheating etc. So I'll likely not consider this as the primary way to play. But maybe leave it as a secondary way to play to support the stop killing games movement. And leave ranked ladder play on the dedicated servers.

Comparing Options

  • Option 1 is basically
    • 100 players
    • 25 matches total (4 players per game)
    • 25 unreal dedicated servers
    • Let's assume each dedicated server is around 300MB of memory each. That's around 7.5GB of memory usage
  • Option 3 is basically
    • 100 players
    • 25 matches total (4 players per game)
    • 1 unreal dedicated server (with all 100 players connected to it)
    • In theory, the memory usage is significantly less than 7.5GB mentioned above. It might even be less than 1 or 2 GB of memory. Of course this has 25 matches worth of stuff in memory but the unreal engine server overhead is not repeated 25 times which is really nice.
  • Pros to Option 1
    • Simpler for an indie
  • Cons to Option 1
    • Could be ungodly expensive
  • Pros to Option 3
    • Likely significantly reducing the memory footprint of my dedicated servers, allowing me to save a lot of money on server expenses
  • Cons to Option 3
    • All these players on one server. If the server crashes, it affects 100 players instead of just 4.
  • Pros to Option 4
    • Cheapest option by far in terms of infrastructure costs
  • Cons to Option 4
    • It adds some player friction & unreliability out of my control
    • Undermines the competitive nature of the game IMO.
  • Option 2 is a great idea, but I think it's not ideal for me as an indie developer.

In a perfect world, I find a way to accomplish my goals and not be an insanely high cost on my infrastructure bill.

I wonder what other simple card/board multiplayer games that are say 4-10 players "per server" do here? Keep in mind this isn't an MMO, this isn't an FPS. So i'm not replicating physics of 1,000 things. It's pretty simple from that perspective.

Thanks

reddit.com
u/Aisuhokke — 15 days ago