Sonic R Hacking

Discussion in 'Engineering & Reverse Engineering' started by MainMemory, Dec 1, 2009.

  1. McAleeCh

    McAleeCh

    Oldbie
    1,211
    219
    43
    Indeed - this right here is my main problem with Sonic R; the whole exploration element added for collecting emeralds and unlocking secret characters helped a bit, but it could only alleviate the problem so much. If it'd had, say, a similar number of tracks to Mario Kart 64 then it'd have a lot more longevity - although they probably would have struggled to keep up the "all level names must begin with R" thing they had going on for that many tracks!
     
  2. AkumaYin

    AkumaYin

    Member
    286
    6
    18
    Wow, I never noticed that!

    1. Resort Isle
    2. Radical City
    3. Regal Ruin
    4. Reactive Factory
    5. Radiant Emerald
    Thanks for pointing that out, man!
     
  3. InvisibleUp

    InvisibleUp

    friendly internet ghost Member
    137
    12
    18
    You know how I said that importing custom characters was nigh-on impossible? That appears to be false. Importing models is easy so long as they're at or below the filesize of the model you're trying to replace. Just as a test, I replaced Sonic's body with a cube.

    [​IMG]

    [​IMG]

    I guess so long as your characters are low-poly enough and match the animation files you can have whatever characters you want. I'm gonna have some fun with this I think.
     
  4. E-122-Psi

    E-122-Psi

    Member
    2,210
    423
    63
    That's a cool breakthrough. Out of curiosity, is it possible to replace Sonic's upper half with Amy's model used in the car. On foot Amy would be a fun addition. :D

    Not to mention get TJ Davis to do more level orientated music tracks for each stage.

    Adding Reverse races into any mode other than Time Attack may have helped as well (especially since the AI seems to built to work around it). Would that be possible via hacking?

    Adding two or three more tracks would have been nice in the sense they could have at least added a couple of cups for Grand Prix mode.
     
  5. MainMemory

    MainMemory

    Kate the Wolf Tech Member
    4,603
    198
    43
    SonLVL
    Or you could just read the first post for a fix.
     
  6. Chibisteven

    Chibisteven

    Member
    1,345
    29
    28
    US
    Now if someone can found a fix for the last track repeating itself after you finish the course. Not sure what kind of audio glitch it is. But my computer's optical drive gets stuck repeating the last frame of the final track (21) after you finish a course. Have to restart the game to clear. Even the last frame plays with other CD tracks playing during normal game play. Another glitch cause the game to freeze for a full second before it finds the correct track during the start of a course. Oddly this frame stops under the options menu but resumes in the main menu.
     
  7. Chibisteven

    Chibisteven

    Member
    1,345
    29
    28
    US
    Sorry about double posting. This is to document the glitches I'm experiencing. At least it runs, now.

    http://www.filedropper.com/glitches

    Graphic glitches, include overlays of maps, text, images.

    CD audio glitch included. Skip to position 4:14 to hear it.

    This game hates modern systems. Maybe mine more?


    Not a scratch or any damage and exact audio copy reports no errors when ripped and the audio is normal (doesn't repeat the last frame at all).

    DVD Multi-Burner (OEM, Accurate Stream, no audio caching, C2-error support)
    AMD ATI RADEON HD3000 ONBOARD GRAPHICS
    ASUS Phoebus (upgrade, drivers are properly installed and are the most recent), no glitches opening or closing normal streams. (Onboard disabled, drivers gone. VIA Vinyl Codec)
    AMD Athlon II X2 220 (2.81 GHz) OEM
    4 GB DDR3 RAM (2x 2 GB sticks, OEM)
    Windows 7 Ultimate - Service Pack 1 64-bit (OEM Windows 7 Home Premium barebones 64-bit)
    ASUS CM1630 Motherboard
    1 TB SATA II Hard Drive (Replacement, WD GREEN) (OEM was Seagate SATA II with 7,200 RPM and 1 TB)

    EDIT: A possible theory is I think it's incompatible with the WASPI driver in 64-bit Windows based on how it may be running. Maybe something in the code, proves it.

    TO DO: Get a SEGA SATURN already and forget about the PC version.
     
  8. InvisibleUp

    InvisibleUp

    friendly internet ghost Member
    137
    12
    18
    The graphical glitches seem to occur on any reasonably modern computer. If you look at my screenshots you'll notice the time and minimap are oddly glitchy as well. Strangely enough this seems to differ from system to system; my desktop has entirely different glitches from my laptop, which is different from your computer, which is different from some other dude's computer. (I'd give you a screenshot of such but my desktop is on the fritz right now. It's a lot like yours except the glitches are more toward the top-right and a bit more severe.) I'm guessing it's because you're trying to run a game designed for DirectX 6 on a graphics card designed for DirectX 10 or 11, and the system isn't quite sure what to do with it. If this is something you can't live with I'd recommend setting the game to DirectDraw mode. It's a bit harder to get a good framerate and the Z-indexing is a bit broken but it works well enough.

    Can't say much about the CD issues; my copy of the disk simply doesn't have audio tracks on it to begin with. It is incredibly bizarre, though. Might be either an issue with your CD drive's audio buffer, or just the fact that the APIs the game is using to play the CD music was designed to run on Windows 95 and newer computers don't like that. I honestly couldn't tell you because I know absolutely nothing about how CD drives work.
     
  9. Chibisteven

    Chibisteven

    Member
    1,345
    29
    28
    US
    The CD audio glitch is likely is caused by the drive or how Windows 7 manages the audio.

    Confirmed this with the old 2000 WON version of Half-Life: Opposing Force, Started a new game, where the second track begins (where Sheppard wakes up with a scientist doing CPR on another solder (quick saved) before you normally trigger the third track, loaded an old save just before end credits music play (last track), quick loaded the new quick save after credit theme finishes. Result the same glitch shows up. Don't ask how I got it to run. It's a lot of work arounds. You never see it during a normal play through.

    Odd glitch in the end credits with blue swirling around something.

    While my Sound card allows EAX calls to be forwarded from the application, it only works for a minute before the audio starts encountering a delay between the front and back and left and right.

    Direct3D does not work without force quiting the application of any Half-Life game. Software works but is unacceptably butt ugly and pixelated. OpenGL works pretty good. Might explain stuff with the Steam versions being OpenGL only and no 3D audio.

    ---------------------------------------------------------------------------------------

    Back to Sonic R, this game has to be forced quit because it actually crashes and I get stuck with a black screen, when I use DirectDraw. Direct3D is the only option that works. Unloading the disc and reloading fixes the CD audio bug but this is totally annoying and no fun. Plus the game locks you out without a disc. So I can't create one with a long end track.
     
  10. Chibisteven

    Chibisteven

    Member
    1,345
    29
    28
    US
    One last double post: Confirmed. It's how Windows 7 handles audio streams. The bug also occurs on my mom's laptop which has Windows 7 Ultimate 32-bit installed (mine is 64-bit) and is two years older than my desktop is. The fact it affects all period games is amazing and depressing at the same time.
     
  11. InvisibleUp

    InvisibleUp

    friendly internet ghost Member
    137
    12
    18

    Screenshots:
    [​IMG]
    [​IMG]
    [​IMG]
    Mod Download Link: http://www.mediafire...la/amypatch.zip (Let me know if this doesn't work.)

    It is! ...or at least it would be if I didn't look at half an Amy and half a Sonic, say "That's weird", and proceed to throw on a dress and some shoes to make it look better.

    This was actually pretty easy to do. The hardest part was fixing up my importer after realizing it was completely botched up. (I've moved it to Github, by the way: https://github.com/I...nic-R-Utilities ) It works very well with the OBJs spit out by Blender, assuming of course they're not insanely crazy or anything. Only problem is that they're exported in a seemingly random order, so you'll have to reorder them to match the animations after you've converted them, or else you'll have a head for a hand. (Although now that I think about it, you might be able to do it from Blender.)
     
  12. E-122-Psi

    E-122-Psi

    Member
    2,210
    423
    63
    Holy crap you actually made it? This looks awesome. You even edited it to have her skirt and shoes (love that render at the end of the vid too). It seems the arms didn't translate as well though.
     
  13. MainMemory

    MainMemory

    Kate the Wolf Tech Member
    4,603
    198
    43
    SonLVL
    Seeing this almost makes me want to make a mod loader for Sonic R, except that GerbilSoft still hasn't finished refactoring the SADX mod loader that will become the base for all the others, and there isn't a DLL I can replace without hacking the EXE itself.
     
  14. InvisibleUp

    InvisibleUp

    friendly internet ghost Member
    137
    12
    18
    Yeah, I'm pretty sure the arms are on backwards. The thing about these models is that all the parts are centered around the origin, which means when you're throwing parts in to replace other parts it's hard to tell which way things are supposed to be oriented. I'm just surprised I got close, to be perfectly honest with you. And here's the render itself if you want it: http://imgur.com/jInxSTh

    Also, glad you liked it MainMemory. Making a mod loader might be a bit difficult, however, simply due to the fact that almost everything is hardcoded. In fact, those blue splotches on Amy are hardcoded face numbers for Sonic's eyes. Heck, the reason why some of the textures on the other characters are rather weird is because Sonic's model is hardcoded to point to his textures. Unless you feel like hacking the EXE to the end of the Earth and back to load these things from external files your best bet would be to somehow dynamically patch the game every time a mod is installed. Don't ask me how you'd do that, however.
     
  15. MainMemory

    MainMemory

    Kate the Wolf Tech Member
    4,603
    198
    43
    SonLVL
    Yeah that's... basically what the mod loaders do. It can replace files automagically by hooking Windows' CreateFile function, but anything else has to be patched by the mod itself.
     
  16. Tweedle

    Tweedle

    Member
    Right when I saw this thread, I knew this would be a hack. Love it. Now somehow put it in the Amy slot.
     
  17. MainMemory

    MainMemory

    Kate the Wolf Tech Member
    4,603
    198
    43
    SonLVL
    It may be possible to hack Amy to have Sonic's behavior.

    Also, is it possible to import models with a significantly increased polygon count?
     
  18. Jeffery Mewtamer

    Jeffery Mewtamer

    Blind Bookworm Member
    1,673
    11
    18
    I remember reading years ago that the Sonic R model format has a hard upper limit of 256 polygons. Wether that's true, or the game crashing if models larger than the originals are inserted simply makes higher polycounts impossible, I don't know. Either way, I would imagine getting high poly models into the game would require altering the code the game uses to load models. Honestly, I would be surprised if it actually turns out to be easier to port Sonic R's low-poly models to a new engine rather than trying to put nicer graphics within the Sonic R engine.
     
  19. Strife

    Strife

    Member
    2,007
    180
    43
    United States
    Freedom Planet 2
    I was actually wondering if, considering the amount of hack work involved, it would actually be easier to rebuild the game from scratch in Unity or Unreal or something, with the added bonus of making custom tracks and characters far easier to pull off and the elimination of all of those compatibility issues that plague modern systems.