don't click here

Sonic Mania: Hacking Discussion

Discussion in 'Engineering & Reverse Engineering' started by Chimera, Aug 29, 2017.

  1. TuxKnux

    TuxKnux

    Member
    3
    0
    0
    I found a few interesting files/features no one has discussed yet.

    When in developer mode, you can press F3 to toggle through the game's shaders. Backspace speeds the game up. F12 freezes/unfreezes the game, like how pausing worked in the Genesis games. Pressing F11 while the game is frozen advances one frame.

    There is a file, \Images\CESA.tca that appears to be a Japanese copyright notice:
    [​IMG]
    Trying to make sense of Google Translate gives: "Attention! It is strictly prohibited by law to distribute or attempt to distribute this game's software over the Internet without permission--or to knowingly download it from an illegal Internet distribution. Thank you for your understanding and cooperation."
    The interesting thing is that it's called CESA.tca. CESA (or the Computer Entertainment Supplier's Association) is a Japanese organization--whose chairman is the president of Sega Holdings--that holds Japanese game shows and game awards. I'm not sure why this is here.

    Several unused sprites from TMZ Act 2 Boss Fight (\Sprites\Eggman\EggmanTMZ.gif):
    [​IMG]
    Namely, the bottom two rows.
    All of the sprites except the one on the far left, second from the bottom, are used in the GHZ2 cutscene but reversed. Perhaps Eggman would try to sic the HBH on Sonic again here?

    There's sprites in the \Sprites\Editor\Icons.gif that seem to be left over from, well, the level editor the devs used:
    [​IMG]
    The .bin files in the folder suggest that the "Start" boxes are for marking level starting positions for the characters and that the other sprites are for elements of the editor.

    There are three unused but fully functional test special stages in \Stages\SpecialBS named SceneTest3, SceneTest7, and SceneTest8. Test7, in particular, has some unexpected behavior with its first set of blue spheres.

    EyeKey beat me to the punch on the CFG files. I just couldn't figure the structure of the palette settings out (other than they used 24-bit RGB color)! I'm still not quite sure how the size of each palette struct is defined. I'd love to hear a quick explanation.
    I have a few clarifications about the .CFGs, too.
    About that byte for .wav files that your parser labels "unknown": it controls how many times the sound can be playing at once. Most sounds are set to 1 for obvious reasons, but rings are set to 2. This is because the game plays the ring SFX in either the left or right audio channel, so when you get two rings simultaneously, both channels play at once. The difference is VERY noticeable if you set the ring byte to 1 or the jump byte to 2 with Sonic & Tails. Setting the byte to 0 appears to remove the limit altogether.

    The section in GameConfig.bin directly after the global .wav files controls development mode settings. You can modify the menu text and even what zones are loaded in the development menu options by adjusting the file accordingly. The changes made here will also affect the level order, so now you can remove Hydrocity completely :specialed:. I have no idea what the last section is for though!
     
  2. LukyHRE

    LukyHRE

    The only one who has a Portal-themed avatar Member
    395
    12
    18
    Buenos Aires, Argentina
    Bitching and complaining about my country -.-'
    Nice! I wanted this to happen since I first saw that light blue on Sonic. You forgot about the life icon, though, does it use the same pallete, or is just a gif with no pallete?

    @TuxKnux: I can't see your images! Neeeevermind.
     
  3. Tiranno

    Tiranno

    Steveosaurus Rex Member
    I just did the player palette. Menu's and such are not edited.
     
  4. Dark Sonic

    Dark Sonic

    Member
    14,631
    1,617
    93
    Working on my art!
    It's funny. Sonic and Tails' life icon do not use the player palette, but Knuckles' does. I wonder why that's the case.

    Anyway loving all the progress being made with the mods. Can't wait to see more.
     
  5. EyeKey

    EyeKey

    Member
    29
    0
    0
    Nice findings! I will update that info on the WAVs in the struct.
    And about the palettes, for each palette the first word is a bitmap. Each bit indicates wether that column exists in that palette. 1 for the first column, 2 the second column, 4 for the third and go on. And than each column is 16 pixels.
     
  6. Dark Sonic

    Dark Sonic

    Member
    14,631
    1,617
    93
    Working on my art!
    Sharing a post from another thread becauseeeeee

    SOMEONE FIGURED IT OUT
     
  7. Thats pretty sweet! The stage music is great, so to outright lose it sometimes is a missed oppertunity.

    If someone could instead speed up the stage music when you go super that would be really neat, because then you wouldn't lose the stage theme, but it would act different when Super.
     
  8. MainMemory

    MainMemory

    Kate the Wolf Tech Member
    4,796
    383
    63
    SonLVL
    That would require adding sped-up variants of the songs.
     
  9. Mastered Realm

    Mastered Realm

    Member
    3,858
    573
    93
    -
    Or someone could port the speed-changing algorithm from Sonic 1 (or 2) mobile. (There's no fast version oggs, they're rendered on-the-fly)
     
  10. Dark Sonic

    Dark Sonic

    Member
    14,631
    1,617
    93
    Working on my art!
    Nope, Stealth said they made faster versions of the songs as separate tracks and then made an algorithm that'd match up where one song ended and another one began so it'd be like the classic speed shoe effect.

    Since there's more music in this game, and it's more complex, and since there wasn't a need to imitate something from an earlier game, they just decided to go with the speed shoe music.
     
  11. Mastered Realm

    Mastered Realm

    Member
    3,858
    573
    93
    -
    So they aren't stored with the normal level music because I didn't find them in the RDSK folder of the normal songs.
     
  12. Such an algorithm is much easier said than done unless you want the music to go chipmunk (change pitch as well as tempo). There are no freely available libraries that can do a good job on music, and I don't think anyone on the team has the necessary level of specialization in digital signal processing to make their own.
     
  13. Dark Sonic

    Dark Sonic

    Member
    14,631
    1,617
    93
    Working on my art!
    I'm always surprised that an effect that was pulled off on hardware made in 1991 cannot easily be emulated in 2017.
     
  14. MainMemory

    MainMemory

    Kate the Wolf Tech Member
    4,796
    383
    63
    SonLVL
    It can be easily emulated in 2017... if you use sequenced music. Streamed music has always had difficulty with tempo changes.
     
  15. Chimera

    Chimera

    I'm not a furry. Tech Member
    1,272
    17
    18
    Castlevania prettyness
    or you can, you know...

    use adobe audition...



    (edit so i don't just look like a cunt): so like MM said Genesis music could speed up because the Genesis literally just used a sequencer and sped up the rate at which samples were told to play. This let the instruments, on the whole, sound themselves untouched, just played faster. It was a really effective way at playing music back faster or even slower because it was just a series of computer instructions. It wasn't exactly "physically accurate" because of nuances with sound i.e. the speed of playing a trumpet, for example, affecting the attack, reverberation, decay, etc etc. but it was 16 bit programmed synths so it was more than fine.

    Thing is with audio streams, this doesn't exactly work.

    Simply "speeding up a track" isn't gonna net you anything except a pitch shifted song, most of the time, because speeding up / slowing down audio tracks is tied to altering their frequency. Because songs nowadays are a single compiled audio file, you kinda can't just change the timing of a track without either some distortion or the whole thing going up or down in pitch. Without the source files--hell even *with* the source files in some cases--it's just impossible. Assuming TeeLopes used a sequencer for his Daw and didn't precompile most of his samples (which, considering he likely used real instruments for some tracks i.e. Lava Reef's guitar... yeah probably not), he'd have to render out songs at twice the BPM for it to sound like what we'd want for "speed up" music, or HALF for slowed-down if we want that. Not to mention the audio would likely have to be re-mastered by Falk. Too much money to invest in that.


    H O W E V E R


    There's a hack method with specifically *speeding up* music in playing back chunks of the audio and skipping other parts of it. I'm not too familiar with the technical details of this, but it's effectively like blending frames of a high framerate video to conform it to a lower framerate video without it looking choppy. Sometimes this looks bad, other times it's best to not use this frameblending and literally just skip every other frame (which can lead to choppy visuals), but if given enough information i.e. frames it can look quite good. To my understanding (someone more adept at audio science please correct me), this is a similar principle in sound/music, which is why programs such as Audition and Audacity can actually speed up tracks and maintain the original pitch. This requires some math magic to sound good though, ohterwise you're left with really choppy music which, unlike visuals, is usually unacceptable. To my knowledge this is also how Youtube does the 2X speedup on audio tracks, though if you ever hear any crackling, its probably because their method is both working with compressed audio and also not as good as a pre-rendered method like professional audio tools.

    This is also why you can't slow down music the same way. You're trying to make more information out of less, and well, that just doesn't work. It's why trying to slow down audio and maintaining their pitch creates a doubling effect with the audio. All it can do is sample segments of time from its surroundings and kinda clone it, which leads to really disturbing audio problems.



    TLDR You can use an audio suite to speed up the music yourself but it'll have some natural problems with it, and kinda not be "correct," but you can do it easy. Audio tracks =! sequenced tracks though so thats why TaxStealth had to make a way to swap between faster/slower tracks at the right time etc.



    EDIT 2 : (replying to below) No MM :p I mean you can use Audition to pre-speed up the songs yourself even if they'll sound kinda janky.

    .
    .
    .
     
  16. MainMemory

    MainMemory

    Kate the Wolf Tech Member
    4,796
    383
    63
    SonLVL
    You expect Sonic Mania to start up Adobe Audition every time you get speed shoes?
     
  17. Mastered Realm

    Mastered Realm

    Member
    3,858
    573
    93
    -
    People, I know making streamed songs faster makes them sound wonky. After all the soundwaves will be reconstructed using an FFT algorithm which has always the accuracy vs. smoothness trade off. But I was just giving an alternative to pre-rendering the songs and including them.

    But, the best program to change the tempo of a song, to date, is Melodyne IMO.


    There's plenty algorithms to choose from, implemented in various languages. Audacity comes with some and you can find a bunch on github.
     
  18. Frostav

    Frostav

    Member
    657
    225
    43
    Sonic After the Sequel uses the speed-up method with streamed tracks, but it DOES sound kinda wonky and speed shoe monitors seem to be REALLY rare in that game, so perhaps the composers and Lake were unhappy with the implementation.
     
  19. Captain VG

    Captain VG

    Member
    1,048
    108
    43
    Speaking of... Any chance we see something like this for Mania? :V
     
  20. MainMemory

    MainMemory

    Kate the Wolf Tech Member
    4,796
    383
    63
    SonLVL
    Um... I'm gonna say, not likely. I guess it's possible, if I can figure out how the game handles music playback, but I don't really know where to start for that.