Solved Player Speeds

Discussion in 'Plugin Development' started by DevRosemberg, Jul 20, 2014.

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

    DevRosemberg

    Hello, i was wondering if anyone knew of a way to calculate the Speed(s) of a player when he is Sprinting, Walking, Swimming, etc. I need to use this for a project that i made but im not sure on how to calculate them. Not looking for any code just a direction in which to start or a calculation that i need to make.

    Thanks in advance :)
     
  2. Offline

    mythbusterma

    You can use the standard velocity formula: v = ds/dt

    Alternatively, the speeds are always the same:
    Walking: 4.3 m/s
    Sprinting: 5.6 m/s
    Sneaking: 1.3 m/s
    Swimming (surface): 2.2 m/s
    Swimming (underwater): 1.9 m/s
     
  3. Offline

    FabeGabeMC

  4. Offline

    Necrodoom

  5. Offline

    FabeGabeMC

    Necrodoom :>
    Edit: I don't see blocking :<
     
  6. Offline

    mythbusterma

    Necrodoom

    That's the article I was reading from. However OP probably wants to do the math, because that isn't accurate if a potion of slowing is applied, or other effects.
     
  7. Offline

    DevRosemberg

  8. Offline

    mythbusterma

  9. Offline

    _Filip

    mythbusterma One small question, what is the d variable in your formula?
    I know about v = s/t.
     
  10. Offline

    Necrodoom

    TheSpherret Delta, which would basically mean:
    Velocity = (End point - Start point) / (End time - Start time)
     
  11. Offline

    mythbusterma

    TheSpherret

    It's not a variable, ds is a variable and dt is a variable. The "d" portion of it refers to a an infinitesimal change in s and t, allowing for integration to a continuous velocity (in this context the "d" can be safely ignored).
     
  12. Offline

    DevRosemberg

  13. Offline

    mythbusterma

    DevRosemberg

    Someone should tell the RS Wiki they dun' goof'd.
     
  14. Offline

    Conarnar

    Couldn't you just find the players velocity and find its magnitude?
     
  15. Offline

    DevRosemberg

  16. Offline

    Conarnar

    player.getVelocity().length()
     
Thread Status:
Not open for further replies.

Share This Page