Creating a Virtual Good

Introduction

In the context of 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 (such as convenience, customization, competitive advantage, and so on). These can be used and consumed cross-platform:

There are many ways of awarding Virtual Goods. In this tutorial, we'll award the player with a Virtual Good by "purchasing" it. This is done via a BuyVirtualGoodsRequest.


FAQs? You can review Frequently Asked Questions about creating and managing your Virtual Goods.

Setting Up a Virtual Good

1. First, navigate to Configurator > Virtual Goods. The Virtual Goods page opens:

Any existing Virtual Goods are listed and you can edit or delete them.

2. Click Add. The Add Virtual Good page opens.

3. Next, enter the details of the new Virtual Good:

You can leave the other configuration options as default.

Other Configuration Options? For more details on the configuration options for Virtual Goods, click here.

Purchasing the Virtual Good in the Test Harness

Now everything is set up, you'll need to navigate to the Test Harness and authenticate with one of the players you have registered previously. The previous tutorial showed you how to award your player with some currency via an Achievement. Now you are ready to purchase your first Virtual Good.

1. To start, and just to be sure, let's validate that the player has enough of CURRENCY_1 to purchase the Virtual Good using the AccountDetailsRequest:

2. To get the Virtual Good, under Requests click Store and select BuyVirtualGoodsRequest. To submit this request, you'll have to fill the following values in the JSON builder:

3. Click Send Request.

Receiving a successful BuyVirtualGoodsResponse is a good indication everything has succeeded. However, you should still validate this by doing an AccountDetailsRequest. You should see that the Currency 1 has decreased by 1 and that you've been awarded with 1 Gold Coin.

SDK Instructions