Resources

com.cupkekgames.resources — global / save-data-scoped player resources. Currencies (wallet pattern) and Experiences (XP tracker with curve-driven leveling) as two independent sub-asmdefs inside one package. Built on the Data package; consumers cherry-pick which sub-asmdef they reference.

The two halves are intentionally decoupled: a card-battler with no leveling references only CupkekGames.Resources.Currencies; a roguelite with XP but no shop references only CupkekGames.Resources.Experiences.

What's inside

Sub-asmdefPurposeLead types
Resources.CurrenciesPlayer-scoped numeric balances with spend / earn semantics.Wallet, CurrencyDefinitionSO, CurrencyCatalog
Resources.ExperiencesXP totals with curve-driven level computation and level-up events.ExperienceTracker, ExperienceDefinitionSO, ExperienceCatalog, ExperienceCurveSO

Each sub-asmdef follows the same shape — an IData runtime store, a per-id ScriptableObject definition, and an AssetCatalog<T> registered under a stable id string.

Why a single package, two asmdefs

A Wallet and an ExperienceTracker share a surface pattern but diverge in semantics:

  • Wallet is transactional — Spend(id, amount) returns true / false, CanAfford is the primary query
  • ExperienceTracker is monotonic — AddExp(id, amount) accumulates and fires OnLevelUp when a threshold crosses

A shared abstract base would be three methods wide and immediately leak through. Keeping them as siblings inside one repo gives:

  • One submodule pointer to track instead of two
  • One release tag flow
  • Consumers still cherry-pick at the asmdef level (Currencies-only or Experiences-only or both)

Dependencies

Both sub-asmdefs depend on:

  • com.cupkekgames.dataCatalogKey, IData, AssetCatalog<T>
  • com.cupkekgames.servicesServiceLocator for catalog resolution

Neither sub-asmdef depends on the other.

Suggested mental model

  • Currency: a player's bank balance for a specific id. Mutate via Wallet.Add / Wallet.Spend. Wired to UI via Wallet.OnChanged.
  • Experience track: a player's accumulated XP for a specific id (e.g. "Hero", "Crafting", "Reputation"). Mutate via ExperienceTracker.AddExp. Wired to UI via ExperienceTracker.OnExperienceChanged and OnLevelUp.
  • Curve: the XP-per-level formula. Lives in a dedicated ExperienceCurveSO asset registered in ExperienceCurveCatalog. Multiple experience tracks can reference the same curve.

Same-shape patterns elsewhere

The "id-keyed numeric bag + per-id ScriptableObject definition + registered catalog" skeleton is already used three places in the ecosystem:

  • AttributeSet — per-unit float values (Health, Attack, Crit%) in com.cupkekgames.rpgstats
  • ItemStatData — per-item float bonuses in com.cupkekgames.inventory
  • Wallet / ExperienceTracker — global long values, here

The shapes parallel but the semantics diverge (float vs long, per-unit vs global, modifiable vs spendable). A future shared IdValueBag<T> primitive may extract the common skeleton; for now each domain owns its specialized type.

Bridges (future, not in this package)

Worth knowing about even though they don't ship today:

BridgePurposeLikely home
Currency chip / wallet panel UIAnimated chips, count-up tweenscom.cupkekgames.resources.luna
XP bar / level-up burst UIProgress bar binding, level-up flairsame Luna bridge
Quest currency rewardCurrencyReward : IQuestRewardFeaturecom.cupkekgames.quests.resources
Item-as-currency on pickup"Gold Coin" item adds to Walletcom.cupkekgames.inventory.resources
Per-Unit XP featureExperienceFeature : IUnitFeature with curve from SOcom.cupkekgames.resources.units

Settings

Theme

Light

Contrast

Material

Dark

Dim

Material Dark

System

Sidebar(Light & Contrast only)

Light
Dark

Font Family

DM Sans

Wix

Inclusive Sans

AR One Sans

Direction

LTR
RTL