Basic Questions and Answers Thread

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

  1. SonicVaan

    SonicVaan I'm a cyberpunk with a taste for guns Member

    Joined:
    Sep 12, 2008
    Messages:
    456
    Location:
    Germany, Cologne
    It happened to me, too, while I worked with tools. It's because I've set the speed to a very high number or something like that.
     
  2. sonicstheman

    sonicstheman Active Member Exiled

    Joined:
    Jul 12, 2009
    Messages:
    36
    I didn't know about this I searched 'accleraration' and I got a line from Obj01_Main. This is what it looks like.



    Code:
    Obj01_Main:			&#59; XREF: Obj01_Index
    
    		addq.b	#2,$24(a0)
    
    		move.b	#$13,$16(a0)
    
    		move.b	#9,$17(a0)
    
    		move.l	#Map_Sonic,4(a0)
    
    		move.w	#$780,2(a0)
    
    		move.b	#2,$18(a0)
    
    		move.b	#$18,$19(a0)
    
    		move.b	#4,1(a0)
    
    		move.w	#$614,($FFFFF768).w&#59; Sonic's top speed
    
    		move.w	#$C14,($FFFFF762).w&#59; Sonic's acceleration
    
    		move.w	#$80,($FFFFF769).w&#59; Sonic's deceleration
    
    		move.b	#5,$FFFFD1C0.w

    Yeah I changed it.
     
  3. Selbi

    Selbi The Euphonic Mess Member

    Joined:
    Jul 20, 2008
    Messages:
    2,429
    Location:
    Northern Germany
    That's because you only increased it with $14, which is kinda nothing. If you want to feel the difference, increase it with $100 or something like that.
     
  4. Rydia3667

    Rydia3667 Guest

    I can't figure this out.

    Where do I create that?


    Never mind
     
    Last edited: Aug 16, 2009
  5. Destructiox

    Destructiox Newcomer Member

    Joined:
    Jul 9, 2009
    Messages:
    17
    Actually, acceleration is originally just $C, so he increased it by $C07, but i think the problem is occurring because the acceleration is set higher than sonic's top speed. try either reducing sonic's acceleration to under $614, or increasing sonic's top speed to over $C14. I'm not saying this will definitely work, but that's an assumption i've made by reading your code.
     
    Last edited by a moderator: Aug 16, 2009
  6. snkenjoi

    snkenjoi Well-Known Member Member

    Joined:
    Sep 6, 2008
    Messages:
    59
  7. Destructiox

    Destructiox Newcomer Member

    Joined:
    Jul 9, 2009
    Messages:
    17
    I knew I should've double-checked with a calculator >.>
     
  8. Rydia3667

    Rydia3667 Guest

    umm i don't understand this. Sonic 2

    Do I need to add newer files or can I add them later?
     
  9. Thorn

    Thorn wroar Member

    Joined:
    Aug 11, 2007
    Messages:
    70
    ^ If you've put in code that looks for files that you don't have, the ROM won't compile.
     
  10. Rydia3667

    Rydia3667 Guest

    ok, i'll add it when im finished
     
  11. snkenjoi

    snkenjoi Well-Known Member Member

    Joined:
    Sep 6, 2008
    Messages:
    59
    hehe.


    </pedant>


    Where've you been thorn? Not seen you on IRC for a while.
     
  12. Thorn

    Thorn wroar Member

    Joined:
    Aug 11, 2007
    Messages:
    70
    ^ Well, I duck into the Tech Member's channel every once in a while, but that place is largely dead so I don't bother to visit not too often. I don't hang in the usual channel anymore because it's gotten to the point where I'm the only person there not working on that hack, so I'm just observing 99% of the discussion without talking. That, and I wouldn't want my "attitude" to disappoint anybody farther.~


    Also there are worse sins than saying "compile" when talking about this stuff. >_> "Halp, I cant gets mah MP3s into the Sonic 1!"


    In the interest of posting on-topic, here's a stupid question that I can't seem to figure out. In Sonic 2 (yes, Sonic 2; I know I just turned away a good 90% of SSRG members who were itching to help >_>), I'm aiming to get a monitor to break both when Sonic is touching it in a rolling animation and when touching it in one other animation. There's a routine labeled SolidObject_Monitor which branches to SolidObject_Monitor_Sonic, which checks for the rolling animation. So I add code to check for the other desired animation as well, and as expected the monitor isn't solid if I'm in that animation... except apparently the code to actually break the monitor is elsewhere, because I just phase through it. I'm pretty sure that the code that actually breaks it checks for the rolling animation and not just the rolling status, since I've tried telling the code that sets the new animation to treat Sonic as rolling. I just can't find the code that checks to see if I'm against the monitor and breaks it. >_> Does anybody know where it is? I've found code that breaks monitors, but it didn't check collision, so every monitor on screen burst when I went into that animation. :)
     
  13. Oerg866

    Oerg866 Well-Known Member Member

    Joined:
    Aug 29, 2008
    Messages:
    299
    Location:
    Frankfurt, Germany
    Oh, sorry, unfortunately that Sonic 2 thing has a true basis, because if it was Sonic 1 I could've helped you as I ran across that exact SAME problem (if I understood yours correctly, that is) few days ago. I'll post the sonic 1 fix for you then, if you can somehow translate it to Sonic 2 :)


    The key is to jump to the Obj01_DoRoll routoine, if I'm not mistaken with your problem. I set the rolling status but nothing happened and when setting speed Sonic just ran. I had to do a jsr Obj01_DoRoll to actually make him roll.


    Was that your problem or did you actually not want him roll, but rather check for that animation?


    Btw, the DoRoll routine looks like this:



    Obj01_DoRoll:
    bset #2,$22(a0)


    move.b #$E,$16(a0)


    move.b #7,$17(a0)


    move.b #2,$1C(a0) ; use "rolling" animation


    addq.w #5,$C(a0)


    tst.w $14(a0)


    bne.s locret_133E8


    move.w #$200,$14(a0)


    locret_133E8:


    rts
     
    Last edited by a moderator: Aug 20, 2009
  14. Thorn

    Thorn wroar Member

    Joined:
    Aug 11, 2007
    Messages:
    70
    ^ It's not that I want him to roll, but that I want that animation used and for the game to treat it as rolling. I've already done that in most respects, but the issue is that the monitors seem to check for the rolling animation at two points: when checking "Should I treat this monitor like a solid object?" and when checking "is this monitor being broken?". I can't find where the check for the latter is, so I either need to know its location, or I need to know a workaround.


    Oh, and Obj01_DoRoll is a label in the Sonic 2 disassemblies too, by the way. :) I appreciate the effort to help, though.
     
    Last edited by a moderator: Aug 20, 2009
  15. Oerg866

    Oerg866 Well-Known Member Member

    Joined:
    Aug 29, 2008
    Messages:
    299
    Location:
    Frankfurt, Germany
    Try to insert this code in your routine then:



    bset #2,$22(a0)
    move.b #$E,$16(a0)


    move.b #7,$17(a0)


    addq.w #5,$C(a0)
     
  16. Thorn

    Thorn wroar Member

    Joined:
    Aug 11, 2007
    Messages:
    70
    ^ Truth be told, I can't imagine why that would help. While the OST is different in Sonic 2 than it is in Sonic 1, I can tell what it is by comparing it to Sonic 2 code:


    Set rolling flag (I've already done this)


    Set Sonic's y-radius to $E


    Set Sonic's x-radius to $7


    Move Sonic down five pixels


    When you suggested calling Obj01_DoRoll, that code was already included in that routine, so I've already tested this. Unfortunately, none of that changes the fact that the monitor break code is looking for the rolling animation. :( Without the location of that code, any other attempt will be futile. Hell, I could be wrong and the code might not be looking for that animation at all, but I've set most every other aspect of rolling except that. I know a similar routine exists in Sonic 1 -- is it Megamix that lets you run right through monitors when at high speed? -- so I'm sure the answer's out there somewhere.
     
  17. Oerg866

    Oerg866 Well-Known Member Member

    Joined:
    Aug 29, 2008
    Messages:
    299
    Location:
    Frankfurt, Germany
    Well, I then suggest to make a few checks for different animations comeing after the rolling check, like this


    1. Check for Rolling animation


    2. Check for running animation


    > if yes, if speed is over nine thousand then jsr theroutinethatbreaksmonitors


    3. check for your custom animation


    etc.


    And yes, it was megamix that let you do that. (I still have that leaked source somewhere so I could take a look and see how it works, if tweaker grants me permission to do that and share my impressions, that is)
     
  18. Thorn

    Thorn wroar Member

    Joined:
    Aug 11, 2007
    Messages:
    70
    Oerg, I appreciate it, really... but you're still missing the problem. I don't know where the routine to check if a monitor should be broken is. All I've found is the routine that checks for if a monitor should be treated as a solid object, which isn't the same; I can't make a branch to theroutinethatbreaksmonitors since I don't know its name. I know that the routine checks for the rolling animation, since the rolling status doesn't cut it, but I don't see any other lines in the nearby code that check for the character's current animation, so I have no hints as to where to look.


    Also, just to let you know, running isn't what I'm looking to have break it... this is, courtesy of DNXDelta.


    [​IMG]


    (not as choppy in-game... I threw that AniGIF together in ten minutes just to make my question more clear)
     
    Last edited by a moderator: Aug 21, 2009
  19. Qjimbo

    Qjimbo Well-Known Member Member

    Joined:
    Feb 27, 2008
    Messages:
    850
    Location:
    Vancouver, BC
    *drools...*
     
  20. snkenjoi

    snkenjoi Well-Known Member Member

    Joined:
    Sep 6, 2008
    Messages:
    59
    Thorn; SolidObject_Monitor_Sonic and Touch_Monitor are the only two places you need to edit.


    Also, feel free to come back. You are a welcome presence in the channel.