Jump to content

Razmataz

System Admin
  • Content Count

    378
  • Joined

  • Last visited

  • Days Won

    9

Posts posted by Razmataz


  1. YOU ARE INDEED CORRECT!!!!!

    Here's the indepth explanation

    WoW engine sends "MovementSpline" packet to broadcast where NPC walks to when you use default waypoint behaviour, that is, a delay of 0. This is not observed on delay of 10.

    With example NPC of waypointing 100 yards north 3 times, then turn,, then come back south, the client receives

    Points: X: 995 Y: 5 Z: 0
    WayPoints: X: 1000 Y: 0 Z: 0
    WayPoints: X: 1100 Y: 0 Z: 0
    WayPoints: X: 1200 Y: 0 Z: 0
    WayPoints: X: 788 Y: 0 Z: 0
    WayPoints: X: 788 Y: 5 Z: 0
    WayPoints: X: 1200 Y: 4.75 Z: 0
    WayPoints: X: 1100 Y: 4.75 Z: 0
    WayPoints: X: 1000 Y: 4.75 Z: 0

    Obviously we expect to see X: 1300.

     

    However, WoW Client is not receiving 'float' positions. It is receiving 'packed positions', which is storing X, Y and Z coordinates into 4 bytes. How is this accomplished?

    packed |= ((int)(x / 0.25f) & 0x7FF);
    packed |= ((int)(y / 0.25f) & 0x7FF) << 11;
    packed |= ((int)(z / 0.25f) & 0x3FF) << 22;

    The 0.25f = a granularity of 0.25. That means that's your smallest increment.

    The 0x7FF is how many unique values are supported. It is 2048.

    Multiply together and you get 2048*0.25 = 512.

     

    Clearly there's a thing going on here, we should have 30k coordinates. What's going on is that the server is sending you the 'deltas' andtthen using the Points field to calculate the correct positions ahead of time. So, it's actually taking +5, +105, +205, +305, +305, +205, +105, +5, +0.

    Looks like this:

    m_positionX = 0.0285644531, m_positionY = -0.701850891, m_positionZ = 0.000503270887, m_orientation = 0
    m_positionX = -2.93139648, m_positionY = -0.395553589, m_positionZ = 0.000503270887, m_orientation = 0
    m_positionX = -102.961426, m_positionY = 9.15584564, m_positionZ = 0.000503270887, m_orientation = 0
    m_positionX = -202.501465, m_positionY = 18.8446503, m_positionZ = 0.000503270887, m_orientation = 0
    m_positionX = -302.981445, m_positionY = 18.1867447, m_positionZ = 0.000503270887, m_orientation = 0
    m_positionX = -306.211426, m_positionY = 16.5373459, m_positionZ = 0.000503270887, m_orientation = 0
    m_positionX = -302.841431, m_positionY = 16.7536469, m_positionZ = 0.000503270887, m_orientation = 0
    m_positionX = -202.951416, m_positionY = 17.585144, m_positionZ = 0.000503270887, m_orientation = 0
    m_positionX = -103.38147, m_positionY = 8.27894592, m_positionZ = 0.000503270887, m_orientation = 0
    m_positionX = -3.88146973, m_positionY = -1.75905609, m_positionZ = 0.000503270887, m_orientation = 0}}}

    Because of that, it needs to support negatives. This means that our unique values actually half from 0 to +512, to -256 to +256

     

    305 is in excess of 256. How does it handle this? It overflows:

    305-256 = 49

    995 - 256 = 739

    739 + 49 = 788

     

    This cannot be fixed. You must simply not use the MovementSpline techonlogy when you are working with patrols that go beyond 256 yards from the original point.

    OR, you can be clever, and put the npc at the midpoint between the waypoints.

     

    When using a delay of 10, each packet explicitly sends the new position,

    (MovementMonsterSpline) (MovementSpline) PointsCount: 1
    (MovementMonsterSpline) (MovementSpline) [0] Points: X: 995 Y: 0 Z: 0
    (MovementMonsterSpline) (MovementSpline) PointsCount: 1
    (MovementMonsterSpline) (MovementSpline) [0] Points: X: 1000 Y: 0 Z: 0
    (MovementMonsterSpline) (MovementSpline) PointsCount: 1
    (MovementMonsterSpline) (MovementSpline) [0] Points: X: 1100 Y: 0 Z: 0
    (MovementMonsterSpline) (MovementSpline) PointsCount: 1
    (MovementMonsterSpline) (MovementSpline) [0] Points: X: 1200 Y: 0 Z: 0
    (MovementMonsterSpline) (MovementSpline) PointsCount: 1
    (MovementMonsterSpline) (MovementSpline) [0] Points: X: 1300 Y: 0 Z: 0

    As Points contains full granularity and is not packed.

     


  2. changing .npc walk/run to have extra params

    e.g.

    .npc walk here height

    .npc run there formation

    the 'height' will skip the height calculation and use your given height. it won't be able to do much sophisticatd path generation with it, though, so you can't make them go up a ___/ ͞ ͞ ͞  unless you do 3 walks, one to start of ramp, one to top of ramp, one to the end of the raised platform.

     


  3. i could replicate if i used the same issue we had with auras a while back.

    .phase forge npc mount 1337

    .npc set aura 12345

    <restart>

    the npc loses its mount because it has addon data, and addon data has no mount / trumps the phase forge npc settings.

    actually difficult to fix because you can't force an npc to be dismounted in a clever way....


  4. okay, so

    .phase set time off

    - Time progresses in server time as normal.

     

    .phase set time HH:MM

    - Calculate the difference between the specified HH:MM and server time. Anyone who joins your phase receives the same offset.
    If the server time is 6:00pm and I do .phase set time 15:00, then anyone who joins the phase has their time put to 3 hours before server time. i.e. If they join at 7:00pm, then their time is adjusted to 4:00pm when entering the phase

     

    .phase set time HH:MM permanent

    - Phase always stays at HH:MM time. Will adjust date accordingly, though.

     

×