Sonic 1 Question: Restoring unused animations/adding new ones

Discussion in 'Discussion & Q&A' started by Scrap Sorra, Sep 20, 2020.

  1. Scrap Sorra

    Scrap Sorra Well-Known Member Member

    Joined:
    Sep 18, 2020
    Messages:
    112
    Location:
    Development Hell
    I'm working on a hack of Sonic 1 and I wanted to restore + add animations to the game. I don't actually know how to get animations to be triggered in game and how they work so if someone could tell me how I could create animations and how they work that would be appreciated. As an example, I would like to restore the unused greyed out death animation and use it whenever Sonic is killed by a fire related hazard. If someone could help me understand how to restore/edit/add animations that would be appreciated.
     
  2. MarkeyJester

    MarkeyJester ♡ ! Member

    Joined:
    Jun 27, 2009
    Messages:
    2,867
    This might be right up your alley:

    http://info.sonicretro.org/SCHG_How-to:Add_Spin_Dash_to_Sonic_1/Part_1#Animation_sequence

    This is part of a massive guide on how to add the spindash to Sonic 1, but it goes in-depth in explaining the mappings, PLC, animation, tile format, as well as multiple engine explanations and how to alter them for the spindash specifically. So it gives a great insight into the engine/software as a whole. The above link is directed to the animation sequence portion, but I would strongly recommend following the guide entirely, even if you don't want or need a spindash, grab a blank disassembly and do it anyway, there's great knowledge to be gained from it and you seem like the sort of person who would willingly seek and understand such knowledge~
     
  3. Kilo

    Kilo Foxy Fren Exiled

    Joined:
    Oct 9, 2017
    Messages:
    391
    Location:
    A warm and lovely place~
    The format is pretty simple to understand, really.

    First is the animation speed. The value you set it to indicates how long a frame will hold before changing. $FF is used in special cases that rely on speed variables like Sonic walking or running.

    Next is the order of frames you want, there isn't much else to say on it. 0 is frame 0, it's simple.

    Next is the loop type and loop parameters. $FF will make your animation loop forever from the start of the frame list.
    So 0, 1, 2, 3. 0, 1, 2, 3. And that continues until you change the animation.
    Now my memory isn't clear on this, but, if I recall $FE will go back X amount of frames and loop from that point. So let's say you set it to 2.
    A, B, C, D. C, D. C, D.
    This can be seen in Sonic's idle animation to loop his foot tapping.
    Lastly, there's $FD which will go to animation ID X. This is used in Sonic's spring animation to make him go into the walking animation.

    TL;DR This is the animation format
    animSpeed, frame0, frame1, etc, loopType, loopParameter.
    This format is used in all Sonic games, including 2, 3, K, CD, and possibly 3D(?)

    Now to use your animation, what you have to do is move the animation ID of the anim you want to play into anim(a0) or $1C(a0).

    As for the greyed out burn death, a guide was made on it quite some time ago. It has a minor error in it, but it's easy to fix.

    Would've recommended you used the basic questions and answer thread, but I think this is a good opportunity to have proper documentation on the animation format, since there doesn't seem to be much on the matter.
     
  4. DeltaWooloo

    DeltaWooloo The noob next door Member

    Joined:
    Aug 7, 2019
    Messages:
    373
    However, Sonic 1 does have a sprite map limit of $7B sprites so if you're thinking of adding a lot of new art, SCHG has provided the tutorial into extending the animation, mappings and sprite limit to $FF.

    http://info.sonicretro.org/SCHG_How-to:Extend_the_Sonic_1_sprite_mappings_and_art_limit

    I also recommend if you are adding more art to convert Sonic's art to use DMA like in Sonic 2.

    http://info.sonicretro.org/SCHG_How...onverting_Sonic.27s_art_buffer_to_a_DMA_queue

    It should free RAM and shouldn't bug around with the art. Once you do that, you are ready to add a bunch of art to your hack.

    Happy hacking! ;)
     
    Last edited: Feb 14, 2022
    Scrap Sorra likes this.
  5. Scrap Sorra

    Scrap Sorra Well-Known Member Member

    Joined:
    Sep 18, 2020
    Messages:
    112
    Location:
    Development Hell
    Thanks a lot guys! I can't wait to finally add those unused walking sprites from sonic CD among other sprites more people probably want like sonic's cd spring animation or the peelout animation (but adding the peelout is another thread for another day probably)