don't click here

Wall Jump in Sonic 1

Discussion in 'Engineering & Reverse Engineering' started by Mercury, Feb 3, 2011.

Thread Status:
Not open for further replies.
  1. MoDule

    MoDule

    Tech Member
    328
    32
    28
    Procrastinating from writing bug-fix guides
    Your jump is a tad strong under water. Might want to add a check for that.

    I'm also curious to see what it would feel like if you didn't let go of the wall after a while.
    I'll have to try that later...
     
  2. E-122-Psi

    E-122-Psi

    Member
    2,536
    729
    93
    By the way, for anyone who wants to use the original Knuckles Chaotix control scheme (hold jump button instead of direction pad), first go to Sonic_JumpHeight and change and add as such:


    Code (Text):
    1. Sonic_JumpHeight:        ; XREF: Obj01_MdJump; Obj01_MdJump2
    2.     ;Mercury Wall Jump        tst.b    $2C(a0); on wall?
    3.         beq.s    JmpToWJskip
    4.         move.b    ($FFFFF602).w,d0; get jpad
    5.         and.b    $2D(a0),d0; compare jpad to stored L,R button states
    6.         beq.s    WJAnyway    ; if still held, branch
    7.         move.b    ($FFFFF602).w,d0
    8.         andi.b    #$70,d0
    9.         bne.s    JmpToWJskip; if yes, branch
    10.         tst.b    ($FFFFFFA8).w    ; was jumpdash flag set?        
    11.         bne.w    WJAnyway        ; if yes, branch
    12.         move.b    #1,($FFFFFFA8).w; if not, set jumpdash flag
    13. WJAnyway:
    14.         move.w    #0,$2C(a0); clear Wall Jump data
    15.         move.b    #1,$3C(a0)
    16.         move.b    #2,$1C(a0); use "jumping" animation
    17.         btst    #6,$22(a0)    ; is player underwater?
    18.         beq.s    WJNotUnderwater    ; if not, branch
    19.         move.w    #-$400,d0
    20.         btst    #0,($FFFFF602).w
    21.         bne.s    JmpToWJuponly
    22.         move.w    #-$300,d0
    23.         move.w    #-$500,$10(a0)
    24.          jmp    WJ_Animate
    25. JmpToWJskip:
    26.         jmp    WJskip
    27. JmpToWJuponly:
    28.         jmp    WJuponly
    29. WJNotUnderwater:
    30.         move.w    #-$600,d0
    31.         btst    #0,($FFFFF602).w
    32.         bne.s    WJuponly
    33.         move.w    #-$400,d0
    34.         move.w    #-$700,$10(a0)
    35. WJ_Animate:
    36.         btst    #0,$22(a0)
    37.         beq.s    WJuponly
    38.         neg.w    $10(a0)
    39.         
    40. WJuponly:
    41.         move.w    d0,$12(a0)
    42.         move.w    #$A0,d0
    43.         jsr    (PlaySound_Special).l;    play jumping sound
    44.         
    45. WJskip:
    46.     ;end Wall Jump
    47.         tst.b    $3C(a0)
    48.         beq.s    loc_134C4
    49.         move.w    #-$400,d1
    50.         btst    #6,$22(a0)
    51.         beq.s    loc_134AE
    52.         move.w    #-$200,d1
    53.  
    54. loc_134AE:
    55.         cmp.w    $12(a0),d1
    56.         ble.s    locret_134C2
    57.         cmp.b     #1,($FFFFFFA8).w; check if bit 2 of the Air Attack flag is set
    58.         beq.s    locret_134C2; if yes, branch
    59.         move.b    ($FFFFF602).w,d0
    60.         andi.b    #$70,d0    ; is A,    B or C pressed?
    61.         bne.s    locret_134C2; if yes, branch
    62.         move.w    d1,$12(a0)
    63. locret_134C2:
    64.         rts...
    Then go to WallJump and change:

    Code (Text):
    1.         move.b    ($FFFFF602).w,d0; get jpad
    2.         andi.b    #$C,d0; keep just L and R state
    3.         beq.s    @return; fail if neither are pressed
    4.         cmpi.b    #$C,d0; fail if both are pressed
    5.         beq.s    @return
    into:
    Code (Text):
    1.         move.b    ($FFFFF602).w,d0; get jpad
    2.         andi.b    #$70,d0; keep just L and R state
    3.         beq.s    @return        ; fail if neither are pressed
    4.         move.b    ($FFFFF602).w,d0; get jpad
    5.         andi.b    #$C,d0; keep just L and R state
    6.         beq.s    @return        ; fail if neither are pressed
    7.         cmpi.b    #$C,d0; fail if both are pressed
    8.         beq.s    @return
    Then add the obvious clr flag for ($FFFFFFA8) in Sonic_ResetOnFloor.

    This is for the Hivebrain assembly though it shouldn't be too hard to convert. Special thanx to Aquaslash and Fragag.
     
  3. Jimmy Hedgehog

    Jimmy Hedgehog

    Member
    1,728
    8
    18
    England - Slough
    Getting the motivation to continue old projects
    I'm having an odd issue with this, with the GHZ Solid Wall, it's sticking to some of the wall, but not all...mostly not when I go for one from the right...
     
  4. E-122-Psi

    E-122-Psi

    Member
    2,536
    729
    93
    Not all walls can be clung onto sadly, similar to Knuckles' climb move. It seems certain surfaces don't interact the same.
     
  5. Jimmy Hedgehog

    Jimmy Hedgehog

    Member
    1,728
    8
    18
    England - Slough
    Getting the motivation to continue old projects
    But some of the solid walls can, and Mercury said the obj44 Wall was clingable
     
  6. Mercury

    Mercury

    His Name Is Sonic Tech Member
    1,740
    21
    18
    Location Location
    AeStHete
    If you give me a screenshot or video of the wall in question, I can try to suss out the underlying problem.
     
  7. flamewing

    flamewing

    Emerald Hunter Tech Member
    1,161
    69
    28
    France
    Sonic Classic Heroes; Sonic 2 Special Stage Editor; Sonic 3&K Heroes (on hold)
    If I were to guess, it would be that the wall in question is not terrain-based but sprite-based.
     
  8. Jimmy Hedgehog

    Jimmy Hedgehog

    Member
    1,728
    8
    18
    England - Slough
    Getting the motivation to continue old projects
    Sounds about right, as it's the GHZ wall, Obj 44 as previously mentioned. Anyways, funny thing is it's only some of the walls. Here's one little area of trouble:
    [​IMG]
    Green Arrow is where it works, Red are where it does not.
    On the right wall, the green arrow (2 GHZ walls) and the red one, are the EXACT same type of GHZ wall o.O So I don't see the issue there...and the whole wall I've put the left side there doesn't activate walljump (despite being the exact type of wall again). I've tried all Obj44 types that side (grass shadow, no shadow, full shadow) and have tried normal, flip, mirror, everything. But none of them worked, oddly. Any recommendations?
     
  9. Mercury

    Mercury

    His Name Is Sonic Tech Member
    1,740
    21
    18
    Location Location
    AeStHete
    Here's what I know:

    Obj44 works for me wherever it's placed.

    That area (though you haven't told me where it is so I can test the same one) looks to me to be the beginning of Act 2, or another place using very similar chunks.

    The chunk with the green line is chunk 06, and has solid tiles on the left. The chunk with the red line is 16, and has no solid tiles on the left.

    Now, I can't imagine that's your problem, because you explicitly mention placing Obj44 (in SonED2, I'm assuming).

    So I have two questions:

    A) You only mention grass shadow/no shadow/full shadow and flip/mirror/normal. What about the other parameter, Solid/Not Solid?

    B) Is the wall solid and just not triggering Wall Jump, or is it not causing any sort of collision at all?
     
  10. Jimmy Hedgehog

    Jimmy Hedgehog

    Member
    1,728
    8
    18
    England - Slough
    Getting the motivation to continue old projects
    It's a custom area I put there, and all of the wall objects are solid when not wall jumping, and were all placed there in SonED2
     
Thread Status:
Not open for further replies.