If you appreciate the work done within the wiki, please consider supporting The Cutting Room Floor on Patreon. Thanks for all your support!

Notes:The Fairyland Story (Arcade)

From The Cutting Room Floor
Jump to navigation Jump to search

This page contains notes for the game The Fairyland Story (Arcade).

Experience System

The game has a hidden experience point and leveling system. The code that handles adding experience points starts at 0x208F in the ROM and goes through the following steps:

  • If the amount of experience to be added would put the player's experience at 240 or higher, the game immediately exits the subroutine.
  • The game then checks if the player should level up. The amount of experience the player needs to level up is initially set to 30 EXP and increases by 30 every time the player levels up, maxing out at an unreachable 240 EXP.
  • If the player is already at Level 8, the maximum level the player can normally reach, the game exits the subroutine. Otherwise, the player gains a level.

What Affects Experience & Level

The following events change the player's experience:

  • Repeatedly zapping transformed enemies until they disappear will yield no EXP
  • Enemies that are crushed will give 2 EXP each.
  • All other methods of dealing with enemies will give 1 EXP per defeated enemy.
  • Collecting a Crystal Ring will give the player 40 EXP.
Note that there is no overflow check in the code that handles experience; if the player has 216 or more experience points, collecting a ring will drastically reduce their EXP.
  • Getting hit by a Wizard's shrinking spell will make the player lose 10 EXP. This will not affect the player's level.
  • Dying will set the player's EXP to the current Round number minus 1 after they respawn. E.g., dying on Round 50 will set the player's EXP to 49.

The following events directly influence the player's level:

  • Collecting a Holy Water will raise the player's level by 1.
Unlike the main experience handling subroutine, the code that the Holy Water uses caps the player's level at 9, not 8.
  • Getting killed by a Wraith will lower the player's level by 1.
  • Continuing after getting a game over will set the player's level to 1.

None of these events directly affect the player's experience points.

What Level Affects

The player's level has just one effect on gameplay, but the effect is signficant: It extends the duration of almost all time-based items. The lone exception is the Moon Tiara, which just forces the moon event to start, and that uses its own separate timer. The values that the game uses for timers is stored in the table at 0x48BA. Six "long-lasting" items decrement the timer every 6 frames, while 3 "short-lasting" items decrement the timer every frame. Please consult the following table:

Silver ScepterMagic StaffScroll of Fire
Mystical OrbGold ScepterStar Tiara
Glass PotionScroll of IceChange Potion
Level 1 360 Frames
6 Seconds
60 Frames
1.00 Seconds
Level 2 480 Frames
8 Seconds
80 Frames
1.33 Seconds
Level 3 600 Frames
10 Seconds
100 Frames
1.66 Seconds
Level 4 720 Frames
12 Seconds
120 Frames
2.00 Seconds
Level 5 840 Frames
14 Seconds
140 Frames
2.33 Seconds
Level 6 960 Frames
16 Seconds
160 Frames
2.66 Seconds
Level 7 1080 Frames
18 Seconds
180 Frames
3.00 Seconds
Level 8 1200 Frames
20 Seconds
200 Frames
3.33 Seconds
Level 9 1380 Frames
23 Seconds
230 Frames
3.83 Seconds

As previously stated, if the player collects a Holy Water while at Level 8, they'll break the level cap and reach Level 9. The timer table is only 8 values long, so the game ends up pulling a byte from the item pointer table at 48C2. Luckily, the value it pulls is E6, which, as it turns out, is a higher value than the last entry in the table, C8.

Item Spawning

When Items Spawn

The game keeps track of the number of steps the player has taken (measured in pixels) in $E785. After the player has walked 800 pixels, an item will spawn. For reference, stages are 208 pixels in length. Since the game is counting steps taken, not distance traveled, pacing back and forth will increment the counter.

Steps are not counted under the following conditions:

  • The player has an active power-up.
  • Horned (The time-up devil) has appeared.
  • The player is dead.
  • The round has been cleared.

The step counter will not reset after death, but will reset after a continue.

A few additional notes on item spawning:

  • Multiple items can spawn in a single round if the player walks far enough before Horned appears.
  • If the moon is out when the player passes the 800 pixel threshold, the item will not spawn until the moon disappears again.

Determining Item Type

The routine for determining what drops starts at 47CE in the ROM.

  • First, the game compares the player's EXP with a table at 0x488D to determine which of six different odds tables to use. Said odds tables are stored at 0x4893, 0x4899, 0x489F, 0x48A5, 0x48AB, and 0x48B1.
  • Next, the game loads the R register into the accumulator and strips out the uppermost bit. This generates a more-or-less random number between 0 and 127.
  • The game then compares this random number to the data in the odds table to determine the "tier" of item the player gets:
Tier 1 Tier 2 Tier 3 Tier 4 Tier 5 Tier 6
0 to 20 EXP 102/128
79.688%
13/128
10.156%
5/128
3.906%
4/128
3.125%
3/128
2.344%
1/128
0.781%
21 to 40 EXP 1/128
0.781%
102/128
79.688%
13/128
10.156%
5/128
3.906%
4/128
3.125%
3/128
2.344%
41 to 70 EXP 1/128
0.781%
3/128
2.344%
102/128
79.688%
13/128
10.156%
5/128
3.906%
4/128
3.125%
71 to 110 EXP 1/128
0.781%
3/128
2.344%
4/128
3.125%
102/128
79.688%
13/128
10.156%
5/128
3.906%
111 to 160 EXP 1/128
0.781%
3/128
2.344%
4/128
3.125%
5/128
3.906%
102/128
79.688%
13/128
10.156%
161 to 255 EXP 1/128
0.781%
3/128
2.344%
4/128
3.125%
5/128
3.906%
13/128
10.156%
102/128
79.688%
Note that the chance of a better tier generally goes up as the player gains EXP, but is still subject to RNG. For instance, there's a less than 1% chance of getting a Tier 6 item at 0 EXP, and a less than 1% chance of getting a Tier 1 item at at max EXP.
  • Finally, the game compares how many enemies are on-screen to a table at 0x48B7 in the ROM to determine which item in the tier will drop. This ends up producing the following drop table:
Tier 1 Tier 2 Tier 3 Tier 4 Tier 5 Tier 6
1 Enemy Silver Scepter Magic Staff Mystical Orb Holy Water Crystal Ring Book of Life
2-4 Enemies Silver Scepter Magic Staff Mystical Orb Gold Scepter Scroll of Ice Mystical Feather
5+ Enemies Moon Tiara Scroll of Fire Glass Potion Star Tiara Change Potion Book of Death
(Source: Original TCRF research)