so i've had exactly 1 (one) person comment that fox flux feels "kind of floaty", which surprised me, as the person who has played the most of it in the whole world
and it reminded me of how i've seen several devs mention in recent months that they make gravity weaker when jumping and/or stronger when falling
and i always scoff in my head like, well, obviously that's nonsense. gravity makes parabolas. everyone loves parabolas. physics feel floaty in everyone's first platformer because gravity is usually preset to earth gravity, which is way too low, and newer devs don't think to ferret out the menu that lets them increase it.
well, i was half right. at most.
i consulted the canonical disassembly of Super Mario Bros and gleaned the following facts that are hopefully true:
-
normal gravity is $0.28 (that is, 0x28/256 pixels per frame², or 0.15625)
-
there are three tiers of jump, depending on your current movement speed. actually there are five, but tiers 0/1 and tiers 3/4 are identical
-
each tier sets three (actually four but the fourth is only used when swimming) values: your y-velocity, your jump gravity, and your fall gravity, as follows:
- 0 ≤ vx < 16 — initial jump speed -4, jump gravity $0.20, fall gravity $0.70
- 16 ≤ vx < 25 — initial jump speed -4, jump gravity $0.1e, fall gravity $0.60
- 25 ≤ vx < ∞ — initial jump speed -5, jump gravity $0.28, fall gravity $0.90
you use your jump gravity while you're "still jumping", which (i think) means as long as you are moving upwards and still holding the A button. as soon as either of those is not true, you switch to fall gravity, which you may notice is 3~4× stronger than normal gravity
-
terminal velocity is 4 (actually it's something weird like, if you surpass $4.80 then you get capped to 4), and you hit it real fast at those falling speeds
so the short version is that the first half of your jump is a parabola, but your descent is basically linear because you fall so dang fast that you hit terminal velocity after about a quarter of a second. i would insert a graph here but putting an image midway through a copost is tedious enough that i don't want to.
that's kind of weird. i'm not sure how much of this is conscious Miyamoto Magic™, and how much of it is maneuvering around the practical irritations of having your fractional bits in a separate byte and writing the whole fucking game in 8-bit assembly.
it's plausible that the intention here was to get variable jump height — after all, cranking up gravity will make your jump stop ascending real quick — and that the light-speed descent was a side effect that no one thought about. but who knows for sure?
i'm not planning on changing anything; i like how lexy's jump feels right now, and i think it's reasonable to have a little more descent time to plan your landing, especially in a slower-paced game. (there are lexy variants that fall at a different speed, as well.) parabolas are good and you will take my parabola and you will like it.
but now i'm wondering just how many games have a jump/fall imbalance like this.
other fascinating SMB1 tidbits:
-
water physics are exactly the same, except you can jump in midair, your jump is wimpier, and normal gravity is $0.18 rather than $0.28.
-
as far as i can tell, when you land, your gravity is reset to normal, but your y velocity is not. you simply don't fall when you're already standing on something. so if you land from a high jump and then walk off a ledge, you will instantly start falling at terminal velocity.
-
NTSC (Japan and US) is 30fps, but PAL (Europe) is 25fps. so they changed all the magic physics numbers in the PAL release to keep the overall timing roughly the same. but as a result, you can jump about 3 pixels higher in the european release. not enough to make it up another block, but enough to give you a bit more wiggle room when making a max-height 5-block jump.