Red Ball 4 Tool-Assisted Speedrun WR Explained

Video Statistics and Information

Video
Captions Word Cloud
Reddit Comments
Captions
The tool-assisted speedruns for Red Ball 4 volumes  1, 2, and 3 are absolutely insane. Released from   2012 to 2013, these three installments share  various glitches and physics exploits that   speedrunners have utilized for almost a decade  to beat these games significantly faster than   intended. Most notably, a double jump glitch is  used in almost every single level to skip various   puzzles and obstacles to attain a much higher top  speed than otherwise possible. However, thanks to   the more recent development of tool assisted  speedruns for these games, the true potential   of Red Ball 4’s mechanics and its physics engine,  Box2D, have finally been realized. In early 2021,   humans were barely able to break the 3 minute  barrier in Red Ball 4 Vol.1 Any% thanks to the   discovery of a new glitch in level 15, the Boss  Roll, that saved almost 25 seconds. However,   soon after this feat, roblox8192 and Koala  Bread authored a TAS of the game that clocked   in at one minute and 59 seconds, an entire minute  faster. For a game this short, the difference was   absolutely mindblowing. By programming a seemingly  perfect sequence of inputs ahead of time,   the TAS built up a large amount of speed in the  early levels and then maintained it for almost the   entire remainder of the run. Double jumping and  corner boosting were far more broken than people   could have ever imagined just a few months prior.  After roblox and some others gave Volumes 2 and 3   the same treatment, the minute gap over the Any%  real-time records persisted. Fast-forwarding to   the present day, 50 more seconds have collectively  been saved with the current Any% TASses, and it’s   almost all thanks to one person, Starline, who is  the primary author of each run. So, please join me   as I explain the magic behind the tool-assisted  speedruns of the Red Ball 4 Flash volumes. If you have seen my Red Ball TAS Explained video  released in 2021, then you are probably aware of   some of the barriers that exist to making  tool-assisted speedruns of flash games.   To make a “proper” TAS of a Flash game, you have  to find an emulator that is able to run it and   then hope that your emulator and game combination  is also supported by the Linux TASsing utility   libTAS. Back in 2021, the most advanced Flash  game emulator, Ruffle, had zero compatibility   whatsoever for games programmed in ActionScript 3,  which included the entire Red Ball series. To TAS   these games, the community had to create modified  versions of each installment to provide features   like save states, pausing, frame advance, memory  watch, and input recording and playback. For the   Red Ball 4 volumes, each of the mods were created  by Face_McDude, an extremely impressive feat given   how obfuscated the code is when decompiled. While  Ruffle compatibility has improved enough over the   past 2 years to make the Red Ball games somewhat  playable, poor performance and differences from   the stock Flash Player has prevented it from  being used in any kind of Red Ball speedruns   for the time being. Therefore, every Red Ball  4 TAS, including the three primarily authored   by Starline that we will be analyzing,  were created with Face_McDude’s TAS hacks. Typically, the games look like this when playing  back an input string and this with the player   details disabled. But for your viewing pleasure, I  further modified the games to improve the heads-up   display and add widescreen support. These values  track Red Ball’s x and y position in units, these   values track his x and y velocity in units per  second, this tracks his current angle in radians,   and this tracks his angular velocity in units per  second. Red Ball’s circumference is approximately   4.19 units, meaning that an angular velocity of  that value would represent a full rotation each   second. The y axis in Flash is opposite of the  typical coordinate plane, so negative y velocity   points upwards and y position increases as you  go downwards. The stage size is 640x480 pixels   no matter how large you make the game window,  and there are 30 stage pixels per unit. In Any%,   there is no requirement or restrictions on  glitches or medals and achievements collected,   and timing begins the first frame that Red Ball  is visible after skipping the opening cutscene. Just one level in, there is already an enormous  amount to unpack. At low speeds, while Red Ball   is on the ground, pressing the right button will  increase Red Ball’s x velocity by about 1.19 units   each frame and his angular velocity by 0.567 units  each frame. The physics engine wants these two   values to be equal, so it converts some of the x  velocity into angular velocity at a 1:2 ratio…..   almost, so the frame ends at 1.07 x velocity and  0.81 angular velocity. The next frame, the left   button is pressed in addition to the right button,  which you may think is equivalent to pressing   nothing, but that is actually not the case. With  no input on the ground, Red Ball will lose 1.7%   of his speed each frame, but when pressing left  + right at low speeds, this decrease is actually   ignored. The exact purpose of this left press  isn’t known because the inputs for level 1 were   actually mostly generated with a bruteforcing  script, which tried around 100,000 combinations   to determine which one produced the fastest time  with the highest exit velocity. Regardless, this   pause allows Red Ball’s x velocity and angular  velocity to roughly equal out at 0.98. From here,   it’s not really feasible to go frame by frame to  explain Red Ball’s changes in velocity because   the system for doing so is orders of magnitude  more complicated than it is in Red Ball 1. All   you really need to know is that the game has a  soft cap of 11 for velocity in the x direction,   meaning that the game will stop applying  acceleration from the right button once this   value has been reached. However, if this limit is  able to be exceeded, say by rolling down a slope,   the game will allow that velocity to be  maintained. At this spot on the slope, we   will already witness the first instance of double  jumping in the run, and this is how it works: If the jump key is pressed for exactly 1 frame,  there is a window of 3-8 frames inclusive after   this input where pressing jump again will yield  an extra jump. The game uses this formula to   determine what y velocity to add to Red Ball when  jumping based on what his y velocity will be on   the next frame, before the jump. If it will be  greater than -2, the jump will subtract 9.55 from   the y velocity. If it will be less than -5, the  jump will subtract 4.775 from the y velocity. And,   if it will be between -2 and -5, the amount  applied follows a linear relationship between   -9.55 and -4.775. With a double jump, the  grounded jump always yields -9.55 y velocity,   and since gravity adds 0.5 to Red Ball’s y  velocity every frame, the second jump always   yields an additional -4.775 y velocity. While a  jump always applies the same upwards force to Red   Ball no matter how long the input is pressed, this  6 frame window means that there are 6 different   heights that can be obtained from a double  jump. This glitch is an artifact of a mechanic   implemented in the game called coyote time, which  allows the player to still jump up to 8 frames,   or .267 seconds, after they have fallen off of a  platform. This grace period is intended to make   the game feel more “fair” to play and patches up  the issue of jump inputs getting ignored if Red   Ball is slightly airborne after getting kicked  up by a small bump on the ground, something   which happens quite frequently. The problem  with this system arises because upon jumping,   Red Ball will be on the ground for 1 extra frame  before actually becoming airborne. By doing a 1   frame tap, the game applies the jump force to  Red Ball, starts a 3 frame jump cooldown timer,   and disables the coyote jump flag, but on the  next frame, before the physics have processed,   it notices that Red Ball is on the ground without  the jump key pressed, so it re-enables the coyote   jump flag. After the jump cooldown timer expires  on frame 3, Red Ball is able to jump again because   it thinks that he just fell off of a platform  due to that one frame of being on the ground   without the jump key pressed. Consequently, it  is impossible to perform a double jump after a   coyote jump because the flag isn’t reset. Red  Ball exits the ground with 10.4 x velocity,   and while airborne, Red Ball does not gain or lose  velocity unless the opposite direction is held,   meaning that speed is maintained for this  entire section of the slope. In contrast,   simply rolling up the slope causes the  x velocity to drop to as low as 8.63,   a decent bit slower. Unlike Red Ball 1, objects in  Red Ball 4 have zero restitution, or bounciness,   so Red Ball’s y velocity is immediately set to  zero upon hitting the ground in most situations. As alluded to earlier, the speed  from going down the slope causes   Red Ball’s x and angular velocities  to go past 11 into the high 14s,   where another frame 6 double jump is performed  to clear these stairs without slowing down. Now, due to imprecision in the mating of  edges, rolling over almost any vertex in   this game will cause Red Ball to get either a  vertical or horizontal bump. The direction and   magnitude of the bump depend on a multitude  of factors, including the angle between the   edges and Red Ball’s position and velocity.  Right before the bridge, there is a spot in   the ground that Red Ball normally gets a small  vertical bump from, which slows him down since   some x velocity is converted into y velocity.  However, Box2D intentionally incorporates a   certain amount of leeway when determining if  two objects are colliding. For Red Ball 4,   this tolerance is set to 0.005 units, or 0.15  pixels. While the ground is at y = 5.4583 units,   Red Ball lands at y=5.454 units, a height that  he maintains since it is within the range. This   is just enough of a gap to allow Red Ball to roll  over the corner without getting a bump from it. Red Ball’s angular velocity increases on the  bridge while his x velocity slightly decreases,   but upon landing, the two values equal out at  roughly 15 after the 2:1 conversion. A frame   3 double jump is performed to skip moving  this box. The transition to the next level   begins once Red Ball’s center is within 30  pixels of this right boundary wall. Since   Red Ball has a radius of 20 pixels, there is  essentially a 10 pixel wide zone that he can   land in to end the level without physically  contacting the right wall. Since Red Ball   is traveling at 15 units a second, or 15  pixels per frame, landing in this zone is   not a given. If Red Ball misses the sweet spot  and contacts the wall on the transition frame,   all of his x velocity will be taken away before  being placed in the next level, something that   becomes even more of an issue at higher and  higher speeds. However, by planning ahead,   the TAS can ensure that speed is always maintained  between levels, even if it means losing a few   frames from intentionally nonoptimal movement  through the level. The TAS performs a jump on   the transition frame, the force of which will be  applied on the next frame, the start of level 2. When the game loads in level 2, the 3 frame  jump cooldown timer that was initiated at the   end of level 1 is reset, meaning that Red Ball is  instantly ready for another jump. Red Ball’s spawn   position for level 2 is slightly in the ground,  so a coyote jump can go through on frame 1. This   technique is known as a screen double jump, and  since it isn’t bound by the typical 3-8 frame   window, it allows for access to a wider selection  of double jump heights. The amount of speed going   into level 2 was perfectly planned so that the  frame 1 screen double jump would position Red   Ball for an optimal corner boost off the back of  this platform. The apparent speed boost comes from   a good chunk of y velocity being converted  into x velocity, and it often allows for a   double jump to be performed afterwards, as it is  here. Red Ball converts some angular velocity to   x velocity on this box and then performs a coyote  jump to land on the next platform sooner. A single   jump sets up a nice boost and horizontal bump  off of this slope, whereafter, a frame 3 double   jump sends Red Ball to the end of the level,  where another screen double jump is initiated. The screen double jump perfectly sends Red Ball to  this slope where he is able to build up even more   speed. Left is tapped for a frame, which decreases  angular velocity by about 0.567 at high speeds,   leading to an effective decrease of 0.19 x  velocity. This leads to a better slope boost later   in the level. Red Ball perfectly skims off of the  boulder after a frame 8 double jump, incorporating   another left tap and converting just enough x  velocity into y velocity to clear the wall and   land on top of the slope. Thanks to those two left  taps, Red Ball will conserve speed into level 4,   and he is set up for an insane boost on the top of  this second slope. A huge velocity conversion and   a horizontal vertex bump combine to get Red Ball  from 21.3 to 23.3 x velocity. This boost is the   reason why, despite there being several ways  to beat level 1 a frame faster than it is in   this TAS, it is ultimately not worth it to do so.  The possible speed generated from the slope just   isn’t as significant. These kinds of tradeoffs  are persistent throughout many levels in the TAS,   as precise speed manipulation through left  taps and neutral frames is often necessary   to allow things to work out 1, 2, or more  levels down the line. A frame 4 double jump   is performed on the wooden platform to make  Red Ball carry -7.83 y velocity into level 4. The screen triple jump allows Red Ball to clear  the entire starting gap, completely avoiding   the cart that you are supposed to roll back  and jump on to cross it. Red Ball gets a tiny   boost by landing on the intersection between  these two edges, yielding him just the right   amount of speed for him to conserve it into  the next level. A frame 7 double jump is used   to clear this entire bridge section and set up  a corner boost on the end of the ground here,   getting Red Ball up to 24.7 x velocity. A coyote  jump is performed after rolling off of the box   to just barely clear this entire valley, fully  bypassing the boulder and box push puzzle. A frame   3 double jump is performed just before the end to  set up another screen triple jump into level 5. The third jump is executed as a coyote jump on  frame 8, which completely skips the slope and   positions Red Ball to get a boost off the back  of the boulder. Left is pressed alongside jump   to reduce his angular velocity by 0.567, which  ultimately saves time due to allowing for a more   optimal level 6 completion. A frame 6 double  jump places Red Ball on this rolling cart,   and two normal jumps carry him  to the end with -0.55 y velocity.   This value was carefully manipulated to  make Red Ball get out of the ground quicker   at the start of the next level, causing less x  velocity to get converted into angular velocity.   A left tap is performed on frame 1 to  slightly reduce Red Ball’s angular velocity,   which sets up a perfect corner clip on this  wooden spoke after the jump, converting a huge   amount of x velocity into y velocity. A frame  2 coyote jump is performed, and a one frame   left shift is used to make Red Ball land at this  spot, perfectly clearing the elevator. Since Red   Ball is still moving upwards, his y velocity is  not reset upon making contact with the ground,   so a jump here is able to increase it to -11.51.  A frame 5 double jump allows him to barely avoid   the cart that you are supposed to ride to solve  a short puzzle to clear the wall at the end of   the level. Red Ball gets a small vertical vertex  bump at this spot on the slope while initiating a   frame 6 double jump to land on the front corner of  the ending platform, yielding a horizontal vertex   bump. Left is tapped the frame before finishing  the level to allow for a more optimal level 7. Level 7 is actually one of the few levels in  the game where Red Ball spawns slightly off   of the ground, which makes it impossible to set  up a screen double jump or triple jump. Still,   at 25.72 x velocity, Red Ball is easily able  to cross over the starting gap in a single   jump. Thanks to precise position and velocity  control, Red Ball is poised to enter the 0.15   pixel leeway zone above the ground on the next  frame rather than fully contacting it. Alongside   a left tap before the frame 6 double jump,  these minute changes in position and velocity   lead to a slightly better corner boost on this  wooden spoke. With an immense 26.37 x velocity,   a single jump is all it takes to cross this  entire water-filled gap. Left is pressed for   two frames to reduce angular velocity to set  up a better cart bump in level 8. Additionally   a screen triple jump is set up  before entering the next level. A 1 frame left tap and a frame 5 coyote jump set  up a corner boost on the platform all the way   over here. A left press upon landing and a  jump here perfectly sets up a double jump   off of the corner of the cart the same  frame the jump cooldown timer expires.   This effectively yields a triple jump, which  generates enough height to clear the windmill. An unavoidable vertical vertex bump is garnered  after Red Ball rolls off of the starting ledge.   A frame 6 coyote jump carries him to the top  spoke of this turbine that you are supposed   to spin to raise this slope to make the jump  across the gap possible. A left tap followed   by a frame 5 coyote jump allows Red Ball to  clear the wall with just about 0.6 pixels to   spare. A single jump is all that is needed  to cross the pond, and a coyote jump off   of the slope effectively gets him to over 27 x  velocity. After jumping off of the wood platform,   Red Ball barely grazes the corner of the ending  platform to reset the coyote jump flag while   expending a negligible amount of x velocity.  By jumping at -2.9 y velocity, Red Ball ends   the level with -9.8 y velocity, which is exactly  what is needed for a perfect entry into level 10. By entering the level with a large magnitude of y velocity instead  of garnering it from a jump in level 10,   Red Ball can land on this box a single frame  sooner. It’s worth mentioning that it is possible   to get way more speed off of the ending slope in  level 9, but doing so causes you to overshoot this   box if you don’t slow down. A frame 8 double  jump combined with a left shift for later   barely gets Red Ball to the top spoke of this  turbine while it is slanted upward, converting   some angular velocity into x velocity. The left  shift comes into play, as a frame 7 double jump   yields a good boost from killing this enemy. The  bounce sets Red Ball’s y velocity to -8, which   is enough to reach the ending ledge. A jump is  performed on the transition frame into level 11. The transition jump lands Red Ball on the  top of this box, and some angular velocity   is converted to x velocity as a result. This  slight conversion happens due to the box moving   slightly right when Red Ball touches it. It  is possible to get a boost off of the box’s   top right corner by jumping a frame later and  pressing left, but it ends up not being worth   it. A last frame coyote jump gets Red Ball to the  next box, but this time, velocity converts in the   opposite direction. A normal jump gets him to  the top of the ramp, where a vertical bump is   garnered on the first vertex. In this instance,  it is quite beneficial, as it allows Red Ball to   just barely land on the back of this loop and get  a boost. A coyote jump carries him to level 12. Level 12 is the first level where the game’s  “puzzle fail” mechanic becomes a concern. For   most levels, it is possible to put them in a  state where it is no longer possible to clear   them through conventional gameplay. If you  push a box or a boulder into a spot where it   cannot be recovered from, odds are, the game has  a trigger to detect that and will reset you to the   last checkpoint automatically. However, level 12  is unique in the fact that the game will count a   puzzle failure if you decide to avoid the boulder  entirely. This makes sense because you can’t get   back up this slope with a single jump, and you  aren’t supposed to be able to get over the right   wall without the boulder. While Red Ball is within  this region of the level, the game will check for   two conditions each frame: whether the boulder is  past the top of the slope, and whether the boulder   has an x velocity of greater than 0.25. If either  of these conditions are met, the game will not   count a puzzle failure, since it indicates that  the boulder will either make it down the slope or   has already made it down. The entire beginning of  the level is meticulously set up for Red Ball to   get just enough of a push on the boulder while  losing as little speed as possible. There is a   one frame left shift after the coyote jump, and  the ground is landed on with only the jump key   pressed. This causes Red Ball’s angular velocity  to be reduced by 5% on the next frame. Because   of some jankiness with how this pseudo-friction  system is implemented, the 5% reduction happens   again on the next frame even though Red Ball is in  the air. The purpose of reducing angular velocity   here is so that the boulder will receive less of  a leftward force from Red Ball’s rotation while   receiving the same rightward force from his linear  momentum, leading to a greater net push to the   right. Another double jump is performed off of the  boulder with some angular velocity manipulation,   and Red Ball soars to the end of the level.  However, for the first time, a considerable amount   of speed is expended on purpose… you’ll see why  in a moment. A screen triple jump is set up going   into level 13. Ultimately, Red Ball entered level  12 with 26.07 x velocity and left with 16.64. After all that precise speed reduction and  a screen triple jump, Red Ball clears this   obstacle at the start of level 13 with probably  a bit more room than you’d expect from a TAS this   precise. However, the tiny bit of extra speed loss  is necessary to position Red Ball on this tilting   platform in a spot where a double jump will allow  him to clear this armored enemy. That’s what we   were actually setting up for. A frame 4 double  jump sets up a corner boosted double jump on   the front corner of the pond, and Red Ball exits  the level with an effective 19.403 x velocity. Since Red Ball spawns off of the ground  in this level, it's not possible to set   up a screen triple jump. With a frame 3 double  jump, Red Ball barely makes it onto the cart   without bonking. There is a 1 frame left tap  on the slope, and after launching off of it,   Red Ball lands perfectly for a corner boost  off of this platform and this boulder. A frame   7 coyote jump is performed to make Red Ball  land on this plank a bit later, delaying the   angular to x velocity conversion. This is done  to manipulate Red Ball’s x position so that,   after the double jump to clear the wall, he  gets a more optimal corner boost. A coyote   jump is performed to avoid this enemy, and  Red Ball makes his way over to the boss fight. However, before we get into the TAS completion,  it’s necessary to see how things are supposed to   go down. The fight is split up into three distinct  phases that each require the player to do very   different things. In phase 1, the boss starts  by rolling to the left side of the screen in   aggro mode, meaning that any contact will damage  the player and reverse his direction. However,   if the boss crosses the 3.33 unit mark on the left  side of the level or the 18 unit mark on the right   side, he becomes vulnerable for up to two seconds.  If Red Ball hits the boss in his vulnerable state,   he will take 1 heart of damage, and a 16 frame  cooldown will start where Red Ball cannot damage   or be damaged by any enemies, including the boss.  The boss’s damaged state also lasts for 2 seconds,   so despite the cooldown, you can consecutively  hit the boss as many times as you want,   resetting the cooldown and damaged timers each  time. However, you won’t deal any extra hearts   of damage by doing this. After hitting the boss  3 times, phase 2 will initiate, where the boss   ground pounds to drop a normal enemy from the sky,  which Red Ball must kill to make the boss roll to   the other side and initiate the next wave. Next  come 2 normal enemies, and then 2 armored enemies,   which each require 2 hits to kill. After  expending those guys, phase 3 initiates,   where the boss bounces either 4 or 5 times on  the ground before becoming vulnerable. After 3   more hits, the boss loses his last heart, and  the fight is over, taking a total of around   a minute to complete with no glitches. So,  let’s now see how the TAS takes on the boss. A sub-21 second fight. Red Ball hugs the left wall at  the start of the battle, and a few frames after   the boss becomes vulnerable, the right  button is held. After damaging the boss,   Red Ball remains in contact for a good chunk of  the 16 frame cooldown timer, hoisting him to the   right. This makes the distance that the boss needs  to travel to the next vulnerability zone shorter.   While you can hit the boss back to the left in  his aggro state to get another hit in much sooner,   this can only be done twice throughout the  whole fight, since Red Ball dies after taking   a third hit. It’s faster to budget those hearts  for later. Red Ball charges to the right and   jumps over the boss, hitting left upon contacting  the wall while continuing to spin to the right.   He deals a hit the same frame the boss becomes  vulnerable, and because of the rightward spin,   the boss slides on top of Red Ball. That’s  when this incredible maneuver comes into play.   Once the boss crosses the 3.33 unit plane,  he becomes vulnerable for another hit,   which is taken after the boss bounces off of  the wall. Now that the boss is at 3 hearts,   the game is waiting for him to become aggro again  to initiate phase 2 of the fight. However, the TAS   doesn’t allow for this to happen, as the boss is  launched back to the right side of the screen in   the refreshed damaged state with the help of that  16 frame cooldown timer. Since phase 1 behavior is   still active, the boss again becomes vulnerable  after crossing the 18 unit plane, and a fourth   heart of damage is dealt on the first possible  frame. This all is simply a faster version of   the Boss Roll glitch that was shown at the start  of the video. Since the boss is now at 2 hearts,   phase 2 will never start because it is checking  for the boss to be at 3 hearts. The hearts that   were budgeted finally come into play, as the boss’  direction is reversed on the first possible frame,   causing him to instantly become vulnerable  again, and another hit is dealt the frame   the cooldown timer expires. Two seconds  later, this is repeated, and the boss is   finished off. Red Ball 4 Vol.1 complete in  1 minute, 39 seconds, and 200 milliseconds. And that’s the Tool-assisted speedrun world  record for this game fully explained. Starline   did end up improving this thing by 9 frames  during the creation of this video, but due to   factors like the box in level 10 and the platform  at the start of level 13, it is very unlikely for   the time to ever go much lower than it currently  is, barring a grand discovery that has yet to be   made. In a glitchy physics sandbox that makes  very little effort to take away your speed,   the possibilities that are opened up are  quite amazing. And indeed, the impact that   Red Ball 4 TASsing has had on the game’s real-time  speedrunning scene has been absolutely monumental.   These TAS tools have allowed various frame perfect  setups to be created for the beginning levels and   ending levels that allow speed to be built up and  maintained in a way never seen before in RTA runs.   A 1-5 setup made by Starline requiring just a few  frame perfect double jumps is what allowed the   first sub 2:50 to happen, and a frame-based 12-14  setup is what allowed for the first sub 2:40 to   happen. Further developments and persistence from  speedrunners has brought the time down even lower,   and a certain speedrunner is currently attempting  a 40 frame perfect input setup that would yield   a final time faster than the original sub 2  TAS. But all of that is a story for another   day. Additionally, I’m afraid that the TAS  explanations for Red ball 4 Volumes 2 and 3   are going to have to wait for part 2 of this  series. If you thought this TAS was crazy,   those 2 are equally as insane, so subscribe if  you don’t want to miss out on it. See you then!
Info
Channel: Maximum
Views: 216,191
Rating: undefined out of 5
Keywords: maximum, speedrun, red, ball, progression, wr, wr history, red ball, itsmaximum, games, speedrunning, world record, red ball speedrun, red ball wr, redball, flash, red ball 4, tas, red ball tas, red ball tas explained, tas explained, speed, run, tool-assisted, perfect, world, record, explained, explanation, breakdown, TASing, tas wr, TAS, tas speedrun, speedruns, speedrun world record, flash game tas, red ball 4 tas explained, red ball 4 tas, boss roll, double jump
Id: JExvy-ZUEMQ
Channel Id: undefined
Length: 35min 41sec (2141 seconds)
Published: Sat Jul 01 2023
Related Videos
Note
Please note that this website is currently a work in progress! Lots of interesting data and statistics to come.