Submission #5639: joojamoi & Evil_3D's Genesis Sonic 3 & Knuckles "Knuckles, 100%" in 44:27.73

(Link to video)
Sega Genesis
Knuckles, 100%
Gens 11b
159858
59.922751013550524
40136
Unknown
Sonic and Knuckles & Sonic 3 (W) [!].bin
Submitted by joojamoi on 8/21/2017 6:38:44 PM
Submission Comments

Sonic 3 & Knuckles - Knuckles 100% by joojamoi & Evil_3D

Emulator and tools Used

  • Gens Re-Recording 11b + Camera hack + Solidity and Terrain dysplay
  • Sonic TAS tools + Frame Advance

Game objectives

  • Collect all Chaos and Super emeralds even faster
  • Best Ending
  • 100% completion
  • No deaths
  • Aim for faster in-game time, not RTA
  • Takes damage to save time
  • Abuses programming errors
  • Manipulates luck and badniks
  • Avoids underflowing the horizontal position (see comments below)
  • No skip zones/acts

Super/Hyper Knuckles

Knuckles when collect all Emeralds he can reach his super form, double the running, spindash, glide and climbing rate.

Running Speed

    2048 subpixels (8 pixels) per frame

Running Braking rate

    192 subpixels (3/4 pixels) per frame per frame

Running Deceleration (vertical, holding forward, at or below Running Speed)

    8 subpixels (1/32 pixels) per frame per frame

Max Spindash Speed

    3840 subpixels (15 pixels) per frame

Gliding X Acceleration

    12 subpixels (3/64 pixels) per frame per frame

Double the following values

    Running Acceleration, Air Acceleration, Climbing Rate

Hyper Form

  • By gliding into a wall when either his horizontal or vertical velocity exceed a certain value, Hyper Knuckles can cause an earthquake which destroys all enemies within rendering range of the camera. This will also enter any active star rings for bonus stages within rendering range.

Horizontal Underflow

An explication by Marzojr
  • This run uses almost all of the known glitches and abuses: the only exception is the underflowing of the horizontal coordinate; this is the technical form of saying "teleporting from the start to the end of a level" for this game.

Comments

This is an improvement of 00:32.14 seconds over the previous submission. 00:24.10 seconds was saved in special stages by using newly found glitches and by optimizing routes. Other 00:08.04 seconds was saved by optimizing other levels and using a new stair clip in Lava Reef 2.
All special stages were recorded by joojamoi and everything else was copied from previous movie by Evil_3D or remade by him.

Frames saved in special stages.

The special stages are listed in the order they are played in the movie. Special stages were timed from entering the big ring to when the act begins reloading. Or more accurately by wathing special stage flag at memory address 00FFFE48, timing is started when the flag is set to 1 and stopped when it's set to 0.
stageframes saved
Special stage 137
Special stage 2105
Special stage 339
Special stage 4345
Special stage 540
Special stage 6190
Special stage 747
Special stage 8108
Special stage 9158
Special stage 1031
Special stage 1173
Special stage 123
Special stage 1366
Special stage 14202
total1444

Other saves/losses

Stageframes saved/lost
Marble Garden Zone ACT 20
Flying Battery Zone ACT 234
Sandopolis Zone ACT 2322
Lava Reef Zone ACT 2127
Sky Sanctuary Zone-1
Total482

New tricks and glitches

Turning spheres into rings without surrounding them with red spheres (rings glitch)

This discovery is what lead me into this whole project of trying to find uses for the glitch and improving the special stages. All other glitches and improvements were found more or less by chance during planning and testing new routes.
Here's a more detailed explanation of the glitch. The algorithm which turns blue spheres surrounded by red spheres into rings seems to work by trying to find a closed path of red spheres with following rules:
  • Start from the last collected sphere.
  • Path must not cross itself (same red sphere cannot be used twice).
  • Path must be closed (return back to starting point).
  • Path must not do sharp turns (no U-turn on 2x2 area).
If such path is found then the inside of the path is determined only by the first turn the algorithm has taken. This is where the algorithm goes wrong and it can be tricked to mark a sphere on the outside as being inside the path. Then starting from the blue spheres on "inside" the algorithm uses flood fill to recursively convert all touching blue spheres (including diagonals) into rings. And finally all red spheres next to the converted blue spheres are converted into rings.
Below is a diagram which illustrates how the algorithm works. In each case two first images are showing the different found paths and the third image is the result.
Used in special stages 1, 2, 3, 4, 6, 9, 13 and 14.

Turning on red spheres

Under certain conditions it's possible to jump directly on a red sphere and turn on it without losing. This trick likely has something to do with subpixel position. At lowest speed (first 1800 frames of the stage) it's possible to turn in the same direction as what was the previous turn. After speedup things get somewhat more complicated.
Used in special stages 3, 5 and 7 (though in stage 3 this does not save any time).

Optimizing emerald position

After the last blue sphere is collected, Knuckles keeps walking for 85 frames at the same speed what he had when collecting the last sphere. At this point Knuckles' speed is set to 2048 (which equals to moving 1 square every 32 frames) and the emerald appears in the intersection which is 7.5-8.5 squares in front of Knuckles and the stage ends when Knuckles hits the emerald. So the difference between shortest and longest walk to the emerald is about 32 frames.
There are a handful of ways to manipulate Knuckles' position to have the emerald appear as close as possible:
  • Jumping on the last sphere.
  • Turning on the last sphere.
  • Changing from reverse to forward a few frames before hitting the last sphere. This is the most useful because this allows quite precise fine tuning especially when combined with turning on the last sphere.
A script was used to try going forward and turning on different frames.
Used in special stages 1, 2, 3, 4, 5, 6, 7, 10, 12 and 14.

Even more bumper abuse

Used extensively in most of the levels mostly to optimize turns and routes. Bouncing twice on the same bumper in 11th special stage is kind of glitchy too.
Used in all but one stage.

Entering first input before special stage begins to load

It's possible to start special stages 1 frame earlier by entering input on the frame before the special stage begins to load (frame before lag frames). For some reason this input is buffered until the special stage has loaded and begins to take input.
Used in every special stage except where the next trick ends up saving more time.

Delaying start by 1-2 frames

This one I couldn't completely figure out but I think it has something to do with turns taking variable number of frames after the first speedup (14-16 frames). For reference, before speedup turning always takes 14 frames when turning in the same direction as last turn and 15 frames in the opposite direction.

Stage by stage comments (special stages)

Special stage 1

37 frames saved. Starts on frame 903.
Most of the save comes from using rings glitch at the first and last 4x4. (frames 1100-1600 and 3300-3600)
Saved 2 frames by delaying start by 2 frames. Delay itself wastes 2 frames but 4 frames are gained later on because some turns are faster after speedup.
Saved 1 frame by going reverse near end. (frame 3150) Reversing wastes 13 frames but gains 14 frames later because it allows better positioning when the emerald appears. (frame 3666)
Lost 1 frame on ring bonus.

Special stage 2

105 frames saved. Starts on frame 6424.
Most of the save comes from new route at the second 3x4 and using the rings glitch at the 5x5. (frames 7290-7880)
Saved 6 frames by jumping at the end. (frame 9314) This delays collecting the last blue sphere by 4 frames but gains 10 frames by making the emerald appear closer.
Lost 2 frames on ring bonus.

Special stage 3

39 frames saved. Starts on frame 15218.
Saved about 26 frames on the last 4x4. (frames 18220-18550)
Saved about 13 frames by delaying start by 1 frame and staying reverse at the end and using that to get into better position when the emerald appears. (frame 18915)
Turning on the red sphere did not gain or lose any frames. So why not? (frames 17510-17550)
Lost 1 frame on ring bonus.

Special stage 4

345 frames saved. Starts on frame 21179.
Saved 5 frames by starting input a frame earlier and optimizing the first 3x3. (frames 21400-21600)
Saved 33 frames by optimizing the last 3x3. (frames 23140-23390)
Saved 285 frames by using the rings glitch at the middle. (frames 23550-23770)
Saved 23 frames at the end by pressing up and left to get the emerald appear much closer. (frame 23763) Without this trick it would have been 7 frames faster to collect the middle earlier, right after the first 3x3 (around frame 21660-).
Lost 1 frame on ring bonus.

Special stage 5

40 frames saved. Starts on frame 28244.
Saved 13 frames with some subpixel manipulation and a series of frame perfect jumps (3 frame perfect jumps in a row). Turning a bit late on one corner (frame 29951) delays movement by one frame and adjusts subpixel position for later use. The one frame delay is required for turning left on the red sphere a bit later (without delay it would be possible to turn right but turning left would end the stage). And the subpixel position is required to get over the bumper and hit the blue sphere at the end after a series of frame perfect jumps. Missing any of the jumps by a single frame would either jump over the blue sphere or hit a red sphere. Missing any two jumps by a single frame would also hit the bumper. (frames 30329-30490)
Saved 27 frames by staying reverse until the end to make the emerald appear closer. (frame 30598)

Special stage 6

190 frames saved. Starts on frame 33084.
Completely new route. This stage was maybe the hardest to optimize due to enormous amount of possibilities to do those 4x4s and the corridors. And changing route in one of them will almost certainly change routes on other sectors too. The final route ended up being about 20 squares (10%) longer than old route but has 34 turns less (50 vs 84).
One of the tested routes was whopping 45-50 squares (25%) longer than the old route but still about 100 frames faster because it also had 50 turns less (34 vs 84).

Special stage 7

47 frames saved. Starts on frame 41927.
Saved 6 frames by optimizing start and jumping on a bumper. (frame 43456)
Saved the rest by turning on a red sphere (frames 43860-43920) and staying reverse to get into better position when the emerald appears. (frame 44006)
Had to waste 1 frame on suboptimal turn to be able to turn on the red sphere. Also had to delay 2 more frames to gain 3 frames at the end. (frames 43656, 43688 and 43834)

Special stage 8 (S3&K stage 6)

108 frames saved. Starts on frame 84625.
More conveniently placed bumpers. (whole first half of the stage, frames 85040-85800)
Taking shorter and faster route over some bumpers. (frames 86100-86200)
Saved 6 frames on ring bonus.

Special stage 9 (S3&K stage 7)

158 frames saved. Starts on frame 89537.
Completely new route.

Special stage 10 (S3&K stage 4)

31 frames saved. Starts on frame 94938.
Optimized emerald to appear closed by turning at the end. (frame 98067)
Not going reverse around frame 97850 and simply jumping over the last yellow sphere around frame 98040 would have been 23 frames faster than old route.

Special stage 11 (S3&K stage 5)

73 frames saved. Starts on frame 100229.
Bumper ride in the middle saved about 14 frames. (frames 101040-101200)
About 53 frames were saved with a new route starting after the bumper ride in the middle. (frames 101200-end)
Jumping at the end saved 6 frames. (frame 102963)

Special stage 12 (S3&K stage 2)

3 (4) frames saved. Starts on frame 105056.
4 frames might not be a lot but I had almost given up with getting any improvement at all in this stage. The previous route already was the best I could find but finally also this stage got some improvement, or in fact 2 different improvements.
3 frames were saved by turning at the very end. (frame 106871)
1 more frame could be saved by starting input before the stage begins loading but this frame was sacrificed to resync Mushroom Hill Zone act 1 boss.

Special stage 13 (S3&K stage 3)

66 frames saved. Starts on frame 111868.
New route in the beginning and the end. (frames 112020-112170 and 113660-end)

Special stage 14 (S3&K stage 1)

202 frames saved. Starts on frame 117275.
Completely new route. There was also yet another totally different route which started with 180 degree turn but that route ended up being just 3 frames slower than this route.
Also some more bumper trickery. (frames 118910-119420)

Evil_3D Stage by stage comments (other levels)

Marble Garden 2

0 frames saved/lost.
The boss fight was remade because of desync but no frames were gained or lost.

Flying Battery 2

34 frames saved.
I remade the boss battle here because I hit the boss in a wrong frame and I lost one hit in the previous movie. So I saved 30 frames for an extra hit and 4 more for better positioning.

Sandopolis 2

322 frames saved.
Used the same route as in Knuckles any% TAS and saved 1 frame in the boss compared to this movie. So an Knuckles any% completed revision is in my TODO list in a far future.

Lava Reef 2

127 frames saved.
I discovered a stair clip in the beginning of the level, thanks to this I can zip directly to the giant ring in Knuckles' path, thanks to this some objects are in more friendly position and I can save more time compared to the previous movie.

Sky Sanctuary

1 frame lost.
I lost 1 frame because Mecha Sonic has very random and unfriendly attack patterns and with the new times in the movie the patters changes drastically, so when SSZ start I do micro pauses to manipulate his attack patterns. It's a shame to have lost 1 frame here, but well, if I had not done the pauses I would have lost 10+ seconds in comparison. And thanks to marzojr for his help in SSZ.

Other comments

Special thanks to mike89 and Evil_3D.
mike89 for showing one variation of this glitch (case 2 in the illustration) in his stream which made me research the subject way too much.
Evil_3D for helping with desyncs and making the previous movie which was used as a base for this movie.

Suggested screenshots

7828, 30364

feos: Judging... & Knuckles
feos: Improvement over [3422] Genesis Sonic 3 & Knuckles "Knuckles, 100%" by Evil_3D in 44:57.97 is quite clear and nice, so no doubts in obsoleting it.
The submission discussion though turned towards the best way to perform a glitchless run, despite of the issues mentioned in my previous judgment of this branch. But I won't be addressing them this time, because they don't affect this run at all, even in observable future. Let's leave the glitchless branch definition to the Sonic runners, and whenever they come up with something people can evaluate, we'll just treat it as usual and decide when it's submitted.
& Knuckles & accepting.
Fog: Publishing... & Knuckles.
Last Edited by adelikat on 10/23/2023 5:07 PM
Page History Latest diff List referrers