Skip to content

feat: player-reactive demand multiplier on top of curated baseline#25

Merged
icemansparks merged 5 commits into
merkerhoodfrom
feat/demand-multiplier
Jul 2, 2026
Merged

feat: player-reactive demand multiplier on top of curated baseline#25
icemansparks merged 5 commits into
merkerhoodfrom
feat/demand-multiplier

Conversation

@icemansparks

Copy link
Copy Markdown
Collaborator

Stacked on #23 (retarget to merkerhood after that merges). Covers planned items 1, 2 and 10.

Adds a per-item demand multiplier on top of the ChromieCraft price baseline that reacts only to real human purchases and decays back to neutral. Design doc in docs/superpowers/specs/2026-07-02-demand-multiplier-design.md.

How it works

  • New world table mod_auctionhousebot_demand (item, multiplier, last_bump), loaded with the other override tables and refreshed by .reload config.
  • In OnAuctionSuccessful, if the buyer is a real human, the item's multiplier bumps by BumpPercent (applied to the already-decayed value, clamped to [MinMultiplier, MaxMultiplier]) and persists.
  • Human detection: buyer is not one of the bot's own characters and not a playerbot. Playerbots are recognized by account-username prefix (BotAccountPrefixes, default rndbot, case-insensitive) with a per-account verdict cache; ambiguous lookups fail toward no-op. The cache clears on reload so prefix changes take effect.
  • Decay is lazy: effective multiplier = 1 + (stored - 1) * 0.5^(hoursSinceBump / DecayHalfLifeHours), computed on read, snapped to 1.0 inside 1%. No periodic job, no periodic writes.
  • Applied in AdjustPrices() to both buyout and bid; bid <= buyout invariant preserved.

Config (all in mod_ahbot.conf.dist)

DynamicPricing.Enable (default 0 — off), BumpPercent (8), DecayHalfLifeHours (72), MinMultiplier (0.5), MaxMultiplier (3.0), BotAccountPrefixes ("rndbot"). All validated with clamp-and-warn.

Out of scope (deferred): supply-side signal from human listings.

Compile-checked against the full core tree (RelWithDebInfo, gcc/ninja).

@icemansparks
icemansparks changed the base branch from fix/sell-flow-and-override-guards to merkerhood July 2, 2026 14:47
…/decay/bump

New per-item demand multiplier table and AHBConfig plumbing: an in-memory
itemDemand map (mirroring the price/count override maps), lazy decay computed
on read (GetEffectiveDemandMultiplier), and BumpDemand to persist a bump. Not
wired into the signal or the pricing path yet.
OnAuctionSuccessful now bumps the winning item's demand multiplier when
dynamic pricing is enabled and the buyer is a real human: excluded via
gBotsId for the bot's own characters, and via a LoginDatabase account
username prefix check (cached in gAccountHumanCache) for mod-playerbots
random bots, since there's no compile-time dependency on that module.
Ambiguous/failed resolution never bumps.
AdjustPrices multiplies buyout/bid by the item's effective demand multiplier
when AuctionHouseBot.DynamicPricing.Enable is set, after the existing
moving-average and override clamps; the bid<=buyout guard further down in
Sell() still runs afterward. LoadSharedOverrides now also loads and shares
the demand map on startup and .reload config. New DynamicPricing.* options
documented in mod_ahbot.conf.dist.
@icemansparks
icemansparks force-pushed the feat/demand-multiplier branch from a19424d to 8638be2 Compare July 2, 2026 14:50
@icemansparks
icemansparks merged commit 9287f1d into merkerhood Jul 2, 2026
1 check passed
@icemansparks
icemansparks deleted the feat/demand-multiplier branch July 2, 2026 14:51
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.

1 participant