Is there a way you could do a Credits Warp In Sonic 3 & Knuckles?
2 years ago
Texas, USA

I thought about this question when I realized that the Level Warp Glitch in the game could cause you to go to random levels once you exit the blue spheres stage. To back up my belief that a Credits Warp is possible here, the game has a level that is the ending to the game (for Sonic at least). The Level ID is this one here: $0D01. Could anyone make a TAS that uses this information to perform a credits warp or was I just over-exaggerating the Level Warp? I know that doing the level warp glitch is possible without debug mode. But hey, I may be even contributing to the creation of a new category!

Edited by the author 2 years ago
United Kingdom

If it's the glitch I'm thinking of, the warping only takes you to levels where there are big rings, with performing the glitch from hidden palace. And since there are no big rings beyond lava reef 2, you can only warp backwards rather than forwards.

If there is a glitch that sends you to a random stage after leaving a blue sphere stage, do you have a video that show cases it?

Texas, USA

Unfortunately, I have been unable to make video on it because of how unlikely it is for it to warp you to seemingly random stages. However, I remember one occurrence when doing the glitch warped me to an out of bounds level with a glitched out title card that I had never seen before. Technically, the level warp is a type of arbitrary code execution that causes you to go to various stages based off of memory addresses that would normally be for something else but instead are used as level IDs to send you to after exiting the Special Stage. When doing the level warp, it can cause the type of A.C.E. mentioned above.

Edited by the author 2 years ago
United Kingdom

Unfortunately, it's not an ACE, the game has values stored in memory of the last big ring (or starpost) entered, and will only read those values for where to send the player. There is no known way to manipulate those values beyond entering a bonus or special stage (where it will record where you entered it).

Edited by the author 2 years ago
Texas, USA

It is kind of like ACE. But it actually redirects you to a seemingly random level. It turns out that the Memory might get mapped incorrectly when exiting the Special Stage. As in, it uses 2 bytes from an unrelated memory address as the level that you enter after exiting the Special Stage. If the hex value turns out to be $0D01, then the credits warp will work. But if the first byte value ends past $17, the game displays a glitchy title card then usually either crashes or displays even more unrelated garbage data. Although I probably recommend you visit this link here: https://tcrf.net/Sonic_%26_Knuckles#ID_0D_Act_1

Edited by the author 2 years ago
United Kingdom

An ACE is where you can inject your own code in memory and get the game to execute it, this isn't doing that.

It turns out that the Memory might get mapped incorrectly when exiting the Special Stage. As in, it uses 2 bytes from an unrelated memory address as the level that you enter after exiting the Special Stage

Good theory, but is not what is happening in the game code. These are the two functions that run depending on how you exit the blue sphere: https://i.imgur.com/qqcNhXc.png

Saved2_zone_and_act is hardcoded to memory address FE4A and is a word (2 bytes), and is only updated when you enter a big ring with the current values of the zone and act: https://i.imgur.com/CrPxazu.png

This is why the level warping works, as you aren't entering a big ring, but entering a blue sphere stage through unconventional means, it doesn't update the values in ram for where you came from, and instead uses the values already present in memory. So you can enter a big ring in a separate save file, soft reset (so the memory doesn't clear), and do the trick to enter a blue sphere stage from Hidden Palace, and you leave the blue sphere stage to where you entered the big ring on the other save.

As we know in the regular game mode that memory won't be touched for anything else (otherwise the Level Warp wouldn't work if it was reused for something else). So for actually corrupting it there's two choices - Debug Mode where all bets are off, and pointless within the scope of speedruns. Or maybe if competition mode reused that memory for something else, which is unlikely.

If you want to take a look yourself, you can see the game code here: https://raw.githubusercontent.com/sonicretro/skdisasm/master/sonic3k.asm (or if you have S3AIR, it's in a more readable form, in the form of lemon files). And the ram addresses are available here: http://info.sonicretro.org/SCHG:Sonic_the_Hedgehog_3_%26_Knuckles/RAM_Editing

Edited by the author 2 years ago
Texas, USA

I was referring to if you do not enter a giant ring then it might warp you to seemingly random levels.

Edited by the author 2 years ago
Texas, USA

Wait. The "Saved2" part of it, that might be the cause.

Texas, USA

How does that make sense? If I test it with code FFFE4A:0D01 in Bizhawk it just sends me to HCZ2 after I exit a special stage along with a glitchy X+Y position.

Edited by the author 2 years ago
United Kingdom

How does that make sense? If I test it with code FFFE4A:0D01 in Bizhawk it just sends me to HCZ2 after I exit a special stage along with a glitchy X+Y position.

Endianness, Genesis is Big Endian, so you need to swap them around (010D). But there wasn't any doubt around this part, if the value is correct then you would get sent to the ending cutscene upon leaving a blue sphere stage, because, yeah, that happens: https://streamable.com/lqfztq

The issue is that there are no known ways of manipulating that area in memory to be what you want it to be, or even so it's random for that matter, it's also no where near the memory that we know that can be overflowed (F100).

If you find a way that area in memory changes to something unexpected and is possible within the game from a hard reset without cheat codes or debug mode, then it's worth investigating, but unfortunately I'm pretty certain it's impossible.

Texas, USA

Well, I have something that I know, apparently, it is possible to cause the ring count to integer overflow but that requires debug mode unfortunately.

Game stats
Followers
619
Runs
989
Players
145
Latest news
Steam Submissions Now Banned

As of today, any new submissions of S3K from the Steam version will no longer be allowed. This is due to a couple of factors but mostly being inhibited availability as SEGA delisted it when releasing Origins. Any existing runs will remain unaffected.

12 days ago