don't click here

Hack Sonic the Hedgehog & Miles "Tails" Prower the Fox in Knuckles the Echidna in Sonic the Hedgehog 2

Discussion in 'Engineering & Reverse Engineering' started by Clownacy, Aug 14, 2023.

  1. Clownacy

    Clownacy

    Tech Member
    1,076
    639
    93
    Having created a new Knuckles in Sonic 2 disassembly, I figured I'd put it to use by restoring Sonic and Tails to the game. This isn't just a matter of 'enabling' them: they were both removed from the game's code almost in their entirety. Likewise, two-player mode and the options menu were gutted. Restoring these would have been a nightmare, but part of my process for creating the new KiS2 disassembly was noting each and every change that was made from regular Sonic 2, which included noting every removed or modified piece of code. This made the task of restoring this code much more manageable, but still a massive time-sink.

    After a few months of on-and-off work, here is the result:



    Authenticity is a goal with this project, so tweaks that were introduced to suit Knuckles are not reverted when playing as Sonic or Tails. For instance, the shield will always be grey regardless of who you are playing as. This is done to match Sonic 3 & Knuckles, where things like the invincibility stars are grey no matter who you are playing as, despite the old blue colour working fine for Sonic and Tails. The idea is to produce a hypothetical 'what if' hack that presents KiS2 as if Sonic Team hadn't removed Sonic and Tails.

    So why were Sonic and Tails cut? Of course Knuckles is the focus of the game, but KiS2 also introduces some nice quality-of-life improvements and bugfixes, such as reduced special stage ring requirements, removing the leftover air-speed cap from Sonic 1, and fixing the broken scrolling at the bottom of the screen in Emerald Hill Zone. Were Sonic and Tails kept, KiS2 would have felt much more like the definitive version of the game. My guess is that the two were cut to save ROM space: KiS2's code and data is stored in a 256KiB ROM chip, and it's evident from studying KiS2's changes to Sonic 2's code that the developers were desperately trying to save space by removing whatever code and data they could afford to. For example, the lists of objects that you can spawn in debug mode were deleted, leaving every zone with only the default ring and monitor. Likewise, some unused code was removed. In the end, KiS2 had only 680 bytes of ROM space spare. By restoring Sonic and Tails, this threshold is crossed, requiring a 512KiB ROM chip instead, which is the same size as the entirety of Sonic 1.

    For authenticity's sake, and to show that this is definitely a hack of KiS2 that restores Sonic and Tails and not just a hack of Sonic 2 that adds Knuckles, this hack comes in the same format as the original Knuckles in Sonic 2: an 'upmem' ROM that must be appended to a combined Sonic & Knuckles and Sonic 2 ROM. For simplicity, a pre-combined ROM is provided, but a plain 'upmem.bin' binary is also provided for those who want to try combining ROMs themselves. The Everdrive v3 has a strange compatibility issue with KiS2 and this hack which requires a modification to the Sonic & Knuckles ROM to work-around, so a standalone non-lock-on build of the ROM is also provided for compatibility with that and any other problematic flash-carts or emulators.

    One thing that was awkward when making this hack was deciding the ring requirements for the special stages when playing as both Sonic and Tails: while KiS2 does lower the ring requirements for when the player is alone, it lacks ring requirements altogether for when they're accompanied by Tails, so I had to make up my own. To do this, I took the original Sonic and Tails ring requirements from Sonic 2 and reduced them by the same amount that KiS2 reduces the Sonic Alone/Tails Alone ring requirements.

    Anyway, this has been a fun project: it was nice to do some Sonic hacking again, and it's good to know that I haven't gotten too rusty at 68000 assembly. This hack should provide a nice base to build my own definitive version of Sonic 2 upon, since not even the tutorial on porting Knuckles to Sonic 2 actually ports everything that KiS2 adds.

    You can download this hack here.
     
    Last edited: Aug 15, 2023
  2. MainMemory

    MainMemory

    Kate the Wolf Tech Member
    4,758
    341
    63
    SonLVL
    Look, I planned on getting everything implemented eventually...

    Anyway, this is really cool!
     
  3. Akrenix

    Akrenix

    Member
    6
    2
    3
    Sonic 2 & Knuckles is finally real
     
  4. JGMR

    JGMR

    Member
    5
    0
    1
    This is really cool to see. I’ve often wondered from time to time about how Sonic and Tails were completely inaccessible in KIS2 and Sonic can only be seen on the Sega screen, so seeing this hack in action was one of the very interesting things I have ever heard of.

    Very cool to see!
     
  5. Jeffery Mewtamer

    Jeffery Mewtamer

    Blind Bookworm Member
    1,938
    122
    43
    Huh, never knew about KIS2 changing stuff beyond anything needed to make Knuckles work, but still a cool hack.

    Though I find myself wondering if that is the longest hack title ever.
     
  6. The Joebro64

    The Joebro64

    SAY HELLO TO MY CHOCOLATE BLEND Member
    3,112
    2,743
    93
    This is rad as hell
     
    • Like Like x 1
    • Agree Agree x 1
    • List
  7. Clownacy

    Clownacy

    Tech Member
    1,076
    639
    93
    I've updated the hack with a bugfix: apparently I went my entire Knuckles test playthrough without running into an enemy, otherwise I would have realised that Knuckles was invincible. Oops.
     
    Last edited: Aug 19, 2023