Sign In Register

How can we help you today?

Start a new topic
Answered

Virtual Good Transactions and Config Data - Purchasing Unlocks

I have a game in which the player can buy building blocks to build with to make space ships (current prototype built in flash using Flox backend, I'm looking into implementing it in Unity with Gamesparks backend). I have json data that defines each part's info (e.g. size, shape, sprite id, color). I give the player a set of building blocks to start with but only though playing the game can they unlock more parts.


Here's an example of my shop:

http://screencast.com/t/pMQelmmkKXvS


Let's say I'm using currency1 as the main currency to purchase the part. Once they purchase a part, they get it forever and can use as many instances of that part as they want for their building projects.


Example of parts unlocked and the building mode:

http://screencast.com/t/R9zyy0YzmB


I have hundreds of unique parts, but each part may share a similar price as you can see in the shop screenshot.


Question #1: How would you recommend defining the part cost info through Sparks? I don't think I need to create an individual virtual good for each and every part, but instead perhaps a price tier virtual good (e.g. virtual goods: common, uncommon, rare, epic) and then reference that virtual good id in the part's config json.


Question #2: How would you recommend I set up the transaction to unlock a part through cloud code so that the currency1 cost is deducted and the unlock is awarded? Do I even need to use a virtual good to accomplish this?

 


Best Answer
Hey Jason,

[1] - There arent any limitations with VG costs, they can be whatever you like (they cant be decimals though) so really it depends on how much you want to charge. If you have tiers, then you can just define your goods like that.
If you want to cut down on how much prices you enter, you could use tags on your VG and then check the tag for how much the good costs.

[2] - No, you dont specifically need to use VGs for this. You could use a custom collection of your own, with the part's cost and details, and have the transaction, log and currency deductions all operate from a single event. Parts can be added to player script data instead of players VGs. This might be useful, for example you have VGs that are not parts. But you can use tags to filter non-part VGs out anyway, so either way is fine.

The benefit of using VGs is that you can also hook them up to your play-store or app-store goods.

 

Does that help?

Sean

1 Comment

Answer
Hey Jason,

[1] - There arent any limitations with VG costs, they can be whatever you like (they cant be decimals though) so really it depends on how much you want to charge. If you have tiers, then you can just define your goods like that.
If you want to cut down on how much prices you enter, you could use tags on your VG and then check the tag for how much the good costs.

[2] - No, you dont specifically need to use VGs for this. You could use a custom collection of your own, with the part's cost and details, and have the transaction, log and currency deductions all operate from a single event. Parts can be added to player script data instead of players VGs. This might be useful, for example you have VGs that are not parts. But you can use tags to filter non-part VGs out anyway, so either way is fine.

The benefit of using VGs is that you can also hook them up to your play-store or app-store goods.

 

Does that help?

Sean

Login to post a comment