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
    Regardless of what the guy might've done, I doubt it was anything that serious to warrant a channel termination, and I hope he sorts it out later. Beating down on him constantly does not lead to productive behavior of any sort, and I'd say it'd be best if we refrained from such a discussion on this thread. To promote some actual hacking discussion I'll share some of the stuff I've been taking a look at for the past week.

    A lot of people that followed the Unleashed porting from the beginning will probably remember that we've pointed out several material inconsistencies / differences in the past to get stuff to render correctly, and how we ended up going for similar but not quite perfect replacements. And rightly so, there's quite a few differences in the lighting of both games that didn't seem to make the transition from one engine to the other. Sadly some of these complaints were mixed in some misunderstanding due to the Xbox 360 version of the game being wildly inconsistent with the resulting colors due to the inaccurate Xenon gamma curve, while the PS3 version of the game is much closer in color tone to what you get on the Generations port.

    There's quite a few noticeable differences between the way the game renders the same kind of materials, mostly when it comes to dealing with the intensity of the normal maps and the specularity highlights. While most materials that only used a diffuse map or a diffuse/normal map in Unleashed (Common_d/Common_dn) used specularity to some degree, Generations just removed that functionality entirely. This is why a lot of stuff tended to look more "glossy" in a way in Unleashed, which is subjective to personal preference I guess but it isn't very accurate. The best way to correct this is just about the most insane way to go about it: convert the Xbox 360 vertex/pixel shaders to being usable on PC. Luckily enough, there's quite a bunch of usable tools for disassembling said shaders to make them human-readable to a degree. After developing my own parser to fix any inconsistencies between the two languages (which is a bit harder than it sounds due to Shader Model 3.0 having a smaller instruction set and being limited to DX9) and translating any constants as necessary, it seems like the conversion is much more feasible than I previously thought.

    All I'm gonna show here is very heavy WIP work, and is very subject to change as the quirks of the converter get fixed. On the following screenshots I converted Common_dn (red bridge, grass) and Common_dpn (Floor, etc.). I'd like to you to notice the differences between the red bridges, the grass, the straw tops of the windmills, the flowers and how their specularity looks way different. This looks more noticeable in motion, but I'd like to get stuff fixed up some more before showing a proper video.

    Generations with regular FxPipeline Shaders:
    [​IMG]

    Generations with Common_dn/Common_dpn/[email protected]@ ported from Unleashed's Xbox 360 Shader files (Ignore the broken trees and rainbow-colored stuff):
    [​IMG]

    For funsies I decided to compare the Egg Fighters as well, so Zoney set me up the Unleashed Egg Fighters converted with the right shader names and I decided to try out [email protected]@ and its other necessary shaders:
    Regular Generations Egg Fighters:
    [​IMG]

    Unleashed Egg Fighters with ported shader:
    [​IMG]

    My other test was Ice_dpnenr, Ice_dpnr, and Common_dne for Cool Edge. The most noticeable difference is the way the floor lights up during the Tube section, which looks pretty flat in the Generations version.
    http://youtu.be/9dFVJoTFeNY

    Sadly I've still got a lot of quite frustrating main issues to deal with on the converter so far that I haven't been able to crack yet:
    • Dynamic shadow-maps are just very screwed up. I imagine this is in part to both games handling this differently. Without this being fixed the scene just won't look right most of the times.
    • Lightfield does seem to work to a degree for dynamic objects, but it does not seem very accurate yet positioning-wise.
    • Vertex Shaders seem to have a very nasty issue when converting the ones that use Skinning, causing random vertices to glitch around. Very annoying issue to debug so far as it even behaves differently between GPUs.
    • Almost all post-processing related shaders haven't been able to been converted yet. I'd assume due to this being more dependent on what the game's rendering pipeline gives you might not be ever feasible without exe modifications.
    • I've yet to figure how to properly translate the specific cube-map instructions, so I cheated on the Sonic screenshot below by using the non-cube map version of the Enamel shader for the shoes.
    • Most of these conversions so far are very inefficient as expected due to having to work around inconsistencies instead of just generating the assembly code in the first place, but this might not be very important since any modern GPU just overpowers this game a lot anyway.

    Keep in mind that all I'm converting so far is just instructions and not particular features of the shaders themselves, so fixing these is a lot harder than it sounds without some through research at what the shader is actually doing. Sadly it's just not very nice to have to read a disassembly of fairly complex stuff generated from HLSL, but I'll try to see what I can do. I don't want to fully commit to finishing this just yet until I find the limit of how much I can actually do, but if stuff goes nicely I guess it could lead to a worthwhile update to the Unleashed Mod. If we got any HLSL ASM (As in GPU microcode, not regular ASM) experts lying around that would like to verify the integrity of my converted shaders, let me know.

    Also shiny shoes:
    [​IMG]
     
  2. Josh

    Josh

    TGC Warrior Oldbie
    1,450
    75
    28
    USA
    I never bought any of the original Unleashed DLC, so to make sure I've got this straight for the hacking contest...

    The Unleashed Project DLC demo by S0LV0 is an optimization of Unleashed's DLC with a custom HUB and other changes. The World Adventure Packs and Spangonia Adventure Packs from N69 and TiManXD are more straight, barebones ports without optimization.

    Is that accurate?

    EDIT: And while I'm at it, has anyone ever managed to fix the settings bug? I have to delete my INI files like every other time I start the game.
     
  3. S0LV0

    S0LV0

    Sonic Generations Helpdesk Tech Member
    586
    0
    0
    Spagonia
    Abusing SMPS
    I wouldn't call the other Adventure Pack ports "barebones" so much as a more straightforward attempt to port Unleashed as a whole, rather than adjusting the content to fit with Generations. I'll withhold my personal opinions on the matter, but I hope this distinction helped.

    edit: And just in case you don't know, my demo contains a single stage. Sorry it couldn't have been more, but I'd prefer to release something in as polished a state as possible, even if it sacrifices quantity.
     
  4. SF94

    SF94

    Tech Member
    775
    2
    18
    Utah
    SA1/2 hax
    Awww yeah, shiny shoes.
    Honestly, if you manage to get it working reasonably enough, I don't think I'll ever play with the default Generations shaders again. I personally prefer the Unleashed look to Generations (strictly in terms of its shaders--everything else about Unleashed was pretty blurry at best).
     
  5. synchronizer

    synchronizer

    Member
    1,921
    1
    18
    The rings don't blend into stages in Generations as well as they do in Unleashed. Is this related to the shaders, or are the rings not affected by the lighting in Generations?
     
  6. SF94

    SF94

    Tech Member
    775
    2
    18
    Utah
    SA1/2 hax
    Edit: oh boy new page
    I seem to recall a while back that someone from Sega mentioned barely being able to see the rings because you would move so fast. In fact, I think it was during the Sonic Lost World reveal. Don't quote me on that, but that leads me to believe they were aware of this as far back as Generations, and specifically went out of their way to make them stand out.

    Context:
     
  7. Twilightzoney

    Twilightzoney

    Tech Member
    353
    0
    16
    Elgin, IL And Hampshire
    Unleashed and Generations Stuff and Custom Works
    I did port the ring shader from Unleashed they honestly don't look that different from the Generations ones. But maybe when/if everything is ported they'll blend in better. I haven't retried since some new things were fixed though so it might look better now.
     
  8. JansenM

    JansenM

    Member
    117
    0
    16
    Devon, UK
    Generations mods
    Suppose I should post it here.



    Info/downloads in description and/or the SHC page.
     
  9. BlazeHedgehog

    BlazeHedgehog

    A "Community Enigma"? Oldbie
    1,459
    4
    18
    Honestly, I think the rings blend in to the scenery in Generations MORE because they're a darker brass/copper color with a very detailed reflection. Makes them get lost in the noise a lot easier than Unleashed's bright yellow rings.
     
  10. Overlord

    Overlord

    ...did we just switch realities? Moderator
    17,632
    82
    28
    Berkshire, England
    Learning Cymraeg
    Looks absolutely fantastic, you've done a really neat job with this! My only complaint would be the sudden speed at which the pulled bridges come down but I assume this is because there's no other way of doing it.
     
  11. Tiller

    Tiller

    Member
    836
    0
    16
    HDK & World Runner
    Awesome. Ya did good with all the repurposed and new stuff linking into Mystic Cave's gimmicks on top of looking quite nice. One thing that this stage doesn't do that Generations did was upscale nearly everything so that things are bigger and wide open. It keeps things similar to Sonic 2's scaling if that makes any sense, but in comparison it feels more restrictive and tight than other Generations stages. It's just a shame that Classic Sonic's everything feels so entirely off in comparison to what the actually classics control like. Because of the condensed nature of the stage the overpowered spindash gets you into more trouble than it's worth unless you tap your inner Paraxade0. Though it seems appropriate given the cave trope. I was hoping for a little more 2.5 that the camera and 3D offers in the stage so it wasn't entirely from the 2D perspective. The only part that seems to experiment a little bit with it is the path at the end past the goal post.

    Hopefully you're planning on doing a modern rendition of the stage since you already have a number of assets. Mystic Cave's blue winding blue roads and rickety boards wrapped around stalagmites seem like it could be an entire stage like the start of Modern Chemical Plant only twisted and intertwined around a cave.
     
  12. JansenM

    JansenM

    Member
    117
    0
    16
    Devon, UK
    Generations mods
    The stage is actually scaled up when compared to the original, that's the thing. It seems it may need even more upscaling though, otherwise it's just going to be a pain to play in all foreseeable updates, and no trickery can solve the flaws of the engine in a level like this.
    The level is currently planned to shift its rotation (plane on which you're moving, whatever) three times, giving the stage as a whole an overall curved layout. Two are featured in this build - after the first spike staircase, the player travels along a curve when travelling down the slope (also the platform above continues on straight which I thought would be a nice addition, but it's not too obvious), and as you said, the goal post area (which will be the halfway point of the level eventually) also curves. There'll also be little secrets which break out of the strict 2D plane so expect a little variation at least.

    Thanks for the ideas for the modern stage! I've got a bunch of my own as well as concepts from other people, so I think a modern stage is feasible at some point in time.
     
  13. Falk

    Falk

    Member
    1,568
    0
    0
    Hot damn that background geometry is awesome. Gonna agree that it feels a little too cramped compared to the other classic stages in Generations.

    edit: were the mj samples really necessary in the music this just went from best mod ever to worst mod ever kill it with fire
     
  14. JansenM

    JansenM

    Member
    117
    0
    16
    Devon, UK
    Generations mods
    Yeah, the first thing I do's definitely going to be fixing the scale of the stage - followed by a bunch of other fixes both planned all along and in response to comments from people who've played.

    brb fetching fire
     
  15. Lanzer

    Lanzer

    The saber calls for its master... Member
    6,842
    0
    16
    Glendale, AZ
    Doing Stuff.
    http://www.youtube.com/watch?v=cNqhGefioVY

    http://www.youtube.com/watch?v=xNLVNp_U7sg

    Hmm, what are you 2 up to?...
     
  16. Twilightzoney

    Twilightzoney

    Tech Member
    353
    0
    16
    Elgin, IL And Hampshire
    Unleashed and Generations Stuff and Custom Works
    I've actually been working on Eggman Land since I've had some free time when not doing some things for others. I'm just making a basic layout tweaking to make the level beatable then will continue on from there improving everything for a release. I haven't touched the werehog parts yet though, still thinking about what I can do for those areas.
     
  17. Falk

    Falk

    Member
    1,568
    0
    0
    It's amazing how much shadows/lighting can salvage flat terrain.
     
  18. Paraxade

    Paraxade

    Member
    186
    0
    0
    I like how Melpontro just posted a video of something random he made to practice modeling environments and everyone thinks it's a stage.
     
  19. Falk

    Falk

    Member
    1,568
    0
    0
    I dunno, I can sorta understand considering the bar in the past year or so has been pretty damn low.
     
  20. Lanzer

    Lanzer

    The saber calls for its master... Member
    6,842
    0
    16
    Glendale, AZ
    Doing Stuff.
    I didn't figure it was a stage but I do figure hes up to something with all that custom modeling work.

    @Twilightzoney: What about puzzle platforming? y'know to make up for the fact that the stage design was made for action platforming?