Sonic 1 entering in the "big ring"

Discussion in 'Discussion and Q&A Archive' started by Psycho RFG, Nov 22, 2011.

Thread Status:
Not open for further replies.
  1. Psycho RFG

    Psycho RFG Well-Known Member Member

    Joined:
    Feb 22, 2011
    Messages:
    234
    I have noticed that sometimes, if you enter in the big ring with too much speed, Sonic dissapear late, when he is on the ground, and not inmediately when he touch the ring. Is there any way to fix or dissimulate this?
     
  2. SpirituInsanum

    SpirituInsanum Well-Known Member Member

    Joined:
    Feb 11, 2010
    Messages:
    642
    I can't be sure since I rewrote mine entirely, but I think the problem is originally in the flash object:



    Flash_Collect:
    subq.b #1,obTimeFrame(a0)


    bpl.s locret_9F76


    move.b #1,obTimeFrame(a0)


    addq.b #1,obFrame(a0)


    cmpi.b #8,obFrame(a0) ; has animation finished?


    bcc.s Flash_End ; if yes, branch


    cmpi.b #3,obFrame(a0) ; is 3rd frame displayed?


    bne.s locret_9F76 ; if not, branch


    movea.l $3C(a0),a1 ; get parent object address


    move.b #6,obRoutine(a1) ; delete parent object


    move.b #$1C,(v_player+obAnim).w ; make Sonic invisible <<


    move.b #1,(f_bigring).w ; stop Sonic getting bonuses <<


    clr.b (v_invinc).w ; remove invincibility <<


    clr.b (v_shield).w ; remove shield <<


    locret_9F76:


    rts



    That's where the game makes Sonic invisible after collecting the giant ring, and as you can see that's kind of late in the process.


    In my object, those four events are placed right before the sound plays in the giant ring object, so maybe it makes it happen one or two frames earlier.
     
  3. Dark Lips

    Dark Lips Well-Known Member Member

    Joined:
    Nov 14, 2008
    Messages:
    293
    Location:
    Wolverhampton UK
    that is something I noticed back when I had my first megadrive with sonic 1... I would spend hours with debug mode and the big ring experimenting - if you put spikes directly under the big ring object and a spring next to it sonic will hit the spikes even though he looks like he has vanished... try it when you hae some rings for a really cool effect !!!
     
  4. Crash

    Crash Well-Known Member Member

    Joined:
    Jul 15, 2010
    Messages:
    302
    Location:
    Australia
    It's really not a bug, because it's deliberately coded to work that way. Moving the line that makes sonic invisible back to before it checks the frame number of the flash should make it do what you want, though.
     
  5. Psycho RFG

    Psycho RFG Well-Known Member Member

    Joined:
    Feb 22, 2011
    Messages:
    234
    Thanks SpirituInsanum, that has too much sense. I will do it in that way. Do you think that I should change this line before too:



    Code:
    
      move.w #0,($FFFFD000).w ; remove Sonic object
    
    
    I think I have a bug because I added a pose to Sonic when the "GOT THROUGH" screen appears, so when Sonic collect the big ring with too much speed and he dissapear too late, he starts to make the pose... then, my pose code makes Sonic go out of the screen, but after deleting it due to collect the big ring.... the game keeps in this screen forever :S It only happened a few times, but I always noticed it when I enter the big ring with too much speed...

    I didn't say it's a bug... :p it is only something I noticed and I don't like it because it doesn't look good...

    [/CODE]
     
  6. SpirituInsanum

    SpirituInsanum Well-Known Member Member

    Joined:
    Feb 11, 2010
    Messages:
    642
    Of course, you can. I guess your animation is made such a way the next level will load only after Sonic left the screen, in which case there are other solutions, for example you could use a timer instead if Sonic is disabled/invisible.


    Check if Sonic is disabled, then the ring and time bonuses, and if they're equal to 0, launch a timer (increment it, it's easier), and when it reaches something like 150 frames load the next level.
     
  7. Psycho RFG

    Psycho RFG Well-Known Member Member

    Joined:
    Feb 22, 2011
    Messages:
    234
    My code works this way. Sonic is doing his pose (if he didn't take the big ring, of course) and in Obj3A_NextLevel, I check if Sonic object has been cleared by giant ring, if not, make Sonic walk to the end of the screen... if yes, branch to next level with the original instructions for it... So I really don't know why sometimes happens what I told you of been in this screen forever (after the score screen goes out).... As I said, it only happened very few times and I remember it was entering in the big ring too fast (falling from too much high or so...).
     
    Last edited by a moderator: Nov 23, 2011
  8. SpirituInsanum

    SpirituInsanum Well-Known Member Member

    Joined:
    Feb 11, 2010
    Messages:
    642
    How do you check the object has been cleared?


    You probably test the memory, whatever the way you're doing it, so the best would be to verify the value you're testing is the one you expect. You can use Regen's debugging tools to see the RAM's content.
     
  9. Psycho RFG

    Psycho RFG Well-Known Member Member

    Joined:
    Feb 22, 2011
    Messages:
    234
    Yes, I did it like this:



    Code:
    
    Obj3A_NextLevel:   ; XREF: Obj3A_Index
    
      tst.b ($FFFFD000).w ; check if Sonic object has been cleared by giant ring
    
      beq.s NextLevelCont
    
    
    [/CODE]
     
  10. Psycho RFG

    Psycho RFG Well-Known Member Member

    Joined:
    Feb 22, 2011
    Messages:
    234
    I found a way to prevent seein Sonic on the ground before he dissapear... I locked Sonic when he touch the big ring lol


    That works fine and it's not noticeable. Now the problem is that when I go to fast and take the ring, the flash art is not loaded at time :S
     
  11. Crash

    Crash Well-Known Member Member

    Joined:
    Jul 15, 2010
    Messages:
    302
    Location:
    Australia
    The ring flash is nemesis compressed, so it's going to take a few frames to load. Changing it to kosinski or maybe even uncompressed should work better. Or maybe even keep the nemesis compression and load it a bit earlier (I think it overwrites the explosion art so not to early :p)
     
Thread Status:
Not open for further replies.