question

klfw91 avatar image
klfw91 asked

Multiplayer Costs vs Firebase

Hello,

I am a new developer and I have been making my game with Playfab. I am at the stage where I want to implement matchmaching and multiplayer but I am concerned with the cost. My game is just a two player turn based card game where a game would last about 10 minutes. Looking at the cost example in the documentation.

If I had 30 minutes per user per day, that would be 900 minutes per user per month.

If I had 100,000 users, that would be 90000000 minutes divided by 2 for the users per session.

So 450000000 minutes, packing 3 servers on a 2-core D2_v2 = 15000000 minutes

Which equals 250000 VM hours x $0.252 = $63,000? Is this how the pricing works?

Alternatively, I have seen videos of people build matchmaking on Firebases' realtime datebase which I assume would not have such a cost.

Please let me know if I have made any incorrect assumptions, and suggestions on what the best way to make my game would be?

Thanks

Matchmaking
1 comment
10 |1200

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

appgame avatar image appgame commented ·

90,000,000 minutes divided by 2 = 45,000,000 & Not your 450,000,000

Best not to assume you have $450,000 & you only having $45,000 to pay your $63,000 Bill.

0 Likes 0 ·
brendan avatar image
brendan answered

Specifically, the cost is the per-hour cost for the machine type, charged on a per-minute basis. So if you run an A2v2 for 30 minutes, it would be half the hourly cost for the region, based on the publicly available hourly cost (which is currently $0.09 for a Linux server of that type, or $0.13 for Windows, per this page: https://docs.microsoft.com/en-us/gaming/playfab/features/multiplayer/servers/multiplayer-servers-detailed-price-sheet).

How many players you can host per server is part of your equation, but how many that is will be down to the complexity of the game logic/simulation and efficiency of the code. But I will say that in general, you should be able to get significantly more players on a D2v2 (based on the hourly price you mentioned), so I'd recommend uploading a build and testing. But I'd also recommend using Av2 or Fv2 servers, since we provide some free hours of each of those per month in Development Mode.

I'd also note that you can get better efficiencies with larger server models if you have that large of a user base. And it would be best to determine if you're primarily CPU or memory bound, in order to tune the server model you use to your needs. But that said, if what you specifically need is 250,000 hours of D2v2 hosting, your math is fine.

Matchmaking is a distinct service in PlayFab - you don't have to run your own servers to support that. More specifically though, a better comparison with the realtime database product (since in that model, you're trusting the client to be fully authoritative over the data) would be our Party service: https://docs.microsoft.com/en-us/gaming/playfab/features/multiplayer/networking/. If you need server authority to prevent cheating, you'll need either custom game server hosting or at least script logic in the cloud (though if the frequency of data updates to and from the client is high, server hosting is going to cost less overall).

10 |1200

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

Max Guernsey, III avatar image
Max Guernsey, III answered

I really like the PlayFab matchmaking service which, as @Brendan already said, is a distinct service. I'm using it for my turn-based game and I'm paying nothing, at the moment. I expect to pay nothing for it for the foreseeable future. I haven't looked at what it will cost as I scale up but I trust the pricing folks to be fair.

For the "game server", I don't think it's a concept that makes sense for a lot of turn-based games. I would highly recommend a serverless solution. Again, @Brendan kind of suggested this with his mention of script logic in the cloud.

I use Azure Functions and it works marvelously. It's super-easy to integrate with PlayFab services, the costs are trivial - I just pay the minimum fee for each call, and I have no question of whether or not I will be able to scale. After all, if Azure Functions can't scale, it means Azure can't scale.

It may be true that some kind of provisioned solution would be cheaper for a high-volume project - which it sounds like yours may already be and I hope one day for mine to be - but you can't beat the flexibility of only paying for the compute time you actually use.

10 |1200

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

Write an Answer

Hint: Notify or tag a user in this post by typing @username.

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.