How to create Hiro configurations with Google Sheets

This guide provides an overview of the Hiro Exporter, a tool designed for developers to create Hiro JSON Data Definitions using Google Sheets. The Hiro Exporter simplifies the process of converting spreadsheet entries into the correct JSON format required by Hiro.

Currently, the exporter supports key systems including Economy, Achievements, Energy, and Inventory.

It also allows for direct exports to Heroic Cloud through Hiro’s Personalizer system. This guide will walk you through how to effectively utilize the Hiro Exporter to enhance your data management workflow.

Getting Started #

Prerequisites #

Before proceeding, ensure that you have:

  • A Google account with access to Google Sheets

  • (Optional) An active Heroic Cloud account

Setting up your workspace #

  1. Open the Hiro Exporter sheet.
  2. You will be prompted to make a copy of the sheet. Click Make a copy.
Copy Warning
The warning you see means that you are not only copying the Google Sheet, but also its attached script. This script is what converts the Google Sheet into JSON.

Hiro Exporter Copy Page
Hiro Exporter Copy Page

After copying the sheet, it will immediately open in your browser. The Exporter already comes pre-filled with mock data; this is to help you better understand how to fill in each sheet. Feel free to delete them and refer to the original sheet for examples.

Getting to know the sheet #

The Exporter is divided into 3 parts:

  • The Upload Details (_Env): The server details for uploading the exported JSON.
  • The Indexer (_Indexer): An index of which sheet corresponds to each system and subsystem.
  • The Systems: All the sheets that contain the data for all the systems.
Built-in tooltips
Use the tooltips in the Hiro Exporter to check what each field does. Simply hover over the title of any column to see what that field is for and what it should be filled with.

_Env #

The ‘_Env’ sheet is where you specify the upload destination for your exported JSON data.

Hiro Exporter _Env Page
Hiro Exporter _Env Page

PropertyTypeDescription
NamestringName for this destination, for organizational purposes, optional.
SchemestringWhich URI Scheme the destination uses, most commonly HTTP or HTTPS.
PortintThe port to send this request to. Nakama/Hiro use port 443.
Server KeystringThe server key to authenticate the request. Can be found on your Heroic Cloud console.
HTTP KeystringThe HTTP key to encrypt the request. Can be found on your Heroic Cloud console.
UploadboolTrue if you want the exporter to upload to this destination.

_Indexer #

In the sheet named “_Indexer”, you can indicate which sheets contain which system or sub-system. For organization purposes, you can have multiple sheets for the same system and subsystem. For example, you could have 2 pages for Achievements: one where you define the achievements for your main campaign, and another where you define the achievements for side quests and mini-games.

In the next sections, you will see how to fill in each system’s spreadsheet to prepare them for export.

Hiro Exporter _Indexer Page
Hiro Exporter _Indexer Page

PropertyTypeDescription
systemstringThe name of the system we want to map.
sub_system_keystringThe name of the subsystem we want to map. The subsystem must be part of the system.
page_namestringThe name of the page that contains the system and subsystem’s data.

Additional Properties #

Columns of type Additional Properties are filled with the format property1=value1,property2=value2. For example:

foo=2,baz=2

Hiro Exporter Additional Properties Field
Hiro Exporter Additional Properties Field

Tooltips #

The Hiro Exporter tool comes with tooltips included, so you can check what each field does without needing to consult the documentation. Simply hover over the head of any column to know what that field is and what it should be filled with.

Hiro Exporter Tooltip. Example of the auto_claim field in the Achievements System
Hiro Exporter Tooltip. Example of the auto_claim field in the Achievements System

Rewards #

The rewards sheets define all the rewards that can be used by any of the other systems. Rewards are defined in groups and can be referenced on the other pages by their reward_id.

The rewards themselves are divided into 2 parts:

  • rewards: Each row defines a group of content rewards, their max_rolls, max_repeat_rolls and total_weight
  • content_rewards: Each row defines the content that is included in a single reward.

Populating the Rewards Sheet #

To create a new reward, enter a reward_id in the first column and fill in the rest of the row referring to the Rewards data definition.

The reward_id is what you will use to reference this reward from other sheets. Use it when the column key is one of the following: reward, total_reward, consume_reward, recipient_reward or contributor_reward.

If you want to define a reward for new players, you might use the following values to fill in the row:

reward_id : new_player
max_rolls : 1
max_repeat_rolls : 0
total_weight : 100

Hiro Exporter _Rewards Page
Hiro Exporter _Rewards Page

Populating the Content Rewards Sheet #

The new player reward is now defined but it is still “empty.” This section demonstrates how to populate the reward with content i.e., the actual items, currency, and other bonuses that will be rewarded to the player.

PropertyTypeDescription
reward_idstringUsed to reference this reward in any other pages.
reward_contentsstringDefines the reward we want to add, these can be one of the following: item_sets, currencies, items, energies, energy_modifiers or reward_modifiers.
reward_typestringDefines the reward type, can be either guaranteed or weighted.
reward_namestringDefines the reward name.

Fill in the remaining fields as needed. Refer to the Reward Contents data definition.

About empty fields
When filling in the remaining columns, you don’t need to fill all the fields, only those that are needed for that content_reward. Empty fields will be ignored by the exporter.

For example, to add content to the new_playerreward, you could enter the following values for an item-type reward:

reward_id : new_player
reward_contents: item
reward_type: guaranteed
reward_name: bronze_sword
min : 1

Hiro Exporter _Content_Rewards Page
Hiro Exporter _Content_Rewards Page

Economy #

The Economy system is divided into five separate sheets:

  • initialize_user : Defines the currencies and items a user should start with.
  • allow_fake_receipts : Boolean that defines if fake receipts are allowed. A receipt is fake if it contains the string: ‘fake receipt’.
  • store_items : A map of all store_items
  • donations : A map of all donations
  • placements : A map of all placements

Read more about the Economy System.

Initialize User #

This sheet lets you define which currencies and items a user should start with. Both of these columns are “Additional Properties” types. If you want a player to start with 10 gold, 10 silver, 1 sword and 1 bow, you should define it as:

currencies : gold=10,silver=10
items : sword=1,bow=1

Read more about each field in the Initialize User guide.

Hiro Exporter Economy Page
Hiro Exporter Economy Page

Allow Fake Receipts #

Enter TRUE to allow Fake Receipts and FALSE to disable them. Fake Receipts are useful for developing and testing purchase flows.

Store Items #

The Store Items sheet lets you define which items are available in the store for players to purchase.

Read more about each field of the Store Items.

SKU and Currencies

For the SKU and Currencies fields, you don’t need to fill in both:

  • To create a pure IAP store item, fill in only the SKU field.
  • To create a pure currency purchase, fill in only the Currencies field.
  • To create a store item purchasable with both soft and hard currencies, fill in both fields.

Hiro Exporter Store Items Page
Hiro Exporter Store Items Page

Donations #

The Donations sheet lets you define the donations, which are a way for players to share in-game items.

Read more about each field of the Donations.

Hiro Exporter Donations Page
Hiro Exporter Donations Page

Placements #

The Placements sheet lets you define the placements, which are rewarded videos.

Read more about each field of the Placements.

Hiro Exporter Placements Page
Hiro Exporter Placements Page

Achievements #

The Achievements system is divided into two sheets:

  • Achievements
  • Sub Achievements

Each achievement is identified with an achievement_id. This is used in the Sub Achievement sheet to identify which achievement each Sub Achievement belongs to. Achievements can have multiple Sub Achievements.

Read more about each field of the Achievements and Sub Achievements

Hiro Exporter Achievements Page
Hiro Exporter Achievements Page

Hiro Exporter Sub Achievements Page
Hiro Exporter Sub Achievements Page

Inventory #

The Inventory system is divided into three sheets:

  • Inventory
  • Category Limits
  • Item Sets Limits

String properties and numerical properties are filled with the format property1=value1,property2=value2, see example. When converted to JSON, string values are converted to string and numerical values are converted to int. For example, the following values:

string_properties : foo=1
numeric_properties : bar=1

Will be converted into the following JSON:

{
  "string_properties": {
    "foo": "1"
  },
  "numeric_properties": {
    "bar": 1
  }
}

Read more about each field of the Inventory System.

Hiro Exporter Inventory Page
Hiro Exporter Inventory Page

Category Limits and Item Sets Limits #

Limits for inventory items are defined in two separate sheets: one for Category and one for Item Sets. Each limit is defined on a separate row. Read more about configuring Limits.

Hiro Exporter Category Limits Page
Hiro Exporter Category Limits Page

Hiro Exporter Sets Limits Page
Hiro Exporter Sets Limits Page

Energy #

The energy sheets defined everything related to the energy system.

Read more about each field of the Energy System.

Hiro Exporter Energies Page
Hiro Exporter Energies Page

Exporting to the Cloud #

First Time Running the Script
If this is your first time running the Hiro Exporter, a pop-up window will appear requesting you to give permission for the script to run on that Google sheet. Follow the steps when prompted.

After setting up the _Env and selecting which environments you want to upload the data definitions to, hover over the Hiro Exporter Menu menu on the top Menu Bar. You will be met with the following:

Hiro Exporter Export Button
Hiro Exporter Export Button

Select which system you want to export and wait for the tool to create and upload the JSON. Once the script is done, a “Script Finished” alert will appear and you will see what has been uploaded on the right side of the screen:

Hiro Exporter Export Output of the Inventory System
Hiro Exporter Export Output of the Inventory System

After this you can head over to your Nakama Console and confirm that everything has been uploaded correctly:

Nakama Console Storage of Hiro’s Inventory System with the Exporter Output
Nakama Console Storage of Hiro’s Inventory System with the Exporter Output