don't click here

Sonic Generations Hacking (and More!)

Discussion in 'Engineering & Reverse Engineering' started by Andrew75, Jun 23, 2011.

  1. Korama

    Korama

    Tech Member
    272
    2
    0
    By hacking SonicGenerations.exe - most likely yes. But that's not going to be easy.
    By modifying the parameter files - I don't know, I haven't really looked at those yet.
     
  2. CrashSG32

    CrashSG32

    20
    0
    0
    Australia
    Project Crash & Generations Hacking
    Has anyone put a character from another game into generations yet?

    I would try putting a character from unleashed as Sonic, but I don't have the Xbox 360 version, so I have no way of getting the character files :/

    Yes, I was inspired by Pickle Unleashed (the hack of unleashed with prof. Pickle in place of Sonic).
     
  3. Dario FF

    Dario FF

    Tech Support Hotline Tech Member
    You mean as in custom model imports? Well the joke video I made once was to show off exactly that. I got a bone skeleton loader/writer in place as well but I'm not sure how to use the bone data yet. It's a Matrix4 that I've been having too much trouble in converting to regular coordinates. Last time I tried importing my own skeleton I had some fairly horrible results.

    So to sum it up, I can import models, I just can't edit skeletons too much yet.
     
  4. CrashSG32

    CrashSG32

    20
    0
    0
    Australia
    Project Crash & Generations Hacking
    ^Yep, model imports is what I meant. That's cool, I didn't know if it's been done with a character that's not from Generations yet.
     
  5. Aerosol

    Aerosol

    Not here. Moderator
    11,163
    573
    93
    Not where I want to be.
    Sonic (?): Coming summer of 2055...?
    I don't think my question got answered. Is it known if it is possible to turn xbox 360 saves into PC saves for Generations?
     
  6. CrashSG32

    CrashSG32

    20
    0
    0
    Australia
    Project Crash & Generations Hacking
    ^I wouldn't think so, the fact the PC port is a Steam release, I don't think it would be possible to take an Xbox save and make it compatible with steam.
     
  7. Aerosol

    Aerosol

    Not here. Moderator
    11,163
    573
    93
    Not where I want to be.
    Sonic (?): Coming summer of 2055...?
    But this works for Skyrim, which is a Steam game isn't it?
     
  8. CrashSG32

    CrashSG32

    20
    0
    0
    Australia
    Project Crash & Generations Hacking
    ^Maybe I was wrong... Have you tried that method yet?
     
  9. Aerosol

    Aerosol

    Not here. Moderator
    11,163
    573
    93
    Not where I want to be.
    Sonic (?): Coming summer of 2055...?
    I don't have a 360 formatted usb drive, nor do I have a decent enough internet connection to download my purchase of Generations on Steam. That's why I'm asking if it can be done.
     
  10. Yarharhar

    Yarharhar

    Oldbie
    58
    0
    6
    I have sonic generations on both PC and Xbox, and have done the skyrim-xbox-to-pc save (and understand the logic behind it), so I'll try this soon and let you know
     
  11. Dario FF

    Dario FF

    Tech Support Hotline Tech Member
    So let's spice up this topic a bit since I've been pretty silent the last days. I've been working on cracking 2 quite hard formats and fixing up a lot of stuff in geometry imports.

    Unleashed Update
    • Original normals(smoothing groups) from the XBox 360 files can be loaded and converted now.
    • Same deal with vertex blending, although there's a few issues with blending materials that I'm still working on debugging.

    Notice on the following screenshot how you can see the corrected normals, and how vertex blending makes the textures from the ground of the buildings blend with the terrain.
    [​IMG]

    As regarding to animations and physics, there might be the possibility we just convert the original HKX to the PC version thanks to the work of someone cracking the format and swapping the endianess in the right spots. Don't want to do any promises but there's at least hope on that department instead of recreating every single animation and collision in our own.


    Editor Update
    So I bet a lot of you were wondering what the sweet mountain video was. While I don't have plans on importing and converting Colors stages for numerous reasons I stated before, the idea originated from Zoney, wondering if the editor was capable enough of doing large scale geometry imports yet.

    Now if you remember the last video, it was choppy as hell. It also took an insane amount of memory when loaded, so some geometry just didn't load. You might've also noticed some objects just disappeared in front of your face. So here's the updates I've been working on to fix these issues.

    Lightfields
    Sega should give you a nice explanation of what lightfields are. Here's the pics they presented once for the Hedgehog engine over at GDC.
    [​IMG]
    In short, it's a list of cubes with color information that interpolate the lighting of the objects. That allows objects and Sonic to have reflected light from the terrain. I've been working on cracking a lot of the file structure of this but I haven't been able to sort and use the cubes correctly yet. But at least I can generate some temporary lightfields to override the one it was used and cover the world AABB.

    Visibility Tree
    Similar boat to lightfields, this handles the visibility of which objects can be seen from certain blocks in the world. While it's not needed to generate the info correctly as I'm not sure yet how to use it, the world AABB NEEDED to be fixed so the visibility doesn't go bonkers outside of it, hence why my geometry imports seemed to have weird visibility issues. Cracking this format has been way harder and it's still in progress, but it shouldn't be vital for doing our own imports for now unless you needed some heavy optimization. As with lightfields, I can generate my own dummy files just for the sake of testing.

    Terrain Groups
    Shit goes wrong sometimes. I was incorrectly sorting the geometry in terrain groups, so my previous block theory wasn't working at all! Now I fixed it and it works very well. Here's an old pic of how the system works out.
    [​IMG]
    The grid size will be able to be tweaked to your liking in editor. Less the grid size, the more chunks it will load, the more checks it will have to do. The bigger the grid size, the more geometry it loads in memory at a single time, but the less checks it has to do. For now the standard size is 60.

    So yeah, after fixing this nasty bug the terrain group count for sweet mountain went down from 600 to 100, and it worked at 60 FPS since it wasn't loading unnecessary geometry now. Plus, crap doesn't disappear randomly in your eyes and there isn't even a good tri stripping algorithm yet! So there's plenty of room for even more optimization.

    Some geometry is dark because the rip in Max just didn't have normals for specific objects... They were literally 0,0,0. It's not an editor bug, just a ripping problem. The geometry is straight from max using the Easy Ogre Exporter, plus it exports out the VRay light as well and uses it ingame as the directional sun.


    No, I'm not planning to port Colors. It's as I said before, a large scale geometry test. Still, with these formats out of the way I'm getting closer to doing something functional you guys can play around with. Next up, a material editor hopefully. I should clarify that sweet mountain stage doesn't have any GIA generated yet so that's why there's no terrain shadows! My next point of research as well is finding out how to generate GIA properly so the shadows blend with Sonic's and objects.
     
  12. Aerosol

    Aerosol

    Not here. Moderator
    11,163
    573
    93
    Not where I want to be.
    Sonic (?): Coming summer of 2055...?
    I'd appreciate that quite a bit!
     
  13. Catley

    Catley

    Member
    50
    1
    0
    Great work here, Dario! I'm impressed with what you and Zoney have been doing with this game.
    Keep up the good work.
     
  14. Yarharhar

    Yarharhar

    Oldbie
    58
    0
    6
    No luck on my initial attempts at save porting.

    The xbox version of the file is 48k, the pc version is 42. Byte-wise, they start with the same header. PC generations tells me "no save data" when trying to use the xbox file, even if I trim it down to the proper size. It's possible there is a "this is an xbox save" flag I would need to unflip, or that certain data is endian swapped in the file.
     
  15. Dario FF

    Dario FF

    Tech Support Hotline Tech Member
    For the sake of testing and seeing what features I should strive for and what not I have uploaded a very, VERY work in progress version of the 0.5 branch for SonicGLvl. 0.5 is the unstable branch up until 0.6 is released, which will be the last stable version for a while as well.

    Download's over here as always.

    [​IMG]

    I've written a couple of basic tutorials in the help folder plus leaving a few pointers here and there, but I don't expect anyone that isn't really technically inclined as to how the game works to even attempt to do their own stage yet. If anyone wants to give it a try, it's there though. You should be able to achieve something comparable to the Sweet Mountain rip I did with it easily. There's quite a lot of features that aren't even implemented so don't bother on doing obvious bug reports yet.

    The official topic will likely get updated when 0.6 is launched. For now I'll just update you guys on my progress on this thread and try to release snapshots every once in a while.

    For the ones who just want to explore Generations levels with it feel free to do so. The overlapping geometry is not a bug but just how the generations terrain is mostly built since they tend to load/unload a lot of far away terrain as you progress through the level. If you get any stupid unpacking bugs try placing it in a folder without spaces on the path... I know it's a stupid issue, and I've been trying to fix it as best as possible. It's just that bugs like it are expected when dealing with several command line tools I guess.
     
  16. Aerosol

    Aerosol

    Not here. Moderator
    11,163
    573
    93
    Not where I want to be.
    Sonic (?): Coming summer of 2055...?
    Appreciate the attempt! I'd be willing to try to hack this myself, because it seems intriguing. Are you planning to tinker with it any more?
     
  17. CrashSG32

    CrashSG32

    20
    0
    0
    Australia
    Project Crash & Generations Hacking
    Ooh, looking good ;)
    I'm gonna have to give it a shot when I get a chance :)
     
  18. Dario FF

    Dario FF

    Tech Support Hotline Tech Member
    Doing some hotfixes.

    v5.1.0

    Fixes:
    - Reduced RAM usage about 40% in heavy stages due to not reloading cloned terrain-model files(woes Sonic Team for efficient storage).
    - Added an exception for visibility trees with unusual offsets(which meant non-existant table) to be read correctly. Otherwise stages like Metal Sonic boss fight just crash.
    - Keylogger removed since now I have your bank account data
    - Shader database updated.

    Either download the new pack from the Downloads folder, or get the new exe directly from the trunk since that's all that changed.
     
  19. Azu

    Azu

    I must be stupid. Member
    Awesome. Question though, I how I import objects from one stage to another? Kind of forgot.
     
  20. Dario FF

    Dario FF

    Tech Support Hotline Tech Member
    You'd need to add the relevant entries from one StageObject.sto.xml to the other, plus add the resources it uses to the relevant AR files. Say, if you wanted to port the Rooftop Run swinging blade, you'd need to copy over the hkx and model, textures, materials, etc from #euc_cmn.ar and euc_cmn.ar to an AR file the stage reads.

    You should use MM's editor in any case for ARL generation as well, since that's how the game lists the contents of the files.