-
Notifications
You must be signed in to change notification settings - Fork 6
Dynamic Pricing
DynamicShop 2.6.4 calculates regular-item buy and sell totals from base price, stock, optional shortage time, and price clamps. Fixed-price special items use their configured price instead.
-
dynamic-pricing.enableddisables all stock and shortage multipliers when false. Regular items then use base price, with sell tax still applied to sales. -
use-stock-curvecontrols the positive-stock curve. -
use-time-inflationcontrols the shortage-time multiplier. -
min-price-multiplierandmax-price-multiplierclamp the price used inside each bulk-price integral. Bundled defaults are0.01and2.0.
For base price B, current stock s, pricing boundary m, max-stock boundary L, curve strength k, shortage rate r, and time multiplier t:
q = 1 + r / 100
s <= m: price = B * t * q ^ (-(s - m))
m < s < L: price = B * t * (1 - 0.5 * k * (s - m) / (L - m))
s >= L: price = B * t * (1 - k)
The result is clamped between B * min-price-multiplier and B * max-price-multiplier.
Important details:
- An item's
min-stockdefaults to0and moves the boundary where exponential shortage pricing begins. It is not a storage limit. - An item's
max-stockoverrides the global pricing boundary. It is not a storage limit. - An item's
rateoverridesnegative-stock-percent-per-item. - With the bundled
curve-strength: 0.9, the middle branch approaches 55% of base price nearmax-stock, while the high-stock branch uses 10%. The implementation therefore has a step at that boundary; it is not one continuous curve. - Setting
use-stock-curve: falsemakeskzero, leaving a flat base-price branch while any enabled shortage-time multiplier still applies.
Pricing boundaries and transaction limits are separate:
-
min-stock-storageis a hard purchase floor. A purchase cannot leave stock below this value. -
max-stock-storageis a hard sale ceiling. A sale cannot leave stock above this value. - Without an item-specific purchase floor,
restrict-buying-at-zero-stock: trueprevents normal purchases from taking stock below zero. -
dynamicshop.bypass.stockbypasses the GUI stock floor and ceiling checks. It does not overridedisable-buyordisable-sell.
Stock at or below zero accumulates shortage hours. The time multiplier is:
t = (1 + hourly-increase-percent / 100) ^ shortageHours
The configured maximum price multiplier still caps the resulting price.
When stock is positive, shortage hours decay over real time. shortage-decay-percent-per-hour is the number of shortage hours removed per real hour at full max-stock; the rate scales by stock / max-stock.
A player transaction that crosses from non-positive stock to positive stock can apply the configured high-inflation correction. Directly setting regular stock to a positive value with the admin setter resets shortage hours to zero.
DynamicShop integrates over the stock path instead of multiplying one displayed quote:
- Buying
amountintegrates fromcurrentStock - amounttocurrentStock. - Selling
amountintegrates fromcurrentStocktocurrentStock + amount. - Clamps are applied within each price region's integral.
- Sell tax is applied to the completed sell-side integral.
This is why a bulk sell value is not necessarily the displayed one-item buy price multiplied by the quantity and tax rate.