don't click here

Hack Sonic CD Warped

Discussion in 'Engineering & Reverse Engineering' started by Sonic Hachelle-Bee, Jul 30, 2020.

  1. Sonic Hachelle-Bee

    Sonic Hachelle-Bee

    Taking a Sand Shower Tech Member
    814
    214
    43
    Lyon, France
    Sonic 2 Long Version
    Sonic CD Warped

    [​IMG]

    Sonic CD Warped is a small hack of Sonic CD for the Genesis. Small hack because there are only a few gameplay elements changed. However, the changes are worth the effort provided: they are an attempt to enhance the whole game experience.

    This hack provides 3 gameplay changes:

    (1) Time zones are now randomly selected when you start a level, and when you time travel. You may start a level or warp directly to past, present, bad future or good future.
    Rationale: If you don't bother to destroy all the Eggman machines and only collect time stones, you will not miss 3/4 of the game anymore. And each playthrough will be different.
    Note: Time traveling still follows the past/future logic. Example, if you are in the present time zone and warp to the past, you can only go to the past. If you warp from present to the future, you can go to the bad or good future randomly.​

    (2) The warp cutscene when Sonic floats in the air while time traveling is entirely removed. This makes the time travel a lot faster. Time zones seem to load almost instantly.
    Rationale: Actually, this cutscene is useless. Then, it will not break your gameplay repeatedly for a few seconds anymore.
    Note: I don't know why they added this cutscene in the first place. It is boring watching it 50+ times in one game session. And this really breaks the flow of the gameplay.​

    (3) The time to run at full speed before time traveling is reduced almost by half. This also makes the time travel a lot faster and a lot easier.
    Rationale: Like point 2, this enhances greatly the flow of the gameplay. You can time travel more often. This encourages you to go to time zones like the bad future even if there is no point at all! This is also easier and fun to find and destroy all the Eggman machines of the game.
    Note: This actually makes sense in a lot of places where there is such a small room to run. Time travel shall not be a chore to activate...

    [​IMG] [​IMG] [​IMG]

    Side effects introduced by this hack:
    • You do not need to find the Eggman machine to go to the good future: you can go to the good future randomly.
    • Destroying the Eggman machine will only grant you a good future at the score tally, no matter the time zone you are in (even in the bad future). However, you must continue to find all Eggman machines to see the good ending (or collect all time stones).
    • Being in the good future doesn't grant you a good future at the score tally automatically. You must destroy the Eggman machine first (or collect all time stones).
    • Act 3 can begin randomly in bad or good future. If you destroyed both Eggman machines of the zone, don't be afraid. The good future is granted at the score tally (even in the bad future).
    • A little surprise is hidden if you manage to collect all time stones and if you are in a bad future. Nothing too fancy, but this is cool :)
    [​IMG]

    Source code:

    Source code of Sonic CD Warped is entirely available on GitHub: https://github.com/SonicHachelleBee/scdwarped.git
    Source code zip file
    If you are familiar with the Sonic 2 disassembly, you will have no problem to build it.

    The disassembly allows you to choose which gameplay change you want to activate. By default, all 3 described above are activated. You can also edit the warp time at your convenience.
    Here are the options provided in scdwarped.asm:

    Code (Text):
    1. gameRegion = 0
    2. ;    | If 0, compile the japanese version
    3. ;    | If 1, compile the US version
    4. ;    | If 2, compile the european version
    5. ;
    6. randomTimeZones = 1
    7. ;    | If 1, time zones are random at start of every level, and random when warping from a time zone
    8. ;    | to another (note that warping still keep the past/future logic).
    9. ;    | If 0, this compiles the original scd.IPX___.asm file and removes this feature.
    10. ;
    11. removeWarpCutscene = 1
    12. ;    | If 1, remove the warp cutscene entirely. This makes the warp between time zones
    13. ;    | almost instantaneous.
    14. ;
    15. reduceWarpTime = 1
    16. ;    | If 1, the time required to run at full speed for the warp to activate is reduced.
    17. ;    | To edit the time values, edit the 4 warp_time_macro below.

    Download link:

    The iso file you download is fully compatible with the original redbook audio of Sonic CD (not provided).

    Download Sonic CD Warped V1.0.0 from GitHub: https://github.com/SonicHachelleBee/scdwarped/releases
    Japanese version
    US version
    European version
     
  2. Xiao Hayes

    Xiao Hayes

    Classic Eggman art Member


    This was actually explained by Oshima. The programmer they had wasn't as good as Yuji Naka and they made the cutscene to hide to long loading time, the original plan being having the shift happen on the run. Oshima said he wished it was removed in the 2011 remake.
     
    • Informative Informative x 2
    • Like Like x 1
    • List
  3. The Joebro64

    The Joebro64

    SAY HELLO TO MY CHOCOLATE BLEND Member
    3,263
    2,917
    93
    I've been waiting for a new SCD Sonic CD hack for a loooong time. Can't wait to try this out!
     
  4. SuperSnoopy

    SuperSnoopy

    I like Sonic Advance Member
    1,778
    744
    93
    Lyon, France
    Slice of life visual novel, coming soon...?
    Yo, this looks neat. Will definitely give it a try.
     
  5. BlackHole

    BlackHole

    You're going to need MORE than help. Member
    5,848
    854
    93
    England
    Complaining
    Might I make a suggestion? Perhaps you could have the Super Peelout act as a 'jump generator', where you charge it up to ready a jump to a different time period, then let go to jump.

    Just give the mechanic an easier activation method, while giving the Super Peelout a more useful application that the Spin-Dash doesn't.
     
  6. Sonic Hachelle-Bee

    Sonic Hachelle-Bee

    Taking a Sand Shower Tech Member
    814
    214
    43
    Lyon, France
    Sonic 2 Long Version
    You are right, I remember. However they failed to hide the long loading time, because it is not hidden at all. Actually, nothing loads in the background while the cutscene is running. Instead of "loading time", they come up with "cutscene loading time + cutscene time + loading time". This is far worse than no cutscene at all.

    This is an interesting idea. But I will not implement it, I am sorry. I have other projects for now and no time to work on this hack besides bug fixes. Also, you may not want to stop and charge the Super Peelout every single time you want to warp to another time period. Sometimes, you have a time plate, and nearby you build up enough momentum to warp (Collision Chaos U ramps, S tunnels, horizontal facing springs, Wacky Workbench gimmicks...)

    Maybe you can take the source code and mess with it. Sonic CD is not an easy game to hack mainly because of its 73 copies of the main level engine.
     
  7. BlackHole

    BlackHole

    You're going to need MORE than help. Member
    5,848
    854
    93
    England
    Complaining
    Oh, I was simply suggesting it as an option rather then the only method to jump forward in time, and to give the Super Peelout some much needed utility, considering it's basically "Spin-Dash but you can get hurt."

    So if you saw two springs you can bounce between to trigger it, wonderful, but if you didn't see anything and wanted to jump, as the robot generator wreckage is right there, you can just charge up and jump on the spot.

    No need to apologise, I was simply offering a suggestion on a rather under-used mechanic in a very well done hack
     
  8. Liliam

    Liliam

    Oldbie
    1,563
    117
    43
    Wait, what are the surplus three copies?
     
  9. Sonic Hachelle-Bee

    Sonic Hachelle-Bee

    Taking a Sand Shower Tech Member
    814
    214
    43
    Lyon, France
    Sonic 2 Long Version
    They are the 3 demo levels.
    70 levels + 3 demo.
     
    • Informative Informative x 2
    • List
  10. Knucklez

    Knucklez

    I love 2B 'n' ass. Member
    689
    22
    18
    Unless you're willing to do it, the only thing I would update is the compression/decompression if possible to speed up the transition between time so it appears more seamless.

    Otherwise I really like this.
     
  11. Sonic Hachelle-Bee

    Sonic Hachelle-Bee

    Taking a Sand Shower Tech Member
    814
    214
    43
    Lyon, France
    Sonic 2 Long Version
    This is a good idea. But I am afraid this requires a more complete disassembly.

    Thanks to everyone for the positive feedback :)
     
  12. President Zippy

    President Zippy

    Zombies rule Belgium! Member
    It sounds like you're asking for a codec that decompresses assets quickly: I think you want LZ4, which is typically a whopping 1/3 of the speed of memcpy(3). I also don't think you need the compressor itself, just a decompressor. You will want to place new compressed assets into the ROM/ISO, but you should only be decompressing them, invariably to work around the sluggish 1x CD drive.

    You need an LZ4 decompressor that runs on embedded m68k (no ELF headers), and you probably want an includable ASM file rather than some compiled binary. We can just rip the decompressor code out of the C implementation and write a new Makefile that sets build flags to simply generate an ASM file that we can later include into disassemblies. Whether GCC or Clang is better, I cannot say, but I can guarantee the compiler backend is going to generate code designed around m68k variants with pipelining, branch prediction, and instruction caches, none of which we shall find on an MD/Genesis.

    The best solution is a VERY SMALL handwritten LZ4 decoder in m68k ASM. Challenge accepted.

    EDIT: I included a link to the official implementation of LZ4, complete with benchmarks. Note that the compression level used on the original data has negligible effect on the decoding throughput. This is in large part because LZ4 generates a dictionary used for decompression during the compression stage, which IIRC is a common trait of the entire Lempel-Ziv family of algorithms (though I'm not 100% sure, please don't be afraid to call me out).

    https://github.com/lz4/lz4

    You may wonder why I would suddenly care so much about this despite contributing nothing to date besides a couple code reviews. This is because such a tool would facilitate in the creation of more of the free entertainment I've enjoyed since 2008 and continue to enjoy to this day.
     
    Last edited: May 27, 2022