
Streaks
The Hiro Streaks System is a versatile feature designed to enhance player engagement and competitiveness by rewarding consecutive wins. These wins can be tracked, and rewards can be configured to motivate players to reach certain streak thresholds by maintaining momentum. This feature enhances player engagement by adding an extra layer of challenge, encouraging skill mastery, and creating competitive tension.
Customization parameters #
The following JSON represents the customization parameters you can use to configure the default user experience for the Streaks system.
| |
Streak #
| Property | Type | Description |
|---|---|---|
auto_claim | bool | Whether the streak’s rewards should be given automatically as progress is updated. |
name | string | The display-friendly name for this streak. |
description | string | The description text for this streak. |
count | int64 | The initial progress for this streak. |
max_count | int64 | The maximum progress that this streak can achieve. |
max_count_current_reset | int64 | The maximum count that can be submitted within the same reset interval. |
idle_count_decay_reset | int64 | The amount of count that will be decreased if no count is submitted within the reset interval. |
max_idle_count_decay | int64 | The maximum amount of count that can be decreased if no count is submitted over consecutive reset intervals. |
reset_cronexpr | string | The reset schedule expressed in CRON format. |
time_offset_sec | int64 | The offset to be applied to the start, end and reset times to allow local time scheduling. |
grace_window_sec | int64 | Extra time that the user has to stop their streak from decaying if they didn’t update within the defined reset period. |
rewards | StreakReward | The rewards that a user should receive once they complete certain streak checkpoints. |
start_time_sec | int64 | The start time (expressed as a UNIX timestamp) for this streak. |
end_time_sec | int64 | The end time (expressed as a UNIX timestamp) for this streak. |
disabled | bool | Used to disable this streak without removing it from the data definition. |
Streak Reward #
| Property | Type | Description |
|---|---|---|
count_min | int64 | The minimum count required to receive this reward. |
count_max | int64 | The maximum count required to receive this reward. |
reward | Reward | The rewards that a user should receive at each count between count_min and count_max. |
Streak state #
When you list or update a streak, Hiro returns a streak object that includes both the configured values above and the following runtime state fields. These are read-only and reflect the player’s current progress.
| Property | Type | Description |
|---|---|---|
id | string | Unique identifier for this streak. |
count | int64 | The current overall progress count. |
count_current_reset | int64 | The progress count submitted during the current reset interval. |
prev_reset_time_sec | int64 | When the streak’s previous reset period was. UNIX time for gRPC clients, ISO string for REST clients. |
reset_time_sec | int64 | When the streak’s next reset period is. UNIX time for gRPC clients, ISO string for REST clients. |
create_time_sec | int64 | When the streak was first registered for this user. UNIX time for gRPC clients, ISO string for REST clients. |
update_time_sec | int64 | When the streak was last updated. UNIX time for gRPC clients, ISO string for REST clients. |
claim_time_sec | int64 | When the streak was last claimed. UNIX time for gRPC clients, ISO string for REST clients. |
rewards | StreakAvailableReward | All rewards configured for this streak, with their current availability. |
available_rewards | StreakAvailableReward | Rewards currently available to claim for this streak. |
claimed_rewards | StreakReward | Rewards that have already been claimed. |
can_claim | bool | Whether this streak can currently be claimed to obtain rewards. |
can_update | bool | Whether submitting a count update is currently allowed. |
can_reset | bool | Whether resetting the streak is currently allowed. |
claim_count | int64 | The last count that was claimed. |
max_count_reached | int64 | The highest count this streak has ever reached. It only increases, is not reduced by idle decay, and is cleared when the streak is reset. |
Programmatic state control #
Beyond the client APIs (see the Unity streaks reference , for example), Hiro gives studios programmatic control over streak state for live-ops and customer support flows. See the server framework streaks reference for details and usage.
