So I’ve also been trying to wrap my head around the operating costs incurred from utilizing the Unity Multiplayer service as well, and here’s what it’s boiled down to (note that according to Relay Server Bandwidth Explanation - Unity Engine - Unity Discussions it seems as though bandwidth is calculated only by outgoing traffic from the relay server).
My game has a maximum of 8 players per game. We’ll assume the worst case that all games are always full.
In the worst case, each client sends movement data at a rate of 20/sec with the payload size being approximately 32 bytes per packet (sizeof(Vector3) + sizeof(float) + overhead padding).
The server streams all players’ movement data to each other client.
This means that the outgoing bytes/sec from the server to each individual client is approximately 8 bytes * 20 msgs/sec * 32 bytes.
This means the total outgoing bytes from the server is approximately 40kb/sec. Now, from my testing I’ve seen it’s significantly lower due to optimizations, but we’ll just go with this.
At 40kb/sec, or 0.00004096 GB/sec, means that each 8 player game hour costs $0.073728. Thus, each single player costs me $0.009216 per hour. Double-checking these numbers against results gotten from the price calculator here Game Development Software: Build a Multiplayer Game | Unity seems to line up fairly well.
So all this being said, and after some thought, the metric I’ve been looking closest at to evaluate the financial viability of using UNET is basically # of hours a player has to play for me to start losing money on them. At $0.009216 per player hour, they have 108 hours of game time before they cost me $1. If I charge $4.99 for my game, minus a 33% cut, they can play 360 hours before I lose money on them. $1.99 for my game? 143 hours of game time. I have a feeling that’s quite a bit more time, on average, than players will spend on a single game, especially an indie like mine.
For the sake of argument, let’s say I’ve made a mistake in my arithmetic (please, please call me out on it, I’d adore you) and I’m off by two orders of magnitude, i.e. they have 1 hour of game time before they cost me $1. If I charge $4.99 for my game, minus a 33% cut, they can play for 3.3 hours before it’s unprofitable for me… it’s bad, but I do wonder how many folks buy a cheap game like that, play it for an hour or two, and never pick it up again.
So anyway, I was kind of freaking out yesterday by this pricing, but after going through this exercise I’m starting to think perhaps it’s not completely unviable - or perhaps I’m just really bad at math? Anyone mind double-checking me here?