Spinning

From SMO.wiki
Revision as of 04:19, 30 December 2024 by Relaxmas (talk | contribs) (grammar error)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)

Spinning is a type of movement in Super Mario Odyssey that allows Mario to perform a spinjump, and therefore, a spinpound. Spinning can also be used to perform a spinthrow without using motion controls. Spinning lasts for 91 frames unless it is interrupted.

Spin validation

The game has a complex system to determine whether Mario should begin spinning based on the player’s left joystick inputs. The game considers a spin to be validated if there is a sequence consisting of between 31 and 70 consecutive frames that fulfills the following conditions:

  1. The first and last frames of the sequence have joystick angles that are within arccos(.7) ≈ 45.57° of each other.
  2. The total area traced out by the left joystick across the sequence of frames must be at least 5 square units.

The method by which the game monitors the second condition is as follows: Between each pair of consecutive frames, the game records the area of the triangle whose vertices are the two joystick positions and the center of the joystick. If the joystick was rotated counterclockwise, the area is added to the total, and if the joystick was rotated clockwise, the area is subtracted from the total. If the joystick is neutral on one of the frames or remains held at the same angle, nothing gets added or subtracted. If the total is at least 5 or less than or equal to -5, the condition is fulfilled.

Note that while usually a joystick input is considered neutral if its radius is less than or equal to .1, all joystick inputs with non-zero radius are considered in this case. Of course, the area traced out by the left joystick is the greatest if it is held at maximum radius.

Each frame, the game checks if the most recent 31 frames validate a spin, the most recent 32 frames validate a spin, the most recent 33 frames validate a spin, and so on up to whether the most recent 70 frames validate a spin.

Beginning a spin

Once the spin is validated, there is a 30 frame window in which Mario can begin spinning, allowing spins to be buffered. The spin begins on the first frame during this window in which Mario would normally be running, braking, turning, or pivoting in place. If the player interrupts the spin, for instance by crouching or spinjumping, and then tries to begin running, he will begin spinning again provided that the 30 frame window has not yet ended. In this case, the spin will still last a full 91 frames.

Joystick inputs from before one spin is validated cannot be used to validate a second spin, but any inputs from the frame the first spin is validated onward can be used to validate a second one.

Horizontal speed

If Mario’s horizontal speed is over 8 u/fr when beginning a spin, he experiences 5% deceleration each frame until his speed is 8 u/fr. In all other scenarios, his horizontal speed is given by the equation

vt = .95vt-1 + .5j,

where vt-1 is Mario’s velocity the previous frame and j is the joystick magnitude, and his horizontal speed is capped at 8 u/fr.

Optimization

When performing a spinpound after a moon grab, it is optimal to buffer the spin during the moon grab, then hold forward (or another direction) as Mario falls, rather than spin the joystick as Mario falls.

When performing a roll cancel into a spinpound, it is optimal to buffer the spin during the roll, where joystick inputs do not greatly impact his movement, rather than spinning the stick during the roll cancel.

TAS strategy

The fastest possible way to trace out 5 square units of area with the joystick is to rotate the joystick by 90 degrees each frame at full magnitude. Each frame of rotating the stick traces out a triangle of area .5, meaning that only 11 frames are needed to trace out the requisite area. Note that the joystick would have needed to be held at an angle within 45.57 degrees of the last frame of rotating the stick at an earlier point to fulfill the first condition from above.

When diving, in order to not lose any forward velocity, it is often optimal to alternate holding hard right, forward, and hard left, so as to not hold backward at all. Doing so requires 15 frames to trace out the requisite area.

It is possible to spin using only two joystick angles. For instance, the player could alternate holding 45 degrees, 135 degrees, and neutral.