don't click here

Sonic Generations Hacking (and More!)

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

  1. Chimera

    Chimera

    I'm not a furry. Tech Member
    1,272
    17
    18
    Castlevania prettyness
    Well I was just taking a shot in the dark at trying to see what we'd need for collision exports to actually work :v:

    oh and about conversion... Well, didn't you say the PS3 hkx files were actually little endien but they just had extra padding? Maybe you cab find out the padding of that... I mean, you said the PS3 format might be too different to bother, but in all honesty I didn't understand what you meant by that :v: so eh, possibly false theories.

    Howeeeever... Apparently, the Havok exporter can export to Xbox 360 packfiles... So, maybe when Damizean finds out what settings we need in order to export propper collision data, maybe we can then do a hex comparison of the same file exported into the different formats. Of course... I'm a turd hacker, so I'm just blowing off theories. Damn, I just wanna see this thing done :/
     
  2. Dario FF

    Dario FF

    Tech Support Hotline Tech Member
    The endianness part is correct, the problem is I don't have any remote idea what "Reuse Padding Optimization" is, from reading the Havok exporter options. Try saving something as simple as a cube with the Havok tools in both XBox 360 and PC binaries. The files are the exact same size, only difference is the endianness and the header! Problem is, swapping endianness requires knowledge of the format, which is closed source. It's a complex format, it's hard to figure out what should be swapped. Perhaps you can figure it out for a simple cube, but for a huge stage with no source to compare too...

    From comparing the 360 and PS3 versions of the Unleashed HKX, they're radically different. However, one interesting idea just popped in my head. For any address of one file, try to interpret the data as say, a float for example. Then hunt the other file for that value switching endianness of course. If the 360 and PS3 version are saved from the SAME source hkx file, that might just work out... as long as the "Reuse padding opt" just means more padding. Then again, there's probably a ton of copied values, so it might not work anyway.

    Yes, what I'm saying essentially is figuring out what was inside a sandwich from the two slices of bread. :v:


    EDIT: And then my theory is blown over by the fact that the two hkx files are actually the same... W... T... F...? How do they even read the files on the PS3 version? Does havok maybe have some universal reader on the licensed version? WTF is this sorcery?
     
  3. Chimera

    Chimera

    I'm not a furry. Tech Member
    1,272
    17
    18
    Castlevania prettyness
    1) Well, maybe you can try it for a variety of objects, and see if there's some sort of common ground between them? I mean, it's worth a shot I suppose.


    2) I... don't know what you mean.


    3) I STILL don't know what you mean :v:

    Explain this please. I'm horribly confused.
     
  4. Dario FF

    Dario FF

    Tech Support Hotline Tech Member
    I assumed the PS3 version was using PS3 specific platform files.

    It's using XBox 360 HKX binary files. I'm confused as you are.
     
  5. Chimera

    Chimera

    I'm not a furry. Tech Member
    1,272
    17
    18
    Castlevania prettyness
    That's.... very interesting. So Unleashed uses 360 platform files?

    hrm, does Generations use 360 plaftorm files for the PS3 as well?
     
  6. Ch1pper

    Ch1pper

    Fighting the Battle of Who Could Care Less Member
    843
    102
    43
    Life.
    Oh, okay then. Guess I mistook your posting his rip as yours. Wasn't 100% clear on that, but I see what your post meant now.

    And yes, that's basically what I'm asking. Mostly 'cause the rip strictly consists of the final folders, but I'm having trouble keeping track of where each final folder originates from in the Generations directory.
     
  7. Lanzer

    Lanzer

    The saber calls for its master... Member
    6,845
    3
    18
    Glendale, AZ
    Living life.
    Oh well thats easy! don't let all the sub-directeries overwelm you. there basically directorys within directorys *insert inception joke here*

    Voices\30VCE_BLB_NP_EN.cpk_unpacked\Synth\3000000_voice\3500000_VCE_BLB_EN = Final Boss Battle Character voice clips ("SONIC, LOOK OUT! THAT LOOKS LIKE A HOMING SHOT!! and such)

    Voices\30VCE_BOS_EG_EN.cpk_unpacked\Synth\3000000_voice\3010000_VCE_BOS_EG_EN = Eggman Classic and Modern's voice clips. Egg Dragoon's fight is in there too.

    Voices\30VCE_EVT_NP_EN.cpk_unpacked\Synth\3000000_voice\3700000_VCE_EVT_EN = Character has been freed voice clips ("Thanks Sonic. You did a good job back there. Btw, Did you gain weight?!" and such)

    Voices\30VCE_HNT_EN_WIN32.cpk_unpacked\Synth\3000000_voice\3800000_VCE_HNT_EN\xbox360 = All Omochao. ("Press the A button to jump!" and such)

    Voices\30VCE_STE_EN.cpk_unpacked\Synth\3000000_voice\3900000_VCE_STE_EN = Cutscene's audio. all except 3 are there. The introduction cutscene, the cutscene when the sonics find out whos behind the time eater mess, and the cutscene when sonic says goodbye to his classic self. I'm sure Azu will look into it once he is less busy.

    Voices\character voices = This one should be a no brainer but basically its all the character voices including sonic.
     
  8. Chimera

    Chimera

    I'm not a furry. Tech Member
    1,272
    17
    18
    Castlevania prettyness
    The three left out cutscene audio clips are in the video files themselves; Those three cutscenes are pre-rendered video clips you can find in the "movie" folder in the root directory of Generations.

    Also, if you want to know where Sonic's voice clips are (his in-game noises :v:), they're in bb3.cpk/Voices/*language*/SonicVoice.ar.00

    Also so far I've discovered that sound effects are located in the cmn100.ar.00(Classic) and cmn200.ar.00(Modern) archives, as well as (I THINK) SystemCommon.ar.00, SonicActionCommon.ar.00, and most of Sonic's acts are actually in the .ar.00 archives of themselves (Sonic.ar.00 and SonicClassic.ar.00)
     
  9. Lanzer

    Lanzer

    The saber calls for its master... Member
    6,845
    3
    18
    Glendale, AZ
    Living life.
    Huh thats strange, so out of all the cutscenes those 3 are videos? how odd...

    An SFX dump would be sweet too if anyone is up to it.
     
  10. Dario FF

    Dario FF

    Tech Support Hotline Tech Member
    Some of the cutscenes are rendered in-game and locked at 30 FPS I think. It's pretty obvious when you see the resolution suddenly change on the PC version. (I mean change as, seeing a low resolution video upscaled to a bigger one, not change the video mode)
     
  11. I was curious why a couple of cutscenes actually ran at the speed they were supposed to as opposed to going too slowly like all the other ones (my PC was not the best choice to play the game with). Nice to know this.

    By the way, when you guys figure out the collision data and finish fully porting levels over, would you be putting up stuff to let other people do the same? I have absolutely no programming knowledge, but would still like to play through these as well. Do they replace existing levels, or are you adding them? It would be kind of neat to see DLC from here before Sega gets around to it themselves.
     
  12. Dario FF

    Dario FF

    Tech Support Hotline Tech Member
    I have no gripes with putting my half-assed conversion software I coded for people to do the same. :v: For now it's just for fixing and porting over the Unleashed stages, no custom geometry yet. The only problem is they don't really feature any kind of command-line options yet, so they're kind of ugly to use.

    I've seen some other people doing quite neat GUI tools though, like Damizean's HKX reader(only for animations though). As for me, all I've released so far is the object layout editor, which should be easily usable by someone with no programming experience, but the database isn't quite complete yet(only GHZ and CPZ objects so far).

    For my Unleashed porting, I'm replacing the Geneartions' levels, mostly because I would like to play around with sharing the geometry in the missions and make custom missions. Heck, I already have the "hard" object layouts from Unleashed in another XML. :eng101:
     
  13. Sorry, I meant the level data and some sort of insertion tool when you figure out how to get to that point.
     
  14. Dario FF

    Dario FF

    Tech Support Hotline Tech Member
    I haven't taken any tries at importing level data yet, it was just a mere coincidence Unleashed's one happened to be compatible. I'm pretty sure whoever works on that will probably make the software available though.

    On the Unleashed porting topic, I've tried running a batch conversion on the unleashed's textures doing a 90 degrees rotation and Horizontal flip. Some of the mapping gets fixed, but not EVERYTHING needs to be flipped... skies for example. My most notable example is the little lines and walls at dragon road. They seem fixed now. It still looks ugly as hell with no lighting data, which is starting to get in my nerves since I can't find it on the disk!
     
  15. Portalboat

    Portalboat

    Member
    20
    0
    0
    (I just joined this forum help out with the hacking, hi everyone! :P)

    I was messing around with BB2, because that seems to be the least explored archive, and I found the stage files for the overworld. (The ID is PAM, by the way.) So I looked in the XML data, and I found the stage gate data. Unfortunately, they all reference a objectID. Has a list of objectIDs been found, or are they hardcoded into the engine or something?

    EDIT: I also found a stageID entry, as well as the objectID. I changed the objectID from 2 to 6, and Chemical Plant got changed to Speed Highway, so we can assume that stageID 0 is GHZ, 2 is CPZ, 4 is SSZ, etc. I'm guessing the objectID references the model, then.

    Because the stages are different for each Sonic, I'm guessing that the stage ID definitions might be in their files.
     
  16. Dario FF

    Dario FF

    Tech Support Hotline Tech Member
    Do you mean the setdata_ xmls? Objects are declared with an entry of their name(those names are hardcoded I think), and they have unique <SetObjectID> members, since other objects can reference it. For example, switches need the object ID of what object to activate, or event collisions, etc. The number of the ID isn't relevant to the kind of object it is, it's just an identifier for the game world, and must be unique.

    I'm keeping a list of the object templates you might need here. Those are the only ones I've imported so far, and more can be dumped when needed.
     
  17. Portalboat

    Portalboat

    Member
    20
    0
    0
    I found the object's names in BB/#SystemCommon/ObjectDefine, so the names aren't hardcoded. They reference a data path, though, so that might be the hardcoded part. It's probably what references the model, too.

    Also, how are you importing the Unleashed level's geometry? Is it just a direct copy paste?
     
  18. Dario FF

    Dario FF

    Tech Support Hotline Tech Member
    That's interesting. I suppose the behaviour of the objects is hardcoded though, unless there are some lua scripts lying around.

    Well, if you mean JUST the level geometry...

    1. Copy all the terrain files from the Unleashed act files(lights, terrain-groups, .terrain, models, textures, .pfi files, .texture, .texsets)
    2. Extract Stage.pfd from the Unleashed stage and run xbdecompress on the .ar files inside(xbox 360 version)
    3. Use a little tool I did for running makecab(Microsoft's compression tool) on the files inside the Stage.pfd, fix the address and byte sizes of the Stage.pfi file, and repack Stage.pfd with MM's editor with padding=800.
    4. Replace the old Stage.pfi, repack all of that and dump it into the .ar file next to the Stage.pfd
    5. Modify the act's xmls to load up the correct sky and light.

    Not really simple. :v: That's a general overview, not step-by-step instructions.
     
  19. Portalboat

    Portalboat

    Member
    20
    0
    0
    Yeah, doesn't sound that simple :P

    I was mainly asking because I was wondering if the format had an import/export script. But apparently not.

    I'm still wondering where the stage IDs get set, if it isn't hardcoded.
     
  20. Dario FF

    Dario FF

    Tech Support Hotline Tech Member
    So in a conversation with Dami yesterday, he pointed out to me that the Havok headers are indeed on the SDK... and surprise, they have the exact order of the data inside the HKX. It might be easier to crack open and switch the endianness of the format than I thought, so there's still hope for porting the Unleashed collision. That is, as long as the Unleashed collision files are still compatible with the game.