75
edits
AgentMuffin (talk | contribs) mNo edit summary |
No edit summary |
||
(One intermediate revision by one other user not shown) | |||
Line 25: | Line 25: | ||
Using the N64's rounding mode, <code>y</code> will repeatedly return to its original value and continue oscillating with fixed maximum height. Even though each double-to-single conversion produces a small amount of error, this error balances out over the course of the platform's cycle. On the Wii VC, however, the error always accumulates in the same direction (upward if the platform is below <var>y</var> = 0, and downward if the platform is above <var>y</var> = 0), and so the platform slowly drifts in the vertical direction. | Using the N64's rounding mode, <code>y</code> will repeatedly return to its original value and continue oscillating with fixed maximum height. Even though each double-to-single conversion produces a small amount of error, this error balances out over the course of the platform's cycle. On the Wii VC, however, the error always accumulates in the same direction (upward if the platform is below <var>y</var> = 0, and downward if the platform is above <var>y</var> = 0), and so the platform slowly drifts in the vertical direction. | ||
The platforms in BitFS are below <var>y</var> = 0, and so they gradually rise upward. As a result, the bug is of interest to the [[A Button Challenge]], since it lets Mario ride the platforms up to skip a pole that requires an A press to dismount. | The platforms at the bottom floor in BitFS are below <var>y</var> = 0, and so they gradually rise upward. As a result, the bug is of interest to the [[A Button Challenge]], since it lets Mario ride the platforms up to skip a pole that requires an A press to dismount. | ||
The another platforms in BitFS (those at the top floor) are above ''y = 0'', and so they gradually go downward. The platforms in LLL are exactly at ''y = 0'', and so this bug doesn't affect their height at all. | |||
===Drift speed=== | ===Drift speed=== | ||
Line 32: | Line 35: | ||
:<math>\frac{127}{256} \times \frac{1}{4096}\ \frac{\mathrm{units}}{\mathrm{frames}} \times \left(30\ \frac{\mathrm{frames}}{\mathrm{s}} \times 60\ \frac{\mathrm{s}}{\mathrm{min}} \times 60\ \frac{\mathrm{min}}{\mathrm{h}}\right) \approx 13.0806\ \frac{\mathrm{units}}{\mathrm{h}}</math> | :<math>\frac{127}{256} \times \frac{1}{4096}\ \frac{\mathrm{units}}{\mathrm{frames}} \times \left(30\ \frac{\mathrm{frames}}{\mathrm{s}} \times 60\ \frac{\mathrm{s}}{\mathrm{min}} \times 60\ \frac{\mathrm{min}}{\mathrm{h}}\right) \approx 13.0806\ \frac{\mathrm{units}}{\mathrm{h}}</math> | ||
The floating-point numbers are distributed non-uniformly; the gap between floats doubles after each [[wikipedia:Power of two|power of two]], so their number line is denser closer to zero. Because the platform drifts toward zero, the error factor (initially <math display="inline">\frac{1}{4096}</math>) is halved after certain thresholds, and so the platform's net speed is also halved. First, above <var>y</var> = −2048, it drops to about 6.54 units per hour. It continues to halve in net speed as it passes through <var>y</var> = −1024, <var>y</var> = −512, and all other <math display="inline">y = 2^n</math> boundaries, until it stops around <var>y</var> = 0. | The floating-point numbers are distributed non-uniformly; the gap between floats doubles after each [[wikipedia:Power of two|power of two]], so their number line is denser closer to zero. Because the platform drifts toward zero, the error factor (initially <math display="inline">\frac{1}{4096}</math>) is halved after certain thresholds, and so the platform's net speed is also halved. First, above <var>y</var> = −2048, it drops to about 6.54 units per hour. It continues to halve in net speed as it passes through <var>y</var> = −1024, <var>y</var> = −512, and all other <math display="inline">\left|y\right| = 2^n</math> boundaries, until it stops around <var>y</var> = 0. | ||
Each time the platform oscillates through one of these boundaries, its behavior | Each time the platform oscillates through one of these boundaries, its behavior is more complicated. Throughout its cycle, the platform is sometimes above <math display="inline">\left|y\right| = 2^n</math> and sometimes below. The overall speed decrease as the platform's average height passes through the boundary is represented by the [[wikipedia:Differential equation|differential equation]] | ||
:<math>v_y = \frac{dy}{dt} = \arccos\left(y\right)</math> | :<math>v_y = \frac{dy}{dt} = \arccos\left(y\right)</math> | ||
The platform suddenly slows down quickly, then at a slower rate before it decelerates faster again, and finally, suddenly the platform's acceleration completely stops, the speed settling at a constant, half of what it started with. | The platform suddenly slows down quickly, then at a slower rate before it decelerates faster again, and finally, suddenly the platform's acceleration completely stops, the speed settling at a constant, half of what it started with. |
edits