Rewards #
The Reward system is a powerful tool that enables you to reward players’ in-game activities with everything from currencies and energies, to items and reward modifiers. The system is designed to be flexible enough to allow for simple guaranteed rewards as well as complex Gacha weighted table rewards seen in popular games today.
The Reward system is integrated into all systems within Hiro, which allows you to create sophisticated reward structures in your game. These concepts are explored in the Reward Types examples section below.
Customization parameters #
The following JSON represents the customization parameters you can use to configure the default user experience for a particular reward. Note, rewards are configured inline where they are used, for example as part of an Unlockables configuration.
|
|
The JSON schema defines a reward object which defines the various items, item sets, currencies, energies, energy modifiers, and reward modifiers that will be available as rewards where this particular reward is defined. You can configure as few or as many of each as needed for your desired gameplay. This object is defined in-line throughout the various data definitions within Hiro, above it is shown as part of a rewards
field, but in some systems this field may be named differently (e.g. contributorRewards
in the Donations System).
A Reward
object consists of the following properties:
Reward #
Property | Type | Description |
---|---|---|
guaranteed | RewardContents | The rewards that a user is guaranteed to receive. |
weighted | []RewardContents | The rewards that a user may or may not receive depending on the outcome of a random roll. |
max_rolls | int64 | The number of weighted RewardContents to select from among the possibilities. |
max_repeat_rolls | int64 | The maximum number of repeats for any given weighted reward. |
total_weight | int64 | The total weight of all weighted reward contents, this can be omitted if you would prefer it to be automatically calculated. If you want a chance for the player to receive no reward, you can manually set this to be higher than the sum of individual weights. |
Reward Contents #
Property | Type | Description |
---|---|---|
items | string:RewardItem | A map of item IDs and quantities to reward the player with. |
item_sets | []RewardItemSet | The item sets that are part of the reward. |
currencies | string:RewardRangeInt64 | A map of currency IDs and quantities to reward the player with. |
energies | string:RewardRangeInt32 | A map of energy IDs and quantities to reward the player with. |
energy_modifiers | []RewardEnergyModifier | The energy modifiers that are part of the reward. |
reward_modifiers | []RewardRewardModifier | The reward modifiers that are part of the reward. |
weight | int64 | The weight of this reward as it relates to the rest of the weighted rewards. |
Reward Energy Modifier #
Property | Type | Description |
---|---|---|
id | string | The ID of the energy that should be modified. |
operator | string | The operation that should be performed on the energy when rewarded (e.g. multiplier , addition ). |
value | RewardRangeInt64 | The modifier value range. |
duration_sec | RewardRangeUInt64 | The duration range for the modifier (in seconds). |
Reward Reward Modifier #
Property | Type | Description |
---|---|---|
id | string | The ID of the reward element that should be modified (e.g. coins or potion ). |
type | string | The type of the reward that is to be modified (e.g. item or currency ). |
operator | string | The operation that should be performed on the reward when rewarded (e.g. multiplier , addition ). |
value | RewardRangeInt64 | The modifier value range. |
duration_sec | RewardRangeUInt64 | The duration range for the modifier (in seconds). |
Reward Item #
Property | Type | Description |
---|---|---|
min | int64 | The minimum amount to reward. |
max | int64 | The maximum amount to reward. |
multiple | int64 | The multiple the amount will be rounded to. |
string_properties | string:RewardStringProperty | Additional string properties that will be added to the item instance. |
numeric_properties | string:RewardRangeFloat64 | Additional numeric properties that will be added to the item instance. |
Reward Item Set #
Property | Type | Description |
---|---|---|
min | int64 | The minimum amount to reward. |
max | int64 | The maximum amount to reward. |
multiple | int64 | The multiple the amount will be rounded to. |
max_repeats | int64 | The maximum amount of repeats that can be rewarded from this set. |
set | []string | Which intersection of item sets to reward from. |
Reward Ranges #
Below are the types that are used when defining ranges across various properties.
Reward Range Int32 #
Property | Type | Description |
---|---|---|
min | int32 | The minimum amount to reward. |
max | int32 | The maximum amount to reward. |
multiple | int32 | The multiple the amount will be rounded to. |
Reward Range Int64 #
Property | Type | Description |
---|---|---|
min | int64 | The minimum amount to reward. |
max | int64 | The maximum amount to reward. |
multiple | int64 | The multiple the amount will be rounded to. |
Reward Range UInt64 #
Property | Type | Description |
---|---|---|
min | uint64 | The minimum amount to reward. |
max | uint64 | The maximum amount to reward. |
multiple | uint64 | The multiple the amount will be rounded to. |
Reward Range Float64 #
Property | Type | Description |
---|---|---|
min | float64 | The minimum amount to reward. |
max | float64 | The maximum amount to reward. |
multiple | float64 | The multiple the amount will be rounded to. |
Reward String Property #
Property | Type | Description |
---|---|---|
total_weight | int64 | The total weight of all weighted property options, this can be omitted if you would prefer it to be automatically calculated. If you want a chance for a property not to be added to the item instance, you can manually set this to be higher than the sum of individual weights. |
options | string:RewardStringPropertyOption | A map of the possible properties and their weightings. |
Reward String Property Option #
Property | Type | Description |
---|---|---|
weight | int64 | The weight of this property option as it relates to the rest of the weighted property options. |
Reward types #
The reward system in Hiro offers a variety of options to enhance the excitement and progression in your games. With different reward types available, you can create engaging experiences that keep players motivated and eager to continue playing. Hiro supports simple rewards, weighted rewards, gacha-style mechanics, and custom rewards tailored to your game. By understanding how to effectively implement these rewards, you can optimize the gaming experience for your players and provide them with a sense of accomplishment and satisfaction.
Simple rewards #
Simple rewards are a straightforward and easy-to-implement type of reward in Hiro. These rewards typically offer guaranteed items, currency, or energies to players upon achieving specific milestones or completing tasks. Simple rewards are ideal for creating a sense of immediate gratification and progress, providing players with a tangible benefit for their efforts.
Daily login reward
Define a reward as part of a Daily Achievement that will give players a random number of coins for logging in each day.
|
|
Health Restore Potion
Define a reward that will restore a player’s health as part of a Consumable Item.
|
|
Boosting Health Energy Rewards
Define a reward that will multiply a player’s health
energy rewards for the next hour as part of a Virtual Store Purchase.
|
|
Boosting Coin Rewards
Define a reward that will multiply all coin’s received via rewards for the next 2 hours as part of a Donation Contribution reward.
|
|
Weighted rewards #
Weighted rewards introduce an element of chance and rarity to your game’s reward system. With weighted rewards, you can assign different probabilities to various items or outcomes. This allows you to create a sense of anticipation and excitement as players strive to obtain rare and valuable rewards. By carefully balancing the weights assigned to each reward, you can ensure a fair and rewarding experience for your players.
Level completion reward chest
Define a reward as part of a Level Completion Unlockable that guarantees the player a potion as well as a 25% chance to get a rare gem.
|
|
Gacha rewards #
Gacha-style rewards have become increasingly popular in many games. Inspired by capsule toy vending machines, gacha rewards offer players a chance to obtain a randomized selection of prizes. Players typically use in-game currency or special tokens to “pull” from a pool of possible rewards. Gacha rewards add an element of surprise and collection to your game, enticing players to engage in repeated pulls to obtain rare and coveted items.
Hero reward
Define a reward as part of a Virtual Store Purchase that rewards a player with two random heroes.
|
|
Custom rewards #
Custom rewards provide you with the flexibility to design unique and personalized rewards tailored specifically to your game’s mechanics and progression systems. Whether it’s unlocking special abilities, accessing exclusive content, or granting players special privileges, custom rewards allow you to shape the gameplay experience according to your vision. With custom rewards, you have the freedom to create meaningful and memorable moments for your players, ensuring a truly immersive and rewarding gaming experience.
Custom rewards in Hiro are implemented by utilizing a hook function, which allows you to modify the reward behavior and provide a personalized experience for your players. To set up the hook, you can use the appropriate SetOnReward()
function and pass in your own implementation of the hiro.OnReward
hook.
The following example demonstrates how you can implement a custom reward hook when an inventory item is consumed using the inventorySystem.SetOnConsumeReward()
hook.
Define a custom reward hook function:
|
|
Assign the hook function to the inventory system:
|
|
Within the onConsumeReward()
function, you have the opportunity to modify the reward object and/or perform any necessary actions or checks. In the example above, the context of the consumed item is checked and a specific action is taken and reward given depending on the user’s contextual information.
By utilizing a reward hook function and customizing it to fit your game’s specific needs, you can dynamically adjust rewards, incorporate game mechanics, and create a more personalized and engaging experience for your players.
Here are some examples of custom rewards you could create:
- Gacha based pity system, rewarding player’s with a legendary after X rewards without one.
- Unlocking special abilities or powers for the player.
- Granting access to exclusive areas, levels, or game content.
- Granting in-game titles, badges, or achievements.
- Enabling fast travel options within the game world.
- Offering personalized quests or missions.
- Granting access to rare or legendary items with personalized attributes.
- Granting additional character slots.
- Providing in-game social features or privileges, such as VIP status or access to exclusive chat channels.
Pity system example #
The following code show how you could implement a Pity system using a custom reward hook on a Virtual Store Purchase that guarantees a player receives a legendary hero after a certain number of rewards received without one.
|
|