don't click here

Sonic Generations Hacking (and More!)

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

  1. Dude

    Dude

    Tech Member
    3,138
    0
    16
    Southbridge, MA
    Random VR/AR trash
    I've been getting this problem for awhile, I have no idea why but sometimes if I add a new ring and then delete it, the program just closes.

    http://x-hax.cultnet.net/data.7z

    That is my current #ghz200.ar.00 data folder, so if you want to recreate the bug, just load that up and try adding and deleting a ring.
     
  2. Korama

    Korama

    Tech Member
    272
    2
    0
    It's done!
    Finally. Took a lot more work than I anticipated.

    Download CPKREDIR v0.2

    It works with the original (partially compressed) CPK files now and the test files that Dario gave me.
    Let me know how it goes.
    Maybe I'll make a new thread for it if it turns out to be reasonably stable, and after I've polished the code a bit more.
     
  3. Dario FF

    Dario FF

    Tech Support Hotline Tech Member
    Tried doing exactly what you said, and I can't reproduce it. Perhaps it's a terrain related problem? Some obscure memory bug? If it just closed it likely threw an exception and it was stored in the Ogre.log.

    This is incredible. I've tried it with my Windmill Isle files and I could play the level with no problems.

    There's only 1 issue with some files I tested. ghz_cmn.ar.00 for example has the following files:
    ghz_cmn.ar.00
    ghz_cmn.ar.01
    ghz_cmn.arl

    My mod uses 5 AR files for ghz_cmn though, so when I tried placing them over, it just crashed after the Havok screen, before getting to the main menu. So I guess it's possible it's just an issue with how the TOC is generated.

    This is easily fixable as I guessed, by just not using split files and saving the stuff with MM's editor to a single big AR file with an ARL that only lists 1 file. I had to do the same with the ar files in the packed folder. This isn't such a big issue really since it actually helps me organize stuff better by not having so many split AR files! But I thought I might just let you know of it, since most users are likely to run into this issue. Luckily the crash is just at the main menu, so it's just probably an issue with the TOC, just how it crashes for me when my CPK created files are wrong. Here are the ghz_cmn.ar files I tested with.

    If you manage to get it past the main menu crashing with those files it likely means it's working.

    Other than that, it's perfectly functional as long as I don't use split AR files. Did you just go for recreating the entire TOC from the files in the redirection directories? It's really impressive.
     
  4. Korama

    Korama

    Tech Member
    272
    2
    0
    Thanks for the feedback and the new test files.
    For some unknown reason, the game closes bb.cpk for good when those files are in the redirection folder. I guess it finds fault with something when it examines the header or TOC of the virtual CPK that is created. I'll try to track down the cause.

    Thanks! Yes, I create a new CPK header, using the original one as a template, and a new TOC that contains all files in the redirection folder plus the files from the CPK that do not exist in the redirection folder.
    I've got the CPK file format (and the UTF tables it uses) pretty much figured out now and wrote some classes that can read and write the data. If there's demand, I might release a CPK unpacker (and maybe packer) later. I know there's that QuickBMS script, but it's inaccurate and fails to extract certain valid types of CPK files. Before I can do that, I need to do some research on the CPK internal "CRILAYLA" compression, though, I haven't looked at that yet.

    Impressive work on SonicGLvl, by the way!
     
  5. Dario FF

    Dario FF

    Tech Support Hotline Tech Member
    Another idea I had is how hard do you think it would be to be able to add more redirection directories to your DLL? The point of it is I was thinking I could work on some sort of mod loader. It would work essentially like this:

    ModFolder1="./mod/Unleashed"
    ModFolder2="./mod/SilverSwapMod"

    In short, all it would do is search the directories in order for setting up your CPK Header at start. Say, perhaps the first mod has a Sonic resources file, but the Silver mod would replace the Sonic file. Just simply overriding any previous files, giving more priority to the later folders.

    The point of it I was just thinking of writing some sort of GUI Mod Loader with your DLL. What it would do is create a copy of the standard game executable patched(and it's quite a fairly trivial patch to do, since it's just a hex string search), and it would autodetect the folders in a mod subfolder, and let you choose the order. Then a simple Run button would execute the patched exe instead! If people wanted to play the original game they just run the standard game. With this method, all the user has to do is drop the Mod Loader to the game's folder without modifying anything, and dropping any mod folders to the "mods" folder.

    In short, all my GUI would do is modify the INI your DLL uses, and create on its own a patched exe that doesn't tamper with the original game.

    It should be fairly easy to make it happen... what do you say?
     
  6. CrashSG32

    CrashSG32

    20
    0
    0
    Australia
    Project Crash & Generations Hacking
    ^So what you are saying is that we can put different hacks in separate folders in a mods folder, than load the program, choose the mod and then it will run the game with the hack?

    That'd be absolutely awesome! It needs to happen... please? :)
     
  7. Jason

    Jason

    *Results not lab tested. Member
    Bit of a tangent.

    Can one of you be so kind as to render an image of the area where the goal ring is for GHZ Act 2, without HUD, Sonic, Dash Pads, Rings, or Goal Ring, at 1080p? I would really like that as a desktop background.
     
  8. P3DR0

    P3DR0

    b0ss Member
    435
    3
    18
    SONIC INFINITY
    Sounds great to me. Not really sure how you would do it, but if you can pull it off, I guess that would be a big step for the modding community since now we wouldn't need to have a copy of the game installed in another folder for other mods or have backups taking HDD free space.
     
  9. Sappharad

    Sappharad

    Oldbie
    1,415
    70
    28
    You wouldn't have that with the way it is now though. From what I read on the previous page, the mod path is configurable. What Dario wants is multiple mods stacked on top of one another.
    You could probably achieve this as-is without Korama adding it as an official feature, if you built a "combined" mod directory using symlinks to files. But symlinks are only supported on Vista and Windows 7 or newer.
     
  10. Jeffery Mewtamer

    Jeffery Mewtamer

    Blind Bookworm Member
    1,899
    105
    43
    Some awesome stuff is being done here, and I especially like the idea of creating a system for selectively loading multiple mods.

    I just have one question(sorry if this is the wrong place to be asking this): Is there anyway of getting Generations running on my computer short of going to hassle of setting up a dual-boot?(I have a legitimate copy of Windows 7 that came with the machine, but I am currently running only Debian).
     
  11. Aerosol

    Aerosol

    Not here. Moderator
    11,163
    573
    93
    Not where I want to be.
    Sonic (?): Coming summer of 2055...?
    You could use virtualization software, but I'm not sure how well it'd work.
     
  12. SF94

    SF94

    Tech Member
    Virtualization probably won't work well for Generations at all, considering the graphical detail. Or maybe it would, but I'm sure there would be a catch somewhere. It would probably work well (enough) for 2D games, though.
     
  13. Sappharad

    Sappharad

    Oldbie
    1,415
    70
    28
    The WINE AppDB claims that the game works fine, without sound. I personally cannot confirm or deny this, as I always get the infamous "configuration doesn't match" error when I try it in CrossOver. The configuration tool works just fine though, since .NET 3.5 is supported in the latest version of WINE. The sound problem could be caused by the lack of a prerequisite in the WINE bottle. I know Sonic Adventure DX installs fine in WINE but doesn't have sound unless you install Windows Media Player. Perhaps it's a similar situation? (But I know Generations doesn't use WMA audio like DX did)
     
  14. Korama

    Korama

    Tech Member
    272
    2
    0
    That should be possible, but I'd have to make some adjustments of course. I was already thinking myself about some alternatives to the way it is now (external files must be in subfolders in the same place where the original CPK is).

    Anyway, how the game will take it is another matter. I keep running into strange problems, unfortunately.
    I've found and fixed some bugs and your large, split ghz_cmn is working now - until I try to play Sky Sanctuary modern, then the game suddenly crashes.

    Here's the update.

    In the INI file, "PlaceTocAtEnd" should be kept at 1 until further notice. Placing the TOC at the start is bugged at the moment (and has been so previously). I'll probably fix that in the next release.
    Hopefully I can figure out that Sky Sanctuary ghz_cmn crash... if not, we'll have to avoid split .ar files, as you've already said (if those work any better).
     
  15. Lanzer

    Lanzer

    The saber calls for its master... Member
    6,845
    3
    18
    Glendale, AZ
    Living life.
    Just thought I'd stop in and share what were talking about at SSMB:
    http://www.youtube.com/watch?v=J2FnTxXhS84

    Someone has restored the original rank animations from the demo.
     
  16. Dario FF

    Dario FF

    Tech Support Hotline Tech Member
    I really doubt they were rank animations given how it doesn't even match the pose he was in. I bet it was just something to show off or maybe a cut out feature.

    Also you've had a terrific luck they didn't choose to package the HKX as 360 binary files, but HKT which are cross platform. I wonder why they did that on the demo but not on Unleashed or Generations?

    EDIT: Woops, new page.
     
  17. corneliab

    corneliab

    Member
    1,586
    144
    43
    When was it confirmed that those animations were intended for the ranking screen? They seemed too long and out of place to be for that purpose.
     
  18. Twilightzoney

    Twilightzoney

    Tech Member
    353
    0
    16
    Elgin, IL And Hampshire
    Unleashed and Generations Stuff and Custom Works
    Those were just unused animations that were going to be for response in the hubworld, with Sonic and Classic Sonic rocking out while listening to music. I thought I said this way back. Hmm haha. Plus they had the same naming style Col_Rock_anm.hkx or whatever.

    Seems like a more usable approach then a rank animation that is out of place.
     
  19. Lanzer

    Lanzer

    The saber calls for its master... Member
    6,845
    3
    18
    Glendale, AZ
    Living life.
    Probably, I just call them the rank animations because of our early Retro chats about the demo extractions. Its cool to see them reimplemented in something reguardless.

    Meh, who knows. there probably was full intent to port this to the PC and they probably started off with all PC files and made the changes when converting PC files into 360/PS3 files. thats just a wild guess though.
     
  20. Knucklez

    Knucklez

    I love 2B 'n' ass. Member
    687
    21
    18
    Those animations are so unnecessary.. they really overdo the whole situation.

    However, it's cool that they can restore the demo animations for those who prefer them.