don't click here

Sonic Generations Hacking (and More!)

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

  1. Portalboat

    Portalboat

    Member
    20
    0
    0
    Do we have any idea what the extra files in the stage's AR are for? The .pfi, .terrain-group, .tbst, etc?
     
  2. Dario FF

    Dario FF

    Tech Support Hotline Tech Member
    I think (ar files inside pfd) that's just stage geometry and global illumination files. Link was working on reading and importing them into Max I think.

    The .pfi is some sort of header to the PFD, holding the byte lengths, size, and some sort of internal ID I haven't been able to understand what it means yet. Kind of like a more complex ARL.

    As for the other two, no idea. :v:
     
  3. darkspines35

    darkspines35

    It's Easy Actually. No, seriously. Tech Member
    248
    0
    16
    .V.
    Sanik Adevnt Casters
    The terrain-group files are just a listing of the models inside each tg file within the stage.pfd file, and they relate by number (tg-0000.terrain-group = tg-0000.ar in the stage.pfd). I'm not sure what tbst is, and the pfi files are just what Dario said. I'm also not sure what the terrain.terrain files are.
     
  4. MainMemory

    MainMemory

    Has-Been Modder Tech Member
    4,820
    410
    63
    Myself
  5. Dario FF

    Dario FF

    Tech Support Hotline Tech Member
    I'm not sure I remember the original contents of the file, but I linked it to the original source I think.
     
  6. Dario FF

    Dario FF

    Tech Support Hotline Tech Member
    Well converting the whole Unleashed data by swapping endianness is a bit insane to work it out, so instead I'm focusing on loading up the Havok collision and interpret it inside the editor:
    [​IMG]

    My hope is that you could simply import a mesh with any 3D editor you want and convert the vertex data to be compatible. It isn't a really hard format, I'm just not sure where the transformations are, I had to move that mesh manually to make it fit. :v:

    I haven't loaded up all the custom meshes yet, just the extended shapes. It uses a couple of boxes as well, looking into it.

    EDIT: Note that any "missing" faces might be because there's no "back" face defined in the meshes. It's just the normal face which Sonic collides with.
     
  7. Twilightzoney

    Twilightzoney

    Tech Member
    353
    0
    16
    Elgin, IL And Hampshire
    Unleashed and Generations Stuff and Custom Works
    Doing good man, so thats how the collision looks like? If so thats pretty cool.

    Congrats I can't wait to see more. Also what do those green and light green markings mean in your picture?
     
  8. Dario FF

    Dario FF

    Tech Support Hotline Tech Member
    The dark green ones are camera objects. The light green ones are collision objects. Some of those collision events activate the swings when Sonic is in the area.

    The other green thingy to the left are sound lines/points, to play the waterfall ambient sound when sonic reaches that area.
     
  9. Lobotomy

    Lobotomy

    35% Cognac Banned
    4,394
    1
    0
    Traverse City
    Project: Matter/Energy
    Question: How feasible is it to bring back Sonic's crawling action from Unleashed? Holding crouch while stationary and moving in a direction in Generations looks and feels incredibly tacky.
     
  10. Dario FF

    Dario FF

    Tech Support Hotline Tech Member
    So I made progress in importing the collision to be visible. First things off, I was just doing it in a horribly hackish way in the pic above. I was directly loading the stored meshes and just applying manual offsets until I found the right spot.

    So I rehauled it and went for a more... "recursive" approach. The rigid body object contained parameters to these shapes, and they applied a transform of course. Also of note, these transforms sometimes used custom bases(3 in most cases). Anyway, doing the proper transformations, plus loading the meshes and child meshes(since the mesh objects referenced by the Havok rigid body, also contained child shapes of their own), the end result is this beautiful white(and accurate!) landscape. I also set the material as 2-sided so not only 1 face of the terrain is visible.
    [​IMG]
    [​IMG]
    [​IMG]

    The outer white box is some sort of "Kill Sonic" trigger, as I've tried it before when importing Unleashed geometry. It's the level bounds.

    I guess it's an interesting view at how much collision data the terrain actually has. You can get a similar result by turning on the flag in the XML to render it as shown in some pages before. That only confirms it's indeed loaded right. It's so pretty when it works. :)

    EDIT: P.S., the whole purpose of this of course is that I'm gonna try and import my own collision mesh so I can play the Unleashed stages. :v:

    EDIT2: Playing around with importing this little patch of collision I cut out from the Windmill Isle Act 1 terrain:
    [​IMG]

    Imported it into SonicGLvl, rewrote a chunk of terrain collision data of GHZ with the data from my custom mesh, and ta-da!
    [​IMG]

    It's a shame Sonic can't actually walk in that collision for some weird reason(my guess is I didn't set the welding right, one of parameters I haven't figured out yet), but at least it seems to load perfectly ingame and accurate to the original max mesh. Tears of joy all around, but I guess it's time to figure out what went wrong now. But there seems to be hope at least.
     
  11. Portalboat

    Portalboat

    Member
    20
    0
    0
    Nice job!

    Once you completely figure out the format, do you think you could compile everything (.ar viewer, level editor, collision mesh editor, etc) into a single, easy-to-use editor?
     
  12. darkspines35

    darkspines35

    It's Easy Actually. No, seriously. Tech Member
    248
    0
    16
    .V.
    Sanik Adevnt Casters
    Alright, so a thought that just came to me. With all this work Dario's been doing and having the basic knowledge of the stage's model format and how it instances objects, I'm tossing around ideas of whether it's feasible for an exporter to be done. I just need one thing done. Can someone check if it's possible to repack all of the tg folders into one giant one and still have the game load the stage? This is really the only thing I need to know before an exporter is even really thought about any further than just an assumption of it being possible. And for anyone who tries this, just replace the .terrain-model files when prompted to when you put them all in one folder. It won't hurt anything.
     
  13. Dario FF

    Dario FF

    Tech Support Hotline Tech Member
    Hi, I decided porting Unleashed levels is a futile task, and just thought that I should switch to porting Shadow's model into Generations. It's all everyone wants anyway. He'll be the coolest, and have uber cool animations.

    I'm afraid this is all I could do with porting a level.



    I'm crying of happiness inside. And it was so fucking simple. I'll explain later. That collision mesh is a custom one I imported, so yes, we have a way to edit level collision now.
     
  14. DustArma

    DustArma

    Member
    1,370
    15
    18
    Santiago, Chile
    Learning Python.
    [​IMG]

    You sir, are a genius.
     
  15. Dark Sonic

    Dark Sonic

    Member
    14,632
    1,632
    93
    Working on my art!
    o_0 You sir are a god of life. Fantastic job

    I wonder, is it possible to fix C. Sonic's spindash for 3D gameplay? That'd be great to have C. Sonic play through modern's levels with a working spindash. And you joke about model porting but I'd love to have a playable Knuckles or Classic Tails mod.
     
  16. Dario FF

    Dario FF

    Tech Support Hotline Tech Member
    I know it would be cool, but reskinning the textures of Sonic into Shadow is kind of lame(as a lot of people seem to be doing). :v: I'll give major kudos to anyone who manages to reverse engineer the model + material format + hkx animations.

    The Havok exporter plugin for 3ds max has some custom options for exporting the levels. If I hadn't worked in importing the collision into SonicGLvl, I wouldn't have realised the following...

    1 - A havok filter creating rigid bodies needs to be applied, with type ExtendedMesh.
    2 - The Havok shape must be of type "mesh", not convex hull.
    3 - It's needed to apply a custom transformation to the scene, which I wouldn't have guessed at all if it wasn't for previewing it inside the editor. It needs a transformation matrix with the following settings.
    [​IMG]

    I guess all I gotta do now is wait for Zoney to send me more stage meshes. :specialed: I would have spent a bit more time tweaking all those collision meshes if my computer wasn't struggling with 2GB of ram, but oh well.
     
  17. Out-FRIGGIN-standing! That is beautiful. :.)

    Can't wait to see what else you can show us!
     
  18. Guess Who

    Guess Who

    It's a miracle! Oldbie
    4,296
    63
    28
    Oregon
    lol
    Dario FF for tech member.

    So, let's see. Lighting Is still borked and some textures look a bit buggy; enemies will have to be redone manually (or replaced via script with Generations equivalents?); there were a few small camera glitches, but for the most part, looks great.
     
  19. Twilightzoney

    Twilightzoney

    Tech Member
    353
    0
    16
    Elgin, IL And Hampshire
    Unleashed and Generations Stuff and Custom Works
    Well I'm working on Apotos Act 2 right now for him a lot of pointless meshes and lag on my computer even with 6gb of ram. I love it! After that I'll get Chunan done. Wait, some of the mission stages use their own stage meshes so could that mean we could place a few more stages into those?

    Since I'd love to see the DLC Unleashed stages be used in there. Since I have those on hand.

    Since I'm still waiting for some real DLC from you Sega.
     
  20. Turbohog

    Turbohog

    Member
    977
    127
    43
    Fantastic work to Dario, Zoney, and anyone else who has been involved! You've done an incredible job, and you've done it quickly too. Can't wait to see further progress.