Announcement

Collapse
No announcement yet.

DoN's 3D Pathfinding for Flying A.I. [Support Thread]

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

  • replied
    erol_demirci Cache map doesn't contain voxels per se, only the pointers. Size of a pointer is 4 bytes, if I'm not mistaken.

    Leave a comment:


  • replied
    Hey Dain_Torson Question: In the calculation: 7 * 4 = 28 bytes: Are you saying that one voxel is 4 bytes? If so, how did you find that to be?
    -Erol

    Leave a comment:


  • replied
    Hi erol_demirci!
    Originally posted by erol_demirci View Post
    Hi Dain_Torson
    Are you saying it just grows and grows for the duration of the level's existence?
    That is exactly what I'm saying.
    There are the all of the cache's usages:
    https://i.imgur.com/EWyr9Zf.png

    And it's kinda make sense for relaively small volumes. Cache is basically a map, which maps FDonNavigationVoxel pointer to it's neighbours (also FDonNavigationVoxel pointers). There gonna be 6 of them, because FDonNavigationVoxel is a cube. So there gonna be 7 * 4 = 28 bytes of memory usage for every cached voxel. Given the playable space of 100x100x100 meters and voxel size of 1 meter we gonna get approximately 28 Mbs of memory usage for fully filled cache, which is not very much in the whole game scale. Though that is very unlikely to happen because the algorithm always prefer choosing the cached voxel over discovering new ones.

    Leave a comment:


  • replied
    Hi Dain_Torson , I understand the Dynamic Collision Listener only fires (a callback) if there is an obstacle along the calculated path. Just to be clear, (i do not mean to be redundant), when you run the Schedule Path Finding task, are you saying there is not code to remove any previously found path? If not, then how is the cache being managed? Are you saying it just grows and grows for the duration of the level's existence?

    It doesn't make sense, why in the video, he would state that if the Dynamic Collision Listener fires, you must re-run the Schedule Path Finding task again to get a new path, if that did not clear some cache (previously enumerated path).

    -Erol

    Leave a comment:


  • replied
    erol_demirci
    I'm absolutely positive that it's not; I've checked all of the variable's usages: the map is never being cleared.
    Originally posted by erol_demirci View Post

    Hey Dain_Torson , Is it possible that cache is cleared when the Navigation Path Query is re-run? The path query, I would think (without looking at source code) would clear the cache because the path would not change and would run into the same obstacle it already picked up.

    Perhaps it is on a timer? I could be wrong, but I thought I remember in the video he mentions some timer for something to run (though that could be the Dynamic Collision Listener). In the video, he does say though, that you have to re-run the Path Finding Query when the Dynamic Collision Listener returns with an obstacle (perhaps the reason is to clear that cache along with generating a new query ? )
    -Erol
    Dynamic Collision Listener fires only if an obstacle appears on previously known path, but not when obstacles disappear.

    Leave a comment:


  • replied
    Originally posted by Dain_Torson View Post
    Thanks for the reply, @erol_demirci,

    I've searched through the plugin code and found that there actually is a pathfinding cache (TMap<FDonNavigationVoxel*, TArray <FDonNavigationVoxel*>> NavGraphCache variable), which as far as I can see is never being cleared. I haven't managed to develop a quick solution for that without breaking the plugin (mostly a performance of the plugin). Luckily it seems that the unbound version of the manager doesn't have such limitations, so I think I'll stay with it for now.
    Hey Dain_Torson , Is it possible that cache is cleared when the Navigation Path Query is re-run? The path query, I would think (without looking at source code) would clear the cache because the path would not change and would run into the same obstacle it already picked up.

    Perhaps it is on a timer? I could be wrong, but I thought I remember in the video he mentions some timer for something to run (though that could be the Dynamic Collision Listener). In the video, he does say though, that you have to re-run the Path Finding Query when the Dynamic Collision Listener returns with an obstacle (perhaps the reason is to clear that cache along with generating a new query ? )
    -Erol

    Last edited by erol_demirci; 01-25-2020, 01:38 PM.

    Leave a comment:


  • replied
    Thanks for the reply, @erol_demirci,

    I've searched through the plugin code and found that there actually is a pathfinding cache (TMap<FDonNavigationVoxel*, TArray <FDonNavigationVoxel*>> NavGraphCache variable), which as far as I can see is never being cleared. I haven't managed to develop a quick solution for that without breaking the plugin (mostly a performance of the plugin). Luckily it seems that the unbound version of the manager doesn't have such limitations, so I think I'll stay with it for now.

    Leave a comment:


  • replied
    Originally posted by Dain_Torson View Post
    Good evening!

    I guess I finally found a problem with this plugin. The navigation manager failes to find the shortest path after some dynamic collision update happenes. It can surely can find some path, but as far as I can see it would be based on some cached previous path. Is there any way to clear all this cache?

    Here is the video, which represents the issue:
    https://youtu.be/gkFZXKWrGKo

    And here the basic project, which I've used:
    https://gitlab.com/Dain_Torson/donnavifationbugreport
    Hi Dain_Torson ,

    I am not sure if this will help, but, in his documentation youtube video, he goes over what happens when the dynamic collision system finds an obstruction in its path. At 28:50, he goes into custom navigation queries. He goes over, in short, what happens if the Dynamic Collision Listener reports something... see if that helps you any. Important part is at about 30:00. He never talks about caching (not sure if it is something the plugin does or not) but, the sourcecode is small enough for you to take a peek and see if you can find anything on that subject.

    -Erol

    Leave a comment:


  • replied
    erol ademoski I just found a solution for my problem. Apparently I just needed to increase Breaking friction factor to get instant stop. It seems, that's a way how Pawn in demo sample stops. Demo Pawn deceleration is set to 8000. that gives them instant stop. So when I increase my character Breaking friction factor from 2 to same 8000, it's not floating in air anymore,but stops right a way, and in my behavior tree everything gets triggered as it should be.
    Will do some testing, bet it seams like, these was a problem and it's fixed. Hopefully will help someone to save some time.

    Leave a comment:


  • replied
    Originally posted by Freymox View Post
    erol ademoski I did a change and still nothing - https://gyazo.com/49d2fa294f92e0d28d56e3beba0b728c
    If I change maximum proximity required form 15 to 30, then at least it goes farther than fly to in behavior three. As u can see in this video - https://drive.google.com/file/d/1Dya...3JM4wLYl0/view
    at least it prints out hello. But my BP don't understand, that AI is in a place, becouse after reaching the point in just floats in the air. It's not stopping at way point.
    Hi Freymox : Are you using a Behavior Tree with the flyto node? if not, what is it supposed to do after it reaches the destination? I'm kind of confused... if there is only one instruction which is to fly to the flyto node, and there is an expectation that it stops automatically when it reaches the destination, I believe that may be the issue. It wont just stop unless you tell it to stop (I believe). Also, did you test using Pawn type with a FlyingMovementComponent? What collision type is that volume's mesh set up as?

    -Erol

    Leave a comment:


  • replied
    Good evening!

    I guess I finally found a problem with this plugin. The navigation manager failes to find the shortest path after some dynamic collision update happenes. It can surely can find some path, but as far as I can see it would be based on some cached previous path. Is there any way to clear all this cache?

    Here is the video, which represents the issue:
    https://youtu.be/gkFZXKWrGKo

    And here the basic project, which I've used:
    https://gitlab.com/Dain_Torson/donnavifationbugreport

    Leave a comment:


  • replied
    erol ademoski I did a change and still nothing - https://gyazo.com/49d2fa294f92e0d28d56e3beba0b728c
    If I change maximum proximity required form 15 to 30, then at least it goes farther than fly to in behavior three. As u can see in this video - https://drive.google.com/file/d/1Dya...3JM4wLYl0/view
    at least it prints out hello. But my BP don't understand, that AI is in a place, becouse after reaching the point in just floats in the air. It's not stopping at way point.
    Last edited by Freymox; 01-21-2020, 10:20 AM.

    Leave a comment:


  • replied
    Originally posted by Freymox View Post
    Hi erol_demirci,

    Here is a video - https://gyazo.com/cdce54ee6b790bf61bcbe5638e0c19db
    My way-point collision is set to nocolission. and I even add it as "Actors to ignore for collision" I haven't couched DonManager at all. Im using example project to figure out why my sistem is not working.
    I'm using charachter instead of pawn. could that be a problem? And I use my own way-point instead of what is used in example. Cold any of these cause a problem?
    Hey Freymox ; Even if the waypoint collision entry is set to 'no collision' (like a trigger or a volume without a collider) it should still have a collision type entry, and it is likely WorldStatic or WorldDynamic if you have not changed it. This entry is a member of the array of obstacles in the DonManager. The object does not need collision turned on to become an obstacle, only the entry in the obstacles array in the DonManager is required (which those two entries are defaulted into the obstacles array). Please check the Waypoint mesh(es) to ensure none of them are of the types that are defined in the obstacles array. Better yet, you can past images of all the meshes' collision properties that make up the waypoint so we can see their enumerations.

    Character is a subclass of pawn, and I do not believe you need the pawn class to use this plugin. I could be wrong, but I believe you can even attach it to actor and it would work, provided it has movement components for the actor to move. Character comes with a movement component on its own so that should not matter. If you really want to test it, you could try creating a pawn and giving it a FlyingMovementComponent (I think it's called) to see if that helps, but I believe the issue is what I pointed out earlier.

    -Erol
    Last edited by erol_demirci; 01-20-2020, 11:42 PM.

    Leave a comment:


  • replied
    Hi erol_demirci,

    Here is a video - https://gyazo.com/cdce54ee6b790bf61bcbe5638e0c19db
    My way-point collision is set to nocolission. and I even add it as "Actors to ignore for collision" I haven't couched DonManager at all. Im using example project to figure out why my sistem is not working.
    I'm using charachter instead of pawn. could that be a problem? And I use my own way-point instead of what is used in example. Cold any of these cause a problem?

    Leave a comment:


  • replied
    Originally posted by Freymox View Post
    Anyone has idea why Im getting these? It never stops at point. And if I put wait after fly to it just keep floating in air.
    https://gyazo.com/7969ff85a3b8455b9575ec60974213b4
    Hi Freymox ,

    The only time I've seen the drift off like that is when the search query doesn't respond in time, OR, the point you're trying to go to is not reachable. Are you familiar with the DonManager object's properties? Specifically the arrays that identify types of collider identities as obstacles? Also, do not adjust the DonManager scale in the world outliner, and instead, use the DonManager properties X Y Z values to increase the size of the DonManager that way.
    One way you can check the first suggestion is (this OR that) is by enabling all the debugging options in the blueprint node. Do that and then post another video if you still can't figure out. If you see a bunch of red dots around your point, and it never actually hits the point, and the distance from the ai to the destination is MORE than what the threshold is defined in the Blueprint node, then most likely the destination is inside a collider that is marked as an osbstalce (world dynamic and world static are obstacles by default... is that box a world dynamic or world static collision type?).

    -Erol

    Leave a comment:

Working...
X