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. Mercury

    Mercury

    His Name Is Sonic Tech Member
    1,740
    21
    18
    Location Location
    AeStHete
    Because of E-122-Psi's continuing series of Chaotix characters in Sonic 1, I was contemplating how you'd recreate their abilities. I had some ideas for how to make a Mighty-like Wall Jump, and this is the result:

    [​IMG]

    Download

    (It's a mod if the SVN disassembly; the built ROM and .lst file are included.)

    I'd love to write up a full tutorial and also a conversion for the Hivebrain disassembly, but I'm way too busy (I've been pulling 12 hour days in front of the computer lately and I can't take too much more without going mad). Hopefully it will be easy enough to make sense of for anybody who wants a Wall Jump. Just search the .asm files for the tag "Mercury Wall Jump" and you'll find all the changes I made.

    I made the sprite for it from bits and pieces of other Sonic sprites. I really didn't like the Crackers sprite and I think mine is better. Also it uses the same mappings as the Braking sprite so it made it faster to implement.

    Notes:

    While I didn't notice that it broke anything engine-wise, it will allow the player to reach areas that they shouldn't. If one were to put this in a proper hack, they'd have to fix the SLZ metatile solidity and a few other things.

    It works on solid objects (including the GHZ solid wall) as well as level tiles.

    I know there's some resistance to the idea of "giving away code" in the community, but I'm an open source kind of guy. Credit would be appreciated, but as always isn't absolutely necessary.

    Specifically, I hope this helps E-122-Psi make a Mighty hack! =)
     
  2. Hitaxas

    Hitaxas

    Retro 80's themed Twitch streamer ( on hiatus) Member
    Looking at the game real fast and noticing it crashes in Regen, however jumping recovers from that said crash which is strange.

    I also had a look at the coding, it's quite different from the method I used to add wall jumping to my own hack, however without the time limit your's has, it still has the same issue. I tested and removed the flag that puts a limit on the time he can stay on the wall, after falling past the wall he continues to stay in the wallgrabbing animation. But I guess that doesn't really matter to you since your intent was the time limit.

    Anyway, nice work.
     
  3. Mercury

    Mercury

    His Name Is Sonic Tech Member
    1,740
    21
    18
    Location Location
    AeStHete
    Odd that it crashes in Regen. I tested it in Gens Movie and Regen v0.97 and it worked fine.

    I did forget to reenable rompad.exe when I built it, though, so that might be causing an issue.
     
  4. MarkeyJester

    MarkeyJester

    Original, No substitute Resident Jester
    2,248
    509
    93
    Japan
    It crashed on real hardware if you released the D-Pad direction button of the wall you're holding on to, for example, the right wall if I'm clinged onto it and I release the right button before it's finished, it crashes.
     
  5. E-122-Psi

    E-122-Psi

    Member
    2,502
    681
    93
    You REALLY want me to make a Mighty In Sonic 1 hack, don't you? :D

    Well if I can work out the ASM retools here it should hopefully not take too long (I'd still need time to make the sprites however unless anyone knows some authentic looking extra sprites for Mighty anywhere) though it will likely still have the hardware incompatablities listed for this ROM here. I was also wondering if Sally should have a wall jump in her hack, since she is an agility based character do you think it suits her gameplay? (if anyone can make a Projectiles in Sonic 1 hack that would be useful too...just sayin' lol).

    Thanx Mercury. :D
     
  6. FeliciaVal

    FeliciaVal

    Member
    693
    11
    18
    Spain
    mmm I just can think on the Mighty sprites from Chaotix...
    and yes please :D Make Sally walljump. I think I'm gonna make Stella walljump as well since is something I wanted since the beggining

    and yeah, thx Mercury for the guide :)
     
  7. E-122-Psi

    E-122-Psi

    Member
    2,502
    681
    93
    I have seen a recurring sheet for Mighty used in hacks which is basically an expanded version of his Chaotix sheet with more Sonic 1 animations, I'm not sure if it has been publically released though.

    Might be a good idea, since our characters have limited attacks they may as well have good manuevering and agility moves. Sally at this point isn't much more than a weaker version of Amy.
     
  8. flamewing

    flamewing

    Emerald Hunter Tech Member
    1,161
    68
    28
    France
    Sonic Classic Heroes; Sonic 2 Special Stage Editor; Sonic 3&K Heroes (on hold)
    The crash happens because you are writing a word to an odd address; and it is the wrong address too, in fact. In sonic.asm, find Sonic_Control routine, local label @chkLR:

    Code (ASM):
    1.     @chkLR:
    2.         move.b  (v_jpadhold2).w,d0  ; get jpad
    3.         and.b   $2D(a0),d0  ; compare jpad to stored L,R button states
    4.         bne.s   @skip       ; if still held, branch
    5.         move.w  #0,$2D(a0)  ; clear wall jump flag and button states
    6.         move.b  #id_Roll,obAnim(a0) ; use "jumping" animation
    7.    
    8.     @skip:
    and replace it with this:

    Code (ASM):
    1.     @chkLR:
    2.         move.b  (v_jpadhold2).w,d0  ; get jpad
    3.         and.b   $2D(a0),d0  ; compare jpad to stored L,R button states
    4.         bne.s   @skip       ; if still held, branch
    5.         move.w  #0,$2C(a0)  ; clear wall jump flag and button states
    6.         move.b  #id_Roll,obAnim(a0) ; use "jumping" animation
    7.    
    8.     @skip:
    It will no longer crash (edit: and it will clear the flag as intended).
     
  9. MathUser

    MathUser

    3rd top wiki contributor Researcher
    2,151
    9
    18
    I can't wait for those character hacks to get their wall climbs in. Gonna be awesome.

    Good that someone made this POC hack.
     
  10. PsychoSk8r

    PsychoSk8r

    PsychedelAnt | Tone Turner Oldbie
    2,672
    82
    28
    Birmingham, UK
    30 Day Project: Revisited.A New Release!
    Well, I must say this is the first bit of open-source code I've actually been interested in getting my hands on. Maybe I'll use this for Mighty in 30 Day Project... =P
     
  11. Aquaslash

    Aquaslash

    <The Has-been Legend> Moderator
    As a matter of fact, I know someone who has a Mighty sheet for Sonic 1 that puts the Chaotix ones to shame. I'll have a chat with him an see if he minds it being used for this purpose.
     
  12. MathUser

    MathUser

    3rd top wiki contributor Researcher
    2,151
    9
    18
    Save enhanced mighty for the 30 day project. The Chaotix sprites should be used for the Mighty in Sonic 1 hack. I prefer straight Chaotix sprite ports to original sprites in those kinda hacks. The new style may even clash with classic sonic sprites.
     
  13. Aquaslash

    Aquaslash

    <The Has-been Legend> Moderator
    If that was directed at me, then I'll have you know that the sprites I'm referring to fit more with Sonic 1 than the Chaotix ones do.
     
  14. steveswede

    steveswede

    Member
    5,032
    2
    16
    Ask my hand
    Fighting against the Unitary State of Europe
    Well they will be interesting to see if that's the case. the Mighty sprites for Chaotix are not a bad fit for the original art style but they do stand out too much for my liking so I'm quite excited to see how well these custom sprites work.
     
  15. Lapper

    Lapper

    Lappering Tech Member
    1,782
    1,014
    93
    England
    Sonic Studio, Sonic Physics Guide, Kyle & Lucy, Freedom Planet 2
    This should use the sprite in your avatar. :v:

    This is pretty damn nice, except it interferes when you jump over a rock, or a large step, sorta makes you drift off of it. That's the only thing I don't like about it, other than that, it's very good.
     
  16. Mercury

    Mercury

    His Name Is Sonic Tech Member
    1,740
    21
    18
    Location Location
    AeStHete
    Goddamn typos! :argh: Thanks for catching that.


    Odd. I purposely check if Sonic's moving upward and don't activate the move if that's true. I just tested it with a RAM watcher and it doesn't trigger when I push up against a block or rock or wall and jump past it.

    Could you make a savestate/movie of it happening if you can? Thanks. :)
     
  17. Lapper

    Lapper

    Lappering Tech Member
    1,782
    1,014
    93
    England
    Sonic Studio, Sonic Physics Guide, Kyle & Lucy, Freedom Planet 2
    I just played the actual Sonic 1, and it happens there too. Sorry for misleading you, but it seems that there is a slight slope before a few of the rocks and steps, which make you drift backwards.

    I'll suggest an improvement,instead of jumping on a wall, becoming the wall state for a short time, how abouts you make it more like in Damizean's GM engine, where you press jump while against a wall to engage the sliding, then again to jump, including while you are travelling up.

    The way you've done it, you have to press against the wall and be falling to do it, making it annoying to walljump form a standstill.
     
  18. MathUser

    MathUser

    3rd top wiki contributor Researcher
    2,151
    9
    18
    I played the hack finally, while it's cool to have a new move, Mighty must be pretty boring if this is his only new move. Besides the sprite this is basically Mighty in Sonic 1 as I haven't heard of him having any other differences from Sonic.
     
  19. Bgvanbur

    Bgvanbur

    Tech Member
    128
    1
    0
    USA
    a disassembly, some small Sega CD projects
    I wish there was an emulator that could warn you about these type of errors. Right now I have a huge headache why my new game works perfect in the Gens/GS and Kega Fusion, but resets itself on real hardware.
     
  20. Aquaslash

    Aquaslash

    <The Has-been Legend> Moderator
    Mighty is a power type, so you could make him break walls by running into them like Knuckles.

    Incidentally, you could do that to Vector too.
     
Thread Status:
Not open for further replies.