This is a version of Sonic the Hedgehog 2 with Sonic & Knuckles locked on it. The title character is replaced by his rival, Knuckles. The levels remain unchanged. There is more than just an appearance change to this game. Knuckles' abilities remain intact. If you haven't seen Sonic the Hedgehog 2 completed before, you may wish to do so before seeing what a character with gliding and wall climbing can accomplish. The submission is an improvement of 5.9 seconds in-game time.
- Emulator used: Gens version 11a
- Aims for fastest in-game time, then fastest real time
- Abuses programming errors
- Takes damage to save time
- Manipulates luck
About The Movie
This submission consists mostly of minor improvements which came from better positioning and more optimal movement. There are some route changes and a few new techniques are used. This movie initially started out as an individual level run, showing an improved route for Mystic Cave 2 that was also viable for RTA's. From there, WST suggested applying Kiske's monitor trick to Emerald Hill 1 and afterward, recommended improving the current TAS in whole. Thanks goes to Kiske, Tee-N-Tee, Aglar, and WST for making the first published TAS. They did a lot of work in routing the run and pulling off several maneuvers that required precise positions and speeds that otherwise may not have been included in this submission (Aquatic Ruin 1 had a jump over the pool with the revolving platforms that was notably difficult to execute, even with a known speed and position that worked).
Table of Times (minutes:seconds::frames)
|Act||New Time||Old Time||Frames Saved||Total Frames|
|Emerald Hill 1||0:14::11||0:14::28||17||17|
|Emerald Hill 2||0:33::25||0:33::32||7||24|
|Chemical Plant 1||0:14::46||0:14::47||1||25|
|Chemical Plant 2||0:31::54||0:32::04||10||35|
|Aquatic Ruin 1||0:12::40||0:12::52||12||47|
|Aquatic Ruin 2||0:28::27||0:28::27||0||47|
|Casino Night 1||0:15::40||0:15::40||0||47|
|Casino Night 2||0:32::05||0:32::09||4||51|
|Hill Top 1||0:23::36||0:23::56||20||71|
|Hill Top 2||0:42::03||0:42::59||56||127|
|Mystic Cave 1||0:24::03||0:24::20||17||144|
|Mystic Cave 2||0:28::51||0:30::21||90||234|
|Oil Ocean 1||0:16::52||0:16::56||4||238|
|Oil Ocean 2||0:28::59||0:29::21||22||260|
General Information Relevant To The Submission
The following information is not new to speedruns of this game, rather, it is here for convenience.
- The game has a hidden in-game timer that counts the frames. It does not increment during lag frames or while the game is paused.
- When performing a jump, Knuckles does not move for one frame so jumping is limited to when it is faster overall and this restriction does make a difference throughout the run.
- On horizontal ground, Knuckles will lose speed when rolling, while holding forward when running will maintain speed. When traveling down slopes, Knuckles accelerates faster while rolling than running. Transitioning from rolling to running is done by jumping or falling off the ground.
- Bounce height can be controlled by holding either A, B, or C which will keep a higher vertical speed until it falls below 4 pixels per frame. Releasing any of those buttons will immediately set the vertical speed to 4 pixels per frame if it was above that value.
- Knuckles will lose horizontal speed if the vertical speed is upward and less than 4 pixels per frame. This is avoided when possible by jumping from slopes that give Knuckles a downward vertical speed or by bumping a ceiling.
- Spindash release speed is controlled by how many times the buttons A, B, or C are pressed and how long the spindash is held before being released. The first button press sets the held spindash speed at 8 pixels per frame. Subsequent button presses raise the speed by 1 pixel per frame and each frame the spindash is held lowers the speed by 1/32 of the held speed value. The range for spindash speed is bounded to a minimum 8 pixels per frame and a maximum of 12 pixels per frame and the release speed only occurs in increments of 1/2 pixel per frame. Thus, it takes 6 button presses to release a maximum speed spindash.
- Sprite ejection occurs when Knuckles is inside a sprite and is colliding with one of its four sides. This pushes Knuckles out in the direction of the side that is being collided with. This is generally used to get inside terrain. In the run, this is most commonly done by gliding onto a wall with a monitor in a corner without breaking it, and then falling from the wall.
- Zips occur when Knuckles is inside solid terrain. The game ejects Knuckles at speeds up to 32 pixels per frame in the opposite direction that Knuckles is traveling. This is commonly useful for performing a level wrap but is also good for just going fast.
- Level wraps are an effective way to get to the end of a level quickly. The left edge of every level has an invisible wall that is 16 pixels wide. Knuckles can pass through this boundary by having sufficient speed to avoid collision with this wall. This underflows the value for horizontal position and the game then caps the now large value to a position at the end of the level. In levels with a capsule, the maximum position is significantly past the capsule and the height of the floor there does not correspond with the floor at the boss fight. Because the boss fight forces Knuckles to be within the horizontal limits of the camera when the camera locks there, Knuckles can jump before warping to the boss fight, starting the boss fight in mid air.
- Camera speed is capped at 16 pixels per frame. Traveling faster than this will cause Knuckles to get ahead of the camera. The horizontal position of the camera is important as it determines when sprites (such as the sign post) load and can be manipulated, such as spindashing before performing a level wrap, which moves the camera to the right and delays it from following Knuckles to the left. Knuckles generally does not interact with sprites that are out of view of the camera.
- Landing from a glide occurs differently between terrain and sprites. On terrain, Knuckles will stay in a ducking position for 15 frames and is unable to walk or spindash. On sprites, Knuckles either transitions into walking or running with horizontal speed, or transitions into standing with no horizontal speed. Sprites provide a significant advantage in that a spindash can be performed without waiting.
Game Resources has useful RAM addresses and additional information.
Stage By Stage Comments
Emerald Hill 1
Here, a technique found by Kiske was implemented where Knuckles can catch some air when rolling through a monitor which allows Knuckles to transition from rolling to running without losing any speed. This is done by hitting the left most pixel of the monitor with sufficient speed such that the next frame, Knuckles would be past the monitor. An additional frame was saved by spindashing from a more forward position on the angled yellow spring.
Emerald Hill 2
A few frames were saved by getting a faster horizontal speed when jumping over the spikes before the loops and saved some more time by using fewer jumps to gain enough speed to get ahead of the camera.
Chemical Plant 1
Saved 1 frame by turning around at an earlier position. The time spent braking was longer but was compensated by less time traveling to the turn around spot. A level wrap is used as the published run did.
Chemical Plant 2
Saved a few frames by landing on one of the revolving platforms which allowed for spindashing sooner. Also saved time with better positioning for the slope jumps which yielded more speed. Specifically, there are positions that get a better change in slope for jumping from and then the loops have slopes that are a less direct path so these are avoided to make small corner cuts.
Aquatic Ruin 1
Saved 12 frames by jumping into the ceiling of the first log rather than jumping on top and stopping for a spindash. The same zip as the published run was used, with some small changes in positioning.
Aquatic Ruin 2
This is the first level where no in-game time improvements were found. The wait is necessary for the swinging platform to get to a useful position and a level wrap is performed, like the published run. The boss has two timers that it waits for before loading and this occurs right before the boss fight so the game is paused for those two timers to save in-game time without losing any real time. Hitting the boss as it reaches the right edge of travel causes it to skip the explosion scene.
Casino Night 1
The only level with no improvements of any kind. A spindash prior to zipping for the level wrap delays the camera sufficiently to be further right upon level wrapping compared to not spindashing.
Casino Night 2
Saved 4 frames by landing on the top platform earlier. Sprite ejection is used to get inside the terrain and after some maneuvering, a zip is used to level wrap.
Hill Top 1
The route change in this level uses a higher path which was more direct and allowed for stopping on a sprite for the spindash before the high jump. The zip past the lava zone works as it does because a spindash before the zip causes a delay in the camera following Knuckles, allowing Knuckles to get far ahead enough that the giant wall sprite does not load until Knuckles is past it.
Hill Top 2
This level had many improvements. The improvements in the first half can be summarized by better braking, faster wall climbing, and better positioning that allowed for faster running speeds. The second cave section was improved by falling to the variable-height sprite rather than gliding, and skipping the first yellow spring near the exit. The boss fight was improved by not jumping prior to reaching the loading zone and hitting the boss on the first available frame.
Mystic Cave 1
Time savings in this level came from various improvements as well. Two jumps to switch to running were omitted, a faster approach to the wall with hidden spikes was used, better positioning was used on top of the rotating boxes, and a 5-tap spindash was quicker than a 6-tap spindash for approaching the second gate. The last 2 frame savings came from some manipulation of the last 2 crushers. The second to last crusher was loaded 1 frame earlier by omitting a jump and the last crusher was loaded later by waiting to load it. This put the left crusher at the desired height to jump earlier and the right crusher was not in the way for that jump.
Mystic Cave 2
The level wrap was achieved sooner by initiating a zip around the same area that the previous run was ejected upward. The difference was delaying the glide to grab the wall below the one tile opening between the two mostly solid blocks (the blocks are stacked vertically). From there Knuckles could climb onto the lower block and walk into the opening to get the zip. Knuckles is taller than one tile and collides with the ceiling after a few pixels of travel.
Image of the terrain
- |XX| Represents an all-way solid tile (16x16 pixels)- - |XX|XX| Previous destination of glide --> - |XX| - New destination of glide -> |XX|XX| - |XX|XX| -
Oil Ocean 1
The time savings in this level came from a more optimal entrance into the oil. Faster speeds can be achieved upon jumping from the third U-shaped platform but the speeds are insufficient to get far enough ahead to perform several of the jumps that maintain speed.
Oil Ocean 2
One frame was saved by entering the oil at an earlier point. The rest of the improvements were from better braking. The end of the level, just as the published run, warps Knuckles upward the same distance that the kill plane moves.
This run performed the crusher clip earlier by falling in a location that loaded it sooner and therefore moved down sooner. A faster method was used to go up between the walls covered in yellow bumpers. A shorter jump saved time in gliding through the second cage. After clipping through the wall by the invincibility monitor, this run was 65 frames ahead of the published run. Unfortunately, the nearby spikes are controlled by a level-based timer which put a spike in the way of the route. As a result, 40 of those frames were lost from waiting for it to move out of the way. More time was saved after that point by falling past the switch controlled gate faster and by running up the steep slope at the end longer before jumping.
Saved 10 frames by rolling over the switch rather than jumping over it. The same zip and level wrap are used.
It turns out that clipping through the wall by the ring monitor was faster than the spring because it does not unload the crusher used to go to the zip location. The crusher is a camera timer-based object so keeping it loaded earlier meant it would move down earlier. An additional 2 frames were saved with a faster boss fight.
By this point, a tool assisted speedrun of this level is trivial, however, 1 frame was saved because the previous run did not have the plane low enough to maintain sufficient speed on the last jump to get the fastest time (missing the required horizontal position to end the level by 1 pixel). In this run, Knuckles hits the kill plane and the end of the level on the same frame. This completes the level and Knuckles does not lose a life.
This run saved time by not avoiding the rings near the beginning of the level and squeezed 2 more frames out by jumping later to trigger the ending. This works because it gets the camera to the required vertical position sooner by spending more time in the air while still ahead of the camera. The camera moves at 6 pixels per frame to catch up to Knuckles when on the ground. The camera moves at 16 pixels per frame while catching up to Knuckles in the air and then at the same rate when caught up, which is still faster than 6 pixels per frame.
The trick used here and in the published run is performed by standing on a sprite that subsequently unloads. This gives Knuckles the property of maintaining the slope of the last terrain landed on. This also allows Knuckles to keep the same vertical position when gliding onto a floor, which is a few pixels below the top of the floor. Without this trick, the game would move Knuckles to the correct height on the next frame. These properties allow Knuckles to zip from many locations and run in the air.
One frame was saved in the final boss battle. This was made possible by getting a higher bounce from the third hit. It turns out that Knuckles' vertical speed was greater than 4 pixels per frame which meant that the height could be controlled by holding A, B, or C (In this case it was 1 frame). Amazingly, having to hit the boss one frame earlier in its cycle for the rest of the battle made copying the moves in the previous run not possible. With some fairly precise positioning, it was barely possible to maintain the one frame lead throughout the fight.
Real Time Savings
With runs of this game competing for fastest in-game time and differences in real time not being comparable for reasons that will be explained, this section of text would not exist. However, the improvements were significant (for the most part) and the input file is faster by a very small margin so the efforts to avoid a longer input file are discussed below.
Capsules And The Capsule Animals
Shortly after hitting a capsule top, 8 animals will spawn and a capsule timer starts counting down from 179 at a rate of 1 unit per frame until it reaches a value of 1. The timer does not increment on paused frames. On the next frame, the timer changes to 180 which is when the game checks for the presence of animals. When this check sees zero animals, the value changes to 0 and the game proceeds to bringing in the bonus tallies.
When an animal spawns, it starts counting down a timer which triggers the animal to jump. The 8 initial animals have unique timers that range from 98 to 154 in increments of 8. All future animals start with a timer of 12.
Animals will only spawn when the lowest 3 bits of the power-on timer are 0. If the game is paused on this frame, the animal will not spawn. If an animal spawn occurs the frame before the capsule timer changes to 180, the newly spawned animal will be present for the first frame of the check for animals and will unload the next frame. This event will delay the bonus tally one frame and has a 1 in 8 chance of occurring.
The primary method of saving time here is by deleting animal spawns for those animals that would remain on screen longer than the initial set of animals. The game loads several animals that jump later than the initial animals and are usually deleted unless they jumped to the right and left the screen early enough to not delay scrolling the screen to clear the animals that jumped to the left. In levels where the camera could not be scrolled upward, the capsule is generally too far to the left to manipulate animals to jump right, although this is still sometimes faster when manipulating the later animals to jump and is usually combined with deleting animal spawns.
The capsule animals can be manipulated before breaking the capsule by advancing the RNG seed that controls the animals type and horizontal travel speed before breaking the capsule. This occurs by destroying badniks (spawns an animal), deleting or adding boss explosions (explosions spawn on the same frames that animals spawn), and allowing bubbles to spawn in Aquatic Ruin. The boss explosions also use a timer that starts at 179, similar to the capsule timer, and does not increment on paused frames. Because the boss explosion timer does not start on a multiple of 8, two identical runs of a level with different power-on timer values may end with a different RNG seed. The direction they jump can also be manipulated. The direction is determined when they land by the fourth lowest bit in the power-on timer which changes every 16 frames.
No instances in this run were found where adding animals was faster.
Objects are dynamically loaded, so the location of useful RAM addresses change between the levels. These objects will load at addresses from $B400 up to $CFC0 and occupy $40 bytes. The object with the capsule timer can be identified by finding the object with the byte offset $00 set to $3E and the byte offset $25 set to $02. The timer can be found at the byte offset $1F. Capsule animal jump timers are located at bytes offset $37. The other addresses used were the long at $F636 (RNG seed) and the byte at $FE0F (Power-on timer, partial)
Due to in-game time being prioritized over real time and the way capsule animals work, comparing time spent during the capsule animal release may not always be a fair comparison of optimization during those parts.
Finishing a level in less than 30 seconds yields a time bonus of 50000. Finishing a level from 30 to 44 seconds yields a time bonus of 10000. Bonus values increment at a rate of 100 points per frame. This makes finishing a level in 0:29::59 399 frames slower than 0:30::00. The next fastest time would finish the level in 0:23::19 and is the primary reason why speedruns of this game aim for fastest in-game time.
No other instances were relevant in this run but this happens at every transition to a lower time bonus. If the ring bonus is larger than the time bonus, then that becomes the limiting factor for fastest real time.
Lag is minimized, usually with seemingly random changes in movement.
Real Time Table Of Times (frames saved)
In Game Time
|In Game Time|
(From 1st Table)
(Sum of Previous
|Emerald Hill 1||0||17||17||17|
|Emerald Hill 2||3||7||10||27|
|Chemical Plant 1||0||1||1||28|
|Chemical Plant 2||45||10||55||83|
|Aquatic Ruin 1||1||12||13||96|
|Aquatic Ruin 2||4||0||4||100|
|Casino Night 1||0||0||0||100|
|Casino Night 2||0||4||4||104|
|Hill Top 1||-1||20||19||123|
|Hill Top 2||-73||56||-17||106|
|Mystic Cave 1||0||17||17||123|
|Mystic Cave 2||-391||90||-301||-178|
|Oil Ocean 1||0||4||4||-174|
|Oil Ocean 2||56||22||78||-96|
The stage by stage comments below generally refer times savings to the "Real Time Minus In Game Time" column which is where lag, capsule animal manipulation, and bonus tallies are accounted for.
Emerald Hill 2
Pausing to delete or delay an animal spawn was unnecessary, saving 3 frames. This was also the only instance where animals were cleared from the screen by looking up and an animal spawned as the capsule timer expired.
Chemical Plant 2
4 frames of lag were saved by going through the levels lowest loop slower. This required a careful selection of inputs to get the speed and positions that would not get lag and still be fast enough to jump to the top route. The rest of the savings came from animal manipulation (deleted 5 animal spawns).
Aquatic Ruin 1
1 lag frame was saved by using a better selection of movement while ahead of the camera.
Aquatic Ruin 2
Using the same inputs as the published run resulted in an unfavorable animal spawn that required pausing for one frame to delete the spawn. To prevent this, a badnik was destroyed before the level wrap which provided animal spawns that required no pauses.
Hill Top 1
1 extra frame of lag was generated from taking damage with more rings which are unavoidable in the faster route.
Hill Top 2
The published run was able to look up and scroll the animals off of the camera which came at the cost of some in-game time. Being unable to perform that maneuver, 3 pauses were used to delete 2 explosions to advance the RNG seed and 5 animal spawns were deleted, limiting the net loss to 17 frames.
Mystic Cave 2
All of the non-in-game time lost here was caused by getting a larger time bonus. One animal spawn had to be deleted to prevent an animal from remaining on screen late.
Oil Ocean 2
Saved 56 frames from animal manipulation (13 paused frames to deleted 3 animal spawns and manipulate jump direction).
Saved 2 frames of lag by controlling the speed and position on the way to the lava platform.
Saved 2 frames of lag by rolling on the first sprite rather than running. 1 frame was saved by not getting the last frame animal spawn that the published run had.
Suggested screen shots: 36487, 22066, 53910, other.
GoddessMaria: Hello Zurggriff and welcome to TASVideos! I must say that this is quite an amazing and impressive work you've done. Not often do newcomers come in with their first ever TAS and beat an already solid published movie, so congrats! In regards to the matter of what constitutes as an improvements... Sonic runs have always aimed for In-Game Time (IGT), not Real-Time, and this submission is no exception. The submission is indeed very well done on a technical scale, the entertainment value is really good, and the audience response was very positive overall. Therefore...
I'm accepting this to Moons as an improvement to the previous movie.
feos: Finally I can pub something.