question

allen avatar image
allen asked

Inquiry of service capabilities and suggestions on the best way to implementation

Hi,

We are looking for some advice/insight on if the service provides the following out of the box, and some suggestion on how to implement it

  1. Allow one player to login into multiple devices
  2. Allow each device to record active usage time
    1. Granularity of 1 minute is acceptable
  3. The total of active usage time of all devices is attributed to the player
  4. Currency or player Level increases based on total record active usage time
  5. Leaderboards
    1. by total active time of player
    2. Aggregated total active time of multiple players as friends/guild/clan

Additionally, at what level of subscription plan would these features be available?

Player DataLeaderboards and Statistics
10 |1200

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

Citrus Yan avatar image
Citrus Yan answered

Hi @allen,

I don’t know the specific details about your application, however, based on your description, the features you mentioned are viable through PlayFab:

1)Allow one player to login into multiple devices

This is easily done through Anonymous login mechanisms

2)Allow each device to record active usage time

Your client applications is responsible for tracking active time and sending events containing the active time payload to PlayFab service, also note to make this process less frequent, for instance, at least 1 minute per interval, to avoid enormous API calls.

3) The total of active usage time of all devices is attributed to the player

When the events are sent to PlayFab, use Actions and Rules to trigger a Cloud Script function to update device-specific time statistics (if you need them recorded), total active time statistics, total active time statistics in a Group Entity (the player belongs to).

4)Currency or player Level increases based on total record active usage time

When the players update their statistics, some of them will enter a new Segment you pre-defined, which will trigger actions to grant virtual currency, update level(this is usually saved in player data, use Cloud Script function to update it ) accordingly.

5)Leaderboards

Leaderboard will reflect on statistic changes, you can use GetLeaderboard to retrieve the updated Leaderboard. Leaderboard V2 now supports ranking of other entity types in Playfab, which means you can rank the Group entity (multiple players as friends/guild/clan).

Here is a possible workflow:


>>Additionally, at what level of subscription plan would these features be available?

Real-time rules and Player segmentation features are for Indie tier or above, it’s listed on the pricing page. So, you can have an indie tier for a start and then customize your plan based on your actual use case. If you have any billing questions, please contact the sales team in here: https://playfab.com/support/contact/


workflow.png (134.2 KiB)
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.

allen avatar image allen commented ·

Hi,

Thanks for the detailed reply! We have a look at the items you suggested, and wondering what's your thought on

1. using Player - multiple Characters relationship to implement the recording of one player having multiple devices active? In which, we should be able to get Player's total stats among all characters and use it in a leaderboard?

2. What can we use to notify the level up, new device sign-in, device sign out/disconnect event of a player be received from all user's devices?

3. What mechanism is there to recognize that a device has become offline?

4. Would it be better to setup a Timer based (say for 1 minute) Cloud Script to increase the active time for each connected/active device, then push the notification to all clients?

0 Likes 0 ·
Citrus Yan avatar image
Citrus Yan answered

Hi @allen,

1. No, simply linking multiple devices to the player and setting up multiple statistics for each device should work just fine. In this way, you'll only need to call GetPlayerStatistics/UpdatePlayerStatistics once to implement the logic without having to call UpdateCharacterStatistics/GetCharacterStatistics multiple times to each character, which simplifies the logic and cuts down API calls. You then set up the leaderboard for each statistic, it would reflect on statistic changes automatically.

2. You can use PlayStream events service to notify device sign-in, level up, and other events. For device sign-in event, there is a built-in event called player_logged_in which logs all the associated data. For other events, you can write custom events from the client to PlayFab.

3. PlayFab is a stateless service, which means that a player can access it as long as a session ticket is valid. A possible way would be to delete sessionticket locally so that the clients won't be able to make successive calls. You can navigate to this thread for more info.

4. In order to do that, you'll need to keep a list of connected/active devices, which is not supported by PlayFab itself. And, given that you managed to keep the list in an external server and pass the info to CloudScript every minute to increase active time and push notifications to each device, the problem is that iterating across players in CloudScript is not supported by PlayFab since it would hit our service with far more calls that are allowed by our Terms of Service. Please refer to this thread for more info.

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.