don't click here

Sonic Generations Hacking (and More!)

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

  1. Dario FF

    Dario FF

    Tech Support Hotline Tech Member
    Heyo, I've been putting some research towards cracking the terrain stuff so I can try some custom geometry imports. While I have one more format left to crack and a few quirks left to figure out, I have a question about how you, the end users, would like to be able to export their own terrain into my editor, and into the game itself.

    First some technical background on the situation:
    • The format that I will likely end up reading is the Ogre mesh and material format. The reasons are simple. Ogre supports human-readable and edittable material scripts, and the plugins for exporting a mesh(and even entire scenes) is already available for several popular 3D editors(you can check it on the wiki page)
    • Since there is support for scenes, you won't have to do any specific tasks to support instancing of geometry(e.g., rocks, flowers, etc.) the same way the game does.
    • Generations handles terrain loading in the so-called "Terrain Groups". The terrain groups define which instances of geometry to load as groups. The game uses the internal IDs of this groups to specify whether to load it or unload it when Sonic goes past certain points(or the so called, triggers). It's not necessary to bother with this since the game can stream geometry around it on its own, but it's better for geometry-heavy stages if you want good performance.

    So reading the above, you should know "Terrain Groups" say which meshes are supposed to be loaded in a certain range. There's enough evidence to support this on the files I've researched, since a good bunch of them are mostly definitions of bounding spheres that match exactly to the mesh, so the game knows whether to load it when in range or not. For example, in Arid Sands...
    [​IMG]

    While meshes might have their spheres on their own, terrain groups are bigger than that. They cover big chunks of the terrain, and have a list of the sub-meshes that are in its range. For example, a terrain group could have the floor, a pillar, a tree, a rock in its content. When Sonic gets near the chunk, the whole terrain group gets loaded at once.

    The good thing about terrain groups is that they don't have any range limits. They can be as big as you want to cover the entire stage, if you'd like to have a chunk of terrain constantly loaded and viewable. What I come to ask though is, how would you people like to manage these terrain groups?

    Since I said the model format is going to be the Ogre meshes, that leaves out of the question any 3d editor specific features like groups and stuff that can't be exported. (That won't prevent you from writing your own scripts to fit the naming conventions I will explain in a bit). My plan is for the editor to be able to auto-generate these terrain groups on its own by using a configurable grid on the Y plane, but still allowing the user to force the terrain group the mesh belongs to by appending a tag to it.

    Let's say I have this stage in my 3D editor. Instead of bothering to do all that terrain group fancy stuff in my own, I would let the editor do it on its own when importing the Ogre Scene. It would look like this:
    [​IMG]

    As you can see, the amount of Terrain groups would be reduced to the bare-bones it needs. Any terrain geometry in the range of each block would get lumped into the nearest group, and the names would be auto-generated. The plan is, if the user wanted an specific mesh to be part of Terrain Group #5(for example, for unloading far away geometry when Sonic reaches the place), it would have to append to the name INSIDE the 3D editor before exporting, something like @tg-0005. Or probably something similar to that. Keep in mind the terrain groups wouldn't be restricted to the grid at all. The grid is just a guidance for my editor to auto-generate the groups.

    Do you think this method would be fine for all of you? Most of the stuff would be done in the background automatically. Unless someone has a better suggestion I'll probably go with it.
     
  2. Not only for each stage, but even for each section of the stage, which is really annoying. Anyway, it looks like shader structure in SG made the same way with UT3, for example. It means, that it's completely based on DOF, and when you turn it off-you turn off everything.
     
  3. Dario FF

    Dario FF

    Tech Support Hotline Tech Member
    Well since I'm a bit bored and I still gotta debug why my geometry import isn't working(probably due to not cracking the visibility tree yet), I'm gonna throw this little vid here of some testing of my import.

    THIS IS NOT A GEOMETRY IMPORT, the geometry you see in the video is the HAVOK COLLISION with the rendering flag enabled. If you're gonna share this video, please note that important detail. This custom stage could've been done months ago, but nobody seemed to try it, so here you go.


    I think it's quite interesting if this game could have some open free roaming stages... the engine isn't really that flawed for it, other than the camera controls.

    As for the geometry import, I do have something that looks exactly the same when imported into my editor... as far as I know, my files are right, but it doesn't seem to show up(or load) ingame. So I'm still trying to figure out why. At least I got out of the way a HUGE chunk of the code for organizing this whole terrain groups thing and converting meshes to the game's format. As soon as I figure out why it isn't loading yet, we'll be seeing some very interesting things happen(considering I can even write materials as well at the moment!).

    [​IMG]
     
  4. Chemical Heat

    Chemical Heat

    Being the new guy is hard... Member
    7
    0
    0
    Iceland
    None at the moment
    So that means that once you've figured out how to get the levels loading properly, We could import stages like Emerald coast, Red mountain and Aquarium Park? Hell, Wave Ocean? I'd love to see a Wave Ocean port in the future :3
     
  5. TheKazeblade

    TheKazeblade

    "Our Life is More than a Side-Effect" Member
    I'm more excited to see some of the custom stages that can be made with more openness in mind! I'm really anxious to see what you techie guys can do with this :D
     
  6. Dario FF

    Dario FF

    Tech Support Hotline Tech Member
    The way I'm building this all skills you will need is a notepad, a 3d editor, and willingness to click buttons. :v: But yeah, let's not think too much about ports... importing custom geometry means only the sky is the limit from there.
     
  7. Lobotomy

    Lobotomy

    35% Cognac Banned
    4,394
    1
    0
    Traverse City
    Project: Matter/Energy
    You mean the fact that there aren't any? :specialed:

    Chimera was supposed to send me a disassembly of the .exe which may have some interesting things related to the camera in it. I've started work on looking for moveable camera stuff in the sea of XMLs. If I find nothing, I'll hassle Chimera (again).
     
  8. synchronizer

    synchronizer

    Member
    2,196
    93
    28
    A little off-topic, but I always wanted to play a more challenging Sonic Unleashed in which taking damage makes SOnic lose ALL of his rings. This would be interesting.
     
  9. Dario FF

    Dario FF

    Tech Support Hotline Tech Member
    I was planning on including the hard versions of the acts as missions as well if that is enough to satisfy all your hardcore needs. :v: They're merely different layouts though.

    I haven't seen anything in the XMLs controlling the ring drops though.
     
  10. synchronizer

    synchronizer

    Member
    2,196
    93
    28
    No, I'm happy with the original layouts; it's just that it would be nice if the enemies and interceptors were genuine threats.
     
  11. Chemical Heat

    Chemical Heat

    Being the new guy is hard... Member
    7
    0
    0
    Iceland
    None at the moment
    Well, That too. But a Wave Ocean port would be amazing, Mach Speed Section would be a boost to win while chasing the Eggman ship from Rooftop run.
    Isn't it possible to make Modern Sonic play both Acts of a stage? I'd like to have a ''Modern-only'' version of the game. So, for example. Wave Ocean Act 1 would be the first half and the Act 2 would be the mach speed half of the level with some platforming here & there and both acts would be just Modern Sonic alone :P
    Any who, Lookin' pretty good!
     
  12. So, any news on how porting is going? Kind of excited to see how much better things are looking :P
     
  13. Lobotomy

    Lobotomy

    35% Cognac Banned
    4,394
    1
    0
    Traverse City
    Project: Matter/Energy
    It's there, it just uses this totally weird-ass algorithm for ring loss. Classic and Modern use slightly different methods of ring loss and I haven't found a way to make either Sonic lose all his rings, but I'll keep you posted. (I haven't put a whole lot of effort into it, mind. :v: )
     
  14. Dario FF

    Dario FF

    Tech Support Hotline Tech Member
    If you mean visually there's nothing else new than the (with glitchy materials) breakable objects. Tweaking layouts, working on the stage objects, optimizing collision meshes. Mostly gameplay related stuff.

    Besides, I'm currently trying to do this terrain importing thing, which needed me to crack quite a bunch of formats. And I still got a few more before managing to get stuff displaying in-game(which isn't replacing other stage's stuff, but rather creating one from scratch).
     
  15. Lanzer

    Lanzer

    The saber calls for its master... Member
    6,845
    3
    18
    Glendale, AZ
    Living life.
    So has there been any luck trying to get these stages to work as the challenge stages instead of main stage replacements?
     
  16. I was incorrect. Post processing shatters after Motion Blur disabling. With MB only picture looks not so over-bloomed, but like HD version of Heroes. I'll post a video soon, it doesn't uploading..

    Also hub world without shaders. It's blue now.
     
  17. LesbianPonyArmageddon

    LesbianPonyArmageddon

    Member
    11
    0
    0
    New Zealand
    Pissing around with Generations files.
    Please please, PLEASE can I have your .cpk files with the DOF disabled? I'd love to be able to play this game properly ;A;
     
  18. Lobotomy

    Lobotomy

    35% Cognac Banned
    4,394
    1
    0
    Traverse City
    Project: Matter/Energy
    Since you're the only one here who really knows how to fuck with shaders, do you want to see if you can enable Lightrays (God Rays)?
    I tried and couldn't, Dario tried and couldn't, Chimera sort of tried, et al. Are you a bad enough dude to enable God Rays?
     
  19. Yarharhar

    Yarharhar

    Oldbie
    58
    0
    6
    You'll get to eat a hamburger with Ronald Reagan if you succeed.
     
  20. http://www.filefactory.com/file/c440df5/n/SceneEffect_rar
    Well, I can upload bb.cpk if you want... I just think it's kinda too big. Oh, but White Space is in bb2.cpk... Well, it'll take hours to upload bb.cpk anyway.
    [​IMG][​IMG]

    Interesting. You guys here deal with C++ and ASM like you were born with it, and I know only pack, unpack, true/false, numbers, and experiments. Well, God Rays can possibly be disabled in code alerady, along with Deffered Lighting. I don't like DL, coz it don't support proper AA, and I don't really care about God Rays, because they can be barely seen in such a bright place like GHZ. BTW, DX9c don't support proper God Rays (only fake ones, heading to your face), they are DX10 only, which PS3 and X360 incapable of.