Sonic Generations Hacking (and More!)

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

  1. Techokami

    Techokami

    For use only on NTSC Genesis systems Researcher
    1,316
    3
    18
    HoleNet!
    Sonic Edge
    How about a Lua decompiler?
     
  2. evilhamwizard

    evilhamwizard

    Researcher
    1,331
    150
    43
    I tried it, doesn't work. "bad header in precompiled chunk".

    The game seems to take the lua files from the 360 version anyway (I got the game to run in "1st_demo" mode, lol), so if push comes to shove I could always upload those for people to modify instead.
     
  3. Azu

    Azu

    I must be stupid. Member
    You could try a different Lua decompiler. That one seems dated, last updated was 2 years ago.

    Which of the .ar has the lua files? All I see are XML files. (PC version).
     
  4. evilhamwizard

    evilhamwizard

    Researcher
    1,331
    150
    43
    It should work, since I think the lua files are version 5.1 which is what LuaDec supports.

    The only lua files I was actually able to find are in #Application in bb3.cpk. I think this is the only place where they're used.
     
  5. Azu

    Azu

    I must be stupid. Member
    What about copying the lua files from the xbox360 version?
     
  6. Heran Bago

    Heran Bago

    Ah! It's Puyo battle then. Tech Member
    I can confirm this fix working for the US release BLUS30612 on 3.55. I don't know about the lightforce release since I used my own disc. you have to start the game from /APP_HOME/PS3_GAME/ on the xmb. Multiman will say it's the demo, just let it think that.

    http://www.megaupload.com/?d=64MJZK16
     
  7. evilhamwizard

    evilhamwizard

    Researcher
    1,331
    150
    43
    That's what works. I've been using them the entire time. The game doesn't care if they're plain text or whatnot just as long as they're there. Although I don't feel comfortable just transferring things from the 360 version to the PC because they might've changed some things in the lua files, but so far I haven't noticed anything wrong.

    Thankfully they didn't do anything with the XML files, so you can edit those. But it'd be better if we had their debugger enabled so you can edit those files on the fly. I wonder if it's possible to make the game load from the files outside their respective cpk files? The ApplicationSettingDebug.lua file hints that developer versions read/wrote files to image/win32/work/*whatever* while the release version reads from the 'archives' (I think they're referring to the .cpk files). Unlike the console versions, there's a "work" folder in the PC version. I'm curious since the game doesn't seem stingy with the files just how far you can go.
     
  8. Twilightzoney

    Twilightzoney

    Tech Member
    353
    0
    16
    Elgin, IL And Hampshire
    Unleashed and Generations Stuff and Custom Works
    Well all I've been doing is messing with the stage junk the way the stages start off. Just comparing them and seeing how many types there are. Such as Dash, Standing I think there is a Diving start one too not sure.

    http://i40.photobucket.com/albums/e202/Milesgboy/Untitled1.png

    And I messed around with the texture sizes I think I messed up on re-saving them and messed up alpha values.
     
  9. Heran Bago

    Heran Bago

    Ah! It's Puyo battle then. Tech Member
    The ps3 fix doesn't seem to save.
     
  10. Chimera

    Chimera

    I'm not a furry. Tech Member
    1,258
    1
    18
    Castlevania prettyness
    The diving one reminds me of that one mission in Sonic Unleashed, where you dove down that section in Rooftop Run where originally there were spike balls everywhere (seems they cut that out since Chemical Plant has that section now, but with chemicals), but instead you dove to catch the ghosts. Heh.

    So, can anyone tell me where the .XML files are, and how I can go about editing them and then re-packing the .cpk? I think I found a .xml file, but I just want to be sure, and would like to be able to re-pack the .cpk so my edited values will be applied to the game :P
     
  11. Yarharhar

    Yarharhar

    Oldbie
    54
    0
    0
    It is possible the compiled lua files have their endian-ness flipped, especially if the XBox was the hedgehog engine's lead platform. It would be weird they would load endian-flipped lua files on the PC version, but maybe it works easier that way.
     
  12. Chimera

    Chimera

    I'm not a furry. Tech Member
    1,258
    1
    18
    Castlevania prettyness
    Hrm, out of curiosity, anyone think they can do a proof-of-concept model and animation swap of Shadow and Sonic? Maybe even sound effects? :P

    That would actually be pretty cool, considering you can then fight Sonic as Shadow, just like in SA2, except with more tailgating :v: (and suddenly Sonic can throw chaos spears :specialed:)
     
  13. Azu

    Azu

    I must be stupid. Member
    Would be interesting.

    You should be able to repack CPK with this.
    "crifilesystem". It's the first link in Google.
     
  14. Twilightzoney

    Twilightzoney

    Tech Member
    353
    0
    16
    Elgin, IL And Hampshire
    Unleashed and Generations Stuff and Custom Works
    The Crifilepacker should work thats what I used for the pc version. Where though in the stage xml junk does it say it to use generic sonic or classic?

    And model swapping shadow for sonic should work they both have the same bone names except the root bone I believe.

    Edit: Thats what I get for using my Iphone
     
  15. Tanks

    Tanks

    Member
    1,028
    0
    16
    That shits been wiped off the face of the net for a while now though right? Unless good 'ol Jimmyboy's been hoarding again... >8|
     
  16. If someone could detail instructions on exactly what to do, I'll do it when I get in from work. I'm having trouble finding everything at the moment though.
     
  17. Sik

    Sik

    Sik is pronounced as "seek", not as "sick". Tech Member
    6,719
    0
    0
    being an asshole =P
    Don't think so, I think Lua compiled programs are byte-based, not word-based (you don't have endianess on individual bytes, since that's only for storing multibyte data). Unless Sega was stupid and is loading words instead of bytes or something, even if the file isn't stored like that.

    In before somebody proves me wrong :v:
     
  18. Yarharhar

    Yarharhar

    Oldbie
    54
    0
    0
    This posting is a few years old but implies that this was at least a problem at one point: http://stackoverflow.com/questions/1047236/lua-compiled-scripts-on-mac-os-x-intel-vs-ppc
     
  19. Sik

    Sik

    Sik is pronounced as "seek", not as "sick". Tech Member
    6,719
    0
    0
    being an asshole =P
    Shit, the header. Completely forgot that. It's very likely the header is not byte-based and needs swapping. You'd think the Lua developers would know better, though...

    EDIT: or not
    I'm under the impression that Lua bytecode is pretty much similar to GLSL binaries: you aren't meant to run it anywhere but in the machine it was built, and you're meant to be distributing the original source instead. So, it's Sega who's doing it wrong here.
     
  20. Polygon Jim

    Polygon Jim

    Eternal Tech Member
    0
    0
    0
    across town from Hinchy
    All the bitches.
    Is the whole 5 compressed lua files even important at all? They're just compressed versions of the X360/PS3 scripts which can be taken directly from either version and dropped into the PC version. The game doesn't care if it has the compressed ones so there's not much point in wasting time trying to figure this out.