Energies #
Energy is any resource that can be used to limit the number of times a player can perform an action in a game. For example, a player may have a limited number of lives, and each time they die they lose a life. When they run out of lives, they can no longer play the game until they have been given more lives. This can be done by watching an ad, donations, or by waiting for a period of time.
Hiro enables you to manage energy in your game. You can define multiple energy types, each with their own configuration. Energy amounts are stored per user, and the real-time value of the current energy amount is computed on get or spend. Players can spend one or more energy amounts and return all current energy values.
Customization parameters #
The following JSON represents the customization parameters you can use to configure the default user experience for the Energies system.
|
|
The JSON schema defines an energies
object which must contain an individual object for each energy you wish to define in the system. You can configure as few or as many energy types as needed for your desired gameplay.
Property | Type | Description |
---|---|---|
energies | string:Energy | A map of all energies. |
Each individual energy is keyed by name and may define the following:
Energy #
Property | Type | Description |
---|---|---|
start_count | int32 | The initial amount of this energy a user should start with. |
max_count | int32 | The maximum amount of this energy a user can refill up to. |
max_overfill | int32 | The amount of this energy a user can gain over max_count when granted directly from rewards. |
refill_count | int32 | The amount of this energy refilled after each interval (defined in refill_time_sec ). |
refill_time_sec | int64 | The time in seconds it takes for this energy to refill by refill_count amount. |
implicit | bool | If true the user starts with this energy, if false they must be granted this energy. |
reward | Reward | The rewards that a user should receive when spending this energy. |
additional_properties | string:string | A map of key value pairs that can contain additional context. |