Virtual Goods
In the GameSparks platform, a Virtual Good is any in-game asset that can be awarded, accumulated, or bought. This would cover XP points and in-game Currencies, as well as specific goods that deliver benefits in-game (convenience, customization, competitive advantage, and so on). Virtual Goods:
- Can be used and consumed cross-platform.
- Can be set up to be bought as in-app purchases (IAPs) - you associate the Virtual Goods with the Product IDs of the corresponding items on the stores and when a good is purchased, the store receipts are reconciled with the items.
- Can be traded or converted - you can establish relationships between Virtual Goods to facilitate this.
- Can be designated as a Currency Pack when you want your players to be able to exchange real money for in-game Currencies through 3rd-party store requests.
FAQs? You can review Frequently Asked Questions about creating and managing your Virtual Goods.
Managing Virtual Goods Configurations
The Configurator > Virtual Goods page displays the list of Virtual Goods and allows you to create new Virtual Goods and edit or delete existing ones:
You can use the following options (highlighted above):
- Add - Add a new Virtual Good.
- Edit Virtual Good.
- Delete Virtual Good.
Creating a Virtual Good Configuration
Click to Add a new Virtual Good. The Add Virtual Good page opens:
- Short Code - A mandatory field used to give the Virtual Good a unique identifier for use elsewhere in the Portal and in Cloud Code.
- Name - A mandatory field used as an identifier to help you find the Virtual Good in the Portal.
- Description - A mandatory field, which you can use to describe the Virtual Good.
- Currencies - The amount of each Currency needed to buy the Virtual Good. In the above example, the Virtual Good will cost players 10 in any of Currency 1, Currency 2, or Currency 3.
- Product IDs - The ID of the item that has been created in the appropriate store:
- Entering a Product ID for a 3rd-party client store item links the Virtual Good to that item in the store's inventory. When a player makes a purchase against the item in the store, GameSparks validates the receipt sent through from the client and adds the purchased Virtual Good to the player's profile. For more details, read this tutorial.
- Max Quantity - The maximum quantity of this Virtual Good that the player can own at any one time. Only enforced on BuyVirtualGoodsRequest using virtual Currency. Purchases from external stores will still be awarded even if they result in this maximum being exceeded.
- Tags - Tags associated with the Virtual Good.
- Type - Specify the type: Is this a Virtual Good or a Currency Pack?
- You would typically select Currency Pack as the Virtual Good's Type when you want to allow your players to exchange real money for in-game currencies. When players purchase a Currency Pack Virtual Good using any of the 3rd-party store BuyGoodsRequests, such as IOSBuyGoodsRequest, they will be credited with the game Currency amounts you've configured for that Currency Pack Virtual Good. Note that:
- You cannot purchase a Currency Pack Virtual Good with a BuyVirtualGoodsRequest - you'll receive an error. See Error Codes listed on this page.
- If you award a Currency Pack Virtual Good to a player using Cloud Code, the player will get the Virtual Good and not the Currencies configured for the Virtual Good.
- If you link a Currency Pack Virtual Good to an Achievement and then award the Achievement to a player, the player will receive the Virtual Good and not the Currencies configured for the Virtual Good. If you want to award your players with Currency amounts when they gain an Achievement, you can configure Currency rewards as part of an Achievement's configuration - for details on how to do this, see the Achievements page.
- You would typically select Currency Pack as the Virtual Good's Type when you want to allow your players to exchange real money for in-game currencies. When players purchase a Currency Pack Virtual Good using any of the 3rd-party store BuyGoodsRequests, such as IOSBuyGoodsRequest, they will be credited with the game Currency amounts you've configured for that Currency Pack Virtual Good. Note that:
- Property Set - Select the Property Set which you want to attach to the Virtual Good - the Property Set will be surfaced and made available wherever you use the Virtual Good.
- For more details on attaching Property Sets to Virtual Goods, see here.
- Bundled Goods - Select any other Virtual Good which you want to bundle in with the Virtual Good you are configuring. This means that the bundled goods will also be awarded whenever the Virtual Good is awarded. For example, you might want 3 Copper Coins to be awarded to any player that is awarded a Bronze Coin.
- Disabled - Switch to disable the Virtual Good. When disabled, a Virtual Good cannot be bought:
- BuyVirtualGoodsRequest is not available.
- ListVirtualGoodsRequest returns a null.
- Currency Costs - Add Currency costs for the Virtual Good using any of the game Currencies you've created from the Currencies page. In this example, we've costed the Virtual Good at 12 of Currency A.
Virtual Good Segment Configuration
Click Segment to apply a segmentation query to the Virtual Good. This means that if the segmentation query applies to a player, that player receives the values you configure here - Currencies and Product IDs - instead of the values you have set in the main Virtual Good configuration:
In this example, any player to which COIN_SEG_QUERY applies receives a Tin coin - valued at 5 for Currencies 1, 2, and 3 - instead of a Copper coin - valued at 10 for Currencies 1, 2, and 3.
Note: You can disable the Segment Configuration even if you have not disabled the Virtual Good. This means that any players to which the query applies will not be able to buy the Virtual Good.
Segmentation - More Details? For more information on how to set up and work with segmented Virtual Goods, see Segments.