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 ddiez · Jun 13, 2016 at 08:51 AM · CloudScriptIn-Game EconomyPlayer Inventory

Time Locked Items

Hi!

 

I'm developing a game where there are locked items given to the players that will automatically open after a certain period of time, similar to locked chests in the popular Supercell title Clash Royale.

 

I guess I have to create one catalog item for the chest given to the player, and write a variable in the custom data of the item instance to store the timestamp when the chest should open.

 

Is this a good approach? I couldn't find any good practice regarding this topic...

Another approach could be to create a "locked container" item and grant the player the key for that container when the time expires, but I think it's a bit more complicated.

 

Thank you!

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

3 Replies

· Add your reply
  • Sort: 
avatar image
Best Answer

Answer by Brendan · Jun 13, 2016 at 03:53 PM

Well, you definitely need to make the container a locked item (require a key), since otherwise a hacked client could open it whenever it wanted to by calling UnlockContainer. For when to allow the item to be opened, I would go with your plan of adding a timestamp to the chest. When the client detects that the time has passed, call a Cloud Script to which you pass the inventory item instance ID, have the script double-check the timestamp, add the key, and unlock the chest (using the instance ID version of the unlock call).

Comment
Richard

People who like this

1 Show 2 · 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 plourdegui · Apr 03, 2018 at 02:07 AM 0
Share

What if we want the server to detect when a given locked item timestamp is past due?

Is it possible to implement a "Scheduled Task" which periodically iterates over all players' timebound/locked items and then sends a push notification to those that are past due?

The problem with making the client authoritative about the lock countdown check is that the player would only be informed when the game is on.

If ever it is possible to make use of push notifications for that purpose, is it possible to then cancel a push notification that has been previously delayed or even change its timestamp?

avatar image Brendan ♦♦ plourdegui · Apr 03, 2018 at 03:36 AM 0
Share

What I'd suggest is that you have a Segment for users who haven't signed in within the last 24 hours (or possibly more - depends upon how aggressive you want to be), but make it a one hour block. So, haven't signed in for more than 24 hours, but less than 25. Then, have a scheduled task that iterates through that set of people every hour and sends a Push to them. You could use info about their inventory status to choose which Push you go with - "you have a container available", or simply "we miss you", etc. The >24 <25 logic ensures that the Push messages will target when the player last played (so, hopefully when they normally play), and will keep the Segment from growing too large (since it would take too long to process, then).

avatar image

Answer by ddiez · Jun 13, 2016 at 06:34 PM

Thank you very much for the answer.

I'm thinking about using a regular item rather than a locked container, which will solve the problem of the client calling UnlockContainer as you mentioned before. Besides, the content of the chest is calculated by an algorithm and it's not fixed, so I don't think it's a good approach to make one container for each combination of possible results, or even to use drop tables.

I don't know if I'm right, but the approach would be very similar than with the locked container, storing the timestamp and code of the result of the chest in the custom data and then checking it in the client, calling CloudScript, make some counter-cheat checks and process the results.

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
avatar image

Answer by Brendan · Jun 13, 2016 at 10:10 PM

Sounds like a good plan. And yes, you are correct - if your containers drop items which can't be represented with weighted values, you'll need to have distinct logic to manage that.

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

    Item to Currency Conversion 1 Answer

    How to grant an item securely? 1 Answer

    Granting Bundles after IAP purchase 1 Answer

    Initial set of characters from server 1 Answer

    Best practice for getting user data and account info on login 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