Battle Windows

From Kirby Speedrunning Wiki
Revision as of 17:29, 16 September 2024 by Nippo (talk | contribs) (→‎RAM Values)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to navigationJump to search

Battle Windows (referred to as "Computer Virus" in the English version) is a boss fight in Kirby Super Star that appears in Great Cave Offensive, Milky Way Wishes, and The Arena. Battle Windows is known for being an RNG-heavy segment in speedruns. It is a turn-based fight, similar to an RPG. Battle Windows enemies will only be vulnerable while they are not attacking Kirby, and Kirby has a limited amount of time to defeat it during his turn.

Battle Windows has a chance to spawn Copy Essences during Kirby's turn. These abilities currently do not have any implications in the run, as Kirby immediately loses his turn upon obtaining one.

Speedrun Route

Great Cave Offensive

Any%

100%

Milky Way Wishes

In Milky Way Wishes, a small amount of time can be saved by selecting abilities as Battle Windows text is scrolling. Text does not stop scrolling while Kirby's ability animation plays, so this time spent waiting for text scrolling can be spent while simultaneously watching Kirby's ability animation.

Any%

100%

The Arena

Random Number Generation

Turn Order

During the first turn of each Battle Windows enemy, there is a 25% chance that Battle Windows will attack first. This is a notorious point of chance in the run where time can be lost if Battle Windows gets the first attack.

When Battle Windows attacks first, time loss can vary depending on the attack that is done. The worst possible luck is having an enemy shield on their first turn, which requires a whole additional turn to defeat it.

In specific circumstances, it is actually beneficial to have Battle Windows attack first, but this is typically only done in TAS. An example of this is using Suplex while fighting Red Dragon. By having Red Dragon attack first, Kirby can grab its scratch attack and defeat it in one turn.


Calculating the outcome for first turn attack uses one RNG number.

Slime and Magician:

  • 64 < RNG < 127: Battle Windows attacks first
  • Else: Kirby attacks first

Puppet and Dark Knight:

  • 128 < RNG < 191: Battle Windows attacks first
  • Else: Kirby attacks first

Red Dragon:

  • 192 < RNG < 255: Battle Windows attacks first
  • Else: Kirby attacks first

Attacks

Attack choice uses one RNG number.

Every Battle Windows enemy has two attack pools to choose from, which is based on if RAM value 179C is an even or odd number. This number changes between 0 and 1 after each time Battle Windows attacks, first starting on 0.

  • This RAM value will not change on Battle Window's first attack (whether that be first turn or not).
  • This RAM value seems to change, but freezing this value does not seem to alter the attack pool. More research is required.

Slime

  • The only move that deals damage is Star Shot. The rest of Slime's moves do nothing.
  • Slime only attacks every two turns. Its other turns do not have Star Shot in its pool.
RNG Attack Pool 1 Attack Pool 2
0 - 25 Stars Call for help
26 - 51 Sleep
52 - 76 Stars Call for help
77 - 102 Tries to escape
103 - 127 Stars Sleep
128 - 153 Call for help
154 - 179 Stars Call for help
180 - 204 Stars Sleep
205 - 230 Surprised
231 - 255 Stars Sleep

Puppet

Magician

Dark Knight

Red Dragon

Attack Messages

Ability Appearance

Flowchart depicting how Battle Windows uses RNG.

When it is Kirby's turn to attack, abilities have a chance of appearing on each side of the screen. Several random numbers are used during this process. This calculation is different from power calculation in The Arena rest area.

If an ability does not appear, RNG advances by 1, while if an ability does appear, RNG advances by 3. RNG can advance at least 2 times or at most 6 times when calculating powers (unless under a specific circumstance, see notes below). This calculation is done as soon as the Battle Windows enemy lands on the ground.

  • 1.) Determine if a power will appear on the right side:
    • 64 < RNG < 127: Power appears
    • Else: Does not appear (Skip steps 2 and 3)
  • 2.) Determine which pool to choose from:
    • 0 < RNG < 63: Pool 1 (Sprite number 90)
    • 64 < RNG < 127: Pool 2 (Sprite number 91)
    • 128 < RNG < 191: Pool 1 (Sprite number 90)
    • 192 < RNG < 255: Pool 2 (Sprite number 91)
  • 3.) Choose a power from the pool chosen:
RNG Ability Pool 1 Ability Pool 2
0 - 21 Fighter Kss-fighter-statue.png Stone Kss-stone-statue.png
22 - 42 Plasma Kss-plasma-statue.png Cutter Kss-cutter-statue.png
43 - 63 Hammer Kss-hammer-statue.png Wheel Kss-wheel-statue.png
64 - 85 Beam Kss-beam-statue.png Jet Kss-jet-statue.png
86 - 106 Bomb Kss-bomb-statue.png Ice Kss-ice-statue.png
107 - 127 Sword Kss-sword-statue.png Parasol Kss-parasol-statue.png
128 - 148 Hammer Kss-hammer-statue.png Fire Kss-fire-statue.png
149 - 170 Bomb Kss-bomb-statue.png Suplex Kss-suplex-statue.png
171 - 191 Plasma Kss-plasma-statue.png Ninja Kss-ninja-statue.png
192 - 213 Sword Kss-sword-statue.png Yo-yo Kss-yoyo-statue.png
214 - 233 Beam Kss-beam-statue.png Mirror Kss-mirror-statue.png
234 - 255 Fighter Kss-fighter-statue.png Wing Kss-wing-statue.png
  • 4.) Determine if a power will appear on the left side:
    • 128 < RNG < 191: Power appears
    • Else: Does not appear (Skip steps 5 and 6)
  • 5.) Same as step 2
  • 6.) Same as step 3

Notes:

  • If no abilities appear for 3 consecutive turns, abilities will appear from both sides on the next turn (steps 1 and 4 are skipped). This is tracked in CARTRAM value 17A6.
  • In the rare circumstance that abilities appear on both sides, and both sides contain the same ability, step 4 will be repeated again after step 6. This will continue to repeat until either both abilities are different, or the left side ability does not appear.

RAM Values

All currently known RAM values associated with Battle Windows.

Domain Address Description Procedure Function
CARTRAM 1790 Idle Timer Starts at 104, then loops to 255 for a total of 360 frames. Counts down once every frame. Kirby's turn is finished when this value reaches 0.
CARTRAM 1791 Attack state? Changes based on Battle Windows attack. Needs more research.
CARTRAM 179C Even or Odd Turn Value switches between 0 and 1 after each turn. Alters which attacks are used in each RNG range. However, freezing this value doesn't seem to do anything. More research required.
CARTRAM 1838 Timer (after attack) Value stays at 255 until Kirby attacks Battle Windows at least once. After first Battle Windows hit, counts down from 90 once every frame. Kirby's turn is finished when this value reaches 0.
CARTRAM 1888 Timer for text scroll Needs more research
More to come...