question

Gogoasdfg avatar image
Gogoasdfg asked

Asynchronous Game - Can we update offline players data?,Asynchronous Game - Can we update data when player offline?

Hey,

We are doing a travian-style asynchronous game. It will be run on pc and mobile platforms. Thinking about using unity + photon + playfab.

  • Can purchable items will be on currency (economy) side i think. Also players have woods, golds, iron and workers etc. on their village. Should we store this data (only numeric) on PlayerStatistic (leaderboard) ?
  • We also have constant data like archerAttackPower etc. which is shouldn’t reachable from user. Where should we save it?
  • For example when ‘A’ player is online and ‘B’ player is offline if ‘A’ player attack the ‘B’ player, how can we update ‘B’ player data? Normally we thinking update data only when players come online or when players build something etc.

Thanks.

,

Hey,

We are doing a travian-style asynchronous game. It will be run on pc and mobile platforms. Thinking about using unity + photon + playfab.

  • Can purchable items will be on currency (economy) side i think. Also players have woods, golds, iron and workers etc. on their village. Should we store this data (only numeric) on PlayerStatistic (leaderboard) ?
  • We also have constant data like archerAttackPower etc. which is shouldn’t reachable from user. Where should we save it?
  • For example when ‘A’ player is online and ‘B’ player is offline if ‘A’ player attack the ‘B’ player, how can we update ‘B’ player data? Normally we thinking update data only when players come online or when players build something etc.

Thanks.

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

·
Seth Du avatar image
Seth Du answered
  • For woods, irons, workers or other materials, you can define stackable items for them. In terms of Gold (if it is for purchasing), you can create a Virtual Currency. However, if it is just some resources ‘statistic’ numbers (not for trading or other purposes), you can define them in the form of KVP in player's READ ONLY DATA, and all consumption actions can be done via Cloud Script.
  • For some data that player should not be able to reach, you can define them either in READ ONLY DATA or INTERNAL DATA within Player Data. Besides, Leaderboard/Statistics are more like for recording temporary scores.
  • In your case, it’s better to implement a Cloud Script to handle the asynchronous actions, for example, if ‘A’ attacks ‘B’ and obviously ‘A’ should be online, the client will execute Cloud Script functions which receiving attributes (attack power, etc.) and target from ‘A’, then Cloud Script will calculate the damage (you may also get ‘B’ defense power or something) and call server API to update ‘B’’s data. In addition, you can send a push notification to ‘B’ to inform that he is attacked. The attack result settlement should be done right after the attack, and it should not wait until ‘B’ comes online.
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.

Gogoasdfg avatar image Gogoasdfg commented ·

Thanks for your reply @SethDu

For the first answer i want to be sure. Should i define the KVP for my materials (wood, iron etc) from GameManager / Content / Title Data? Or where is the right place for define stackable items?

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

What I have mentioned are 2 different ways(as player data and as items) to define the economy system. You can choose any one to develop your game.

Materials should be defined in Player Data, please see the attached screenshot. You are able to update them via Game Manager and API calls. While Title Data is not designed for frequently changing data and is actually a cached, sharded resources. There can be a delay before all endpoints are updated (based on the TTL of data store)

To define Stackable items, you can navigate to [Game Manager] -> [Catalogs] ->[your defined catalog], and just click NEW ITEM. Stackable is an attribute of the item.

1 Like 1 ·

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.