Search Unity

Question cloud merchant (Economy or just cloud save)?

Discussion in 'Economy' started by xyvan, Feb 3, 2023.

  1. xyvan


    Jun 21, 2014

    I am trying to put shopping part of my game in cloud.
    Basically there will be a lot of buying and selling to the game merchant. with a cost in every item.

    I looked into Economy, and i am not sure i should use it instead of cloud save.since:

    Virtual purchases is not base on item, instead it is a preset package.

    Not sure if it is wise to define every item with 2 virtual purchase package : its cost and selling price.

    ATM item are not stackable, i will have to add custom data inorder to do so.

    It generate lot of useage since player happens to trade a lot with merchant

    I can not purchase mutiple item in one call, it require a bundle of virtual purchase, if every item is defined with one buying virtual purchase ID and one selling ID.Hence there will be no way to check if the bundle of virtual purchase is validate like buying 10 swords at the same time.

    Base on above reason should I use cloud save to do such kind of thing or Econnomy is still good for that.?

    Last edited: Feb 4, 2023
  2. Laurie-Unity


    Unity Technologies

    Mar 5, 2020
    Hi @xyvan

    Thanks for sharing your observations and feedback on Economy.

    A couple of the points that you mention are things that we have been discussing and would help with quite a few use cases.
    • Batch operations : It is only possible to add or remove items from a player's inventory one at a time at the moment. Batch operations allowing you to work with numerous items on a single call would be more efficient, but we need to take care not to create long running async calls.

    • Stacking : Isn't something that is supported out of the box, but can be implemented using Custom Data and Instance Data e.g.
      Code (CSharp):
      1. {
      2.     "assetName": "Apple",
      3.     "canPickup": true,
      4.     "category": "FOOD",
      5.     "isStackable": true,
      6.     "maxStack": 12,
      7.     "quantity": 1,
      8. }
    One of the benefits of the way that we have structured Virtual Purchases is that you can define them with multiple cost and rewards for each purchase. e.g. a food hamper could cost 10 coins and contain 5 apples, 3 banana & 1 pie. Making a single Virtual Purchase call will result in the players coins getting decremented and their inventory getting incremented accordingly. Should you decide to alter the price or contents of the Virtual Purchase, it can be updated in the UI withought modifying or re-publishing your code.


    As for the decision to use Economy, or Cloud Save to store all or part of the player's resources, that is something that will depend on your specific game design. One other thing you might want to consider if you are tending towards Cloud Save is using Remote Config for virtual item definitions and keeping Economy for real money purchases of virtual currency. E.G. use economy to buy Gold for $ and use remote config to store the definition of individual virtual items e.g. price, stackability, asset name, weight, durability etc..

    This would give you some of the server authoritative benefits for Economy for Real Money and Currency and offload the inventory management to Remote Config / Cloud Save.

    At the end of the day you will need to weigh up cost versus convenience for your particular use cases.

    I will share your observations with my colleagues and we will be sure to consider them as we discuss further improvements for Economy.

    xyvan likes this.