Running on water

Discussion in 'Discussion and Q&A Archive' started by Blaumagier, May 31, 2009.

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

    Blaumagier Blue Mage Member

    Joined:
    Jun 5, 2008
    Messages:
    85
    Location:
    Alabama
    I recently viewed my topic about my project to find someone complimented it, and this gave me a new found inspiration to work on it again after I lost everything when my back up was erased. Anyways, I caught back up to where I was and am beginning to form ideas for level design and I was wondering is it possible to create a running on water effect, like in HCZ on S3/K, with the Sonic 1 physics engine?
     
  2. Selbi

    Selbi The Euphonic Mess Member

    Joined:
    Jul 20, 2008
    Messages:
    2,429
    Location:
    Northern Germany
    You need to know, how to make objects solid. This is my beginning of "Obj01_InWater":



    Obj01_InWater:
    lea ($FFFFD000).w,a2 ; load sonic object into a2


    move.w $10(a2),d2 ; load X-yelocity into d2


    cmpi.b #$900,$10(a2) ; is sonic fast enough to run on the water?


    blt.s ChkWater_cont ; if not, branch


    jsr SolidObject ; make water object solid


    ChkWater_cont:



    I'm not sure, how to make objects solid, so I just tried this. Mabe you'll have more luck.
     
  3. Blaumagier

    Blaumagier Blue Mage Member

    Joined:
    Jun 5, 2008
    Messages:
    85
    Location:
    Alabama
    Well, I wasn't actually looking for code (mainly because it's all gibberish to me at the moment), and while I don't understand any of the code you posted, you did actually answer my question. I just wanted to make sure I didn't have to use a different physics engine.


    I'm not actually going to use that code because I don't understand it (and I'll be damned if I put something I don't understand into my work) but thanks anyways.
     
  4. Selbi

    Selbi The Euphonic Mess Member

    Joined:
    Jul 20, 2008
    Messages:
    2,429
    Location:
    Northern Germany
    Just for the lulz, you only need to check if Sonic is fast enough and have to make the water solid. This is everything, even though I don't know how to do it.
     
  5. Blaumagier

    Blaumagier Blue Mage Member

    Joined:
    Jun 5, 2008
    Messages:
    85
    Location:
    Alabama
    Thanks, I was just wanting to know if it was possible. If I decide to use it, I'm sure I'll figure it out eventually.
     
  6. Selbi

    Selbi The Euphonic Mess Member

    Joined:
    Jul 20, 2008
    Messages:
    2,429
    Location:
    Northern Germany
    Well, if you have enough knowledge, you can do EVERYTHING with ASM. =P
     
  7. Armada

    Armada DID SOMEONE SAY WEEABOO? Member

    Joined:
    Aug 17, 2007
    Messages:
    98
    Obj01_InWater:
    lea ($FFFFD000).w,a2 ; load sonic object into a2


    move.w $10(a2),d2 ; load X-yelocity into d2


    cmpi.b #$900,$10(a2) ; is sonic fast enough to run on the water?


    blt.s ChkWater_cont ; if not, branch


    jsr SolidObject ; make water object solid


    ChkWater_cont:



    Basically, it puts the Sonic object into a2. Now, in the next line, we take Sonic's x-velocity from a2 and put it into d2. Then it compares his speed to $900 (it seems). If it is not, then it branches to the normal water code. If it is greater than $900, it skips that line and makes the water solid (although that code does not exist).


    I'm not the most knowledgeable person when it comes ASM, but I can write good pseudo code (read "code in plain words").
     
  8. Blaumagier

    Blaumagier Blue Mage Member

    Joined:
    Jun 5, 2008
    Messages:
    85
    Location:
    Alabama
    That's pretty easy to understand, but what purpose does moving the x-velocity to D2 and comparing it to $900 serve?
     
    Last edited by a moderator: May 31, 2009
  9. Selbi

    Selbi The Euphonic Mess Member

    Joined:
    Jul 20, 2008
    Messages:
    2,429
    Location:
    Northern Germany
    O_O; Uhh sorry, this line was actually completly unnecesary...

    Sonic's velocity is stored in $10(a0). $900 is Sonic, when he is running very fast. We need to check his speed, or Sonic could also stand on the water. =P
     
  10. Blaumagier

    Blaumagier Blue Mage Member

    Joined:
    Jun 5, 2008
    Messages:
    85
    Location:
    Alabama
    Ok that makes sense.


    This is the part about ASM that defeats me. I understand the commands and what they do, but I don't understand the syntax at all. How do you know what all these different values actually mean?
     
  11. Selbi

    Selbi The Euphonic Mess Member

    Joined:
    Jul 20, 2008
    Messages:
    2,429
    Location:
    Northern Germany
    Because I'm awesome. *runs*


    No srs, I just have a freaking wierd brain. I can remeber lots of things, even if I don't want. After my second ban, I learned as much as possible. And suddendly I could work with ASM. It's like, I got this ability over night. After that I was looking at this to learn some stuff by hard. But I learned the most stuff by creating stuffs like Jumpdash and Peelout.
     
  12. Armada

    Armada DID SOMEONE SAY WEEABOO? Member

    Joined:
    Aug 17, 2007
    Messages:
    98
    I wondered why you never referred to d2 anywhere. :\
     
Thread Status:
Not open for further replies.