don't click here

Sonic Adventure 2 Hacking

Discussion in 'Engineering & Reverse Engineering' started by Turbohog, Feb 20, 2012.

  1. MainMemory

    MainMemory

    Kate the Wolf Tech Member
    4,749
    340
    63
    SonLVL
    It exists in the PC version as well, at 0x1313A74, it's part of an array of model pointers, but nothing appears to reference that particular model.
     
  2. CheatFreak

    CheatFreak

    Catgirl expert. Member
    During my efforts to figure out why city escape is broken on my graphics card- I got sick of having to navigate to the mod loader manually to tick/untick mods/codes so I made something you guys may like.

    While I haven't found a solution to my issue- I did grab a source for another game launcher and forked it to make something pretty nice and much more convenient- so here it is for you guys.
    [​IMG]

    Just a simple launcher for the Steam SA2B.
    To install it, download it, open the steam folder, rename the existing launcher.exe to config.exe, and drop this in there. You should probably have the SA2B Mod Loader there too, but I think that goes without saying.

    src
     
  3. MainMemory

    MainMemory

    Kate the Wolf Tech Member
    4,749
    340
    63
    SonLVL
    Personally, I just replaced the normal launcher with the mod manager. I would add a config editor to the mod manager like I did for SADX, but I'm not entirely sure how...
     
  4. CheatFreak

    CheatFreak

    Catgirl expert. Member
    Well the configs are saved in the folder called config- they seems to be basic XML files.

    the userconfig.cfg is easy enough to figure out, and it's a lot more important than the keyboard one.

    Code (Text):
    1. <?xml version="1.0" ?>
    2. <Configs FullScreen="0" Display="0" Res="0" Width="800" Height="600" RefreshRate="60" Language="0" Analytics="0" />
    • Fullscreen is 0 or 1, on or off.
    • Display is either what graphics device and monitor it uses. It's almost always 0 though because most people have 1 display and 1 graphics device so there isn't much room for options there.
    • Res is essentially useless- tells the config tool which preset resolution to show.
    • Width and Height are surprisingly fully customizable, it will accept and try to function with any resolution.
    • Refresh rate is as it is, whatever refresh rate your monitor should use, seems to usually be 60 sometimes 59 if your monitor supports it.
    • Language is language, numbers 0-5 same order as the the config tool lists.
    • Analytics presumably enables sending play data to sega.

    As for the keyboard.cfg I managed to figure out some of this-

    Code (Text):
    1. <?xml version="1.0" ?>
    2. <Setup Layout="0" />
    3. <Players>
    4.     <Player InputWay="0" Vibrate="0">
    5.         <key index="22" />                        <!--Up-->
    6.         <key index="18" />                        <!--Down-->
    7.         <key index="0" />                          <!--Left-->
    8.         <key index="3" />                          <!--Right-->
    9.         <key index="8" />                          <!--Switch: Yellow-->
    10.         <key index="9" />                          <!--Jump: Green-->
    11.         <key index="20" />                        <!--Action: Blue-->
    12.         <key index="10" />                        <!--Action: Red-->
    13.         <key index="25" />
    14.         <key index="16" />                        <!--Rotate Camera Left-->
    15.         <key index="37" />
    16.         <key index="23" />
    17.         <key index="4" />                          <!--Rotate Camera Right-->
    18.         <key index="37" />
    19.         <key index="27" />
    20.         <key index="67" />                        <!--Start-->
    21.     </Player>
    22.     <Player InputWay="0" Vibrate="0">
    23.         <key index="83" />
    24.         <key index="65" />
    25.         <key index="73" />
    26.         <key index="79" />
    27.         <key index="102" />
    28.         <key index="98" />
    29.         <key index="101" />
    30.         <key index="99" />
    31.         <key index="66" />
    32.         <key index="104" />
    33.         <key index="37" />
    34.         <key index="76" />
    35.         <key index="105" />
    36.         <key index="37" />
    37.         <key index="28" />
    38.         <key index="111" />
    39.     </Player>
    40. </Players>
    41.  
    • Setup Layout is whether or not the keyboard is Qwerty(0) or Azerty(1)- I think it's maybe only for the config editor
    • Input Way Is Rather Important- it determines if you'll use an Xinput Gamepad or the defined controls below. 0 = Keyboard 1=Gamepad (Not sure if more gamepads means more numbers-- I only have one pad here)
    • Vibrate is self explanatory.
    • The first player section is P1, the second is P2.
    • As for the key index entries- I managed to figure out the ones listed in the config and noted them in above- I haven't the slightest clue what the other 5 are, they never change.

    Hopefully this information is of some use to you.
     
  5. MainMemory

    MainMemory

    Kate the Wolf Tech Member
    4,749
    340
    63
    SonLVL
    I still don't have the slightest clue what the key index values mean. They're not the normal Windows virtual key codes, the "Start" value there would map to the C key.
     
  6. Turbohog

    Turbohog

    Member
    933
    119
    43
    Okay so I just spent a lot of time skimming through 50+ pages of this topic. I've made a list of notable tools and mods on the first post. If you think I should add/change anything, send me a message. On another note, I'm going to look back into the mlt files shortly. I'm getting a new computer any day now, which means I'll actually be able to run SA2.
     
  7. Turbohog

    Turbohog

    Member
    933
    119
    43
    Double Post.

    I dug through my old drive to find out how I extracted the MLT files from the Dreamcast version. I made a zip of it with instructions a couple of years ago, but apparently I forgot to upload it. Here it is:
    https://mega.co.nz/#!SoUS2DRK!4jRRfm-b3qd3O2Z1PKiW0kSmnzPjPElYTd0qqxpvJCE

    Note that I do not know which mlt files this will work with. I haven't tried them all. The only one I know works is E_TEST.MLT. Post your findings on all of this stuff. Also, on a related note, has anyone managed to unpack and pack the csb files that the pc version uses?
     
  8. MainMemory

    MainMemory

    Kate the Wolf Tech Member
    4,749
    340
    63
    SonLVL
    Yeah, the same CSB tools you'd use for Generations (or other modern games) work here.
     
  9. Turbohog

    Turbohog

    Member
    933
    119
    43
    Ok great. I'm not up to date on Sonic Generations hacking so I didn't know.
     
  10. Dark Sonic

    Dark Sonic

    Member
    14,631
    1,611
    93
    Working on my art!
    Hey, so question. SA2 keeps crashing every couple minutes, occasionally coming back to life after a few seconds, but it just makes all graphics stop on my computer and then my graphics driver says it has crashed and has successfully rebooted. Only SA2 causes this, anyone know the reason why it might be doing this?

    I have a gtx 680 graphics card btw. Also it's worth noting that it seems to only do it in variations of 1920 x 1080 mode. 1280 x 720 windowed has given me no trouble this morning
     
  11. Turbohog

    Turbohog

    Member
    933
    119
    43
    I've had a somewhat similar problem with my laptop. When I run the game in fullscreen mode it crashes after the Sonicteam logo. Is your gpu a laptop gpu or a desktop? I know the problem with mine has something to do with the fact that my laptop tries to run SA2 with my integrated gpu instead of the dedicated one.
     
  12. Retroman

    Retroman

    Member
    733
    2
    18
    Here are the solutions:
    1. Disable the in-game steam community overlay
    2. Run the shortcut/sa2.exe as admin (Right-Click, Properties, Compatibility Tab, under Privilege Level, check 'Run this program as an administrator' and press ok.
    3. Update on-board and dedicated graphics cards and then follow this here: http://www.howtogeek.com/175281/how-to-force-graphics-options-in-pc-games-with-nvidia-amd-or-intel-graphics
    4. Close any overlaying programs, for example, fps showing or video capturing tools like EVGA precision, Dxtory & see if you can delay it 'hooking' itself to the program. Dxtory has a delay setting which you can set for 10 seconds.
    5. Update DirectX
    6. Change resolutions, run in windowed mode.

    Most likely 1. and 4. are the real culprits and will work for you, depending if your system is up-to-date.

    Source: Google. Thank me later :v: :)
     
  13. Turbohog

    Turbohog

    Member
    933
    119
    43
    I know how to google too. I've done all of that. The only thing that works is windowed mode. Thanks though.
     
  14. MainMemory

    MainMemory

    Kate the Wolf Tech Member
    4,749
    340
    63
    SonLVL
    It may be possible for the mod loader to enable a "windowed fullscreen" like SADX's even though I can't hijack the actual window creation. I'll look into it when GerbilSoft finishes refactoring it.
     
  15. Retroman

    Retroman

    Member
    733
    2
    18
    Your welcome.

    Why not try to reinstall it? If you have a registry cleaner, it messes things up because registry cleaners are garbage, and snake oil. Microsoft themselves don't recommend it, even going so far as to say to stay away from it. It's just a fad.
     
  16. SF94

    SF94

    Tech Member
    http://www.youtube.com/watch?v=M3V98bViX1I

    I'm gonna have some fun with this.

    Edit: The object that does this is 0x3B, by the way.
     
  17. Sappharad

    Sappharad

    Oldbie
    1,419
    70
    28
    This was possible on GC via Action Replay, and the memory address responsible works in every stage.
    If it helps find the same thing on PC, here is the relevant info from my notes on the GC version:

    Start 801E5624
    Down: 0000000 BF800000 0000000 (Normal gravity)
    Up: 0000000 3F800000 0000000
    Left: 0000000 0000000 BF800000
    Right: 0000000 0000000 3F800000
    Away from screen: 3F80000 0000000 00000000
    Towards screen: BF80000 0000000 00000000
     
  18. SF94

    SF94

    Tech Member
    Well, I found it in memory, but it doesn't behave the same as it does in Crazy Gadget (tested in City Escape). For example, with flipped gravity, Sonic doesn't actually flip upside-down; he sorta just falls up. Then when on a ceiling, the jump tries to correct itself, and so you get this weird arc thing going on. Same with horizontal gravity.

    Edit: it's at 0x01DE94A0
     
  19. Liliam

    Liliam

    Oldbie
    1,563
    117
    43
    A bit late to the party, but as an aside, the crate objects in this stage are a different set of objects that react to the current gravity direction. I did some research on this when making my hack (for Shadow's Hard layout) and they actually specify how far they can "fall away" from their origin point somewhere in their parameters. I don't know any of the specifics anymore because I'm a dumbass who doesn't document anything, but you should be able to get the gist of it if you look at the stuff I changed in the SET file.
     
  20. SF94

    SF94

    Tech Member
    Welp, we got the gravity figured out. Just before and just after the typical 3 floats for the gravity vector are two integers. The first is X, and the latter Z. They're the direction of gravity in BAMS, where 0 is down, and non-0 is, well, not down. It's the same in SADX as well, and MainMemory just released a gravity control mod as a result.

    That's good to know. I'm assuming the distance is set in the last three floats at the end of the object definition.

    Also, in other SA2 related hax news, I ported Tails's SA1 physics parameters to SA2 for mechless Tails.
    http://www.youtube.com/watch?v=nIKymOkmjJ8

    It's not quite done yet though. I'm not satisfied with the flying speed, and it's definitely not in this structure I ported over. That means it's in the Tails-specific structure, and it's as of yet undocumented. I'll figure it out eventually, though.