question

abdou23 avatar image
abdou23 asked

Dealing with offline users

Hello, I don't have much experience when it comes to backend services ( or in general)

Basically, I'm making a semi-online game. It's an action game where the player fight monsters. But I want to add a "Raid" system where multiple players in a certain group will fight the same enemy and eventually share the loot when he dies.

The enemy will have a health bar, (let's say 1000 points) that will be shared among that group of players, so when a player deal some damage (200) the other players should immediately see that the bar is now at 800 points.

Two questions:

1- What is the most efficient way of achieving this in real time, or even every few seconds.

2- How to deal with offline players? does Playfab provid some sort of "auto-synch" like Firebase?

Thank You.

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

For a realtime game such as you describe, you'll need to use some form of server that can handle a high rate of data packet updates - either Photon Realtime, or (if you need server authority, which I would recommend) either Photon Enterprise or custom game servers.

For the question on offline management, presumably that's completely distinct single-player experience from the first question, since there you're talking about a multiplayer experience. We do not currently provide an offline cache for player actions. We plan to provide that in a future update, but for now you would need to store information about any offline gameplay and then update it when the player is back online (summarizing the changes, to minimize the number of calls - so, total XP gain, etc.).

2 comments
10 |1200

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

abdou23 avatar image abdou23 commented ·

Thanks for your answer @Brandon
Perhaps I was not very clear on describing my game, the players don't play together in realtime, meaning that they don't see or interact with each other. the only connection between them is that enemy's health bar, which if a player is just sitting there doing nothing and a second player is dealing damage, the first player should see that bar getting lower based on the second player's actions.
So, a player does an action and it gets sent to the server, and the server synchronizes that action to all the other players when it happens. This system in my game will not end in seconds or even minutes, it might last for hours or even days.
My second question was about that same game, a player might get offline and I want the amount of damage he dealt to get synched with the other players once he gets back online again.

0 Likes 0 ·
brendan avatar image brendan abdou23 commented ·

Sorry, but that's still effectively a multiplayer game. You want to have each player's actions be reflected in each other player's display of the game in realtime ("immediately", from your post above). That requires a high-frequency message passing system, like Photon Realtime, Photon Enterprise, or a custom game server.

For the offline player, you'll need to track his actions and then sync when the player is back online. But if the player is playing the same fight offline, he's going to be playing against an increasingly irrelevant state as time goes by, since he won't have any information about the actions of other players. What do you plan to do about the case where the other players took out the creature long before he came back on line to re-sync? Or does that not matter in your gameplay model? Are you not making any XP or reward calculations based upon the total damage done by each player?

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.