Basic Questions and Answers Thread

Discussion in 'Discussion & Q&A' started by Malevolence, Jul 7, 2009.

  1. SpirituInsanum

    SpirituInsanum Well-Known Member Member

    Joined:
    Feb 11, 2010
    Messages:
    642
    Don't lock the controls, just set some "climb" bits in memory (when the character hits a wall while in air + a check of some key being pressed if necessary) and rewrite the falling routine so he doesn't fall when those bits are set.


    It looks like you're using either the svn disassembly of S1 or another game disassembly, but for Hivebrain's disassembly, the original routine is as follow:




    ObjectFall:


    move.l 8(a0),d2


    move.l $C(a0),d3


    move.w $10(a0),d0


    ext.l d0


    asl.l #8,d0


    add.l d0,d2


    move.w $12(a0),d0


    ; include your bit checks before the following line, then branch to a newly written part of the routine where the vertical speed isn't modified


    addi.w #$38,$12(a0) ; increase vertical speed << this is the line the program mustn't reach when you're hanging on the wall


    ext.l d0


    asl.l #8,d0


    add.l d0,d3


    move.l d2,8(a0)


    move.l d3,$C(a0)


    rts
     
  2. MarkeyJester

    MarkeyJester ♡ ! Member

    Joined:
    Jun 27, 2009
    Messages:
    2,867
    Try this:



    move.l #$00000000,$10(a0)



    If you're smart, you'll know where to put it =P
     
  3. Hitaxas

    Hitaxas Retro 80's themed Paladins Twich streamer Member

    Joined:
    Aug 13, 2007
    Messages:
    167
    It's all good, works well with the information SpirituInsanum gave me. :p
     
  4. egdelous2

    egdelous2 Newcomer Member

    Joined:
    Nov 3, 2010
    Messages:
    11
    Hi friends, What are supersonic mappings in SonMapED for Sonic 3 & Knuckles? I've searched but don´t find nothing.


    thanks.
     
  5. SpirituInsanum

    SpirituInsanum Well-Known Member Member

    Joined:
    Feb 11, 2010
    Messages:
    642
    Search "Map_SuperSonic:" in s3k's disassembly and copy it to a new file.
     
  6. egdelous2

    egdelous2 Newcomer Member

    Joined:
    Nov 3, 2010
    Messages:
    11
    ok bro,i got it, and the supersonic art and supersonic plc?
     
    Last edited by a moderator: Nov 26, 2010
  7. SpirituInsanum

    SpirituInsanum Well-Known Member Member

    Joined:
    Feb 11, 2010
    Messages:
    642
    The art is mixed with the regular art for Sonic, and the plc is under plc_supersonic.
     
  8. egdelous2

    egdelous2 Newcomer Member

    Joined:
    Nov 3, 2010
    Messages:
    11
    thanks a lot bro. you save me.
     
    Last edited by a moderator: Nov 26, 2010
  9. DanielHall

    DanielHall Well-Known Member Member

    Joined:
    Jan 18, 2010
    Messages:
    860
    Location:
    North Wales
    This seems to be quite a nasty glitch! Anyone know why it happens?
     
  10. EMK-20218

    EMK-20218 The Fuss Maker Exiled

    Joined:
    Aug 8, 2008
    Messages:
    1,067
    Location:
    Jardim Capelinha, São Paulo
    You probably fucked up the routine (or some subroutine) from the Flicky/birdie object.
     
  11. MarkeyJester

    MarkeyJester ♡ ! Member

    Joined:
    Jun 27, 2009
    Messages:
    2,867
    He's referring to a general bug in Sonic 2 which was explained somewhere on SonicRetro, but I can't find the topic for the life of me.
     
  12. SpirituInsanum

    SpirituInsanum Well-Known Member Member

    Joined:
    Feb 11, 2010
    Messages:
    642
    I think it was related to the routine counter being increased past the number of routines x 2. But why was it? I can't remember.
     
  13. Selbi

    Selbi The Euphonic Mess Member

    Joined:
    Jul 20, 2008
    Messages:
    2,429
    Location:
    Northern Germany
    Yes, that's excactly the problem and to fix it you only need to duplicate one line.


    Go to off_37330, which should look like this:



    off_37330:
    dc.w loc_37338-off_37330


    dc.w loc_37350-off_37330; 1


    dc.w loc_3739C-off_37330; 2


    dc.w loc_373CA-off_37330; 3



    Just copy the last entry and paste it right under it:



    off_37330:
    dc.w loc_37338-off_37330


    dc.w loc_37350-off_37330; 1


    dc.w loc_3739C-off_37330; 2


    dc.w loc_373CA-off_37330; 3


    dc.w loc_373CA-off_37330; 4 -- Fixes the Rexon bug



    BAM, the bug is gone!
     
  14. SpirituInsanum

    SpirituInsanum Well-Known Member Member

    Joined:
    Feb 11, 2010
    Messages:
    642
    Does anybody know why the walking animation is being reset when Sonic quits the ground? I mean, when you're on a non-object platform and leave it (at the moment you begin to fall), the animation jumps back to the first frame of the walking animation rather than continuing to the next frame.


    It seems like it doesn't always (maybe it's game related, I've seen it in s1, not in s2 but didn't make thorough check) happen with object platforms and it can be seen in all MD games.
     
    Last edited by a moderator: Dec 5, 2010
  15. vladikcomper

    vladikcomper Well-Known Member Member

    Joined:
    Dec 2, 2009
    Messages:
    415
    It looks like this is intentional. The game checks if Sonic has left the ground in Sonic_AnglePos subroutine, here is a part of its code:



    loc_146CC:
    tst.b $38(a0)


    bne.s loc_146C6


    bset #1,$22(a0) ; set Sonic's in the air flag


    bclr #5,$22(a0) ; clear pushing flag


    move.b #1,$1D(a0) ; force animation reset


    rts



    You see, it sets animation restart flag, so the animation will be reset anyways, except for the case it's animation #1, which is running animation (because animation restarts if $1D not equals $1C).


    If you comment "move.b #1,$1D(a0)" line, the animation won't reset, like in S2 and other.
     
    Last edited by a moderator: Dec 6, 2010
  16. SpirituInsanum

    SpirituInsanum Well-Known Member Member

    Joined:
    Feb 11, 2010
    Messages:
    642
    I couldn't find those lines, many thanks. ^^


    That was a strange design decision...
     
  17. Hitaxas

    Hitaxas Retro 80's themed Paladins Twich streamer Member

    Joined:
    Aug 13, 2007
    Messages:
    167
    Yes and no.


    Sure it is strange that it resets the animation, but they had the concept right.


    I mean, if you run off a cliff you won't be able to keep running forward at the same speed. =P


    But with Sonic, he goes so fast, they should have just cleared his Y speed and kept the X speed the same (keeping the same animation he ran off the cliff with as well). In my opinion, anyway.
     
  18. SpirituInsanum

    SpirituInsanum Well-Known Member Member

    Joined:
    Feb 11, 2010
    Messages:
    642
    Yeah... no... dunno xD I would understand if it was a falling or jumping animation... Well, it's hardly noticeable anyway.


    Now a bigger problem, I was testing my new animations when I noticed this horror with the platforms of SBz:


    [​IMG]


    To be honest, I don't have the slightest idea of what's happening here. I can't even walk on them (they won't influence Sonic's x coordinates, but they do influence y coordinates with Sonic standing 4 pixels above the platform) . The conveyor belt platforms in Lz work fine and didn't notice any other problem.


    Everything was fine two weeks ago (my backup from the 23rd of November doesn't have this problem), I tried removing the few changes I had done since then, but couldn't find any that would fix it. Since I've essentially been working on my new sprite sheet, I did very few changes as far as I can remember.


    I never changed anything in obj6F (the conveyor belt) and I can't see in its code what can be influenced to produce such a result. :/


    Of course I can revert to a previous version, but not knowing what causes this problem makes it likely to see it happen again.


    edit:nevermind, I find the problem: I had replaced a bra.w by a jsr, silly me, lost 6 hours T_T
     
    Last edited by a moderator: Dec 7, 2010
  19. vladikcomper

    vladikcomper Well-Known Member Member

    Joined:
    Dec 2, 2009
    Messages:
    415
    Probably this was relevant on early development stages. Also, the first frame in walking animation may create effect that Sonic pushes himself off the ground edge.

    I can't understand your idea...


    First of all, speeds are not connected with animations, but animations are connected with speeds. Running animation and its speed depend on Sonic's ground velocity, aka inertia (byte $14).


    Second of all, the X- and Y-velocities mustn't be cleared or changed when Sonic leaves the ground. It's normal physics, this is actual even in real life =P When Sonic leaves the ground, his X- and Y-velocities stay the same, then Y-velocity start increasing because of the gravity influence.


    Gravity influences really strongly and immediately, so it may seem that something happens to his speeds, but nothing does, it's just gravity =P
     
  20. RetroX

    RetroX Active Member Member

    Joined:
    Jun 15, 2012
    Messages:
    46
    Location:
    United States
    In my Sonic 1 ROM I recently edited, Whenever I run (not walk) into a monitor it breaks. Can somebody please help me. (Please answer by pm)