Spyro: AHT 2.1 ‐ Features (Shop Randomization) - PhoenixAki/PhoenixAP GitHub Wiki
AHT's Shop
If you choose not to randomize AHT's shop, the shop will work like it does in the vanilla game. You'll be able to buy things for the same price as the vanilla game and each item will behave the same as it does then.
If you decide to opt in to shop randomization, you have a series of new features that become relevant that chain off of it. It's a lot to take in at first, but it was all created to enhance the experience for those who like to maximize how much their randomizer games...well, randomize things 😅
Shop Randomization
If you enable shop randomization, shop items will be replaced with items placed by AP, either from AHT (if doing a solo random seed) or also items from other people's games, if playing a multiworld seed. This has a few effects:
- Double Gems becomes permanent once received, instead of temporary. The same goes with the Butterfly Jar, which replenishes itself on death if depleted.
- There is no upper limit on how many lockpicks (if using them instead of key rings) or breath bombs you can hold at once. Breath bombs will only be given if you have them enabled as a type of filler you can get.
- Moneybags will not upcharge you for shop items at remote shop pads, because shop prices are determined in a logical manner which depends on the prices being consistent everywhere. Sorry to have to cut into his profits...he can afford it 😂
Gem Logic
Shop items have their prices determined using a system called "gem logic". There is a series of logical rules baked into AHT AP that determine, both during generation and during playtime, how many gems you have access to in the game, based on your items at that time. When a seed is being generated, this information is kept track of so that you can be expected to buy shop items at specific times, based on when you have access to enough gems to afford each item.
3 options exist to let you specify exactly how much of the game's gems you intend to collect in this seed. They are not hard rules: you can collect as many gems as you want, but these options determine the prices of your shop items, and in turn, the pacing of how quickly the seed will expect you to collect gems. blink_gems measures gems from Blink minigames, non_blink_enemies, measures gems from enemies while playing as Spyro or Hunter, and other_gems measures gems from all other sources, including standard gems as Spyro, and gems from Sparx and Sgt. Byrd minigames.
Shop Price Calculation
This section details the shop price formula at a conceptual level. The actual formula is included at the bottom of the page, with an example. Note that regardless of settings, the first shop item is always free (this prevents a handful of restrictive start scenarios).
The formula takes a summation of each category of gems, as weighted by blink_gems, non_blink_enemies, and other_gems. For example, because there are 20,203 gems in Blink minigames, blink_gems set to 50 would result in a value of 10101.5. The sum of doing this for all 3 options is then divided by the number of shop items you have (shop_item_count), and the resulting value is called your "base shop price".
If you have shop_logic set to unordered: each shop item will cost your base shop price, rounded down. Your seed will expect you to buy items from left to right (item 1, 2, etc.) as soon as you have access to enough gems to buy enough. For instance, keeping in mind the first item is always free, if each item cost 1,000 gems, you'd be expected to buy item 5 once you have access to 4,000 gems total. (1,000 for items 2, 3, 4, and then 5). This mode allows you to buy items against this order if you want, at risk of having to potentially grind for extra gems if you choose a suboptimal order.
If you have shop_logic set to ordered: each shop item will have an incrementing price (base shop price * 1, base shop price * 2, etc. for each). You will not be charged gems for purchases, but items will be locked for purchase until you have enough gems. For example, if your base shop price is 1,500, the items would be priced as 0, 1500, 3000, 4500, etc. and you will never lose gems for purchases, so that you can focus on your total gems collected so far. This mode enforces a set order for the shop item purchases.
Shop Price Formula, With Examples (for the math nerds 🤓)
blink_gems_total = (20,023 - exclusions) * blink_gems%
non_blink_enemies_total = 16,353 * non_blink_enemies%
other_gems_total = (105,357 - exclusions) * other_gems%
If an individual minigame location is added to exclude_locations, their gems will be excluded from the above categories.
gem_total = blink_gems_total + non_blink_enemies_total + other_gems_total
base_shop_price = gem_total / (shop_item_count - 1)
Formula Example
If blink_gems is 25, non_blink_enemies is 30, other_gems is 35, shop_item_count is 30, you would get the following formula:
blink_gems_total = 5,050.75
non_blink_enemies_total = 4,905.9
other_gems_total = 36,874.95
gem_total = 46,831.6
base_shop_price = 1,614.88
- If
gem_logic = unordered, your shop prices would all be1,614. - If
gem_logic = ordered, your shop prices would be [0, 1614, 3229, 4844, 6459, 8074, 9689, ..., 43601, 45216, 46831]