Skip to content

3 Economy Systems Guide

Paul Gilmore edited this page Nov 14, 2017 · 11 revisions

PlayFab provides an all inclusive system for managing your game's virtual items and virtual currency. Simply define economy the Game manager and fetch the data using the PlayFab API.

Unicorn Battle uses both player inventories as well as character inventories. Up to 10 characters can be saved per Player account. Stores come in the form of selling Character Slot stores, to selling Premium Virtual Currency Packs, to random merchants that are discovered along the player's journey.

Basics:

All in-game items are contained within the CharacterClasses catalog. This catalog represents a typical game catalog with durable items, consumables, keys and locked containers. All transactions take place using in-game stores, are processed using player inventory and virtual currency balances.

Virtual Currencies In-Use:

Virtual Currencies (VC) can be found in the Game Manager under the Economy > Virtual Currencies Section.

  • Hearts - A regenerating lives mechanic. Lives are required to access quests.
  • Gold - The general medium of exchange. Found during quests and used to make purchases from in-game stores.
  • Gems - A premium currency for purchase at many of the in-game stores. Used to purchase premium game features like extra character slots and additional gold.

Catalog Items

Unicorn Battle uses several variants of CatalogItems:

  • Character Tokens - Special items that control the creation of new characters.
  • Durable Items - These items are permanent additions to the player's inventory
  • Consumable Items - These items have limited uses that are consumed during battle.
  • Containers -These are locked and unlocked containers that award random items based on a drop-table.
  • Keys - These are consumable items that are required for opening locked containers
  • Premium Currency Bundles - These items are purchases through in-game stores for Real Money via the GooglePlay or iTunes marketplaces. Your CatalogItem itemIds must match the ids on 3rd party marketplaces.

Stores

Unicorn Battle has many stores that players can interact with.

  • Character Slot Store: Used to sell Extra Character Slots
  • Extra Hearts Store: Displayed when a player has run out of lives.
  • Gem Store: A store for purchasing Gems, UB's premium currency
  • Gem Store MN: A variant of the Gem store targeted at small spenders
  • Gem Store WH: A variant of the Gem store targeted at big spenders
  • Gold Store: A basic store where the player can buy additional gold
  • Happy Hour: A limited edition store that corresponds to the TitleData Sales
  • Launch Party: A limited edition store that corresponds to the TitleData Sales
  • Profile Store: The basic store accessible from the Profile scene
  • Traveling Merchant: A store only found during some quests

Optimizing UI

UB's reusable dialogs make it easy to:

  • Give players access to their character or player level inventory
  • Show stores with dynamic items or orderings
  • Redeem coupons for in-game CatalogItems
  • Grant rewards in the form of containers offering probability distribution and keyed access
  • Transfer CatalogItems & VC among character and player inventories
  • Enable filters on inventory items. Here we are using filters to only show items that can only be used in combat.

See the Dialog Canvas Controller for full implementation.

Advanced Usage:

Attach metadata to your items to drive custom behaviors

In addition to tracking what a player has, items can also be consumed in battle to power our heroes to victory all with custom icons to boot! This can be achieved using the CustomData properties on either CatalogItems or ItemInstances.

Unicorn Battle sets various CustomData fields on the on each CatalogItem. These settings can be found in the corresponding game manager view. The client must deserialize the CustomData string prior to using the ["Key"] accessor.

UB uses a central icon manager, so that icons can easily be changed through editing the icon CustomData property. Once changed, clients will update on the next refresh.

Cross-referencing ItemInstances with CatalogItems

Player and character inventories contain ItemInstances; stores contain StoreItems; both are incomplete when compared to their corresponding CatalogItem. It is always a good idea to provide a look-up service where CatalogItems can be retrieved for a given ItemId.

After fetching the inventory, UB automatically wraps the CatalogItem reference into the player and character inventory objects

Next Steps