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
    Alright, so some more research into GIA.

    Apparently GIA maps in the game are:
    • A regular lightmap
    • A shadow map baked into the alpha channel.

    I knew about the first one, but I just discovered the second one. The game uses the alpha channel as a multiplier to the lighting when it's calculated. Apart from that, there's another parameter in SceneEffect.prm.xml:
    Code (Text):
    1.   <ShadowMap>
    2.     <Category>
    3.       <Common>
    4.         <Param>
    5.           <Ambient_Shadow_Bias_Object>0.3</Ambient_Shadow_Bias_Object>
    6.           <Ambient_Shadow_Bias_Terrain>0.3</Ambient_Shadow_Bias_Terrain>
    7.           ....
    8.         </Param>
    9.       </Common>
    10.   </ShadowMap>
    This one apparently is the extra shadow control for the object's and sonic's shadow. If you remove this or replace it with zero, no extra ambient lighting will be added. This is important, because it will control how much of the object's shadow can be seen on GIA shadows. If you want full blending, it should be removed.

    Anyway, on to some more technical explanations. I mentioned it uses a lightmap and shadowmap baked into the alpha, but that doesn't mean every renderer can do that. Most renderers are likely to be able to just do the following. Consider this scene rendered in Max:
    [​IMG]

    If I render out the lightmaps for the floor in 512x512, I get the following:
    [​IMG]
    Notice how the lightmap should be really bright since shadowing is done later on by the other map. Otherwise you'll get overly dark areas.

    Now, if I render out the shadowmap instead(by setting up VRay to only render shadows, no extra effects, and overly bright and dark multipliers):
    [​IMG]

    So some quick coding later on, I do an application which merges the average greyscale value from the shadow map into the lightmap's alpha channel, so the game reads it correctly.
    (Light blue is alpha=0, fully transparent)
    [​IMG]

    These new GIA maps, coupled with the ambient lighting edit, produces the next result on that stage:


    Notice how the shadows blend properly. The resolution is controlled by the renderer. Since the maps I did are just 512x512, they're a bit jaggy. Of course with more tweaking something even better looking can be done. For now, there's just one more step added to GIA rendering. Which is shadow map rendering, and for VRay users it's easy because it lets you save and load presets on the fly.

    So to sum up, proper GIA support may be coming later on, but it will have to wait until I can code the Downsampler/per GIA level pass so they're properly implemented inside the game, with the different texture ranges for the stage. (Plus merging the smaller textures into bigger ones and saving up texture space).
     
  2. Dude

    Dude

    Tech Member
    3,138
    0
    16
    Southbridge, MA
    Random VR/AR trash
    That is so cool! I'm glad you figured it out.
     
  3. LesbianPonyArmageddon

    LesbianPonyArmageddon

    Member
    11
    0
    0
    New Zealand
    Pissing around with Generations files.
    Oh god, what's the name of that song? It sounds awesome ;A;

    (kickass work on the lightmaps, by the way. that's pretty.)
     
  4. JaxTH

    JaxTH

    Pudding Deity Oldbie
    10,370
    591
    93
    Los Angeles
    Jack shit.
    It's Arid Sands (Night).
     
  5. Blivsey

    Blivsey

    Charismatic Sonicaholic Member
    Coulda sworn it was Skyscraper Scamper (Night), but you're right. Although they sound waaaaay too damn similar.
     
  6. Polygon Jim

    Polygon Jim

    Eternal Tech Member
    0
    3
    0
    across town from Hinchy
    All the bitches.
    Hey Dario, you should be cool and make the exporting function from SGLvl actually useful. Like I don't know, give it UV mapping support please? Also, is there a reason that I can't do any model imports over Planet Wisp? When I try I just get an endless loading screen, am I doing something wrong?
     
  7. Dario FF

    Dario FF

    Tech Support Hotline Tech Member
    We were using the exporting function up to this point just for re-modelling collision, but I've pushed it away due to not being sure what format to export to! There's also the issue 3DS doesn't support names past the 8 character limit(internal and group names). I was thinking about OBJ but it can be really expensive to load. Some people mentioned the DAE format but I'm not sure. If you have any easy-to-implement model formats suggestions that support most of the material needs and up to 4 UV channels, I can do it.

    And about Planet Wisp, I haven't looked into it, but Zoney had the same issue once. I'll give it a try...
     
  8. Polygon Jim

    Polygon Jim

    Eternal Tech Member
    0
    3
    0
    across town from Hinchy
    All the bitches.
    DAE would be a good format to go with. It has wide support with most modeling programs and should support everything needed.
     
  9. Falk

    Falk

    Member
    1,570
    15
    18
    All the night themes are based on big band in some form or another. I personally kept mixing up Apotos night and Empire City night myself on the first playthrough. But yeah, Arid Sands is a sweet track.
     
  10. Lobotomy

    Lobotomy

    35% Cognac Banned
    4,394
    1
    0
    Traverse City
    Project: Matter/Energy
    So would you guys hate me if I attempted porting Sonic UnWiished daytime levels and polished them up by scaling them down a bit, smoothing the geometry, and using the big boy console version textures, physics objects and not completely shit gameplay?

    Would you also hate me if I said I needed help and am actively recruiting people to take on a project of this magnitude?

    I need someone who's at least capable of effectively using 3dsMAX 2011 with VRay, Maybe a little ZBrush and SonicGLvl. Leave your application in my inbox.
     
  11. CrashSG32

    CrashSG32

    20
    0
    0
    Australia
    Project Crash & Generations Hacking
    Uh oh... I broke my Sanic Generashions - Green Wave Mess Zone Act 2:

    http://www.youtube.com/watch?v=zS8m6yZOGQs&feature=youtube_gdata_player

    There's more I managed to accomplish/brake and I'll edit this when I upload (flying with broken spindash anyone? ;))
     
  12. Turbohog

    Turbohog

    Member
    929
    118
    43
    I definitely wouldn't mind. I was thinking about trying to do one of the daytime levels myself, but then I realized I don't have the necessary tools to convert the unWiished models...anyway, I say full steam ahead good sir!
     
  13. Lobotomy

    Lobotomy

    35% Cognac Banned
    4,394
    1
    0
    Traverse City
    Project: Matter/Energy
    After doing some research, it seems the only way to acquire the level data is either through some fantastical luck or by dumping the PS2 version. Either way, this is already proving to be difficult.
     
  14. Turbohog

    Turbohog

    Member
    929
    118
    43
    After extracting onez and one files, I got .gno files, which I believe are the model files used in the game. Someone made a tool to extract/convert it, but the tools are private. Doesn't the PS2 version have the same model format?
     
  15. Dario FF

    Dario FF

    Tech Support Hotline Tech Member
     
  16. Turbohog

    Turbohog

    Member
    929
    118
    43
    Your attention to detail is amazing Dario; I've said it again and again, but great work!

    ...also, I might just be stupid, but is there no way to change Sonic's start position in levels yet? Sorry if this is obvious...
     
  17. Lobotomy

    Lobotomy

    35% Cognac Banned
    4,394
    1
    0
    Traverse City
    Project: Matter/Energy
    Stage.stg.xml. First three parameters.
     
  18. Truner

    Truner

    Member
    Dario FF:
    Are you that used to the Modern Sonic controls or is he really that smooth on open fields?
    Is there any way to change how he controls on just one level, or if you change it, it will be like that on all the levels? I don't remember him running fast on the Unleashed City maps.
     
  19. Dario FF

    Dario FF

    Tech Support Hotline Tech Member
    He's fine on big maps, the drifting really helps a lot. Then again I'm really used to the controls as well, so I can't really say now.

    The game supports overriding previous files in sub-files. Even better, with XMLs, you can override just a few parameters if needed. So you can just change say, the speed cap or the gravity easily per level if needed.
     
  20. Truner

    Truner

    Member

    Thank you for the answer.
    I'm asking all these because I thought about having different set of levels from each era. But for a... let's say Sonic Xtreme level, the in-stage Sonic physics would work, while Unleashed city ones would.
    Well, it's not that I want to do anything just that, but I was caught in a trail of thoughts.