The physics of falling in Metroid Prime are similar to those on Earth; that is, constant downward acceleration. Specifically, your vertical velocity decreases by -67/60 units every frame. Since the velocity and position values are stored as single-precision floats, this got me thinking: after falling for a long enough time, your vertical velocity should be low enough that subtracting 67/60 from it would not change its value because the last bit of the float storing the velocity would be over 2*67/60. This means that a terminal velocity should exist, and if it does, there should also be a minimum possible z-position due to the same floating point issue.
To simulate this, I wrote a simple script to simulate falling. The logic basically looks like this:
where f is the frame ID, v is the vertical velocity, z is the vertical position, and v and z are stored as 32-bit floats.
Here is a summary of some events that occur and when they occur:
So in other words, you hit terminal velocity at 4.81 days and you bottom out at 7.48 days.
I also plotted the data.
Icefire was kind enough to test this on emulator with PrimeWatch, and he found that my numbers are correct. If you manually set your velocity to the terminal velocity and your position to just above the minimum position, you will fall at a constant rate (the terminal velocity) until you hit the minimum position, at which point your position stops changing.
Another thought I had would be to calculate how long it would take to float back up from the lowest position, if it were possible to float down there. (Floating is impossible down there for the same reason that there's a minimum position you can get from falling in the first place: lack of floating point precision, and the upwards floating speed is orders of magnitude smaller than the downwards falling speed.) The floating speed is 0.03 position units per second, meaning it would take 3.52e+16 frames, or 18.6 million years, to float back up, if floating were possible.
To simulate this, I wrote a simple script to simulate falling. The logic basically looks like this:
Code:
while True: f += 1 v += -67/60 z += v/60
where f is the frame ID, v is the vertical velocity, z is the vertical position, and v and z are stored as 32-bit floats.
Here is a summary of some events that occur and when they occur:
Code:
Frame | Time | Note ---------+------------+------------------------------------------------- 0 | 0 | Effective acceleration becomes -1.116666674614 235484 | 1.09 hours | Effective acceleration becomes -1.125 1866602 | 8.64 hours | Effective acceleration becomes -1 16546665 | 3.19 days | Effective acceleration becomes -2 24935273 | 4.81 days | Effective acceleration becomes 0 permanently, | | Velocity becomes -3.355443200000e+07 permanently 38757580 | 7.48 days | Position becomes -1.759218604442e+13 permanently
So in other words, you hit terminal velocity at 4.81 days and you bottom out at 7.48 days.
I also plotted the data.
Icefire was kind enough to test this on emulator with PrimeWatch, and he found that my numbers are correct. If you manually set your velocity to the terminal velocity and your position to just above the minimum position, you will fall at a constant rate (the terminal velocity) until you hit the minimum position, at which point your position stops changing.
Another thought I had would be to calculate how long it would take to float back up from the lowest position, if it were possible to float down there. (Floating is impossible down there for the same reason that there's a minimum position you can get from falling in the first place: lack of floating point precision, and the upwards floating speed is orders of magnitude smaller than the downwards falling speed.) The floating speed is 0.03 position units per second, meaning it would take 3.52e+16 frames, or 18.6 million years, to float back up, if floating were possible.
Thread title: