Announcement

Collapse
No announcement yet.

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

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

    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

    Comment


      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

      Comment


        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.

        Comment


          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

          Comment


            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.

            Comment


              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.

              Comment


                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.

                Comment


                  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

                  Comment


                    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.

                    Comment


                      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

                      Comment


                        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.

                        Comment


                          erol ademoski Hey. Your guide for upgrade plugin from 4.23 to 4.24 is good. Only question is, how to do it for source build? When I start project it says "Loaded ExampleLibrary.dll from Third Party Plugin Samlple" and it's not working, when I enter game, even if plugin shows as enabled. Plugin is not packed, becouse, as my understanding is, its not working, when packaged.
                          And anyways I'm getting error when try to package it:
                          Code:
                          UATHelper: Package Plugin Task (Windows): ERROR: Failed to build "D:/UnrealEngine/Engine/Programs/AutomationTool/Saved\UATTempProj.proj":
                          Last edited by Freymox; 01-30-2020, 10:04 PM.

                          Comment


                            Hi Freymox , are you saying you want to build the ENGINE source, and want to include the plugin to be built during that process? If so, I can't say either way because I have never built the ENGINE source. I would post this in the C++ forum. I am sorry I could not be of more help.

                            Comment


                              erol ademoski I can't make it work for source build :/

                              Comment


                                Originally posted by Freymox View Post
                                erol ademoski I can't make it work for source build :/
                                does source build work without the plugin?

                                Comment

                                Working...
                                X