ThomasSpeedrunner Help Thread

Discussion in 'Discussion and Q&A Archive' started by ThomasThePencil, Jan 29, 2013.

Thread Status:
Not open for further replies.
  1. ThomasThePencil

    ThomasThePencil resident psycho Member

    Joined:
    Jan 29, 2013
    Messages:
    910
    Location:
    the united states. where else?
    (I apologize in advance for the double post)

    Well, then, I guess I'm using Gens Rerecording for videos, since I don't like having to use compression executables and all that. It's just a little too time-consuming :p

    EDIT: Filmed the video of Corrosion Plant Zone Act 1 v2 using Gens Rerecording and tried to upload it. BUT YOUTUBE COULDN'T PROCESS IT :/

    In other news, this hack will be entered in the 2013 Sonic Community Hacking Contest. I'm trying to get as much implemented as possible by the time I enter it.
     
    Last edited by a moderator: Feb 20, 2013
  2. redhotsonic

    redhotsonic Also known as RHS Member

    Joined:
    Aug 10, 2007
    Messages:
    2,969
    Location:
    England
    Convert it to a different format using a video converter like MainMemory and I have already mentioned.
     
  3. ThomasThePencil

    ThomasThePencil resident psycho Member

    Joined:
    Jan 29, 2013
    Messages:
    910
    Location:
    the united states. where else?
    Oh yeah. Forgot about the video converter thing. Sorry about that  :(
     
  4. nineko

    nineko I am the Holy Cat Member

    Joined:
    Mar 24, 2008
    Messages:
    1,902
    Location:
    italy
    That, or you can just set Gens Rerecording to directly output in a format which is supported by Youtube. So many formats are supported, I'm surprised you managed to find one which isn't.


    As for Fusion's codec, yeah, it's a joke, not sure why people actually use it.
     
  5. ThomasThePencil

    ThomasThePencil resident psycho Member

    Joined:
    Jan 29, 2013
    Messages:
    910
    Location:
    the united states. where else?
    Just a small note, though I'm not sure if it's really that important right now:

    Although I gave you all a small "demo" (for lack of a better term) of what Sonic 2: Titanium Upgrade will be like, the official release is planned to be released on or before the date stated at the bottom of this post. This is not really an exact date and is subject to change at any time, so it is advised that you check back constantly to see if the date has changed.

    Current Planned Date:

    December 7, 2013
     
    Last edited by a moderator: Feb 25, 2013
  6. ThomasThePencil

    ThomasThePencil resident psycho Member

    Joined:
    Jan 29, 2013
    Messages:
    910
    Location:
    the united states. where else?
    Hey everyone. I have a working jumpdash in Sonic's moveset now (a bit buggy, but still fully functional).

    I might experiment with this a bit, but what do you guys think about slightly building off of the Marble Zone boss from Sonic 1 for Corrosion Plant Zone's new boss? Under normal circumstances, it would make no sense, but here's the layout idea I had:

    [​IMG]

    A bit of tweaking here and there, and I could end up making an entirely new boss. If coded correctly, Corrosion Plant Zone's new boss should function like this:

    Movement: Back and forth across the arena.

    Attack: Dropping chemicals into the gaps in the ground (and onto the middle platform in pinch mode)

    Other Notes: There should be chemicals in the gaps in the ground that really, REALLY hurt you (read: instant death) on contact.

    I know quite a bit of what I'm doing (read: I can handle priority and SOME other SST things, since I've got the S3K Priority Manager in my hack), but that aside, I want to know where I should start. Assistance, please?
     
    Last edited by a moderator: Feb 23, 2013
  7. ThomasThePencil

    ThomasThePencil resident psycho Member

    Joined:
    Jan 29, 2013
    Messages:
    910
    Location:
    the united states. where else?
    Okay, there are some weird things that currently happen when in 2-character (read: Sonic and Tails) mode.

     -   First and foremost, the game crashes when you use the jumpdash or if Tails spawns after you use the jumpdash.

     -   Secondly, Tails has weird mappings when you use the makeshift Super Peel-Out.

     -   Strangely, neither of the above happen when using the spindash.

    Can someone explain why this is happening?
     
  8. DanielHall

    DanielHall Well-Known Member Member

    Joined:
    Jan 18, 2010
    Messages:
    860
    Location:
    North Wales
    We have nothing to go on. Post some stuff, like VRAM locations, code, whatever.
     
  9. ThomasThePencil

    ThomasThePencil resident psycho Member

    Joined:
    Jan 29, 2013
    Messages:
    910
    Location:
    the united states. where else?
    Okay then:




    jumpdash_flag =        $46 ; used for Sonic's jumpdash



    There's the jumpdash flag itself. Now for the jumpdash code as it is right now:


    Code:
    
    
    ; ---------------------------------------------------------------------------
    
    ; Subroutine that checks to see if Sonic wants to perform a homing attack or
    
    ; jumpdash
    
    ; ---------------------------------------------------------------------------
    
    Sonic_CheckHomingAttack:
    
        cmpi.b    #1,jumpdash_flag(a0)
    
        bne.s    +
    
        beq.s    return_1AD8E
    
    +
    
        cmpi.b    #1,jumping(a0)    ; is Sonic jumping?
    
        beq.s    +    ; if so, branch
    
        bne.s    return_1AD8E    ; if not, return
    
    +
    
        move.b    (Ctrl_1_Press_Logical).w,d0
    
        and.b    #button_B_mask|button_C_mask,d0    ; is B or C pressed?
    
        bne.s    +    ; if so, branch
    
        beq.s   return_1AD8E    ; if not, return
    
    +
    
        move.w    inertia(a0),d0
    
        beq.s    +
    
        bmi.s    Sonic_DoHomingAttack_Left
    
     
    
    ;Sonic_DoHomingAttack_Right:
    
    +  move.w    #$A00,x_vel(a0)    ; set Sonic's x_vel to $A00
    
        tst.b    (Super_Sonic_flag).w    ; are we Super?
    
        beq.s    loc_1AD8D    ; if not, branch early
    
        move.w    #$E00,x_vel(a0)    ; if so, set Super Sonic's x_vel to $E00
    
        bra.s    loc_1AD8D
    
     
    
    Sonic_DoHomingAttack_Left:
    
        move.w    #-$A00,x_vel(a0)    ; set Sonic's x_vel to -$A00
    
        tst.b    (Super_Sonic_flag).w    ; are we Super?
    
        beq.s    loc_1AD8D    ; if not, branch early
    
        move.w    #-$E00,x_vel(a0)    ; if so, set Super Sonic's x_vel to $E00
    
     
    
    loc_1AD8D:
    
        move.b    #1,jumpdash_flag(a0)    ; make it so that we can't use the jumpdash a second time in the same jump
    
        move.b    #AniIDSonAni_Roll,anim(a0)    ; use "jumping" animation
    
        move.w    #SndID_SpindashRelease,d0    ; play the spindash zoom sound (or at least until I can get a sound for the jumpdash/homing attack)
    
        jsr    (PlaySound).l
    
     
    
    return_1AD8E:
    
            rts
    
    ; End of subroutine Sonic_CheckHomingAttack
    
    
    
    
     
    Last edited by a moderator: Feb 23, 2013
  10. MainMemory

    MainMemory Well-Known Member Member

    Joined:
    Mar 29, 2011
    Messages:
    922
    First question: what is the value of object_size? It it is less than or equal to the value of jumpdash_flag, then you're overwriting Tails' data.
     
  11. ThomasThePencil

    ThomasThePencil resident psycho Member

    Joined:
    Jan 29, 2013
    Messages:
    910
    Location:
    the united states. where else?
    It's $40. What should I change it to?

    EDIT 1: MainMemory, I think I just figured out what's happening with each move based on the info you have given me.

    Super Peel-Out:

    1) Super Peel-Out activates

    2) Tails' mappings data is overwritten

    3) Tails displays some really fucked-up graphics (although as a side note, his tails don't since they're a separate object)

    Jumpdash:

    1) Jumpdash is used like normal before Tails appears

    2) Jumpdash flag overwrites Tails' data

    3) Game freezes

    As a second side note, using either move inevitably causes the game to freeze in some way.

    EDIT 2: Apparently, $47 will cause the following error to appear:

    Code:
    > > >s2.constants.asm(1615): error: The RAM variable declarations are too large by $428 bytes.
    > > > 	fatal "The RAM variable declarations are too large by ${*} bytes."
    fatal error, assembly terminated
    
    
     
    Last edited by a moderator: Feb 24, 2013
  12. MainMemory

    MainMemory Well-Known Member Member

    Joined:
    Mar 29, 2011
    Messages:
    922
    Well, increasing the object size by any amount is likely to cause problems with Knuckles, due to shifted RAM addresses that he doesn't have as labels. Perhaps you can instead find a way to make the most of the space you have?
     
  13. ThomasThePencil

    ThomasThePencil resident psycho Member

    Joined:
    Jan 29, 2013
    Messages:
    910
    Location:
    the united states. where else?
    How about using some of the RAM addresses represented by this bit?




                    ds.b    $C0    ; $FFFFE740-$FFFFE7FF ; unused as far as I can tell
     
  14. MainMemory

    MainMemory Well-Known Member Member

    Joined:
    Mar 29, 2011
    Messages:
    922
    If it says it's unused, it's probably unused.
     
  15. redhotsonic

    redhotsonic Also known as RHS Member

    Joined:
    Aug 10, 2007
    Messages:
    2,969
    Location:
    England
    A few tips to optimise your coding:
     
    Instead of:



        cmpi.b    #1,jumpdash_flag(a0)
        bne.s    +

        beq.s    return_1AD8E

    +





    Put this:



        cmpi.b    #1,jumpdash_flag(a0)
        beq.s    return_1AD8E



    This will save processing time and data in your game.


    Before this:



        move.b    (Ctrl_1_Press_Logical).w,d0



    Add "moveq #0,d0" so you know that d0 isn't going to be affected by anything else already stored in that data register. So you'll have this:


    Code:
        moveq    #0,d0                ; Quickly clear d0
        move.b    (Ctrl_1_Press_Logical).w,d0
    
    Now this:


    Code:
    jumpdash_flag = $46 ; used for Sonic's jumpdash
    
    I am guessing we're talking about Sonic 2 here still, right? In Sonic 2, Sonic's and Tails' SST's go upto $40. So using Sonic's $46 is crossing over to Tails's SST's. $6 in Tails is part of Tails' mappings, so Sonic's $46 is going to equal the same thing, hence why when you perform the dash, Tails fucks up, and the game crashes.

    So $46 is no good. It needs to be under $40. But most of them are being used. BUT, in Sonic 2, $1F, $20 and $21 are unused and are available for both Sonic and Tails. So try this instead:


    Code:
    jumpdash_flag = $1F ; used for Sonic's jumpdash
    
    If you have used all these unused SST's already, than I can give you another tip to free up a SST for Sonic and Tails, but I'll wait to see if the above works first.


    redhotsonic
     
  16. ThomasThePencil

    ThomasThePencil resident psycho Member

    Joined:
    Jan 29, 2013
    Messages:
    910
    Location:
    the united states. where else?
    Thanks! Just tried it and it works!

    Well, that's the jumpdash sorted out. But the Super Peel-Out still won't play ball.

    ...

    If it helps any, I did port the S3K Priority Manager to my hack before any of this.

    So, think you can help me free up an SST or two?

    EDIT: I figured it out. All I had to do for the Super Peel-Out was change its counter from $43 to $15.

    However, there's a bit more now. Remember the high jump monitor you can make? Well, THAT needs not one, but TWO Sonic and Tails SST's, since each variable referring to power-up time (invincibility_time, speedshoes_time, and hijump_time (the high jump one)) must be a word.
     
    Last edited by a moderator: Feb 24, 2013
  17. ThomasThePencil

    ThomasThePencil resident psycho Member

    Joined:
    Jan 29, 2013
    Messages:
    910
    Location:
    the united states. where else?
    Two more things I want to mention:

    1) Can someone give me some pointers on porting the elemental shields to Sonic 2?

    2) Does anyone have the Sonic 2 Clone Driver in their possession? The link over on the Sonic Retro forum thread is broken.
     
  18. ThomasThePencil

    ThomasThePencil resident psycho Member

    Joined:
    Jan 29, 2013
    Messages:
    910
    Location:
    the united states. where else?
    Is there a guide on porting the Sonic 1 sound driver to Sonic 2 using the Hg disassembly? Or will we need to translate it for use with the Hg disassembly?

    And does anyone here know how the homing attack works?
     
  19. MainMemory

    MainMemory Well-Known Member Member

    Joined:
    Mar 29, 2011
    Messages:
    922
    There are two parts to a homing attack. The first part involves searching the object ram for any object with enemy-type collision and optionally other specific objects, and finding the one that has the shortest distance, ruling out objects behind or above you. Then, you need to use the trigonometry functions to calculate the angle from you to that object, and then convert a single speed value of your choosing into X and Y speeds based on that angle.
     

    I don't know what your problem is with Sonic 2's stock driver, but if you want to have Knuckles' missing SFX from S3K restored, my guide only covers the stock driver.
     
    Last edited by a moderator: Feb 25, 2013
  20. redhotsonic

    redhotsonic Also known as RHS Member

    Joined:
    Aug 10, 2007
    Messages:
    2,969
    Location:
    England
    His invincibility and Speedshoes SST doesn't necessarily need to be a word, you can make it a byte long, same with Sonic's and Tails' Invulnerability. A bit of maths is needed for his speedshoes and invincibility, but it's possible. Invulnerable is a piece of cake to make into a byte; just go changing all the .w to .b, seeming as in Sonic 2, it's all a byte long in every use anyway.


    Same with move_lock, that ever only uses a byte, but it's being treated as a word. So you can go changing all the .w to .b for move_lock as well.


    Also, please do not double/triple post unless absolutely essential. Please use the edit button to add anything to your previous post.


    EDIT: In fact, Alriightyman made a guide on how to free up Sonic and Tails' Invincibility, Speedshoes and Invulnerability at SonicRetro found here.
     
    Last edited by a moderator: Feb 25, 2013
Thread Status:
Not open for further replies.