Amy In Sonic 2

Discussion in 'Engineering & Reverse Engineering' started by E-122-Psi, Jul 25, 2010.

  1. TheDoctor

    TheDoctor

    Member
    2
    0
    1
    South Yorkshire (UK)
    DocornFilms.wordpress.com
    I'm quite liking your work that you do E-122 for these character hacks for the original Sonic games. For each mod you make/ progress with, it gives me a reason to play through the whole game once again. :L
     
  2. KingofHarts

    KingofHarts

    Member
    1,619
    0
    16
    Project Sonic 8x16
    I've familiarized myself a bit with these routines in one of my recent works with REV C. I'll try and do something with it myself... If I can get something going I'll post it.
     
  3. KingofHarts

    KingofHarts

    Member
    1,619
    0
    16
    Project Sonic 8x16
    I did this with Sonic 1's fading code. Sonic 2's is very similar, if not just about identical. The only difference would be labels, but that's not a huge stretch.

    You should have no issue implementing this. It gives off a pink fade, by decreasing green first, then decreasing blue and red together... so instead of RRRRRRRGGGGGGGBBBBBBB, you have GGGGGGG BR/BR/BR/BR/BR/BR/BR. This gives off the pink effect. I can keep toying with it to see if I can improve it but for now this is that pink effect that is closest to the original blue fade... Lemme know if you like it.

    Here's the code:
    Code (Text):
    1.  
    2.  
    3. ; ---------------------------------------------------------------------------
    4. ; Subroutine to fade out to black
    5. ; ---------------------------------------------------------------------------
    6.  
    7.  
    8. ; ||||||||||||||| S U B R O U T I N E |||||||||||||||||||||||||||||||||||||||
    9.  
    10.  
    11. PaletteFadeOut:
    12.         move.w  #$003F,(v_pfade_start).w ; start position = 0; size = $40
    13.         move.w  #$15,d4
    14.  
    15.     @mainloop:
    16.         move.b  #$12,(v_vbla_routine).w
    17.         bsr.w   WaitForVBla
    18.         bsr.s   FadeOut_ToBlack
    19.         bsr.w   RunPLC
    20.         dbf d4,@mainloop
    21.         rts
    22. ; End of function PaletteFadeOut
    23.  
    24.  
    25. ; ||||||||||||||| S U B R O U T I N E |||||||||||||||||||||||||||||||||||||||
    26.  
    27.  
    28. FadeOut_ToBlack:            ; XREF: PaletteFadeOut
    29.         moveq   #0,d0
    30.         lea (v_pal_dry).w,a0
    31.         move.b  (v_pfade_start).w,d0
    32.         adda.w  d0,a0
    33.         move.b  (v_pfade_size).w,d0
    34.  
    35.     @decolour:
    36.         bsr.s   FadeOut_DecColour ; decrease colour
    37.         dbf d0,@decolour    ; repeat for size of palette
    38.  
    39.         moveq   #0,d0
    40.         lea (v_pal_water).w,a0
    41.         move.b  (v_pfade_start).w,d0
    42.         adda.w  d0,a0
    43.         move.b  (v_pfade_size).w,d0
    44.  
    45.     @decolour2:
    46.         bsr.s   FadeOut_DecColour
    47.         dbf d0,@decolour2
    48.         rts
    49. ; End of function FadeOut_ToBlack
    50.  
    51.  
    52. ; ||||||||||||||| S U B R O U T I N E |||||||||||||||||||||||||||||||||||||||
    53.  
    54. HERE IS THE PART THAT I CHANGED!
    55.  
    56. FadeOut_DecColour:          ; XREF: FadeOut_ToBlack
    57. @degreen:
    58.                 move.w  (a0),d2
    59.         beq.s   @next
    60.         move.w  d2,d1
    61.         andi.w  #$E0,d1
    62.         beq.s   @deblueandred
    63.         subi.w  #$20,(a0)+  ; decrease green value
    64.         rts
    65.  
    66. @deblueandred:
    67.                 move.w  d2,d1
    68.         andi.w  #$E00,d1
    69.         beq.s   @dered
    70.         subi.w  #$200,(a0)  ; decrease blue value
    71. @dered:        
    72.         move.w  (a0),d2
    73.         beq.s   @next
    74.                 move.w  d2,d1
    75.         andi.w  #$E,d1
    76.         beq.s   @next
    77.         subq.w  #2,(a0)+    ; decrease red value
    78.         rts
    79.  
    80. @next:
    81.         addq.w  #2,a0
    82.         rts
    83. ; End of function FadeOut_DecColour
    84.  
     
  4. E-122-Psi

    E-122-Psi

    Member
    1,835
    17
    18
    Where do I put the code exactly?
     
  5. KingofHarts

    KingofHarts

    Member
    1,619
    0
    16
    Project Sonic 8x16
    Search for this (Sonic 2 HG disassembly)
    Code (Text):
    1.  
    2. ; ---------------------------------------------------------------------------
    3. ; Palette fade-out subroutine
    4. ; ---------------------------------------------------------------------------
    5.  
    6. ; ||||||||||||||| S U B R O U T I N E |||||||||||||||||||||||||||||||||||||||
    7.  
    8. ; sub_248A:
    9. Pal_FadeOut:
    10.  
    And all you have to do is mind the different equates. The only part I really changed was the last subroutine, so that's all you really need to copy/paste... not the whole thing. I put the whole code in to help give an idea where it is. The part where I changed starts at:

    Code (Text):
    1.  
    2.  
    3. ; sub_24B8:
    4. Pal_DecColor:
    5.  

    Hope this helps. If you have any issues porting this, lemme know. Also lemme know if you like it.
     
  6. Iceguy

    Iceguy

    グー! Member
    645
    0
    0
    Hell. It's in my head.
    Internal system recovery
    Playing it right now. The new sprites are cute. .u. Great job.
    I stumbled upon a little bug though; if you exit a Special Stage after entering with a hundred or more rings, you get another life if you collect another ring. If you've got 200 Rings, you get two more lives if you get two more rings. (EDIT: This also happens after dying. Speaking of which, why do we have our Rings retained after dying? This game's easy enough as it is. owo; )
    And I can't help it, but I feel Amy's a little too small? By a pixel or two? Iunno, chances are it's just me. I mean, her sprites are more detailed than the vanilla Sonic ones, that might be it.
    I don't know.

    ANOTHER EDIT:
    After a lot of things that interrupted my session, I finished playing this little hack. It was fun! ouo Here's a bunch of things I stumbled upon; warning, long post due to images!

    [​IMG]
    You seem to have left this animation out when you redid Amy to her newer design.

    [​IMG]
    You can't destroy this crawly-bouncy mecha unless you've got invincibility. As Amy. Cream's spin dash works just fine.

    [​IMG]
    It's impossible to break these with Amy. It is possible to use Cream though. That's how I got through it. It's a minor inconvenience if you've got Cream by your side, but if you're playing as Amy alone, you won't be able to pass Hill Top Zone Act 1.

    [​IMG]
    In Oil Ocean, Eggman's got this... interesting pallette. I think it's the same pallette as the one that's used for the background. At least, that's what I've thought until...

    [​IMG]
    ...I saw the same pallette in the bubble duplicates in Metropolis Zone. And speaking of pallettes;

    [​IMG]
    You seem to have changed the monitors' pallette to match their Sonic 3 counterpart. This pallette appears to be shared by the Eggmobile, which results in the Eggmobile's color differing slightly from the rest of the mecha. Like here.

    [​IMG]
    Maaaaybe something should be done about these spikes. Can't get the shield. o-o

    [​IMG]
    Now, I don't want to look like a wannabe expert, or bossy, or demanding, or something, but this pose looks... uh, unnatural? Her head seems to be positioned too high.

    And besides these minor things, I found some... other... minor... things. o-o

    I love the new moves! ouo They add a lot to the game, makes it feel close to Sonic Advance, which I also really like. And seeing that you got the moves from there, how farfetched is it to ask that you program the second hammer attack? You know, the consecutive hits that Amy has in Sonic Advance when you press B twice.
    Speaking of the hammer, there are some minor hitbox issues with it. For example, the hammer hits mechas in front of Amy at the moment she pulls it out. This also made me invincible a couple of times when I did the air-hammer thingy.
    And the Down+A move, when Amy spins her hammer as she falls down, why does it have this, um, boost downwards?
    Another question; is it possible to include this peelout-thingy and the leap? I like using the leap, and so far, although the peelout is quite cool, there were often times when I instincively wanted to leap, and... well yeah, obviously it didn't work. If I may suggest, Down+B would be a good combo for it.
    And, once again, I don't want to be demanding or bossy or anything, but something seems to be off about Amy's ending sprite. Anatomy-wise.
    But, as I said, I love this hack. Keep up the good work! \owo/
     
  7. E-122-Psi

    E-122-Psi

    Member
    1,835
    17
    18
    Thanx.

    The ring stipulations are made according to S2K, which similarly allows rings and extra lives after dying or exiting a special stage.

    If you're talking about classic Amy's sprites it's proportioned according to her official CD sprite. Modern Amy might be too short since she's designed to use a similar tile space.
     
  8. Iceguy

    Iceguy

    グー! Member
    645
    0
    0
    Hell. It's in my head.
    Internal system recovery
    ...posted 37 minutes ago.
    I can't believe I've been editing for so long. Ahaha... ha.
    orz;

    And no, I was talking about modern Amy. I was playing the Pink Edition.
    (Damn, that sounds manly all right.)
     
  9. MathUser

    MathUser

    3rd top wiki contributor Researcher
    2,047
    0
    16
  10. MathUser

    MathUser

    3rd top wiki contributor Researcher
    2,047
    0
    16
    Have you thought of adding a button code to switch between classic and modern Amy? Would be a better option than forcing people to play modern Amy.
     
  11. E-122-Psi

    E-122-Psi

    Member
    1,835
    17
    18
    Thanx very much, MathUser.

    The main concern with that is that Classic Amy has a very different palette that would cause problems with Cream (or at least require a revised sprite file for her as well). Besides we have versions of both so it's mostly moot point unless you want Classic Amy with Cream.

    Looking at all those errors, the leftover sprites will be finished next revision (the different greys have also been changed, decided they didn't look that great). I didn't know about the Hill Top bug however and I'll look into the Crawler issue.

    The changes in moveset were mostly made according to my limitations in programming moves, and also because I thought it gave Amy more of an edge over other characters to compensate her lack of spin jump (Amy's Advance move set was cool, but they seemed nuanced too much in power so she came off as the 'dud' character). If you know how to go about changing the spin hammer attack to it's original physics, I can maybe change that, since the dash variant is a tad too powerful in Sonic 2's programming anyway.

    I got the pink fade out code working, it's a nice effect though I'm not sure what to make of it. I'll let the fans decide next release.
     
  12. MathUser

    MathUser

    3rd top wiki contributor Researcher
    2,047
    0
    16
    So, isn't Cream supposed to be able to fly? Playing as her alone with no flying move kind of sucks. If you figure out how to give her a flight move, you should consider making a Tails flight hack of Sonic 2. The hack that does that currently has different physics and it would be good to see a standalone tails flight hack that is more authentic.
     
  13. KingofHarts

    KingofHarts

    Member
    1,619
    0
    16
    Project Sonic 8x16
    It would be simple enough as porting over the code from Sonic 3... Based on my experience of working with the double jump, as I ported it to Sonic 1 for my sketchhog hack... it's not too hard.

    The hard part would be weaving one's way through the relatively uncharted territory that is the code itself... but it shouldn't be too much of a stretch. PLUS there are plenty of hacks, and other places to get the S2 flying Tails art...

    If nothing else, it's worth making an extra copy of the disassembly and giving it a go on the side...
     
  14. E-122-Psi

    E-122-Psi

    Member
    1,835
    17
    18
    I'm working with someone on how to insert the fly move, so I might be able to get that put in. As said though I tried it before and to no avail.

    EDIT: Good news, everyone. Fly move will be available for next revision. Special thanx to Flamewing.
     
  15. E-122-Psi

    E-122-Psi

    Member
    1,835
    17
    18
    New revision of Pink Edition:

    * Cream can now fly (special thanx to Flamewing for code). Following Advance's mechanics, she can't swim and it lasts half of Tails' air time. She can't carry Amy (baby steps, people).
    * Cream can also use debug mode now (special thanx to redhotsonic).
    * Continue screen fixed (special thanx to Markeyjester).
    * Some mentioned sprite faults fixed. The grey color scheme is now also back to standard Sonic 2 shades.
    * Crawl issue with Amy's hammer fixed.
    * Cream's name is now on Special Stage HUB in western region mode (thanx redhotsonic).
    * Added pink fadeout (thanx to KingofHarts).

    http://info.sonicretro.org/Sonic_the_Hedgehog_2:_Pink_Edition
     
  16. KingofHarts

    KingofHarts

    Member
    1,619
    0
    16
    Project Sonic 8x16
    It's good to see that pink effect in the game. Somehow I feel like it would fit a little better with Classic Amy... but it definitely feels more fitting in a "Pink Edition"
     
  17. E-122-Psi

    E-122-Psi

    Member
    1,835
    17
    18
    It's a nice touch. Since we already have an 'as is' Amy in Sonic 2 I suppose it's okay to have some deviations.

    I'm wondering whether it might be possible to put Classic Amy in after all, though it would have to be S3 Amy due to more compatible palette and would require some sprite tricks with the palette lines.

    Would it require making a new character altogether or could I just program the game to switch between the two sprite sheets for the same character properties?
     
  18. KingofHarts

    KingofHarts

    Member
    1,619
    0
    16
    Project Sonic 8x16
    Don't quote me on this... I could be completely wrong, but I think as long as both Classic and Modern Amy have the same mappings, it would be as simple as loading a certain art file and DPLC's into VRAM depending on a certain variable (perhaps set for classic, cleared for Modern)... but take this with a grain of salt, I'm really not sure. Just a guess.

    But as you said, palettes alone make it tricky. I'm running into the same deal with REV C, trying to make bosses and signposts appear with different colored characters while retaining their original colors.

    I was actually thinking about the same thing with regards to multiple characters in the Sonic 1 Special Stage... just loading different art into 1 SS character object, depending on who the player is.
     
  19. MainMemory

    MainMemory

    Have no fear...Amy Rose is here! Tech Member
    4,372
    41
    28
    SonLVL
    You can easily load alternate art, mappings and DPLCs depending on a flag in RAM or the current character variable.
     
  20. I'm loving that pink fade transition. :specialed: Plan on giving this a proper play through later, it looks and feels very complete. Amy's game play was the whole reason I wanted Sonic Advance 1, so this gives me a lot more options for replaying Sonic 2. I'm also interested in Cream's ability to fly being added. The only downside to this build is that it doesn't run on Kega Fusion, not that it likes homebrew much anyway, but Regen is playing it nicely.

    And if making the switch is simple enough, that would be a nice option too, even with the existing Amy hack that has already classic Rosy the Rascal in it.