don't click here

SADX/SA1 Hacking/Modding

Discussion in 'Engineering & Reverse Engineering' started by MainMemory, Aug 15, 2009.

  1. MainMemory

    MainMemory

    Kate the Wolf Tech Member
    4,757
    341
    63
    SonLVL
    Ugh. Why am I so bad at noticing Floats? Gravity isn't a Word at 03B0F0FE, it's a Float reading '-1' at 03B0F0FC!
     
  2. Endri

    Endri

    Officer I don't have my drivers license with me. C Tech Member
    About the shield...

    If you get a shield (a normal shield, didn't test the other) and modify the bite value for it's effect, you can toggle it on and off at will, but only if you had previously picked one in the that level before. I think that may be what got me confused. If you get hurt and lose this shield, however, you can't toggle it on anymore using the address table, unless you pick another in the game.

    Damn!
     
  3. MainMemory

    MainMemory

    Kate the Wolf Tech Member
    4,757
    341
    63
    SonLVL
    Just like the old games. The shield is probably a separate object... but then why can you change its size in your object data?
     
  4. Sik

    Sik

    Sik is pronounced as "seek", not as "sick". Tech Member
    6,718
    1
    0
    being an asshole =P
    Maybe there is some kind of generic structure for model data?
     
  5. MainMemory

    MainMemory

    Kate the Wolf Tech Member
    4,757
    341
    63
    SonLVL
    'Model Address' is better described as 'Animation Address'. Every 16 ($10) bytes is an animation starting with a pointer to an address in chrmodels.dll ($10000000). I copied the second pointer over the first and Sonic repeatedly played the 'Transition to surfer stance' animation when standing. Editing these addresses could give us better model swaps that don't freeze/glitch horribly.
    Edit: I edited the SADX SCHG article to link to mine.
     
  6. Polygon Jim

    Polygon Jim

    Eternal Tech Member
    0
    3
    0
    across town from Hinchy
    All the bitches.
    So, something I just remembered about the Dreamcast version, and why it crashes at any attempt at turning into Super Sonic.

    In SADX all character models are stored in CHRMODELS.DLL, which means the file is always loaded at all times. The Dreamcast version on the other hand has the main character models/objects in 1ST_READ.BIN while Super Sonic is in the file STG12.PRS, which is the Super Sonic level itself. That presents a bit of a problem.
     
  7. MainMemory

    MainMemory

    Kate the Wolf Tech Member
    4,757
    341
    63
    SonLVL
    On the animation format, it seems that byte $4 is usually $49, and if byte $5 is $4, when the animation finishes it will change to the animation specified in byte $6. If byte $5 is $3, the animation will repeat.
    Edit: Setting byte $B to $C0 or above makes you invisible.
    Setting byte $5 to $2 makes the character stand straight up, not moving, with arms and legs pointed straight down.
    Edit2: Disregard byte $B. $8 is transition speed Float, and $C is animation speed Float.
    Edit3: I hit refresh and suddenly I'm a tech member!
     
  8. Graxer

    Graxer

    Member
    It's amazing to see that SADX hacking is becoming even more awesome! With the addition of an aura, and possibly spin dashing this could be an amazing chance to really play Super Sonic in DX.

    Could you please stop using sharebee for your files, the particular ad I got when trying to use it gave me a virus. :(
     
  9. MainMemory

    MainMemory

    Kate the Wolf Tech Member
    4,757
    341
    63
    SonLVL
    Edit2: Super Sonic can not spindash. He lacks a Spindash action.
    Edit: Object Editor moved to first post.
     
  10. Endri

    Endri

    Officer I don't have my drivers license with me. C Tech Member
    I could almost picture a solution for this.

    I'm gonna d/l the DC version to see what I could be done. The DC version is the one that interests me the most.

    We kind of see that coming, now, didn't we? :P Yet, Polygon Jim and I aren't, though... u_u

    First. The Object Editor returns a 0 variable for every field in the proggy.
    Second. Oh... that's why, then. However it still returns 0 values even for the first object in the level data file.
    Third. What do you mean? I can't understand...



    Answering what you asked in the Youtube video:

    There are two approaches.

    What I did was, instead of chaging Sonic's action to switch to Super Sonic, I made Sonic load the Super Sonic animations, while still been Sonic (Actions 70 and under), adding '133' to Sonic's animation if the Super Sonic bitflag is checked. So he remains with Sonic's actions. Moreso, I made Sonic use the Super Sonic actions, instead of trying to make the opposit, which would require more time and effort. So, technically, yes, Super Sonic could spindash and roll like Sonic. But I just made Sonic use SS's actions for the sake of looking authentic.

    The other approach involves modifing the collision interactivety with the object, but the approach mentioned before is less time consuming, and delivers a better result, since you don't have to heavily interfer with the codding. Besides, you would need to literally disassembly the main "sonic.exe", though most of the variables would be almost impossible to figure out.
     
  11. MainMemory

    MainMemory

    Kate the Wolf Tech Member
    4,757
    341
    63
    SonLVL
    Okay, so you're hacking it beyond doing what the game does for Super Sonic. Also, I finished the editor, but I'm too lazy to make lists for anything other than Hedgehog Hammer and Emerald Coast. If you try another level, it will crash. Also, Get Properties takes your current position and copies it to the Property fields for rockets and dash hoops.
     
  12. Endri

    Endri

    Officer I don't have my drivers license with me. C Tech Member
    Yeah, because the Super Sonic gameplay would be broken otherwise, since there are many things that he can't do normally. If you think about it, there many, many places that must be fixed, namelly, the icycles in Ice Cap, Ice Cap is unbeatable without the Lightspeed Dash, Windy Valley is unbeatable without the number pannels, Super Sonic cannot snowride, Lost World is unbeatable if you can't how objects, etc... etc... So that's why, in order to have a fully playable Super Sonic in the normal levels, extreme codding is necessary. Not that this is a good thing either, since it just proofs that Super Sonic wasn't ready and isn't suitable to be playable in the normal levels at all.

    Regarding your reasearches, looking for the aura address for Super Sonic in the Perfect Chaos fight would led me into pointers, that you point into another pointer, that, again, would led me into another pointer, and so on, so on. It's kind of difficult. Also, apparently his aura is a independent entity, and that the Sonic object is attached to it. He only has his super powers when the aura is active. When it is inactive, his acceleration, max speed, etc are the same of the ordinary Sonic.
     
  13. MainMemory

    MainMemory

    Kate the Wolf Tech Member
    4,757
    341
    63
    SonLVL
    I'm not sure about that. The flag makes him invincible and the acceleration value is increased during the Perfect Chaos fight. I think the aura is simply an object displayed over Sonic like the shields and invincibilty sparkles and doesn't affect gameplay. A lot of stuff in this game is very similar to S3K. All the pieces are loaded separately and you have to do 5 different things to get what you want.
     
  14. Endri

    Endri

    Officer I don't have my drivers license with me. C Tech Member
    Maybe so, then again...

    Do the following:

    When the Perfect Chaos fight starts, and Sonic starts falling, disable the Super Sonic flag. Re-enable it before Sonic hits the water, so the aura is deactivated, but you are able to play as Super Sonic. Walk, run, jump, and you will see what I mean.

    Do you know what address plays the sound effects? Or, do you know anything related to sound effects?
     
  15. MainMemory

    MainMemory

    Kate the Wolf Tech Member
    4,757
    341
    63
    SonLVL
    His acceleration definitely decreased. But that could be because the level has extra code that runs when the Super Sonic flag is deactivated. I could check what writes to the acceleration address when that happens. And I don't know anything about sound effects. Maybe near the music address?
    Here's the code near that:
    Code (Text):
    1. 004942D0 - 8b 44 24 04                - mov eax,[esp+04]
    2. 004942D4 - 56                         - push esi
    3. 004942D5 - 8b 70 2c                   - mov esi,[eax+2c]
    4. 004942D8 - 8a 0e                      - mov cl,[esi]
    5. 004942DA - 88 4c 24 08                - mov [esp+08],cl
    6. 004942DE - 8b 54 24 08                - mov edx,[esp+08]
    7. 004942E2 - 52                         - push edx
    8. 004942E3 - e8 18 d8 fa ff             - call 00441b00; load pointer into eax
    9. 004942E8 - 83 c4 04                   - add esp,04
    10. 004942EB - 85 c0                      - test eax,eax; test someting
    11. 004942ED - 74 25                      - je 00494314; and skip to pop esi if equal
    12. 004942EF - 8b 4e 04                   - mov ecx,[esi+04]
    13. 004942F2 - 89 88 ac 00 00 00          - mov [eax+000000ac],ecx; Change Value at $AC?
    14. 004942F8 - 8b 56 08                   - mov edx,[esi+08]
    15. 004942FB - 89 90 d8 00 00 00          - mov [eax+000000d8],edx; Change Ground Acceleration
    16. 00494301 - 8b 4e 0c                   - mov ecx,[esi+0c]
    17. 00494304 - 89 88 dc 00 00 00          - mov [eax+000000dc],ecx; Change Air Acceleration
    18. 0049430A - c7 80 1c 01 00 00 cd cc ac 40 - mov [eax+0000011c],40accccd; Change Y Offset
    19. 00494314 - 5e                         - pop esi
    20. 00494315 - c3                         - ret
     
  16. Endri

    Endri

    Officer I don't have my drivers license with me. C Tech Member
    I don't know. Many things in SADX looks hardcoded. Namelly, the very Perfect Chaos fight. There are redundant codes over and over and over. (Pleonasm FTW)
     
  17. MainMemory

    MainMemory

    Kate the Wolf Tech Member
    4,757
    341
    63
    SonLVL
    I just followed some of the code, and it looks like there's a pointer table at $A000000. I also found a pointer that when zeroed disabled the aura (super speed and invincibility intact) and made me go right through Perfect Chaos like he wasn't even there.
     
  18. PicklePower

    PicklePower

    Wiki Sysop
    632
    26
    28
  19. Sik

    Sik

    Sik is pronounced as "seek", not as "sick". Tech Member
    6,718
    1
    0
    being an asshole =P
    I think he means the lists used by the editor itself.

    Also I wonder how many IDs listed as "nothing" there are actually objects. Morph went crazy fixing that some time ago for a couple of levels.
     
  20. MainMemory

    MainMemory

    Kate the Wolf Tech Member
    4,757
    341
    63
    SonLVL
    I'm working on the rest of them. I made a quick program to convert the wiki text. I would upload one now, but the board won't let me. I'll just make a new zip later.
    Edit: Wow, there are 16 objects in Speed Highway not on the list.
    Edit2: And now I can't edit the wiki.
    Edit3: Fixed.
    Edit4: 30 Unknowns for Red Mountain.
    New levels for the editor!