question

Karlo avatar image
Karlo asked

Do you support Photon Bolt and UNET?

I see that multiplayer addons that are available are just PUN, however I've seen on these forums that you also recommend users to use Bolt next to PUN, so do you support Photon Bolt also? And what about new Unity Networking? PUN is not a good solution for me because I need an authoritative framework, so my options are either UNET or preferably Photon Bolt.

10 |1200

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

brendan avatar image
brendan answered

We wouldn't say that you should use Bolt instead of PUN as they are very different technologies - can you point me to where this was implied? I'll get it updated.

As opposed to PUN and Photon Realtime, Bolt and Unity Networking are peer-to-peer style systems, though they do include relay and matchmaking servers, as well. They do not use the same type of authentication mechanisms, so no integration is required. You can use them in conjunction with PlayFab.

One question, though - you say you need an authoritative framework. If you mean that you need server authority in a way that players cannot cheat, what you actually need is dedicated servers. You could use Photon Server or our own Unity server project in GitHub as your starting framework for this, and we can then be the host for those servers. Here's a write-up on server hosting, in case you need it: https://api.playfab.com/docs/custom-game-servers

10 |1200

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

Karlo avatar image
Karlo answered

I've read this here https://community.playfab.com/questions/689/208599947-NAT-Punchthrough-.html so I got confused.

I'm making a competitive fps game and I need a framework that is fast and authoritative. At the moment I have PUN integrated in my game but it doesn't fit my needs. It is simply too slow for an arena shooter, like weapons being out of sync(one of the problems is that the bullet hit on the client, but miss on the master client so the damage doesn't get registered). What would be the best and least complex to integrate framework for me? I used UFPS asset and their MP Kit which uses PUN as a base of my game, so right now I'm trying to find the best solution which wouldn't require me to change the base of my game. UNET is most future-proof and Bolt seems the best asset for fast-paced authoritative FPS games. Photon Server would require me dedicated servers with good performance, which are not cheap and still perform worse than a peer-to-peer system, but I don't know. I need a long-term solution which is the best for a competitive, fast-paced FPS game.

How does your server work? Can I run on my Linux VPS or it requires Windows OS like Photon Server? If you host it, how much does it cost?

I still didn't start integrating any of the PlayFab's services, but I will after I have multiplayer gameplay working.

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.

ryancoastek avatar image ryancoastek commented ·

I would recommend using UNET and the custom server build example that PlayFab provides. I was able to convert my previous UNET relay server game (Fast paced fps game) to one utilizing PlayFab's matchmaking in a couple hours. It seems like the best of both worlds to me. You get to use the most future proof networking code while still having a system manage your server for you and allow you to matchmake.

0 Likes 0 ·
brendan avatar image
brendan answered

Well, first things first, you've mentioned competitive and authoritative a couple of times, so it really sounds like you want a game where players cannot cheat (at least, not easily). Realistically, that means that you, as the developer/publisher of the title, need to control the servers that players use, so that you don't have players running modified servers locally. Then too, there is the fact that even if your game runs its server version only in a headless mode, a player who retries his matchmaking until he lands on the server he has running on his own LAN will have a far lower ping time than any other player, which can impact how fair the match is. So ultimately, it sounds like you want to run dedicated servers (custom game servers in our service). But you are correct that those have a higher cost than simple web services, or even a matchmaking + packet relay service, like Bolt.

For latency, the primary consideration is going to be regionality. You'll need to run servers in each region where you have a concentration of players, so that the distance between them and a server is minimized. There's also the last-mile issue to consider (crappy connections by players), but there's effectively nothing you can do to improve a player's network connection, so it's best to focus on things that are in your control.

As to pricing, we use EC2 Windows On-Demand instances for hosted custom servers, and pass on that cost directly, with a 10% markup to cover our costs. You can find the details for pricing on different server sizes in the EC2 pricing page, here: https://aws.amazon.com/ec2/pricing/.

Finally, server authority is actually a tricky thing, once you start taking into consideration the perspective of users. A lot has been written on this topic, but in short, for some game types using only the server's state when player packets arrive works fine. Shooters are not one of those game types. Consider:

A player who shoots another player who is dead-center of his crosshairs has a bad experience if that other player takes no damage.

A player who ducks around a corner, then gets hit by a bullet fired by a player who can no longer see him also has a bad experience.

But since each player will have some latency (hopefully less than 100ms, but there will be many cases where it will be worse - potentially much worse if the player is in a region where you can't afford to run servers or where he has a particularly awful network connection), one or the other of those two scenarios is what you're going to wind up with. Most games choose the latter - letting the player hit the other player, since he's looking right at that player, from his perspective, while the other player may not be looking at that player.

But you need to be cautious not to provide too much "give" in your calculations. One cheat technique used is packet interruption. So, a player blocks the network packet flow very briefly when he sees an enemy player. This either causes that player to freeze in place or, if you use prediction, move in a straight line. The player takes the now much easier shot, then turns the packet flow back on. So there is a bit of a balancing act to this. Where specifically you land on this is going to be very game-specific, since there are many factors that will influence what "feels right".

10 |1200

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

Karlo avatar image
Karlo answered

I understand how cheating works in fps games because I was a cheater myself and reverse engineered games, coded memory hacks and sniffed packets etc. This is why I want my game to be very authoritative because I know that anti cheat systems can't be perfect and can always be broken.

In short, what would be the pros and cons of each of my options(Bolt/UNET/PhotonServer/your custom server)? What does Photon Bolt offer me versus UNET and vice versa(as someone mentioned, it's possible to run both UNET and your custom server, is the same possible with Bolt?), in what ways could I combine frameworks(like in the previous example, what would UNET/Bolt be handling in my game and what would your custom server handle)?

I know that from the player's perspective, the logic is really based on the experience in game, and I'm aware that I have to run servers in many regions for players to have a low latency experience, however there is something else which has to be foreseen here - what if someone wants to play a match versus a player who is on the other end of the world? They won't have a close server for both of them to have low enough latency, so the experience will be pretty bad.

Valve(Source engine) games like CounterStrike have full server authority, and in old version of the game(CS 1.6) it was almost impossible to play with 50+ ping, however in the newest version of the game(CS:GO) it is possible to play even with 150 ping while still having full authority handled by the server. There are more examples of this, like Quake where you could play with very high ping and still have good experience without anything being out of sync. These are not Unity games and I'm wondering what they did in order to achieve this and if it's possible to do the same with a Unity game.

10 |1200

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

brendan avatar image
brendan answered

Sure: Bolt and UNet are peer-to-peer, meaning all the updates are necessarily trusting the client. With a custom server (using Photon Server or any other), it runs in a datacenter that the user doesn't have access to (apart from the connection from the client), and can use the Server API.

As to pros and cons between UNet and Bolt, I would recommend contacting Unity and Exit Games, as those are their products. We can give feedback on usage, but it would be best for you to talk with the teams directly for hard "which is better" advice, based upon your requirements.

As to combining custom servers and Bolt/UNet, that's going to be very game specific. The simplest answer I can give is, anything which must be secure should run with server authority, which means a custom game server or Cloud Script. Lighter-weight logic can run in Cloud Script, but it sounds like you want your main game sessions to be fully server authoritative, so they would need to run on custom game servers.

Most triple-A games, quite frankly, try to avoid the issue of players in widely disparate geographic regions playing together, as there is no good solution. There's no way to change the speed of light, so you either have a poor latency time for one player or both.

Games which have a good experience with higher latency start by use prediction algorithms so that clients see other players continue to move, even if they're not getting packet updates (within reason, of course). For example, here's the Source engine write-up on their prediction/interpolation system: https://developer.valvesoftware.com/wiki/Source_Multiplayer_Networking.

10 |1200

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

subzero911 avatar image
subzero911 answered

@Brendan Hi. I have read this topic, but still do not quite understand. If i connect PUN to PlayFab, I can use Cloud Code, right? But if I use Bolt or Unet, i can't do it. But I still can use PlayFab to store player profiles, currency, leaderboards and other data.

,

@Brendan Hi. I have read this topic, but still do not quite understand. If i connect PUN to PlayFab, I can use Cloud Code, right? But if I use Bolt or Unet, i can't do it. But I still can use PlayFab to store player profiles, currency, leaderboards and other data.

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.

brendan avatar image brendan commented ·

None of the functionality of PlayFab itself is affected by which Photon services you use. You can, for example, call Cloud Script from the client using Client/ExecuteCloudScript. I believe what you're referring to is using the Webhooks in Photon to call into handlers in Cloud Script in our service, yes? If so, your best bet is to talk to the Exit Games team about which of their services can provide Webhook calls.

0 Likes 0 ·

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.