• Visit Rebornbuddy
  • WorldManager.Raycast questions

    Discussion in 'Community Developer Forum' started by iyake, Mar 2, 2016.

    1. iyake

      iyake Member

      Joined:
      Oct 19, 2014
      Messages:
      143
      Likes Received:
      5
      Trophy Points:
      18
      I've been thinking about writing a waypoint maker for flight paths.

      Was wondering if the raycast function gave a line of sight ray or a traversible (via flight) ray (or are they the same?) and how far away the start/end points can be (from our character's position?) for it to remain useful.

      What's put into the distances param for the 4-param version? I can't seem to make sense of the value.
       
      Last edited: Mar 2, 2016
    2. mastahg

      mastahg Administrator Staff Member

      Joined:
      Feb 27, 2011
      Messages:
      4,575
      Likes Received:
      240
      Trophy Points:
      63
      In no particular order.

      Raycast is good about 100 yards away from the character, any further its use falls off rapidly.
      Im not sure what you mean by a flight ray.
      Works by shooting a small beam from a to b and if it hits anything in between it returns that location.
      4 param function used to work differently, just ignore it now.
       
    3. Neverdyne

      Neverdyne Community Developer

      Joined:
      Sep 12, 2014
      Messages:
      631
      Likes Received:
      17
      Trophy Points:
      18
      I did something similar to make one of my projects fly, by creating a "waypoint mesh" using raycasts to determine if two points can be traveled. It worked well, however I did notice there are some false positives on the raycast function, sometimes it appears to detect hits where there is no visible objects. I'm guessing this is a problem with the game. These cases are rare though, but they did happen here and there on HW zones. Otherwise, it worked fairly well. Just make sure you're not checking big distances. If you're curious I could post the "mesher" project here (though as I've said, it's not a real mesher, more of a flight waypoint creator and a dirty A* pathfinder).
       
    4. mastahg

      mastahg Administrator Staff Member

      Joined:
      Feb 27, 2011
      Messages:
      4,575
      Likes Received:
      240
      Trophy Points:
      63
      I'll look at changing the internal astar class we use from internal to public since its a very fast implementation.
       
    5. Neverdyne

      Neverdyne Community Developer

      Joined:
      Sep 12, 2014
      Messages:
      631
      Likes Received:
      17
      Trophy Points:
      18
      That would be very helpful, thank you.
       
    6. iyake

      iyake Member

      Joined:
      Oct 19, 2014
      Messages:
      143
      Likes Received:
      5
      Trophy Points:
      18
      If you already have something working, I'd appreciate it if you shared it.

      The biggest hurdle I've come across is visualizing waypoints in the game. Been thinking of mostly using it for a gathering bot.
       
    7. mastahg

      mastahg Administrator Staff Member

      Joined:
      Feb 27, 2011
      Messages:
      4,575
      Likes Received:
      240
      Trophy Points:
      63
      Nesox made something for warcraft but my experience with directx is super limited so i never figured out what was needed to port it.
       
    8. ExMatt

      ExMatt Active Member

      Joined:
      Jul 5, 2015
      Messages:
      1,030
      Likes Received:
      14
      Trophy Points:
      38
    9. mastahg

      mastahg Administrator Staff Member

      Joined:
      Feb 27, 2011
      Messages:
      4,575
      Likes Received:
      240
      Trophy Points:
      63
      I've gone and exposed the astar class via Pathfinding.Astar
       

    Share This Page