Available vs Obtained Currency
Unlockable
The concepts of available
and obtained
within IUnlockable
are used in the default IdleKit implementation to denote how Entities
that can be accumulated by the player, are rewarded and displayed. In this article, we will look at how these flags are used specifically with Currencies
. For more details specific to Unlockables see this documentation.
Available vs Obtained states
As shown in the above diagram, there are four distinct states that a Currency
can be in given the use of the available
and obtained
flags in the default IdleKit implementation.
A currency that is available can be granted as a RandomObtainedCurrencyReward
or RandomUnobtainedCurrencyReward
. Most often, a currency becomes available through gameplay: By reaching a stage, claiming a goal, claiming a milestone or any other gameplay that results in dispatching a GrantRewardStateAction
. A currency can also be made available using a CurrencyAvailableReward
, which is a reward meant expressly for unlocking the currency without granting any.
A currency that is obtained has had some amount added to the players inventory at some point even if that amount is zero. For example, when starting a new stage IdleKit will grant some starting currencies. If the amount of those starting currencies is zero, those currencies will be flagged as obtained.
Unavailable & Unobtained
In this state, the Currency
has not been received by the player and cannot be granted to the player via random Rewards. Usually a Currency
in this state will have its available
flag set to true in a later Stage of the game, depending on the balance.
In the UI, the Currency
is usually presented to the player as being locked with the Stage at which it can be received displayed.
Tip
In TPB, the Barb Currency
is not available
to the player until Stage 16, the same Stage at which the associated Generator
can first be purchased.
Available & Unobtained
The player has not received the Currency
previously but it can be granted to them via random Rewards. The gating of availability is usually on a per Stage or per Event basis, depending on the balance requirements of the game.
The way in which the UI displays the Currency
should denote that it can be rewarded to the player within the current Stage.
Tip
In TPB, once the player reaches Stage 16 the Barb Currency
is now available
and so can potentially be granted via any random Reward that targets Currencies
tagged with Rare
.
Unavailable & Obtained
Important
In this state, the Currency
has a modifier effect on other Entities within the game but more units cannot be granted to the player via random Rewards. This ensures the balance of the game remains correct.
The player has received the Currency
previously but it cannot be granted to them via random Rewards.
While uncommon, it is possible for a player to have a Currency
in this state. For example, they may have been explicitly granted the Currency
via a CurrencyReward
or purchased it via the Store.
In the UI, the Currency
would usually be displayed to the player in the same way as if it was both the available
and obtained
flags were set.
Tip
- You can run a social media promo that rewards players with a specific
Currency
. Because this promo is open to players at any Stage of the game, allowing it to beobtained
but notavailable
avoids any balance-related problems.
Tip
- A costume
Currency
that was previously rewarded as part of an Event but can now be purchased via a premium Reward. In this case, the player should only be able to get extra units of theCurrency
via the premium Reward and not via random Rewards. Keeping theavailable
flag false achieves this.
Available & Obtained
In this state, the player has both received the Currency
previously and can be granted more units of it via random Rewards. It is possible for the player to have obtained
a currency but for them to have 0 units. In the UI, the player should be able to see that they have unlocked the Currency
, how many units they have and the upgrade level. For a currency to be granted through a IStoreUpgradeableCurrencyCollection
the currency must be available and obtained.
Tip
In TPB, once the player completes Stage 18, the Barb Currency
is always rewarded to the player via that Stage's AscensionReward
making it obtained
. As we know that the Barb Currency
is now both available
and obtained
for all players, it is used as a Generator
automation requirement in Stage 19.