Sign In Register

How can we help you today?

Start a new topic
Answered

Managing specific details of a virtual good

The base purchase structure of virtual goods is great, but I'm struggling as to best practices of how to use the goods once they are purchased in the best manner.  Properties and property sets seem a bit heavy for managing options, and tags could work but get equally tedious. Here is an example and 3 approaches, as I understand them.  Are any of these a best approach or is there something else?


Example:

My 'shop' in the game sells many objects. I am focusing on 3 different ones as their types and details vary.


Item 1 - Axe 

- Type : Weapon

- Attack : 10

- Usably by : Warrior, Woodsman


Item 2 - Potion

- Type : HP

- HP : 100

- Usable by : All


Item 3 - Shield

- Type : Armor

- Defense : 20

- Usably by : Warrior

- 2handed : false


So in this case I have 3 virtual goods (easy) but need to set a few properties that apply to all goods (type and usable by) as well as some types having other custom properties (hp, attack, etc)


Option 1: Tags

I can use tags like type_weapon, type_armor, hp_10, etc.

Pros : Flexible and easy

Cons : Parsing chaos, string to int chaos, typos by user input, feels 'dirty' from a development standpoint.


Option 2 : Properties and sets

As I understand this I would make a property for each option (HP10, HP20, HP30, Weapon, Armor)


Then I can set up a property set for each item...

Axe of the Awesome property set -> Contains the tag for Weapon, Attack 10, Who Can Use Warrior, Who Can use Woodsman

These combine more granular JSON onto one mass block with all the settings and can be used at runtime. 

Pros - Can mix and match options and make clear sets.

Cons - Extremely tedious for something I could drop in JSON on an item. 


Option 3 - Custom solution

This can be worked into meta data or db storage with lookup references for each item with additional info as a document.

Pros - more flexible, more searchable

Cons - Tedious to match and make sure that every virtual good has its associated table with it. 

No built in way to get back the meta data WITH the virtual good without custom handlers (IE a base call to get the user's info won't contain this data)


The DB designer in me is leaning heavily towards #3 with a custom function to get store inventory, get user inventory, etc


Am I on the right track here or missing built in options that would be better?


Thanks. 


-Chuck


Best Answer

Hi Chuck,


While all three options are viable to meet the needs of your game, we do have a dedicated tutorial for creating a system to Load, Save and Manage your players inventory through the use of Events, Meta and Runtime collections. I believe you might find this the most useful as you are slightly leaning towards a more database style inventory system.  The tutorial itself can be found here

Do you think this might work best for your game?


Thanks,

Ronan


Answer

Hi Chuck,


While all three options are viable to meet the needs of your game, we do have a dedicated tutorial for creating a system to Load, Save and Manage your players inventory through the use of Events, Meta and Runtime collections. I believe you might find this the most useful as you are slightly leaning towards a more database style inventory system.  The tutorial itself can be found here

Do you think this might work best for your game?


Thanks,

Ronan

Thank you. I went through the forums, API, etc and managed to totally miss this example. Just what I needed and looks like I am on the right track. 

No problems at all Chuck, glad to be of help.


Ronan

The tutorial Ronan is pointing out does NOT use Virtual Goods, nor Property Sets!


I don't understand the purpose of Properties if we can't modify them. Are they supposed to be static values?... then they are just flags.


As Chuck, I'm creatig VirtualGoods with PropertySets.

The property is a number called "discount" (more complex than that).


Different VirtualGoods have different discounts.


Q: How do designers asign different discounts to different VirtualGoods?


The sad part is that, in the tuturial, GameSparks team creates a totally different way of having a player's inventory, not using player.virtualGoods at all. Why? This means we would never use any Store endPoint, only custom Events.


I've been spending a lot of time on this, and I just found out PropertySets are NOT editable via CloudCode or Dynamic Forms, are they?


Bests,

M

Virtual goods seem to be very static, the only way that you can modify them is by having a property set for each level for example, and having that set to change with segments.. Overall Ive found them to be very useless and not very usefull if you want to change values dynamically. 


You're better off using meta data or data types, and creating an admin screen for designers to change what needs to be changed.

Login to post a comment