Microsoft Azure PlayFab logo
    • Multiplayer
    • LiveOps
    • Data & Analytics
    • Add-ons
    • For Any Role

      • Engineer
      • Designer
      • Executive
      • Marketer
    • For Any Stage

      • Build
      • Improve
      • Grow
    • For Any Size

      • Solo
      • Indie
      • AAA
  • Runs on PlayFab
  • Pricing
    • Blog
    • Forums
    • Contact us
  • Sign up
  • Sign in
  • Ask a question
  • Spaces
    • PlayStream
    • Feature Requests
    • Add-on Marketplace
    • Bugs
    • API and SDK Questions
    • General Discussion
    • LiveOps
    • Topics
    • Questions
    • Articles
    • Ideas
    • Users
    • Badges
  • Home /
  • General Discussion /
avatar image
Question by Ion · May 31, 2020 at 11:47 PM · CloudScriptTitle DataphotonShared Group Datawebhooks

Achievement system + Photon webhooks

Hey!

I am starting to build an achievement system. I have been reading other posts about achievements, and finally I decided to post my thoughts.

I have read a good approach would be storing meta-data in the title data and storing player progress in its own read-only data.

So I can use cloud script to make achievements progress checking both data.

I am not using my own game server, but I am trying to avoid client api calls for user data etc.

Also, the matches are up to 8 players. It's a realtime gameplay.

Since my game uses photon for multiplayer, I was thinking to take some more room properties through photon webhooks. I am using shared group data for potential data of the room (game state, the result place - depending on the member amount left in the group...).

I call raise events to remove a member from the shared group, if he has been eliminated, for example...(and updating others result place) and I am also taking the game state from webhooks.

But I think I could jump to the next level taking some more data from room properties, like some statistics for each player, so I can store in the data of the player in the shared group, and update its achievements when the game finishes.

Have I explained correctly?

Is this a crazy idea? Should I manage achievement statistics more locally and send to the server when the game finishes?

I know it is potentially hackeable, even though I could check that the received data have sense.

I think saving data through room properties and update in the cloud script, could be more secure, what do you think?

Any suggestion is very welcome.

Thanks for reading!

Comment

People who like this

0 Show 0
10 |1200 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users

2 Replies

· Add your reply
  • Sort: 
avatar image
Best Answer

Answer by Brendan · Jun 01, 2020 at 02:20 AM

One immediate issue is that Shared Group Data is not intended for realtime gameplay. All it really is, is player data that has no single owning player. So it works quite well for strictly turn-based asynchronous games (which is what we added it to support), but if you have multiple players trying to update it at the same time, you're going to have contention issues, as well as players overwriting each others' updates. One way to solve that could be to move to Entity Objects or Files.

However, the other issue is twofold: First, if you're updating shared data for a realtime game, you're going to be updating that data at a high rate. Second, you're also going to be reading it at a high rate, since scripts run stateless - so, each script has to read the data to know the state that you're updating. All these reads and writes are going to hit the relevant meters (https://docs.microsoft.com/en-us/gaming/playfab/features/pricing/meters/meters).

So between the cost of the high level of reads and writes, plus the fact that you're correct that since the state of the game is really being updated by the clients, you're more vulnerable to cheating, you'd likely be much better off using hosted game servers. The servers would protect you against cheating far more, since the only thing you'd be taking from the clients are inputs, and all the state information for the session would be in memory on the server, so no reads or writes would be required at all during the session - you'd just update the PlayFab store of data at the end (or periodically during the sessions, if they run long).

Comment
Ion

People who like this

1 Show 1 · Share
10 |1200 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users
avatar image Ion · Jun 03, 2020 at 12:29 AM 0
Share

Sorry I answered to the post. Could you check it please?

It is very appreciated.

Thanks!

avatar image

Answer by Ion · Jun 01, 2020 at 09:15 AM

thanks Brendan.

But the way I am using shared groups its very simple. i just create a group when the match starts. The master client raises an event to create it.

After that, the SGD is only updated when a player kills another. and it is done by a raise event using webhook.

Each player has his KVP in the group, but others can edit it when they die, to update the result place. So if the game finishes by time or by being the only player alive, the players can call a function in the cloud script and get the result and the reward.

I could send Achievements statistics only at the end of the match then.

In one hand, I am not worried about cheaters, almost in our first version.

In the other hand, I don’t have experience with own game server and I find it much slower development.

So, what do you think about using SGD in that way? I create the group in raise event webhook. The group is only updated through them and only up to 12 times in about 5 min of gameplay, then the SGD is deleted when all the players left the room. The idea is to store the final results in a more secure way.

thanks.

Comment

People who like this

0 Show 0 · Share
10 |1200 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users

Your answer

Hint: You can notify a user about this post by typing @username

Up to 2 attachments (including images) can be used with a maximum of 524.3 kB each and 1.0 MB total.

Navigation

Spaces
  • General Discussion
  • API and SDK Questions
  • Feature Requests
  • PlayStream
  • Bugs
  • Add-on Marketplace
  • LiveOps
  • Follow this Question

    Answers Answers and Comments

    3 People are following this question.

    avatar image avatar image avatar image

    Related Questions

    webRpcResponse.Parameters are coming up null / RoomCreated not being called 4 Answers

    ,How to use PlayFab for storing persistent Photon Rooms? 1 Answer

    Is there a way to Send Data between Clients ? 1 Answer

    SharedGroupData Notification on Desktop 1 Answer

    Allowing User to Save Images/Audio/Video File on Playfab 1 Answer

    PlayFab

    • Multiplayer
    • LiveOps
    • Data & Analytics
    • Runs on PlayFab
    • Pricing

    Solutions

    • For Any Role

      • Engineer
      • Designer
      • Executive
      • Marketer
    • For Any Stage

      • Build
      • Improve
      • Grow
    • For Any Size

      • Solo
      • Indie
      • AAA

    Engineers

    • Documentation
    • Quickstarts
    • API Reference
    • SDKs
    • Usage Limits

    Resources

    • Forums
    • Contact us
    • Blog
    • Service Health
    • Terms of Service
    • Attribution

    Follow us

    • Facebook
    • Twitter
    • LinkedIn
    • YouTube
    • Sitemap
    • Contact Microsoft
    • Privacy & cookies
    • Terms of use
    • Trademarks
    • Safety & eco
    • About our ads
    • © Microsoft 2020
    • Anonymous
    • Sign in
    • Create
    • Ask a question
    • Create an article
    • Post an idea
    • Spaces
    • PlayStream
    • Feature Requests
    • Add-on Marketplace
    • Bugs
    • API and SDK Questions
    • General Discussion
    • LiveOps
    • Explore
    • Topics
    • Questions
    • Articles
    • Ideas
    • Users
    • Badges