Skip to content

feat: add bonus experience game mechanic#1026

Merged
GregHib merged 1 commit into
GregHib:mainfrom
HarleyGilpin:feat/bonus-xp-weekend
Jun 12, 2026
Merged

feat: add bonus experience game mechanic#1026
GregHib merged 1 commit into
GregHib:mainfrom
HarleyGilpin:feat/bonus-xp-weekend

Conversation

@HarleyGilpin

Copy link
Copy Markdown
Contributor

Description

Implements Bonus XP Weekend: while active (events.bonusExperience.enabled), players earn
boosted experience starting at 2.7x, decaying every 30 minutes spent online down to 1.1x.
Progress shows in the XP counter orb hover tooltip (multiplier, time elapsed, bonus xp earned).

Changes

Engine

  • Experience.multiplier — per-player multiplier applied on top of world.experienceRate;
    not persisted, resets to 1.0 each login. Reusable by other xp-boosting content (auras, pendants).

BonusExperience.kt

  • Login while active: enables tooltip (varbit 7232), starts a 1-minute timer, sends welcome message
  • Timer increments time online (varbit 7233, persisted) and recalculates the multiplier — the decay
    table matches the client's own table in clientscript 338 exactly (verified by disassembling the
    cache), including the inclusive ≤30 minute first interval
  • experience hook accrues the bonus portion into the bonus xp counter (varp 1878, x10 units,
    persisted) and reruns the orb refresh script (776)
  • While disabled: persisted progress is reset on login

Data & config

  • Varbit/varp definitions in gameframe.varbits.toml / gameframe.varps.toml
  • refresh_bonus_experience (776) mapping in client.scripts.toml
  • events.bonusExperience.enabled game property, default false

Tests

  • BonusExperienceWorldTest — activation on login, 2.7x grant + bonus tracking, decay after
    31 minutes online, progress reset when disabled
  • BonusExperienceTest — multiplier decay table boundaries
  • ExperienceTableTest — engine multiplier applied with/without rate

Known limitation

The 634 client has no bonus-xp orb art (sprite 5568 absent), so the only display is the XP orb
hover tooltip. The tooltip box wraps the trailing "xp" of "Multiplier: 2.7xp" onto a second line —
client-side layout in clientscripts 776/569; fixing it needs a cache edit.

@GregHib GregHib left a comment

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Isn't it supposed to use this interface (548:41) or is that a different revision?

Image

Edit: Looks like it was used but later removed and the cache doesn't have the xp+ orb icon.

@HarleyGilpin

Copy link
Copy Markdown
Contributor Author

Isn't it supposed to use this interface (548:41) or is that a different revision?

Greg and I discussed via Discord that this interface wasn't introduced until the end of 2011, Client scripts were not available yet. We will need to update the cache to implement bonus xp orb and this interface in the future.

@GregHib GregHib merged commit 4bcd141 into GregHib:main Jun 12, 2026
2 checks passed
@HarleyGilpin HarleyGilpin deleted the feat/bonus-xp-weekend branch June 12, 2026 20:43
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants