Announcement

Collapse
No announcement yet.

Get Random Point in Navigable Radius (Can this be forced into a cone?)

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • replied
    Hi, get a random point inside your cone (or inside the between the two radius for your other usage) and then use "ProjectPointToNavigation". If that succeds, then you've found a point, if not try it again until it either succeeds, or you should also stop after a certain number of fails and then assume that there is no navigable point there.


    Also you could use EQS, and generate points in a cone with trace mode navigation and then choose a random one of them.

    Leave a comment:


  • replied
    Originally posted by Benni.Lodge View Post

    Sorry about the delayed reply, and thank you for your answer. This sounds like it would work, but I don't think it would consider the NavMesh would it? the main reason I was trying to find a method that used the Random Point In Navigable Radius node was that it factored the traversable space for the AI. I will try using this method, but I get the feeling it might produced invalid destinations for my characters.
    Hello @Benni.Lodge, Hello all
    did you ever found a suitable solution? I am looking exactly for the same thing, "get random Point in navigable cone" and also a "get random Point between two navigable radius". So I can set "min" range from center and "max range from center" and get a random point between.

    Is saw JJ_Jacks 'sidea, but as he already said, this could often lead to very, very inefficient and many calls, if the place get to very small cone. Is there any way you can think off or perhaps a tutorials you know how to make a good:
    1. "get random Point in navigable cone"
    2. "get random Point between two navigable radius"
    ?

    Leave a comment:


  • replied
    The easy way would be to get a random point in navigable radius, test if it's in your cone by using the dot product and the bik's forward vector. If it's not, repeat the process.

    If your cone is really small this will be inefficient though.

    Leave a comment:


  • replied
    Originally posted by Name368 View Post
    Its probably possible...
    There is node "random unit vector in cone with yaw and pitch"
    Output of this node is max 1 1 1, its usually used for shotguns...
    So, you can multiply this value from 1 to 1000 so you can get point in shotgun muzzle, or 500 units away from muzzle but still in cone... if you want only "2d cone" use pitch 1 and yaw 10 for example... i hope you understand, if not let me know and i will make bp for this and print screen here.
    Sorry about the delayed reply, and thank you for your answer. This sounds like it would work, but I don't think it would consider the NavMesh would it? the main reason I was trying to find a method that used the Random Point In Navigable Radius node was that it factored the traversable space for the AI. I will try using this method, but I get the feeling it might produced invalid destinations for my characters.

    Leave a comment:


  • replied
    Originally posted by Benni.Lodge View Post
    Is there a way for me to use the Get Random Point In Navigable Radius node and have it only check within a cone? In my game the AIs are motorbikes who move forwards, but I was hoping to get some variation within their paths whilst still using pathfinding.

    Do I need to add a filter class or some NavData? I'm not a programmer so I'm not sure how I'd go about solving this. I spent ages trying to clamp and flip the result into a valid positive x-axis but then i realised that this makes the "Navigable point" part invalid.
    Its probably possible...
    There is node "random unit vector in cone with yaw and pitch"
    Output of this node is max 1 1 1, its usually used for shotguns...
    So, you can multiply this value from 1 to 1000 so you can get point in shotgun muzzle, or 500 units away from muzzle but still in cone... if you want only "2d cone" use pitch 1 and yaw 10 for example... i hope you understand, if not let me know and i will make bp for this and print screen here.

    Leave a comment:


  • Get Random Point in Navigable Radius (Can this be forced into a cone?)

    Is there a way for me to use the Get Random Point In Navigable Radius node and have it only check within a cone? In my game the AIs are motorbikes who move forwards, but I was hoping to get some variation within their paths whilst still using pathfinding.

    Do I need to add a filter class or some NavData? I'm not a programmer so I'm not sure how I'd go about solving this. I spent ages trying to clamp and flip the result into a valid positive x-axis but then i realised that this makes the "Navigable point" part invalid.
Working...
X