ASM Sonic the Fighters - Disassembly (and discoveries from it)

Discussion in 'Engineering & Reverse Engineering' started by biggestsonicfan, Jun 1, 2020.

  1. biggestsonicfan

    biggestsonicfan

    Model2wannaB Tech Member
    1,263
    188
    43
    Formerly Sonic the Fighters
    Being able to write your own code and inject it basically wherever gives you some quite humorous results:

     
  2. biggestsonicfan

    biggestsonicfan

    Model2wannaB Tech Member
    1,263
    188
    43
    Formerly Sonic the Fighters
    Alright folks. This is what I consider to be the first real mod of Sonic the Fighters. Actual new code inserted, code modified in places. This isn't just some memory manipulation or a few bytes changed. This is a rework of 1p story mode in Sonic the Fighters.

    I present to you:
    Sonic the Fighters - Randomizer Edition
    What it does:
    • In single player mode, before each round:
      • The character you play as will be random.
      • The character you play against will be random.
        • This includes Eggman out of mech, Eggman in mech, Eggman's minion, Metal Sonic, and Honey.
      • The stage you play on will be random.
        • The last two stages, however, will still be on the Death Egg II.
    Enhancements:
    • The character select screen music has been replaced with its unused, alternate music.
    • The music in the final battle has been restored to "DEATH EGG'S HANGAR ~ Hurry Up" instead of "SONIC vs KNUCKLES ~ North Wind".
    • Honey the Cat's before round portrait and her P1 colored squished body has been restored.
    Things that could be fixable but aren't in this version:
    • The mod has been designed with story mode, not multiplayer, in mind. Multiplayer randomization of player characters is not implemented.
    • The mod is intended for the Player 1 to play Story Mode. Playing as Player 2 will result in random CPU opponents and stages, but not the player's character.
    • The final fight in Death Egg II's hangar is also random, and is not Meched Eggman. In my opinion it should always be Meched Eggman.
    • If you lose a fight and continue, the round is re-randomized, meaning you do not necessarily fight as the same character, against the same character, and on the same stage as you just did.
    • The replays shown during the credits sequence show each stage replayed in the original story order and not necessarily the stage you played on against that character. This is probably the hardest to accomplish fix on this list.
    Enjoy!

    EDIT: Something that isn't working in the script that works in my assembled version is the cutscene with the Lunar Fox is missing from the script version and I can't figure out why...
     

    Attached Files:

    Last edited: Oct 22, 2020
  3. JaxTH

    JaxTH

    Pudding Deity Oldbie
    9,153
    133
    43
    Los Angeles
    Jack shit.
    Hacking Contest 2021 entry? :V
     
  4. biggestsonicfan

    biggestsonicfan

    Model2wannaB Tech Member
    1,263
    188
    43
    Formerly Sonic the Fighters
    I honestly don't know if it would count. I haven't modified enough for it to qualify, have I?
     
  5. nineko

    nineko

    I am the Holy Cat Tech Member
    I'm no judge, but...
    I'd say more than yes. Also because it sounds like you have more stuff cooking, who knows what else you can pull off in one year.
     
  6. Overlord

    Overlord

    Now playable in Smash Bros Ultimate Moderator
    18,212
    349
    63
    Berkshire, England
    Learning Cymraeg
    Oh yeah, you've certainly got time to make something worthy of an entry.
     
  7. MarkeyJester

    MarkeyJester

    Vague Memories Resident Jester
    2,060
    158
    43
    Japan
    This is absolutely delightful!

    I love assembly at the best of times, so seeing a series of "mov" and "ld" instructions everywhere is quite the blessing dX

    Perhaps a bit of a too far fetched idea here for early stages, but it seems there are enough assets in each stage to create a full 3D level out of which could be platform related! I would be surprised if in a few years we'll find mods breaking away from the fighting to create actual platforming levels!

    Don't get me wrong, fighting mods are great too, perhaps I'm thinking way outside the box here, all in all, it's very exciting, I remember playing Fighters on Gems collection, so I have some minor nostalgia for it~
     
  8. TheInvisibleSun

    TheInvisibleSun

    OVER THE TOP TECHNO-BLAST Member
    I think the fact that it's a Sonic the Fighters hack might be reason enough, honestly.
    Or both, perhaps; 3D Sonic beat-em-up anyone?
     
  9. biggestsonicfan

    biggestsonicfan

    Model2wannaB Tech Member
    1,263
    188
    43
    Formerly Sonic the Fighters
    Thank you for your kind words of praise! However, that kind of modification, hmmm... the camera is, uh, how to put it... picky? While I've documented a few camera routines, approximately 0% of how the camera's engine is understood right now. That could change in the future.

    If anything, when you speak of editing 3D stages to become platform stages, I would use that energy not to create a Sonic platform stage, but to use the unused Pengo assets inside the game and recreate the Pengo engine! A 32-bit arcade Pengo title!
     
  10. Tiberious

    Tiberious

    Yeah, I'm furry. Got a problem? Oldbie
    709
    4
    18
    Would you maybe be able to change the behavior of the character select screen when there's more than 8 entries in the list?

    I remember making a quick and dirty hack to the character select screen's table to add a bunch of unused characters to it, but the results were pretty ugly. There were a bunch of extra Sonic icons that screen-wrapped to the next row up the screen. Should be possible to write something in the drawing routine to not display any graphics for the characters after the 8th position, allowing you to 'hide' extra characters past the edges, right?
     
  11. biggestsonicfan

    biggestsonicfan

    Model2wannaB Tech Member
    1,263
    188
    43
    Formerly Sonic the Fighters
    Most likely no. Each character select portrait has a predefined length and height. The background image also is drawn to have the portraits in the exact positions they are supposed to be placed. What might be possible is changing the graphic for the unused characters from Sonic to a "null" graphic value, but I am unaware of any "null" graphics that exist in the game.

    Also your hack was for the Sonic Championship romset, not Sonic the Fighters. Not that that makes any real difference for what we're discussing here.
     
  12. Tiberious

    Tiberious

    Yeah, I'm furry. Got a problem? Oldbie
    709
    4
    18
    Oh. Well, in fairness, I know it wasn't elegant. Wasn't even really meant for distribution. It was really just for me to be able to play around with all the unused fighters easily.
     
  13. qwertysonic

    qwertysonic

    Member
    517
    99
    28
    creating the biggest sonic collection
    This is really impressive, good work!
     
  14. biggestsonicfan

    biggestsonicfan

    Model2wannaB Tech Member
    1,263
    188
    43
    Formerly Sonic the Fighters
    Futzing about with Sonic the Fighters again, I wanted to see what some of the animations were, and more importantly, if they were unused.

    In a list of "motions", two of these animation names caught my eye: "oiroke_y" and "oiroke_n". In the nomenclature for these animations, the "y" indicates that the animation is dealing the damage, and the "n" indicates an animation that is receiving damage.

    The result of these two animations can be seen by Honey here in this tweet.

    In the first animation, "oiroke_y", we can see Honey puffing out her chest and putting one leg back striking a "sexy" pose and shaking her polygons if you know what I mean. Her hand then goes out to her lips and it looks like she blows a kiss.

    In the second animation, "oiroke_n", we can see Honey lean in close for a smooch, get dizzy and collapse to the ground in a spiral.

    After I made this discovery, I decided to look into whether or not Honey actually is blowing a kiss, and lo and behold, when looking at the array of data which stores the projectile types the game has, a flying heart is one of them!

    Video here.

    You can see the heart flies out similar to a bullet, but instead of a straight path, it seems to fall and bounce off the ground. The fact that the heart bounces up and down on Knuckles in the video is probably because some collision data is not set correctly due to the proper code to execute the flying heart isn't being used. I am merely substituting Fang's projectile routine with the routine the heart uses.

    I am obviously going to have to investigate this further, but I do believe the motions and projectile discovered here are linked together.
     
    • Informative Informative x 5
    • List
  15. biggestsonicfan

    biggestsonicfan

    Model2wannaB Tech Member
    1,263
    188
    43
    Formerly Sonic the Fighters
    Something I just discovered.... The song "MISSION COMPLETE - Egg Fanfare", the music played when you beat the Eggman Boss in the 15 seconds allotted after Metal Sonic... that song is not selectable in the sound test! The sound test list only goes up to "sd_game_bgm_17" with a sound code of 0xAE1017. The Egg Fanfare has the code of 0xAE1018 and would have been sd_game_bgm_18!
     
    • Informative Informative x 3
    • List
  16. biggestsonicfan

    biggestsonicfan

    Model2wannaB Tech Member
    1,263
    188
    43
    Formerly Sonic the Fighters
    • Like Like x 2
    • Informative Informative x 1
    • List
  17. Rudie Radio Waves

    Rudie Radio Waves

    happy! :D Member
    293
    40
    28
    Italy
    Many a game.
    Who the hell would use flying hands as a move? Great find nonetheless!
     
  18. biggestsonicfan

    biggestsonicfan

    Model2wannaB Tech Member
    1,263
    188
    43
    Formerly Sonic the Fighters
    While I've documented it in the disassembly, I didn't think much of it until someone pointed out the obvious: Mirror matches do not use grayscale character cards

    However, grayscale pallets do exist in the game's data:

    sfight039.png

    I have yet to understand the corruption going on in the foot area, but someone else modified values in the Gamecube version of StF to this result:

    unused-gc.png
     
    • Informative Informative x 3
    • List
  19. biggestsonicfan

    biggestsonicfan

    Model2wannaB Tech Member
    1,263
    188
    43
    Formerly Sonic the Fighters
    Because the PS3 version of Sonic the Fighters is simply emulation with no mapped interrupts to special buttons, I decided to hack my way into the test menu, and lo and behold, it works:

    screenshot-2021_04_24_13_18_30.png

    The Memory Test fails. Not sure why IC7 and IC8 fail, or the RAM. IC15 and IC16 fail because those two ROM's were modified to enable me to shortcut to the test menu without a test button.
    screenshot-2021_04_24_13_22_24.png

    The really cool thing about all this though is the Sound Test. Apparently to save space, Sega used the source samples and nulled out all unreferenced sounds. So sounds like the "kiss" noise, it does not play in this PS3 version. Meaning we can now create a concise list of what sounds went unused in the game!
    screenshot-2021_04_24_13_32_47.png

    I know this really doesn't have anything to do with the disassembly, but I modified the disassembly to inject into the PS3's data. I could have also done it manually with a hex editor but the modified disassembly to reassembly is just faster and easier for me.
     
    • Informative Informative x 5
    • Like Like x 1
    • List
  20. biggestsonicfan

    biggestsonicfan

    Model2wannaB Tech Member
    1,263
    188
    43
    Formerly Sonic the Fighters
    It looks like the credits in the game, which are just texture files, are purposefully manipulated into what is shown when you beat the game. So the textures as images files and what you see during the staff role are two different things.

    Credits as they appear in images (No way to dump them yet but I've written it out):

    Code (Text):
    1. ROM:000106E4 staff_credit_textures:.short 391        # DATA XREF: ROM:00010350↑r
    2. ROM:000106E4                                         # Sonic the Fighters Staff
    3. ROM:000106E6                 .short 392              # Director
    4. ROM:000106E6                                         # Hiroshi Kataoka
    5. ROM:000106E8                 .short 397              # Game Coordinator
    6. ROM:000106E8                                         # Daichi Katagiri
    7. ROM:000106EA                 .short 398              # Programmers
    8. ROM:000106EA                                         # Daichi Katagiri
    9. ROM:000106EA                                         # Susumu Morii
    10. ROM:000106EA                                         # Eiji Ikuta
    11. ROM:000106EA                                         # Hiroshi Masui
    12. ROM:000106EC                 .short 399              # D.S.P. Programmer
    13. ROM:000106EC                                         # Katsunori Itai
    14. ROM:000106EE                 .short 400              # Character Designer
    15. ROM:000106EE                                         # Masahiro Sugiyama
    16. ROM:000106F0                 .short 401              # Stage Designers
    17. ROM:000106F0                                         # Yasuko Suzuki
    18. ROM:000106F0                                         # Wataru Kawashima
    19. ROM:000106F2                 .short 402              # 2D Graphic & Model Design
    20. ROM:000106F2                                         # Takako Kawaguchi
    21. ROM:000106F4                 .short 403              # Graphic & Model Design
    22. ROM:000106F4                                         # Kazunori Oh
    23. ROM:000106F6                 .short 404              # Motion Designers
    24. ROM:000106F6                                         # Daichi Katagiri
    25. ROM:000106F6                                         # Hiroki Iwasaki
    26. ROM:000106F8                 .short 393              # Sound Designers
    27. ROM:000106F8                                         # Maki Morrow
    28. ROM:000106F8                                         # Takenobu Mitsuyoshi
    29. ROM:000106FA                 .short 394              # Special Thanks
    30. ROM:000106FA                                         # original SONIC TEAM
    31. ROM:000106FC                 .short 395              # Producer
    32. ROM:000106FC                                         # Yu Suzuki
    33. ROM:000106FE                 .short 396              # PRESENTED by
    34. ROM:000106FE                                         # SEGA