don't click here

Sonic 3 Complete

Discussion in 'Engineering & Reverse Engineering' started by Tiddles, Dec 25, 2009.

  1. Tiddles


    Diamond Dust Tech Member
    Leicester, England
    Get in an accident and wake up in 1973
    I think I've figured out what's causing this - it's actually to do with destroying the bouncy spike badniks with a hyper dash. This seems to set a couple of bytes where Tails' object variables normally reside that cause terrible problems when he's spawned later - which is the moment the drill hits the ground. If you play a Sonic and Tails game, this won't happen because he's already spawned. But yeah, that glitchy mess? That's Tails, that is.

    The fix I've put into my source seems to be working and should be in the next version.
  2. Hayate


    Tech Member
    Well, I've just been attempting to fix the same bug going on what you said, but now I get stopped or crushed by invisible walls during the earthquake scene. I've absolutely no idea what I did wrong, because as far as I know I haven't touched anything to do with that.

    I'd give a diff but that'd be ginormous because I removed all of IDA's stupid crossref comments earlier, so here's the changes I made. As you can see there's nothing at all related to MGZ or invisible walls or earthquakes or anything of the sort - the only thing I can think of is forgetting an align, but I'm pretty sure I've aligned everything I've changed, and I would have thought the game would complain more if this was the case.

    Edit: After screwing around with debug mode, I've found that there's actually invisible blocks and death traps all over that section of the level - everywhere between the top of the hill in the next inside area after Robotnik pops up, up to where the last "tall rotating spiky platform" object in the level is. In fact, directly above said object is an invisible slope (!) that Sonic will run up and die at the top of, but only if you approach it from the right (if you try and reach it by jumping from the platform, he won't land on it).

    Also, I don't know whether it's because I bypassed a tag with debug or because I've broken this as well, but the Ride B doesn't work at all in the parts which I actually can walk through - Sonic just falls to his death.

    ... After thinking about it for a while, my impression is that somehow the Ride B collision data got corrupted, which would cause all of the above issues. However, I'm still clueless as to how I caused this massive fracture in game logic, but I have a feeling that it's a bug SEGA avoided with pure luck and completely unrelated hacking has somehow brought it to light.

    I'm going to investigate FBZ2 and SSZ to see if they also suffer from Ride B madness.

    Edit 2: Sky Sanctuary is perfectly fine, but FBZ is just as bad as MGZ.

    Oh, and have a ROM so you know what I'm on about.
  3. Puto


    Shin'ichi Kudō, detective. Tech Member
    Portugal, Oeiras
    Part of Team Megamix, but haven't done any actual work in ages.
    Can we have VGMs of that?

    Also, you can use the slot for the original S3 credits theme - afaik, S3K doesn't replace it.

    And track $18 IS used - by the HPZ "Eggman stealing the Master Emerald" cutscene.
  4. Tiddles


    Diamond Dust Tech Member
    Leicester, England
    Get in an accident and wake up in 1973
    I could probably string some together within the next couple of days if nobody else cares to beat me to it. I might already have one of S&K Knuckles' theme using the S3 sound somewhere.
    You can also recreate this quite simply using savestates - load a savestate from my copy (don't take it from the level select, that all got muddled around a lot) against regular S3K and you should be able to hear Sonic 3's 1F and 2E with S&K DAC. Likewise if you take a normal S3K savestate and load it against my ROM you can hear S&K's 1F with S3 DAC.

    Good point. I forgot, since I put it back as the ending theme in this version, but if you revert that to using Sky Sanctuary, that's another free slot. Also, although S3K replaces 32 with an S&K theme based version, I'm sure it's never used in the final game, so one should be able to repurpose that too.

    18 is used in this version, but it's 2E like everything else in the original game - this I remember quite well because I had to change it to 18 myself. :)
    It's $64CDF in the ROM, under loc_64CA6 in the disassembly.

    Ouch, the collision... it burns us. I've not yet looked at anything to do with collision myself, but one thing I do know about this disassembly is that there are a few things that are mislabelled, and a few things not stitched together quite right, such that certain sections falling out of their original binary position causes all sorts of cats-and-dogs-living-together scenarios...

    FWIW, the MGZ fix I put in was this - in Obj_MGZ2_BossTransition, changed
    Code (ASM):
    1. move.l  #Obj_Tails,($FFFFB04A).wƒo݊÷ ÚÚ²g6move.l  #MGZ2_Boss_Fix,($FFFFB04A).w
    Then added elsewhere:
    Code (ASM):
    1. MGZ2_Boss_Fix:
    2.         tst.w   ($FFFFFF08).w       ; Don't do this in a Sonic+Tails game;
    3.         beq.b   MGZ2_Boss_Fix_Skip  ; Tails is already initialised
    4.         clr.b   $5(a0)          ; This is the byte that seems to break it ($FFB04F)
    5. MGZ2_Boss_Fix_Skip:
    6.         move.l  #Obj_Tails,(a0)     ; Get back to the business of
    7.         jmp Obj_Tails       ; spawning Tails
  5. nineko


    I am the Holy Cat Tech Member
    Tiddles, I took the liberty to split your hack from Hayate's thread, so you're free to update title and description in the first post (and please do, I gave it a temporary name just to separate it). Keep up the awesome work! :)
  6. Hayate


    Tech Member
    Well, I've just used a program called VBinDiff to compare the binaries, and now I'm sure that I haven't forgotten any aligns, so nothing unchanged has moved.


    Ahahahaha, I'm an idiot.

    Obviously, I missed this:

    Code (ASM):
    2. loc_EFF0:
    3.     ...
    4.     move.w  $A(a1,d0.w),d0
    5.     ...
    6. loc_EFB6:
    7.     ...
    8.     move.w  8(a1,d0.w),d0
    9.     ...
    Fixing this bug right now.

    Yep, fixed.


    Alright, thanks. Once I fix whatever went wrong with the Ride B collision, I'll put this in.

    you know we should really do this on an SVN :P
  7. Tiddles


    Diamond Dust Tech Member
    Leicester, England
    Get in an accident and wake up in 1973
    OK, minor update here. This doesn't add much new stuff, but it does come with a bunch of IPS patches to swap music around if you're so inclined.


    Notes for this version: <div class='codetop'>CODE</div><div class='codemain' style='height:200px;white-space:pre;overflow:auto'>"Sonic 3 Complete" 091230

    Changes since 091224

    Fixes for previous issues specific to this modification:

    - Stage music should now return to the correct speed after transforming, or
    collecting or losing speed shoes, during 1up music.
    - Fixes to handling of music speed for Tails only.
    - Clarified change list:
    + Big Arm makes two sweeps instead of four like in Sonic 3, but still can't
    hit when super.
    + Transformation can be invoked by holding C and pressing B, rather than
    having to mash both.

    New bugfixes:

    - Collecting extra lives will not increase the counter past 99.
    - Fixed possible Marble Garden 2 boss corruption after killing a Spiker with
    hyper dash.

    New features:

    Included various music-related IPS patches. These only apply to this ROM:

    sk_main_themes.ips - Uses the title, invincibility, extra life and
    unused game complete music from S&K rather
    than S3.
    sk_credits.ips - Uses the final S&K version of the credits
    ssz_ending.ips - Restores the Sky Sanctuary theme to the ending
    in place of the Sonic 3 credits track.
    sk_knux_miniboss.ips - Uses the S&K themes for Knuckles and minibosses.
    knux_hpz_special_theme.ips - Uses the S3 Knuckles theme and S&K miniboss theme.
    The S3 miniboss theme is used only when fighting
    act_complete_fade.ips - Brings back S&K style music fade before the act
    complete screen.
    after_zone_music.ips - Brings back post-zone-complete music.
    If you want to apply this patch only to certain
    zones using something like IPSelect, the hunks
    are in the following order:
    CNZ (Knuckles)
    MGZ (Sonic/Tails)
    MGZ (Knuckles)
    CNZ (Sonic/Tails)
    LRZ (Sonic/Tails)

    *LBZ Sonic/Tails follows ICZ in the original.
    The added Big Arm stuff means this shouldn't be
    restored so it has no patch hunk. Knuckles
    never had the act music resume in LBZ anyway.</div>

    Thanks nineko. I've updated the topic title and such - I'm just using the faintly presumptuous "Sonic 3 Complete" I stuck in the ROM header for now. I never gave much thought to a name, since I only initially intended this as a drop-in replacement for my own S3K ROM. But it might benefit from a little more disambiguation in the public domain, so I'm open to suggestions in that respect.
  8. Effexor


    JUSTICE Member
    You think there's any chance in changing it so that Super/Hyper Sonic makes the normal transformation sound at the beginning of Doomsday Zone, rather than that whistle sound?
  9. Impish


    This gave me a crazy idea, stitching Sonic 2 and Sonic 3k together. So if you don't get the chaos emeralds in the sonic 2 part, you start off surfboarding.

    For flying battery zone, why not split up the zone, putting one act in one place, and the other act in the other place. I'd say Act 2 before ice cap zone, because then you can implement the sonic snowboarding door thingy.
  10. Josh


    Excellent work, man! I've always been so impressed with the Sonic community's dedication, and I'm sure this will be my primary method of playing my favorite game ever from here on. Thank you!

    As for suggestions, the only thing I could think of that's always irked me about all the 2D Sonic games is the way Sonic Team never bothered to make Super versions of a few of Sonic's sprites (skidding, floating, etc). It's just a bit jarring, especially in Sonic 3 where Super has green eyes.
  11. Hayate


    Tech Member
    Try the patch code 081674:709F. This is what Tiddles tried (according to his source) but apparently it "interferes with the music" somehow.
  12. Tiddles


    Diamond Dust Tech Member
    Leicester, England
    Get in an accident and wake up in 1973
    It's to do with it cutting into music channels in a way the whistle doesn't. It's no worse than getting a ring in that respect, admittedly, but I thought it was a bit too jarring just as the song was starting up.

    That patch code should do it nicely if you want to try it though. The Game Genie version of it is X6MA-VA5Y and it should work on original S3K too. (Edit: and here's an IPS patch to do it if you want one.)

    Also, as promised, here are some Knuckles and miniboss themes with the wrong DAC samples in VGM format. (Updated with smaller VGM 1.50 files as of 1 Jan ~13:20GMT)

    Thanks to everyone for your feedback so far. I'm glad that this is proving of interest. I have no idea when I'll get time to do any more with it myself, but I really wanted to get this patchable version done and out while I'm still on holiday so you can enjoy either musical setup with the other changes. :)
  13. Dark Sonic

    Dark Sonic

    Working on my art!
    This hack is awesome! Also nicely done with the background change for the level select. Always thought the Sonic and Tails text looked cheesy.

    Idea, perhaps you could make a patch that allows for the music in the Knuckles boss fight to work like the beta did, where that theme continues to play after the fight throughout the rest of the level. I always thought that was a cool effect.

    Speaking of effects maybe you could bring back the original Hyper Sonic star effect... only for Knuckles. After images for Knuckles never really made sense as shouldn't after images represent super speed, which is a trait that doesn't really work for Knuckles.
  14. nineko


    I am the Holy Cat Tech Member
    I'm going off-topic for a moment, so I can tell you to download optvgm.exe.
    I see you took your time to trim, loop, and tag your vgms, which is very good. However, as you noticed, those files are still quite big because of the DAC channel, so once you're done with that, you should take your vgz files and throw them on optvgm.exe. This will convert them from vgm format 1.10 to 1.50, allowing them to have the DAC redundancies optimised.
  15. Runner


    Long time no see, old friend. Member
    Awesome hack man! :)

    I have a few bug-fixes to suggest:
    Fix the Knuckles sprite bug that moves forward when you look up.
    For some strange reason only in this part of the game the splash is unaligned with the water level:
    If it is possible, fix the lack of underwater color (at least only for the Sonic/Tails/Knuckles sprites) in the begin of the stage.

    How about the opposite? If you start the game with all Super/Hyper emeralds (from a cleared game or from the emeralds cheat) You will start the intro with the surfboard because it makes no sense Knuckles stealing you and still transforming in Super
  16. Spanner


    The Tool Member
    Dunno if somebody's mentioned this, but in LBZ Act 2 a few monitors were different in Sonic 3. I say it's worth implementing.
  17. Glisp


    That one weird guy that does stuff. Member
    Bloomington, IN
    None at the moment I'm afraid.
    are you using the Sonic 3C beta ending theme for this? If not then I highly suggest it but that's just me.
  18. That was one of the 1st things he did. Did you play it?
  19. nineko


    I am the Holy Cat Tech Member
    That's not even lazyness, that's not even reading the first post of the thread nor the fucking readme file which has that name for a reason.
  20. DM Ashura

    DM Ashura

    Atlanta, GA
    Sonic Gemini
    Fix idea... I apologize if this has been mentioned.

    Changing the Level Select to correctly reflect Hidden Palace Zone and Doomsday Zone. I suggest:






    Also, it would be great if we had a way to get back to the title screen from Blue Sphere.

    MAJOR kudos for making Super/Hyper just speed up the music instead of that annoying as hell theme over and over and over again.