question

marcmptest avatar image
marcmptest asked

Possible to store player's game session data?

Hi, currently I have made a game that tests and logs users' reaction speed, and I was wondering if there is a way to explicitly store player session information with UpdatePlayerStatistics()

Right now, I the data that I would like to capture would be 1.Current timestamp of game session and 2. the time of each click of the player, with the assumption that I can use Player Data with the game manager as a means of identifying users

Traditionally in SQL, my table would look something like :

__________________________________________________

[PlayerID] | [SessionTimestamp]| [ClickTimings (in json format)]

--------------------------------------------------------------------------------------

Would this be possible to be implemented with playfab? Any thoughts would be appreciated

Player Data
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

·
madmojoman avatar image
madmojoman answered

Yes, you can find more information about using Player Statistics here:

https://api.playfab.com/docs/tutorials/landing-players/player-statistics

And you could also use Player Data, as well. Which may be a better method to use in this situation, especially if you want to keep the data private in any way. Find more information about that here:

https://api.playfab.com/docs/tutorials/landing-players/using-player-data

But it also probably depends on the size of the ClickTimings data, though. If the player is clicking thousands of times and you're saving the timing of every single one of those clicks...I'd think about if that's really something that needs to be saved for loading at a later time. Maybe just keeping the top one to five fastest click timings or something instead, and that would work fine.

Either way, you should be able to use either of those methods to get the results you're wanting.

6 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.

marcmptest avatar image marcmptest commented ·

Hi, I appreciate the response

Statistics does look like a way forward, but if I set the key as the sessiontime stamp, that would be very messy from a development point of view, wouldn't it ?

If I add another minigame, would my key (as said in the documentation, saved as a string) be something like "Game1 + DateTime"?

0 Likes 0 ·
Seth Du avatar image Seth Du ♦ marcmptest commented ·

In terms of Statistics, we usually do not suggest allowing players to update, which may cause abusive uses. You are able to disable it in API Features of Settings in the Game Manager. It will be better to implement it in the Cloud Script so that you may use server API and also do a value verification before the update.

The value of Statistics only can be a number, you may craft your own special format, otherwise, Player Data will be a good choice since it supports structured Json Object.

0 Likes 0 ·
marcmptest avatar image marcmptest Seth Du ♦ commented ·

I see, so for this particular database access control I will have to explore cloud script implementations.

Pardon my lack of experience on this matter, I am new to playfab, but as I understand that some subsystems of playfab is built upon dynamodb (please correct me if I am wrong), may I know if there is a way to create a table directly with playfab?

Say I would like to create a table with the partial keys of a unique game id and the current timestamp, may I know what would be the best possible solution, in your opinion?

0 Likes 0 ·
Show more comments

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.