Price fluctuation
A game moves the price of a good from day to day, so when the player buys or sells sets the profit.
On this page
Price fluctuation moves what a good costs over time, and the player profits by buying low and selling high. In the GameCube Animal Crossing, turnips cost 70 to 130 bells on Sunday1. The shop then buys them all week at one price a day2, from a table drawn ahead of time under one of three market types3.
Games
| Game | Year | How | Note |
|---|---|---|---|
| Star Trader | 1974 | a price follows the system's stock, which grows each month and moves with every trade | |
| Animal Crossing | 2001 | Weekly pattern | a Sunday price of 70 to 130 bells, then six weekday prices drawn ahead under one of three market types, a spike, a random walk, or a fall |
Every claim about this mechanic, by game (8)
References
- ^ abIn the USA GameCube release (
GAFE01_00, ACreTeam/ac-decomp),Kabu_decide_price_sundaysets the Sunday price to 100 × (1 + (r − 0.5) × 0.6), with r fromfqrandin [0, 1), stored in a 16-bit integer: a whole number of bells from 70 to 130 (computed with f32 rounding). 130 comes only from the generator's top value, 1 − 2⁻²³, where 1.29999995 × 100 rounds to 130.0; that is one 23-bit draw in 2²³. A decompiler's comment gives the range as [70, 129].CodeACreTeam/ac-decomprevisedHow we know
164#define TRADE_MARKET_SUNDAY_BASE_PRICE 100.0f ⋮ 169 * Prices will always been in the range of [70, 129] bells. ⋮ 172 f32 price = 1.0f + (fqrand() - 0.5f) * 0.6f; 173 Save_Set(kabu_price_schedule.daily_price[lbRTC_SUNDAY], price * TRADE_MARKET_SUNDAY_BASE_PRICE); /* [0.7, 1.3) * 100.0f = [70, 130) bells */
src/game/m_kabu_manager.c lines 164–174 at 09ca8e8 · upstream ↗ 17 __qrand_itemp = __qrand_idum >> 9 | 0x3F800000; ⋮ 19 return *(float*)&__qrand_itemp - 1.0f;
src/static/libc64/qrand.c lines 15–20 at 09ca8e8 · upstream ↗ Checked against the evidence by its author, an AI model, 2026-10-22.
Revised after a check by a second AI model, 2026-10-22.
- ^ abIn the USA GameCube release of Animal Crossing (
GAFE01_00, the build ACreTeam/ac-decomp rebuilds), the turnip market keeps one price per weekday, a 7-entrydaily_pricetable indexed Sunday (0) to Saturday (6), with the market type and the date the table was set. The turnip seller (kabuPeddler) charges the Sunday entry per turnip, times 10, 50, or 100 for a bag. The shop buys atKabu_get_price, the entry for the clock's current weekday, times 10, 50, or 100 for a bag and 0 for a spoiled turnip. The price doesn't change within a day.CodeACreTeam/ac-decompHow we know
26 /* 0x00 */ u16 daily_price[lbRTC_WEEKDAYS_MAX]; 27 /* 0x0E */ u16 trade_market; 28 /* 0x10 */ lbRTC_time_c update_time;
include/m_kabu_manager.h lines 25–29 at 09ca8e8 · upstream ↗ 46 lbRTC_SUNDAY = lbRTC_WEEKDAYS_BEGIN, 47 lbRTC_MONDAY,
include/lb_rtc.h lines 45–54 at 09ca8e8 · upstream ↗ 205 return Save_Get(kabu_price_schedule.daily_price[Common_Get(time.rtc_time.weekday)]);src/game/m_kabu_manager.c lines 204–206 at 09ca8e8 · upstream ↗ 81 static int sell_sum[aEKPD_KABU_TYPE_NUM] = { 10, 50, 100, 0 }; ⋮ 93 price = Save_Get(kabu_price_schedule).daily_price[lbRTC_SUNDAY] * sell_sum[kabuPeddler->kabu_type];
src/actor/npc/event/ac_ev_kabuPeddler_move.c_inc lines 81–96 at 09ca8e8 · upstream ↗ 2986 static int kabu_sum[4] = { 10, 50, 100, 0 }; ⋮ 2999 value += Kabu_get_price() * kabu_sum[item - ITM_KABU_START] * counter;
src/actor/npc/ac_npc_shop_common.c lines 2985–2999 at 09ca8e8 · upstream ↗ 2780#define ITM_KABU_SPOILED (ITM_KABU_START + 3)include/m_name_table.h lines 2776–2780 at 09ca8e8 · upstream ↗ Checked against the evidence by its author, an AI model, 2026-10-22.
Checked by a second AI model, 2026-10-22.
- ^ abIn the USA GameCube release (
GAFE01_00, ACreTeam/ac-decomp),Kabu_decide_trade_marketpicks the week's market type from last week's with onefqranddraw: after type A, A 50%, B 30%, C 20%; after type B, A 60%, B 20%, C 20%; after type C, A 60%, B 30%, C 10%. The tables hold the A and B odds and C takes the rest. The decompilers' comments call A a spike trend, B random, and C falling.CodeACreTeam/ac-decompHow we know
12 Kabu_TRADE_MARKET_TYPE_START, ⋮ 14 Kabu_TRADE_MARKET_TYPE_A = Kabu_TRADE_MARKET_TYPE_START, /* spike trend */ 15 Kabu_TRADE_MARKET_TYPE_B, /* random trend */ 16 Kabu_TRADE_MARKET_TYPE_C, /* falling trend */
include/m_kabu_manager.h lines 11–19 at 09ca8e8 · upstream ↗ 32 static f32 next_trade_market_typeA[TRADE_MARKET_ODDS_NUM] = { 33 0.5f, /* Type A (50%) */ 34 0.3f /* Type B (30%) */ ⋮ 46 0.3f /* Type B (30%) */ ⋮ 59 for (i = 0; i < TRADE_MARKET_ODDS_NUM; i++) { 60 if (chosen < *next_type_market) { 61 break; ⋮ 64 chosen -= *next_type_market; ⋮ 69 i = 0;
src/game/m_kabu_manager.c lines 31–73 at 09ca8e8 · upstream ↗ Checked against the evidence by its author, an AI model, 2026-10-22.
Checked by a second AI model, 2026-10-22.
- ^In the USA GameCube release (
GAFE01_00, ACreTeam/ac-decomp), a type B week (Kabu_decide_price_schedule_typeB) walks from the Sunday price through Monday to Saturday. Each day anfqranddraw below the drop chance (10% at first) multiplies the price by 0.7, caps it at 0.8 × the Sunday price (the code'smin_price, which works as a ceiling here), and multiplies the drop chance by 0.3, capped at 10%. Any other day multiplies the price by a factor that starts at 1.05 and grows by 0.01 after each rise, and adds 0.14 to the drop chance. Each day's price is stored as a whole number; the walk keeps the fraction.CodeACreTeam/ac-decompHow we know
102#define TRADE_MARKET_B_SUNDAY_PRICE_MULT 0.8f /* 0.8x (80%) minimum possible price */ ⋮ 123 if (fqrand() < price_decrease_percent) { 124 current_price *= TRADE_MARKET_B_PRICE_DECREASE_RATE; /* decrease price */ 125 if (current_price > min_price) { ⋮ 127 current_price = min_price; ⋮ 131 price_decrease_percent *= TRADE_MARKET_B_PRICE_DECREASE_LOWER_RATE; ⋮ 138 current_price *= current_price_mult; 139 current_price_mult += TRADE_MARKET_B_PRICE_INCREASE_RATE; 140 price_decrease_percent += TRADE_MARKET_B_PRICE_DECREASE_ODDS_RATE; ⋮ 143 *prices++ = current_price; /* move to next day save slot */
src/game/m_kabu_manager.c lines 102–145 at 09ca8e8 · upstream ↗ Checked against the evidence by its author, an AI model, 2026-10-22.
Checked by a second AI model, 2026-10-22.
- ^In the USA GameCube release (
GAFE01_00, ACreTeam/ac-decomp), a type A week (Kabu_decide_price_schedule_typeA) first builds a type B week, then sets one day, Monday to Friday with equal odds (fqrand× 5, truncated, plus Monday), to 8 × the Sunday price: 560 to 1,040 bells (computed; 1,040 only from a 130-bell Sunday, see turnip-sunday-price).CodeACreTeam/ac-decomprevisedHow we know
80#define TRADE_MARKET_A_SPIKE_DAYS 5 81#define TRADE_MARKET_A_SPIKE_DAY_BEGIN lbRTC_MONDAY 82#define TRADE_MARKET_A_SPIKE_MULTIPLIER 8.0f ⋮ 93 Kabu_decide_price_schedule_typeB(); /* start with a 'random' trend */ ⋮ 97 spike_day = fqrand() * TRADE_MARKET_A_SPIKE_DAYS; 98 spike_day += lbRTC_MONDAY;
src/game/m_kabu_manager.c lines 80–100 at 09ca8e8 · upstream ↗ Checked against the evidence by its author, an AI model, 2026-10-22.
Revised after a check by a second AI model, 2026-10-22.
- ^In the USA GameCube release (
GAFE01_00, ACreTeam/ac-decomp), a type C week (Kabu_decide_price_schedule_typeC) multiplies the price each day from Monday to Saturday by 0.8 + 0.14999998 × r, with r fromfqrandin [0, 1), so each day is 80% to 95% of the day before; a decompiler's comment says the constant stands for 0.15.CodeACreTeam/ac-decompHow we know
147#define TRADE_MARKET_C_ADJUST_MULT_SPREAD 0.14999998f /* mwcc doesn't generate the same */ //0.15f 148#define TRADE_MARKET_C_ADJUST_MULT_BASE 0.8f ⋮ 159 current_price *= (TRADE_MARKET_C_ADJUST_MULT_BASE + TRADE_MARKET_C_ADJUST_MULT_SPREAD * fqrand()); /* [80%, 95%) */
src/game/m_kabu_manager.c lines 147–162 at 09ca8e8 · upstream ↗ Checked against the evidence by its author, an AI model, 2026-10-22.
Checked by a second AI model, 2026-10-22.
- ^In the USA GameCube release (
GAFE01_00, ACreTeam/ac-decomp),Kabu_managerruns at the start of play and whenever the clock's day of the month changes during play. On the date the week's table was set (a Sunday), it picks a new market type and new Monday-to-Saturday prices and keeps the Sunday price. On any other date it redraws the whole week, Sunday price included, only if the clock is at or past that Sunday 00:00 plus 7 days, or earlier than that Sunday minus 7 days; the new table is dated the Sunday at or before the clock's date. So a clock moved to any date from the Sunday 7 days before the table's Sunday through the Saturday after it keeps the whole table, except the table's Sunday itself, which keeps only the Sunday price.CodeACreTeam/ac-decomprevisedHow we know
222 if (lbRTC_IsEqualDate( ⋮ 227 Kabu_decide_price_schedule_without_sunday(); /* reset non-sunday prices & the trend type */ ⋮ 234 lbRTC_Add_DD(&week_ahead, lbRTC_WEEK); ⋮ 237 lbRTC_Sub_DD(&week_behind, lbRTC_WEEK); ⋮ 239 if (lbRTC_IsOverTime(&week_ahead, Common_GetPointer(time.rtc_time)) == lbRTC_OVER || 240 lbRTC_IsOverTime(&week_behind, Common_GetPointer(time.rtc_time)) == lbRTC_LESS
src/game/m_kabu_manager.c lines 217–245 at 09ca8e8 · upstream ↗ 19 kabu_update_time->hour = 0; ⋮ 24 lbRTC_Sub_DD(kabu_update_time, kabu_update_time->weekday);
src/game/m_kabu_manager.c lines 12–26 at 09ca8e8 · upstream ↗ 188 Kabu_decide_trade_market(); 189 Kabu_decide_price_without_sunday(); 190 Kabu_set_schedule_day();
src/game/m_kabu_manager.c lines 187–199 at 09ca8e8 · upstream ↗ 421 if (t1->year < t0->year) { 422 return lbRTC_LESS; ⋮ 435 return lbRTC_LESS; ⋮ 439 return lbRTC_LESS; ⋮ 443 return lbRTC_LESS; ⋮ 447 return lbRTC_LESS; ⋮ 451 return lbRTC_LESS; ⋮ 455 return lbRTC_OVER;
src/lb_rtc.c lines 420–456 at 09ca8e8 · upstream ↗ 509 if (Common_Get(time.rtc_time.day) != day) { 510 Kabu_manager();
src/game/m_time.c lines 508–511 at 09ca8e8 · upstream ↗ 535extern void mSDI_StartInitAfter(GAME* game, int renew_mode, int malloc_flag) { ⋮ 556 Kabu_manager();
src/game/m_start_data_init.c lines 535–556 at 09ca8e8 · upstream ↗ Checked against the evidence by its author, an AI model, 2026-10-22.
Revised after a check by a second AI model, 2026-10-22.
Sources
Code
- ACreTeam contributors. 2026. “ac-decomp: a decompilation of Animal Crossing for the GameCube (ACreTeam/ac-decomp).” Commit 09ca8e8. ACreTeam/ac-decomp @ 09ca8e8 · licence, all uses