Editor, Player (120)
Joined: 8/3/2014
Posts: 204
Location: USA
Can I please be forgiven for interrupting this very detailed discussion to ask a question that I've been wondering for ages? I've always known how to backwards long jump; it's really easy in many places, and is the most classic and well known speed glitch in the entire game, and perhaps the glitch that made it so well known as a speed game in the first place. But something I never quite understood was, how does it work? How in the world do a bunch of simultaneous backwards (not forwards, not any other direction but backwards) long jumps increase speed so much? I've looked everywhere for an explanation of this, but have found nothing. Could someone please explain this to me? Again, I'm not really looking for how to do it, I'm looking for how it works. What is actually going on behind the scenes? Thanks. On another note, I'm really excited for any completed ABC TAS projects that will come out, especially 120 star. This is something I'm really dying to see!
* http://tasvideos.org/ReadySteadyYeti.html - my user page on the TASVideos site * https://www.youtube.com/ReadySteadyYeti - my YouTube channel * My Discord username is "RSY#3799".
Experienced player (601)
Joined: 10/23/2004
Posts: 706
Backwards long jumps work because there is no speed check on negative speed and blj is an effective way to build up increasingly and uncapped NEGATIVE speed.
Current Project: - Mario Kart 64
Editor, Player (120)
Joined: 8/3/2014
Posts: 204
Location: USA
Weatherton wrote:
Backwards long jumps work because there is no speed check on negative speed and blj is an effective way to build up increasingly and uncapped NEGATIVE speed.
Interesting, and that answers half of my question. But why is a.BLJ an effective way to build up increasingly and uncapped NEGATIVE speed?
* http://tasvideos.org/ReadySteadyYeti.html - my user page on the TASVideos site * https://www.youtube.com/ReadySteadyYeti - my YouTube channel * My Discord username is "RSY#3799".
ALAKTORN
He/Him
Player (99)
Joined: 10/19/2009
Posts: 2527
Location: Italy
Ready Steady Yeti wrote:
Weatherton wrote:
Backwards long jumps work because there is no speed check on negative speed and blj is an effective way to build up increasingly and uncapped NEGATIVE speed.
Interesting, and that answers half of my question. But why is a.BLJ an effective way to build up increasingly and uncapped NEGATIVE speed?
Probably because a BLJ is programmed to give a high speed increase in its first frame, and it can be done going backwards, thus the negative speed.
Player (36)
Joined: 9/11/2004
Posts: 2623
Ready Steady Yeti wrote:
Weatherton wrote:
Backwards long jumps work because there is no speed check on negative speed and blj is an effective way to build up increasingly and uncapped NEGATIVE speed.
Interesting, and that answers half of my question. But why is a.BLJ an effective way to build up increasingly and uncapped NEGATIVE speed?
Because you can steer backward on a longjump to slow yourself down. This subtracts from your forward speed. I suppose the devs never thought that you'd be able to subtract enough speed from a longjump to even begin to go backwards, let alone so much so that it would become an extremely fast method of movement.
Build a man a fire, warm him for a day, Set a man on fire, warm him for the rest of his life.
Joined: 12/29/2007
Posts: 489
I've always heard it as long jumping accelerating Mario until his speed hits an upper limit and can't go any higher. But there's no lower limit programmed in, so if Mario decelerates (and then accelerates backward) repeatedly, his speed will keep dropping to arbitrarily low negative numbers (really fast backward). The BLJ setups are simply places where Mario can perform a couple dozen of these within one or two seconds.
Plush
Other
Player (152)
Joined: 9/1/2014
Posts: 235
Location: Italy
Yeah pretty much what everyone said. The (very simplified) formula for new LJ speed is simply +-50%, but positive speed has a cap (48), while negative doesn't.
Editor, Player (120)
Joined: 8/3/2014
Posts: 204
Location: USA
But how is it that I could long jump backwards for hours on end in just any open space in the game, or against any old wall in the game, and would still gain no extra speed. Though there is no speed check on negative speed, just an average backwards long jump will do nothing at all as far as gaining speed goes. Why is it that doing simultaneous BLJs in BLJ spots (you know all the different types, not gonna go into that) builds up speed while just BLJing in regular spots does nothing? How does the time frame in which one A press is done and the next A press is done effect the speed itself?
* http://tasvideos.org/ReadySteadyYeti.html - my user page on the TASVideos site * https://www.youtube.com/ReadySteadyYeti - my YouTube channel * My Discord username is "RSY#3799".
Mitjitsu
He/Him
Banned User, Experienced player (532)
Joined: 4/24/2006
Posts: 2997
Plush wrote:
Yeah pretty much what everyone said. The (very simplified) formula for new LJ speed is simply +-50%, but positive speed has a cap (48), while negative doesn't.
TBF, there isn't a cap on forward speed either. It just resets whether you touch the ground. After all, how's a trick like HSWK possible.
ALAKTORN
He/Him
Player (99)
Joined: 10/19/2009
Posts: 2527
Location: Italy
Ready Steady Yeti wrote:
But how is it that I could long jump backwards for hours on end in just any open space in the game, or against any old wall in the game, and would still gain no extra speed. Though there is no speed check on negative speed, just an average backwards long jump will do nothing at all as far as gaining speed goes. Why is it that doing simultaneous BLJs in BLJ spots (you know all the different types, not gonna go into that) builds up speed while just BLJing in regular spots does nothing? How does the time frame in which one A press is done and the next A press is done effect the speed itself?
It’s what I said. BLJ setups let you BLJ every other frame or so, really quickly. A LJ is programmed to accelerate you in its first few frames, and decelerate you in its latest frames. You never reach the latest decelerating frames with a BLJ setup so you just keep on building speed. Probably.
Plush
Other
Player (152)
Joined: 9/1/2014
Posts: 235
Location: Italy
Mitjitsu wrote:
Plush wrote:
Yeah pretty much what everyone said. The (very simplified) formula for new LJ speed is simply +-50%, but positive speed has a cap (48), while negative doesn't.
TBF, there isn't a cap on forward speed either. It just resets whether you touch the ground. After all, how's a trick like HSWK possible.
Na that's not true, speed doesn't immediately reset to 48 when touching ground after LJ. Mario first goes into LJ landing state which lasts 4 frames, and in this state Mario slows down by ~1 every frame (or by 4 if you neutral input). You can chain another LJ in this state, but speed will reset to 48. If what you said was true, you couldn't even chain normal jumps without resetting your hyperspeed, but it's obviously possible (look at any hyperspeed flying TAS). EDIT: o shit srry I just realized you probably got my earlier post wrong. I meant that there's a cap when starting a LJ, not simply in air lol
Active player (419)
Joined: 9/21/2009
Posts: 1047
Location: California
Ready Steady Yeti wrote:
But how is it that I could long jump backwards for hours on end in just any open space in the game, or against any old wall in the game, and would still gain no extra speed. Though there is no speed check on negative speed, just an average backwards long jump will do nothing at all as far as gaining speed goes. Why is it that doing simultaneous BLJs in BLJ spots (you know all the different types, not gonna go into that) builds up speed while just BLJing in regular spots does nothing? How does the time frame in which one A press is done and the next A press is done effect the speed itself?
I want you to think of Mario's speed represented as a number. While in the long jumping animation, Mario's backward speed *IS* capped to an extent. You cannot land with a speed "bigger" than -15.999... However, if you land with that negative speed and then do a consecutive long jump while still holding 100% backward, your speed will go from -15.99 to about -23. The lower the speed Mario has when pressing jump again, the lower your speed will be after the jump. For example, landing with 0 speed will give you -1.4999 on the post-jump frame, while doing it with -5 will lead to roughly -9, etc. The number gets exponentially bigger and increases by larger and larger amounts every further BLJ, and is also affected by where the joystick is. That is key to optimizing BLJs and reaching specific speeds. Anyway, under regular circumstances, if your jump successfully went "over" -15.999, this value will revert back toward -15.999 by about 1 every frame Mario is in the air until said threshold is reached, when you are once again capped by it while in the LJ animation. What is required to abuse these physics for massive speed is a long-jumpable surface for Mario to land on before the speed can fully "decrease" back to the above threshold. This is why you see common BLJs on slopes and/or stairs and/or elevators: Mario can "catch" the ground basically instantly due to the surface behind him being higher, instead of doing what TASers call an "air-BLJ," which as explained above, makes Mario's speed move to -15.99 by 1 speed every frame. This applies with all air-BLJs at any speed, even very fast ones. Sometimes BLJ spots actually require air-BLJs and need to be optimized accordingly. Hopefully this cleared up some stuff for you. If you want to read an in-depth tutorial with photos on how to side-BLJ with TAS tools, check this out.
Experienced player (617)
Joined: 11/30/2008
Posts: 650
Location: a little city in the middle of nowhere
Can I also just mention that there are actually two different types of long jump? You can see one with Mario's arms going forwards at low forwards speeds (or negative speeds), and you can see another one with his arms going backwards, at higher positive speeds, I remember the speed calculations per frame being different between these two configurations, especially during "takeoff", the first kind being more suited to acceleration, and the second more suited to maintaining a high speed. I would say it's likely (but without proof) that Mario would not be able to BLJ in this second LJ state (even if it were possible to go backwards in the state). Since the actual LJ is different forwards than backwards, maybe this is a possibility why you can't BLJ forwards?
Measure once. Cut twice.
Active player (419)
Joined: 9/21/2009
Posts: 1047
Location: California
andymac wrote:
Can I also just mention that there are actually two different types of long jump? You can see one with Mario's arms going forwards at low forwards speeds (or negative speeds), and you can see another one with his arms going backwards, at higher positive speeds, I remember the speed calculations per frame being different between these two configurations, especially during "takeoff", the first kind being more suited to acceleration, and the second more suited to maintaining a high speed. I would say it's likely (but without proof) that Mario would not be able to BLJ in this second LJ state (even if it were possible to go backwards in the state). Since the actual LJ is different forwards than backwards, maybe this is a possibility why you can't BLJ forwards?
You can BLJ from both types, and I believe it's merely an animation difference based on speed when leaving the ground. Also, the speed doesn't work differently while in the air either, so you're remembering incorrectly. I know what technique you're referring to and inferred this idea from, and it's used simply for gaining takeoff speed prior to a follow up long jump for crossing a large distance. Edit: and the reason you can't apply a BLJ to go forward is because the programmers made the speed value decrease to 48 no matter what while starting a long jump when you have more than like 25 speed (estimate, because I don't want to check). You can of course take off with less, but a long jump *never* leaves the ground with over 48 speed due to the cap.
Experienced player (617)
Joined: 11/30/2008
Posts: 650
Location: a little city in the middle of nowhere
hmm, maybe I recall incorrectly, but I thought that was one of the reasons the 5:04 run saved time over the 5:28 run? During the DDD skip, they changed "modes". Lower starting speed meant less forward acceleration during takeoff (not in the air) allowing mario to BLJ more effectively. I wasn't referring to building up speed with long jumps, that's an entirely different kettle of fish. And yes, you can BLJ from either mode, but as soon as you start the second jump, you will already be in the slow mode. I seem to remember the slow mode having an exponential increase in speed forwards or backwards, whereas the other mode I thought had a constant acceleration with a max speed (48). You would need some code hacking to do a slow velocity jump at high velocity or vice versa. I'm just wondering if you have a formula or description of the change in velocity for Mario for long jump takeoff for the various speed brackets?
Measure once. Cut twice.
Active player (419)
Joined: 9/21/2009
Posts: 1047
Location: California
andymac wrote:
hmm, maybe I recall incorrectly, but I thought that was one of the reasons the 5:04 run saved time over the 5:28 run? During the DDD skip, they changed "modes". Lower starting speed meant less forward acceleration during takeoff (not in the air) allowing mario to BLJ more effectively. I wasn't referring to building up speed with long jumps, that's an entirely different kettle of fish.
A lower take off speed saved, yes, but not because of an animation difference. The movement I had thought you meant is this (timestamped for 2:11).
andymac wrote:
And yes, you can BLJ from either mode, but as soon as you start the second jump, you will already be in the slow mode. I seem to remember the slow mode having an exponential increase in speed forwards or backwards, whereas the other mode I thought had a constant acceleration with a max speed (48). You would need some code hacking to do a slow velocity jump at high velocity or vice versa.
No you wouldn't, because as I said, it's the same lol. A long jump is a long jump and has the same physics regardless of takeoff speed. Maybe you are thinking of how once you reach the 48 cap while in the air, your speed begins to increase at a slower rate?
andymac wrote:
I'm just wondering if you have a formula or description of the change in velocity for Mario for long jump takeoff for the various speed brackets?
Tyler Kehne or pannenkoek might, but I only have what's in my head from using MHS. Edit: thanks MKDasher for posting below this
sonicpacker wrote:
...while starting a long jump when you have more than like 25 speed (estimate, because I don't want to check).
Checked, and it actually requires 32 speed units to take off with the 48 cap. 25 only gets you to about 40.
Experienced player (647)
Joined: 5/16/2009
Posts: 235
Well, I'm gonna explain how this works exactly on game's code, and then I'll try to explain a bit more about it. (Credits to Tyler for finding out basically all the formulas I'm gonna show right now). To understand this, we have to understand that Longjumping consists on 2 different states: 1. Releasing a Longjump 2. Being in air after a Longjump. Being in air after a Longjump I think the clearest way to show this is with some pseudocode.
Language: c

float hSpeed; //horizontal Speed from previous state (we assume this was already initialized). float vSpeed; //vertical Speed from previous state. if (hSpeed > 0) { if (hSpeed > 0.35) hSpeed -= 0.35; else hSpeed = 0; } else { if (-0.35 > hSpeed) hSpeed += 0.35; else hSpeed = 0; } int S0 = facingAngle - moveAngle; // angle goes from -32768 to 32767. float F2 = joystickTilt / 32; //joystickTilt is just a value that goes from 0 to 32 hSpeed += F2 * cos(S0) * 1.5; F0 = SM64Operation.sin(S0) * F2 * 10; //this is not used to calculate horizontal speed so ignore. if (hSpeed > 48) hSpeed -= 1; if (hSpeed < -16) hSpeed += 2; calculateXSpeedAndYSpeed(); // Calculating x speed and y speed based on the horizontal speed you just got.
Now let's see what this means in the different scenarios: - If you're forward longjumping, if your speed goes from 0.0001 to 48, your speed will increase at most 1.15. - If your speed is higher than 48, your speed will increase at most 0.15. - If you're backwards longjumping, if your speed goes from -16 to -0.0001, your speed will decrease at most -1.15. - If your speed is lower than -16, your absolute speed will always decrease by at least 0.85 (your speed will increase by at least 0.85). - When your speed is 47, if you do a perfect input, your speed will go to 47.15. Instead, you can force your joystick tilt to be worse to get a 47.9999 speed. Releasing a longjump This one is very simple, just multiply speed by 1.5, and if speed is higher than 48, cap speed to 48. As you can see there's no cap here for negative values, which makes BLJ possible. Another important thing to say is, on the frame where you release a longjump, you get both releasing state and air state. You can notice this when you are forward longjumping at high speed, when you release a longjump you don't see a 48 but a 48.15 (speed was capped to 48, then you got a 0.15 increment from the air state).
Experienced player (647)
Joined: 5/16/2009
Posts: 235
Previous Air longjumping state formula can be generalized into just Air state as follows (again credits go to Tyler):
Language: c

float hSpeed; //horizontal Speed from previous state (we assume this was already initialized). float vSpeed; //vertical Speed from previous state. float F0 = 0; float F1 = 32; if (longjumping) F1 = 48; if (hSpeed > 0) { if (hSpeed > 0.35) hSpeed -= 0.35; else hSpeed = 0; } else { if (-0.35 > hSpeed) hSpeed += 0.35; else hSpeed = 0; } if (inputPossible){ //Indicates if input is enabled or disabled. When you jump off a slope, input is sometimes ignored. int S0 = facingAngle - moveAngle; // angle goes from -32768 to 32767. float F2 = joystickTilt / 32; //joystickTilt is just a value that goes from 0 to 32 hSpeed += F2 * cos(S0) * 1.5; F0 = SM64Operation.sin(S0) * F2 * 10; //this is not used to calculate horizontal speed so ignore. } if (hSpeed > F1) hSpeed -= 1; if (hSpeed < -16) hSpeed += 2; xSpeed = cos(moveAngle) * hSpeed + F0 * cos(moveAngle + 16384)); //reminder angles go from -32767 to 32768 ySpeed = sin(moveAngle) * hSpeed + F0 * sin(moveAngle + 16384));
This explains why when you single jump, double jump, dive, WK, etc. Speed gets capped when your speed is higher than 32, but longjumping speed increases faster until your speed is 48.
Experienced player (617)
Joined: 11/30/2008
Posts: 650
Location: a little city in the middle of nowhere
This one is very simple, just multiply speed by 1.5, and if speed is higher than 48, cap speed to 48.
This was exactly the information I was looking for, given I don't have the ability to get an emulator running. Thanks for that.
Measure once. Cut twice.
Plush
Other
Player (152)
Joined: 9/1/2014
Posts: 235
Location: Italy
Sick stuff David :)
Plush
Other
Player (152)
Joined: 9/1/2014
Posts: 235
Location: Italy
mkdasher wrote:
- When your speed is 47, if you do a perfect input, your speed will go to 47.15. Instead, you can force your joystick tilt to be worse to get a 47.9999 speed.
I was wondering, this isn't useful on every circumstance, is it? I mean, let's take as an example a LJ starting from 45.55: 45.55 +1.15 => 46.7 At this point, I could either do the trick you say 46.7 => 46.999 => 47.999 => (+0.15) or just normally tilt 46.7 => 47.85 => 48 => (+0.15) You can see by eye that normally tilting is faster (47.85 > 46.999). So since I'm very bad at maths, I was wondering, in what range(s) simply tilting is faster than doing the trick you mentioned? :v
Plush
Other
Player (152)
Joined: 9/1/2014
Posts: 235
Location: Italy
II think I've solved it. The trick you say makes you travel more distance only if you get your speed between 45.85 and 46.275. Might be wrong though :S EDIT: Yeah this is correct if the LJ happened to land right after. But if the LJ lands much longer, it's better to do the trick. Idk I wish I could put this in a practical formula to use when TASing :S
Experienced player (647)
Joined: 5/16/2009
Posts: 235
Plush wrote:
mkdasher wrote:
- When your speed is 47, if you do a perfect input, your speed will go to 47.15. Instead, you can force your joystick tilt to be worse to get a 47.9999 speed.
I was wondering, this isn't useful on every circumstance, is it? I mean, let's take as an example a LJ starting from 45.55: 45.55 +1.15 => 46.7 At this point, I could either do the trick you say 46.7 => 46.999 => 47.999 => (+0.15) or just normally tilt 46.7 => 47.85 => 48 => (+0.15) You can see by eye that normally tilting is faster (47.85 > 46.999). So since I'm very bad at maths, I was wondering, in what range(s) simply tilting is faster than doing the trick you mentioned? :v
You are supposed to do the trick to get 47.999, not 46.999. If your speed is lower than 46.85, a perfect input will always get you a speed lower than 48, so there's no reason to do that. If your speed is higher than 47.85, a perfect input will give you over 48, so unless you're trying to force your angle, the trick is useless as well. So the range you would usually do this is 46.85 to 47.85. (For jump diving, there's a equivalent range, which goes from 30.85 to 31.85).
Plush
Other
Player (152)
Joined: 9/1/2014
Posts: 235
Location: Italy
mkdasher wrote:
Plush wrote:
mkdasher wrote:
- When your speed is 47, if you do a perfect input, your speed will go to 47.15. Instead, you can force your joystick tilt to be worse to get a 47.9999 speed.
I was wondering, this isn't useful on every circumstance, is it? I mean, let's take as an example a LJ starting from 45.55: 45.55 +1.15 => 46.7 At this point, I could either do the trick you say 46.7 => 46.999 => 47.999 => (+0.15) or just normally tilt 46.7 => 47.85 => 48 => (+0.15) You can see by eye that normally tilting is faster (47.85 > 46.999). So since I'm very bad at maths, I was wondering, in what range(s) simply tilting is faster than doing the trick you mentioned? :v
You are supposed to do the trick to get 47.999, not 46.999. If your speed is lower than 46.85, a perfect input will always get you a speed lower than 48, so there's no reason to do that. If your speed is higher than 47.85, a perfect input will give you over 48, so unless you're trying to force your angle, the trick is useless as well. So the range you would usually do this is 46.85 to 47.85. (For jump diving, there's a equivalent range, which goes from 30.85 to 31.85).
Ohhh right, turns out it was much easier than I thought lol And yeah my example was wrong (idk what I was thinking when I wrote 46.999 lol). Thanks a ton
Active player (419)
Joined: 9/21/2009
Posts: 1047
Location: California
MKDasher wrote:
(For jump diving, there's a equivalent range, which goes from 30.85 to 31.85).
This also applies for dives after wall kicking, like right after the BLJ in BitDW prior to the roll leading into slope jump dives.