don't click here

PoC: Homing attack/jumpdash in Sonic 2

Discussion in 'Engineering & Reverse Engineering' started by Hitaxas, Jan 26, 2009.

Thread Status:
Not open for further replies.
  1. Pretty cool bro. I just want me a sonic 2 that plays like Sonic Megamix's sonic.
     
  2. Hitaxas

    Hitaxas

    Retro 80's themed Twitch streamer ( on hiatus) Member
    Ok, so I went through the code tonight and I believe I fixed all the bugs (except the title card, which is a strange bug)

    Download

    Fixes include:

    You should no longer stick to ceilings (bug pointed out by Epsilonsama)
    You will no longer bounce in the air after spindashing into a monitor (bug pointed out by Irix)
    HAing a monitor will bounce you up as well as jumping on one, Spindashing won't anymore.

    Although, in order to make Sonic not infinitely HA onto a target he cannot get to, touching a wall when jumping will clear Sonic's Y_vel, making him fall to the floor. So yes, pushing on a wall and jumping will cause Sonic to fall. That makes it more realistic anyway.

    Other fixes are also there, of course. Those include:

    I adjusted the range on the HA, as well as the speeds.
    I modified the Touch_monitor routine so that a monitor bounces Sonic up at -650 rather than reversing his y_vel.
    I removed the air speed cap, as mentioned by Alriightyman.
    I removed the ability to HA on bosses (it was too cheap).
    ARZ's boss now shows up again (new ASM file).
    I removed the flash that caused palettes to go weird when JDing as Super Sonic.
    I added topspeed trails (Sonic reaches a certain speed, and as long as you hold left/right, there will be trails behind him).
    I added a few lines to Sonic_HitCeilingAndWalls so that Sonic won't infinitely HA onto an object he can't get to (I.E: above a loop or on the other side of a wall).

    Edit: Fixed a slight bug with HAing on monitors
     
  3. Aerolite

    Aerolite

    Feel teh powah! Tech Member
    See? Told ya you could do better. :)

    One thing though: The actual Home-In phase of the attack seems quite slow, but you may be specifically aiming for this; I don't know. If not however, I found it works quite well to left-shift the X/Y speeds by about 4 immediately after calling the CalcSine function, like so:
    Code (Text):
    1. jsr (CalcSine).l        ; Get the HomeIn X/Y speeds from angle (Return: d0 = Sine, d1 = Cosine)
    2. lsl.w   #4,d1           ; Multiply the horizontal speed
    3. lsl.w   #4,d0           ; Multiply the vertical speed
    Also, I'm confused as to why Sonic was previously (I know you fixed it) sticking to walls in your implementation.. Are you disabling gravity while Homing-In or something? If so, if you have the Home-In fast enough then this is entirely unnecessary (ie. you'll never miss anyway).
    Also, why are you disabling the Mid-Air speed cap? I've not had to touch it myself, and my Home-In is much faster than yours...

    You know what, now I'm just being picky so I'm gonna shut up :psyduck:. Nice improvement however; IMO you just need to up the Home-In speed a bit.
     
  4. nineko

    nineko

    I am the Holy Cat Tech Member
    6,308
    486
    63
    italy
    I didn't test either of your implementations, so I can be wrong, but Hitaxas is working in Sonic 2, which effectively has a speed cap, and you are working in Sonic 3, which doesn't have a speed cap.
     
  5. Aerolite

    Aerolite

    Feel teh powah! Tech Member
    Yes but my S3K work was based on my S2 implementation. That being the case, I still didn't have to touch the speed-cap. :psyduck:
     
  6. Tweaker

    Tweaker

    Banned
    12,387
    2
    0
    The code that handles the speed cap is stored in three distinct parts of the Sonic object—Sonic_MoveLeft. Sonic_MoveRight, and that one routine that handles Sonic moving in the air (I forget the name). As such, adding the homing attack isn't going to change that behavior unless you've replaced these routines—they're entirely separate.
     
  7. STILL can't play this. Apparently the file is either in an unknown format or damaged.
     
  8. djdocsonic

    djdocsonic

    Testing YOUR Hacks Since 2005... Member
    374
    0
    0
    Emerald Hill Zone
    Looking for a Rom Hack to Test.
    I have had no problems downloading it or playing it using Gens 9f. I think its pretty good! I especially like the shadow effect.
     
  9. I'll mirror it on SS later, but it seems media fire is down at the moment <_< at least for me, the link isn't even working.
     
  10. Hitaxas

    Hitaxas

    Retro 80's themed Twitch streamer ( on hiatus) Member


    I'll have to try that out.

    EDIT: Yeah, that method is much faster. I was using a method that took up more lines.

    Code (Text):
    1.             move.w  #$550,d3            ; move 550 into d3
    2.             muls.w  d3,d1           ; multiplier
    3.             asr.l   #7,d1           ; changed to 7 to improve attack speed
    I did that for both x and y


    Sonic was sticking to walls because I set walls and ceilings to clear Sonic's Y_vel when he is jumping. Me being absent minded, forgot to add some checks and branches to avoid sticking to them.


    I removed the air speed cap so that the jumpdash gives Sonic a slight boost in speed. Also, because I feel the game plays better without it.


    EDIT2: V Irix's mirror is the version with Aerolite's speed suggestion.
     
  11. Hitaxas

    Hitaxas

    Retro 80's themed Twitch streamer ( on hiatus) Member
    Ok, I fixed a few problems with the trailing images (after-images).

    I added a few lines to Sonic_MoveRight and Sonic_MoveLeft to check for Sonic's speed. Thus not allowing images if he slows to a stop, or turns.
    I added a few lines to Obj11_Depress to check if Sonic has HA'd, if not, the trailing images will not dissapear, like in the last release.
    I adjusted the speed required for the trails to appear.

    If there are any other bugs, let me know.

    Download
     
  12. Eduardo Knuckles

    Eduardo Knuckles

    Not a loved one, but the most hated person. Banned
    414
    10
    18
    Someplace somewhere
    Project S.A.M.G.
    Finally I see the hoaming attack working great out of Megamix. But as I said now in MSN, when Sonic is running fastly and releases the double jump, the hoaming attack appears be released a little slower than what it should.
     
  13. Hitaxas

    Hitaxas

    Retro 80's themed Twitch streamer ( on hiatus) Member
    I tried that, but I couldn't get the mappings to work correctly for some reason.
     
Thread Status:
Not open for further replies.