don't click here

Sonic Generations Hacking (and More!)

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

  1. GeneHF

    GeneHF

    SEGA-ier than you'll potentially ever be. Site Staff
    8,429
    59
    28
    Scenic Studiopolis
    Complete Global Conquest
    That's what happens when you have people with Photoshop and Illustrator who suddenly think they're professional designers. There are several more effective (and cleaner) hud choices to make, and I can think of a few that utilize that tribal logo motif from Shadow's game.

    But this isn't the topic for that (nor can I be arsed to actually put something together like that.)

    I'm not too hopeful on Colors stages on Generations' engine aside from maybe a handful. For instance, Asteroid Coaster? Not happening because of the rollercoasters and that one midboss with gravity alteration. Aquarium Planet? Doable, but with how expansive the underwater sections are to facilitate Underwater Drill, things could get problematic (and painfully slow) if bubble positions can't be changed among other things.

    If anything, more basic stages like Sweet Mountain, Tropical Park or Planet Wisp are going to happen. Or the team can pull a grand troll and only import Straight Line Z—Terminal Velocity. :v:
     
  2. KuroBit

    KuroBit

    Member
    38
    0
    0
    For levels like Asteroid Coaster, could we not simply skip areas of the level with use of springs and/or teliporters? Sure it would severely cut down on the length of the level, but eh, I don't know. Someone could also completely rework an area of a stage if they where really feeling creative.
     
  3. Korama

    Korama

    Tech Member
    272
    2
    0
    Even if you've heard it before a hundred times already: fantastic work, Dario!

    I actually looked into that, but I didn't get anywhere and feel like I just wasted my time. The CRI filesystem stuff is quite complex, and multithreaded, which makes reversing it a terrible chore. There's an old version of the CRI "FileMajik" SDK for PC around, but it's of little help as so much has changed in the version used by Sonic Generations. The game uses an awful lot of CRI libs, here's a list of build strings I extracted from the exe, if someone's interested:
    ADXDSOUND8/PCx86 Ver.1.04 Build:Apr 8 2010 14:18:14
    CRI ERR/PCx86 Ver.1.01 Build:Apr 8 2010 14:18:05
    SVM/PCx86 Ver.1.68 Build:Apr 8 2010 14:18:00
    XECI/PCx86 Ver.1.84 Build:Apr 8 2010 14:18:00
    CVFS/PCx86 Ver.2.60 Build:Apr 8 2010 14:18:05
    MFCI/PCx86 Ver.1.24 Build:Apr 8 2010 14:18:02
    ADXPC(PRO) Ver.1.76 Build:Apr 8 2010 14:18:12
    ADXDS Ver.0900 Build:Apr 8 2010 14:18:12
    ADXT/PCx86 Ver.11.05 Build:Apr 8 2010 14:18:13
    MCRNA Ver.2.06 Build:Apr 8 2010 14:18:02
    CRI CRW:WIN/PCx86 Ver.0.83 Build:Apr 8 2010 14:18:06
    CRI CRS/PCx86 Ver.1.03 Build:Apr 8 2010 14:18:06
    CRI DLG/PCx86 Ver.1.15 Build:Apr 8 2010 14:18:05
    LSC/PCx86 Ver.2.32 Build:Apr 8 2010 14:18:04
    ADXF/PCx86 Ver.7.74 Build:Apr 8 2010 14:18:15
    SJ/PCx86 Ver.6.47 Build:Apr 8 2010 14:18:01
    SKG/PCx86 Ver.1.01 Build:Apr 8 2010 14:18:14
    AFAnalyzer/PCx86 Ver.1.00 Build:Apr 8 2010 14:17:59
    CRI Audio/PCx86 Ver.3.57.06 Build:Apr 1 2011 21:56:22
    CRI Sound Renderer/PCx86 Ver.1.05.00 Build:Apr 1 2011 21:56:15
    CRI AHX (CPP)/PCx86 Ver.1.90 Build:Apr 1 2011 21:56:23
    CRI Error/PCx86 Ver.1.03.00 Build:Apr 1 2011 21:08:23
    CRI Heap/PCx86 Ver.1.21.02 Build:Apr 1 2011 21:08:22
    CRI Critical Section/PCx86 Ver.1.00.12 Build:Apr 1 2011 21:08:21
    CRI C Runtime Wrapper/PCx86 Ver.1.02.00 Build:Apr 1 2011 21:08:23
    CRI Stream Joint/PCx86 Ver.1.01.00 Build:Apr 1 2011 21:08:21
    CRI ADX Decoder/PCx86 Ver.1.00.08 Build:Apr 1 2011 21:08:22
    HCA Decoder (Float) Ver.1.40 Build:Apr 1 2011 21:08:23
    CRI Base/PCx86 Ver.2.15.01 Build:Apr 1 2011 21:08:23
    CRI Thread/PCx86 Ver.1.01.01 Build:Apr 1 2011 21:08:22
    CRI UTF Retriever/PCx86 Ver.1.00.01 Build:Apr 1 2011 21:08:22
    CRI File System/PCx86 Ver.2.24.04 Build:Apr 1 2011 21:08:31
    CriFsBinder/PCx86 Ver.1.02.63 Build:Apr 1 2011 21:08:31
    CriFsGroupLoader/PCx86 Ver.1.00.73 Build:Apr 1 2011 21:08:31
    CRI CPK Analyzer/PCx86 Ver.0.99.32 Build:Apr 1 2011 21:08:31
    MWSFD/PCx86 Ver.5.00 Build:Apr 12 2010 13:11:28
    CRI SFD/PCx86 Ver.2.129 Build:Apr 12 2010 13:10:26
    CRI ASVD/PCx86 Ver.0.14 Build:Apr 12 2010 13:11:45
    CRI SFH/PCx86 Ver.2.25 Build:Apr 12 2010 13:08:44
    CRI SUD/PCx86 Ver.0.05 Build:Apr 12 2010 13:09:33
    CRI SFX/PCx86 Ver.2.49 Build:Apr 12 2010 13:09:50
    CRI MPS/PCx86 Ver.2.068 Build:Apr 12 2010 13:07:56
    CRI MPV/PCx86 Ver.2.067 Build:Apr 12 2010 13:08:18
    CRI FNO/PCx86 Ver.1.001 Build:Apr 12 2010 13:12:45
    CRI M2TSD/PCx86 Ver.2.066 Build:Apr 12 2010 13:08:28
    CRI M2PES/PCx86 Ver.2.066 Build:Apr 12 2010 13:08:29
    CRI M2T/PCx86 Ver.2.066 Build:Apr 12 2010 13:08:28
    CRI CFT/PCx86 Ver.2.17 Build:Apr 12 2010 13:09:45
    CRI DCT/PCx86 Ver.2.037 Build:Apr 12 2010 13:08:38
    AIXP/PCx86 Ver.3.20 Build:Apr 8 2010 14:18:08
    CRI CFG/PCx86 Ver.1.03 Build:Apr 8 2010 14:18:06
    MPASJD/PCx86 Ver.1.51 Build:Apr 8 2010 14:18:02
    M2ASJD/PCx86 Ver.1.32 Build:Apr 8 2010 14:18:03
    LPCMSJD/PCx86 Ver.1.00 Build:Apr 8 2010 14:18:05
    HEAPMNG/PCx86 Ver.0.92 Build:Apr 8 2010 14:18:05
    CRI Handle Manager/PCx86 Ver.1.00.07 Build:Apr 1 2011 21:08:23
    CRI LLDECOMP3/PCx86 Ver.0.90.04 Build:Apr 1 2011 21:08:22
    CRI Timer/PCx86 Ver.0.50.02 Build:Apr 1 2011 21:08:21

    Anyway, on startup, the game looks in these subfolders of "work" (if your language is set to English):
    Code (Text):
    1. work\Sonic
    2. work\Languages\English\Sonic\
    3. work\SonicVoice
    4. work\voices\English\SonicVoice\
    5. work\SonicClassic
    6. work\GameHint
    7. work\Languages\English\GameHint\
    8. work\SonicActionCommon
    9. work\SonicActionCommonHud
    10. work\Languages\English\SonicActionCommonHud\
    11. work\ActionCommon
    12. work\Languages\English\ActionCommon\
    13. work\DecorationText
    14. work\SystemCommon
    15. work\Languages\English\SystemCommon\
    16. work\ConverseCommon
    I extracted most of the respective .ar files from the bb?.cpks and placed the contents in these work folders. The game looks what files are present there, but as far as I can tell, they get never loaded. I could be wrong though, didn't check too thorougly. Maybe I shouldn't have unpacked the .ar archives, but I think it does expect extracted files...

    Given that the CRI filesystem calls in the exe are so complex and confusing, my first thought for an "easy" solution was to trap all ReadFile WinApi calls by Sonic Generations and redirect them to a specific folder, if some bb?.cpk content is being read. However, I don't know if that would be very useful, as most files in the CPKs are packed (.ar/.pfd). So, implementing something like this would save you from rebuilding the entire CPKs, but you'd still have to build the other archive files.
    If somebody wants to try and implement this idea, go ahead. I don't have as much time for hacking business these days as I used to, unfortunately.
     
  4. Dario FF

    Dario FF

    Tech Support Hotline Tech Member
    That would be incredibly useful. The way I build my tools so far already repacks all of that(except cpks obviously), the time isn't even relevant seriously! The CPK repacking is the most annoying thing by far and it completely cripples mod distribution of any kind. If you manage to bypass the CPK checks and just redirect it to a file directory it'd be all we need. Massive kudos would be in order as well. :thumbsup:

    Don't sweat it for bypassing AR files and PFDs. The game needs them for defining archive trees and doing fast searching of geometry inside the PFDs.

    EDIT: You as in general to whoever wants to try.
     
  5. DustArma

    DustArma

    Member
    1,337
    10
    18
    Santiago, Chile
    Learning Python.
    If that was the case then having a framerate cap of 60FPS rather than 30FPS would affect not just the walljump but Sonic's entire physics, nevermind that there's still the fact that the main version of Unleashed, the 360 version, was also created with 30FPS in mind yet the PS3 version which is capped at 60FPS doesn't suffer issues with the physics, nor specifically with its walljump.
     
  6. Falk

    Falk

    Member
    1,570
    15
    18
    I'm admittedly awful at explaining things, so let me take another shot at this.

    This is the theory:
    1) There is a physics parameter file that essentially defines how Sonic interacts with the world. Unleashed is developed to be compatible with 60fps, and all the parameters are set with that in mind. The X360 version gets capped to 30fps, but 'if it's broke, don't fix it', hence the parameter file is unchanged and remains compatible with 60fps. (Actual physics calculations obviously take into account dropped frames, or in 360's case, halved framerate)

    2) For Generations, both console versions are capped to 30fps. The physics parameter file was likely overhauled as part of tightening up Modern Sonic's controls, and since this new game only runs at 30fps, among other things the walljump parameters (e.g. how much vertical momentum is allowed before disabling sticking to a wall) were set with the assumption that you'd never have a check 1/60th of a second from (stationary Sonic + gravitational force) since this only happens at 60fps and is impossible at 30fps.

    3) The PC port is handled by an outsource, and this detail is overlooked, hence the 'cant happen' happens, resulting in Sonic's newfound ability to spaz out on walljump surfaces

    Symptoms:
    - Bug -only- occurs on the PC version
    - Replacing the parameter file with the Unleashed parameters makes the issue go away.

    edit: We're not talking about physics radically changing at different FPS. Sonic should travel the same distance regardless of if it's 60fps, 30fps or even 5fps on a dying PC. The engine takes care of the difference because engines -have- to be designed with frame drops in mind, I.e. all physics are based on how much time has elapsed since the previous think. What we're talking about is a parameter that is possible/impossible at those different framerates due to rounding errors and greater precision from higher FPS.

    And obviously this is all speculation on my part. I'm just defending my speculation on a base that it's something that -could- be happening rather than hogwash. I wouldn't be surprised if the actual cause was something else, to be honest.
     
  7. ezodagrom

    ezodagrom

    Member
    90
    0
    6
    Some progress about the PC version wall jump, in the Sonic.prm.xml file, changing the WallJumpReadyGravity parameter from 2.81 to 3 fixes the wall jump.
    3 is the minimum value for the wall jump to be fixed, while trying to find the minimum value I first tried to double the default value, 5.62, and then I started using lower values until I found the minimum value. All the values that I tried between 3 and 5.62 worked, while 2.99 didn't work.

    From what I tried so far, there's one place where the walljump is still broken, in the Egg Dragoon boss fight. For the Egg Dragon walljumps, I'm guessing the value that has to be changed is either in another parameter or in another file.
     
  8. Dario FF

    Dario FF

    Tech Support Hotline Tech Member
    There's another Sonic.prm.xml in the boss fight. Any files that are afterwards in the loading order (Configuration -> Sonic -> Stage) will override parameters on the previous ones. Not completely but it can override certain parameters of the XMLs.
     
  9. KuroBit

    KuroBit

    Member
    38
    0
    0
    Ah yes this was it! I could NOT remember the name of that value even though it was so obvious. It's interesting that it starts working EXACTLY on 3 though, I wonder if it's rounding the number somewhere (Like what Falk is saying?).
    I would assume that the boss fight overrides that value, setting it back to something close to 2.81, since wall jumping is a major part of that battle.
     
  10. ezodagrom

    ezodagrom

    Member
    90
    0
    6
    Managed to make it work in Egg Dragoon by changing the Sonic.prm.xml that is inside bb.cpk -> #bne.ar.00, it used the same 2.81 value in the WallJumpReadyGravity parameter, changed it to 3 like the other.

    EDIT: Made a small video comparing the walljump with the gravity value set at 2.81 and at 3:
    http://www.youtube.com/watch?v=CbVn27X8XRE

    Also, anyone knows what handles the mid-air somersault that happens at the top of the speed highway building? Just asking if anyone knows if it's a value in the same Sonic.prm.xml parameter file as the walljump, or if there's anything else than handles this. Like the walljump, this is bugged in the PC version, and, as seen in the video, Sonic lands upside down:
    http://www.youtube.com/watch?v=y7k0Fdc6gqM
     
  11. KuroBit

    KuroBit

    Member
    38
    0
    0
    This also happens when you try to get to Shadow in the HUB world. I'm not sure if this is a PC only issue though. (And actually, now that I think about it, it's a bit of a different situation I think)
     
  12. ezodagrom

    ezodagrom

    Member
    90
    0
    6
    The one in the HUB world, I have no idea if it also happens in the consoles or not, but the one in Speed Highway, it only happens on the PC, video from the 360 version, at 00:45:
    http://www.youtube.com/watch?v=KFvyoV0yZWI
     
  13. Turbohog

    Turbohog

    Member
    920
    116
    43
    Speaking of speed highway, I always get this awful camera glitch:
    http://www.youtube.com/watch?v=1GBSegPpW2g

    Sega should really patch these issues; they're easy enough to fix.
     
  14. Lanzer

    Lanzer

    The saber calls for its master... Member
    6,845
    3
    18
    Glendale, AZ
    Living life.
    If there easy to fix, why don't we patch these issues then? I mean sure SEGA should push the generations team to fix the issues but at this point I don't even think there bothering with Generations anymore. It very well may be up to us now...
     
  15. Twilightzoney

    Twilightzoney

    Tech Member
    353
    0
    16
    Elgin, IL And Hampshire
    Unleashed and Generations Stuff and Custom Works
    I never get these camera issues that you guys seem to be having when I play the PC. Also the upside down thing that that happens, used to happen in the old demo for Generations for Modern Sonic when in GHZ.
     
  16. SF94

    SF94

    Tech Member
    I only get that camera glitch when I boost right where the dash panel is. If I just land on it normally, the camera works fine.

    Edit: Screw you new page =|
     
  17. Dude

    Dude

    Tech Member
    3,138
    0
    16
    Southbridge, MA
    Random VR/AR trash
    I get that camera glitch pretty much every time I play. I've gotten camera glitches like that in my SADX hacks as well during development. I can see why they missed it. With the way levels are set up, there are so many paths to take and every possible playable volume needs to be accounted for. That's also the same reason they never made any wide-open playable areas in Sonic adventure / SA2.


    When I learn the camera system in the game bit better, I'll try my hand at fixing the speed highway glitch.
     
  18. Iggy for Short

    Iggy for Short

    Member
    813
    179
    43
    Could the Jungle Joyride teleport could be done with whatever was used in the Egg Dragoon battle? I'm not sure if anybody has figured out how to use that event/script/etc. in a normal stage, but if it can be solved, it'd probably be the best fit.

    Also, if you don't mind, there are some other questions I'd like to ask. (I apologize in advance if any of these have been answered in a place I haven't looked at yet.)

    • What are the general differences between how Sonic handles in Unleashed and how he handles in Generations? I can tell that the Generations drift is much sharper, but I'm still curious about possible differences in running speed, acceleration, handling while running on water, boost physics, etc.
    • Are any changes to Sonic's handling going to be necessary for the stages to be fully playable?
    • If you do actually use the challenge gate doors for the extra/DLC Acts, what would be done with the extra challenge gates (or stages that have more than 5 extra Acts, if that's the case for any of them)? Keep in mind that I don't know how many Day Acts there are on any given country, as I couldn't find any numbers online and don't own Sonic Unleashed (or either HD console to play it on) myself.
    • Do you plan on adding custom Super Sonic flight paths to the levels? For that matter, do you plan on making any tweaks to the way Super Sonic works in general?
    • Will the Unleashed mod be released simultaneously with your level editor, or will they come at separate times?

    Also, keep up the great work, guys!
     
  19. Falk

    Falk

    Member
    1,570
    15
    18
    Stomping cancels all horizontal movement for one. That's quite likely the biggest change to speedrunning other than the obvious nix of QSS/etc.
     
  20. Jason

    Jason

    *Results not lab tested. Member
    Based on the most recent video, it looks like the Air Boost is weaker, so things like grinding above the covered bridges in Chunan is far more difficult if not nigh-impossible. Placing some Dash Rings could fix most of those issues.