brendan avatar image
brendan asked

Photon Realtime, UNet, and custom game servers

Questions from a developer:

We're working on a realtime game using Unity (using UNet for our prototype), and we're worried about cheating in our game. We'd like to get some feedback on the options we're considering for our networking, to try to help with this:

1. Use Photon Realtime. Since we don't want players to be authoritative (since that makes it too easy to cheat), we're thinking of cheating. We're thinking of storing info about players which we can use to make a determination of the most "trusted" player, and have them be the host for the session.

2. Continue using UNet and wait for the Server Library which Unity have in their long-term roadmap, with the hope that it'll be easy to use and that it'll be delivered by the time we need it. To date, we don't have a good feel from Unity on when this will be though, nor when docs will be available.

3. There's also the option of using Photon Server, but I'm not clear on the pricing. They have a free 100 CCU plan "per app / server" but I don't really know how to read this. Could I have multiple servers running in PlayFab's hosting with this free tier?

Finally, can you show example pricing of your game server hosting if we want to have servers in all major regions (e.g., US, EU, Brazil and Asia)?

Custom Game ServersMatchmaking
10 |1200

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

1 Answer

brendan avatar image
brendan answered

1. Photon Realtime - There is actually an option to have your logic be server-authoritative in this model, using their plugins model. It's more expensive than their core Realtime service, so it may not be an option, but it's worth talking to them about that, to get a feel for the costs. Your idea of using a calculation to determine the "best host" is a good one in some ways - I actually worked with a team in Xbox on a similar system, though it was specifically to find the best host purely from a bandwidth/quality perspective. The potential issues you'll have with it are when people identify the elements used in your logic and start finding ways to "game" it (which, for any popular title, is inevitable). Also, there is the issue that the host will have a far better ping time than anyone else. So if there's any realtime component to the game at all, you'll be giving an unfair advantage to a subset of players frequently. And because your algorithm would necessarily not favor new players, that could make for a bad new user experience. But it really depends upon the game specifics, so that's something you should playtest, if you have any doubts there - just things to consider.

2. Unity Server Library - I really can't offer any advice on this, as they haven't given us any information outside what you've already seen. Personally, I would never take a dependency on anything that you can't get a solid date on for release, and solid docs to help make sure it meets your needs well ahead of that. That's one of the reasons we don't provide "guesstimate" dates for anything we're not actively working on. If someone were to take a dependency on it and then we missed that date, it would be bad for the developer.

3. Photon Server - For info on Photon Server pricing, I'd have to direct you to the Exit Games team. It sounds like you already understand this, but please bear in mind that the Photon Server license is a license to run their software on servers you host (or have hosted for you). Our custom game server service runs in EC2 and automatically scales to support your players, so we spin up additional servers (using the values you supply) as needed, and spin them down when they're not. There's a complete write-up of this here: The costs are specifically the AWS EC2 pricing, plus 10% to cover our costs. You can find the EC2 base pricing here: The prices to look at are Windows On-Demand servers. We'll also be providing a way to run your own servers in any server host later this quarter. This will allow you to run servers that integrate with our matchmaker and game wrangler (which is what pulls the log and output files when your server instances are done), but we won't be able to control spin-up/spin-down, as we won't have that level of access, so that would be your responsibility in that model. To calculate costs for custom game servers, you need to work out what you believe the average number of servers you'll need to run in each region where you want to have active servers - and note that server hosting costs vary by region, so you'll want to make note of those prices for your calculations. We provide a single small server instance for free while you're in development, which you can use to make some calculations on resource usage by your game per player, so that you can determine what server model you want to use when you go live. We recommend using the New Relic add-on from our marketplace to get that data. There's no way for us to predict how many users you could host on any particular server model, as games vary wildly in this respect. A game with low usage per player might be able to host thousands of players on a server type that, for another game type with much higher usage, might only be able to hosts dozens, so it's important to do thorough testing on your title. It's also worth noting that we provide a server framework you can use in our GitHub repo, as well:

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.