Announcement

Collapse
No announcement yet.

Rama's Multi-Threaded Dynamic Pathing System, Full Physics Support

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

    Rama's Multi-Threaded Dynamic Pathing System, Full Physics Support

    Dear Community,

    I am designing a custom AI with my own custom pathing system, as requested by a client!

    Here's a video of my progress with my very own pathing system!

    First video
    https://www.youtube.com/watch?v=mMKQvAf9KSQ


    What you see in video is that I am dynamically generating as-large-as-possible nodes to represent open spaces of no collision in the world.

    My dynamic pathing system generates whatever size shapes are required to contain collision-blocking objects, including physics simulating meshes!

    My internal data representation is utterly simple, just a point and a radius, though I draw them as boxes to be easy on the engine (spheres take longer to draw in large quantity).

    ~~~

    Full Physics Support

    In the video I keep dropping physics simulating meshes into the world and you can see how my dynamic pathing system adapts to the changing outlines of the physics meshes!!

    The AI I am designing will use these nodes to navigate through the world, avoiding objects with collision, to get to their chosen destinations!

    The larger the node is the better! This means the AI has choice as to how it wishes to path through those larger nodes.

    Having that much space allows the AI to customize its movement patterns so that each type of creature feels unique, and knows where it can roam free and where it has to fit through tight spaces.



    ~~~

    Multi-threading

    The entire process that you see in this video is multi-threaded!

    I am leveraging our modern technology for my pathing system!

    The game thread is free!

    The only thing the game thread is doing is drawing the results as it receives them from my dynamic navigation thread, and it wont even be doing that during normal gameplay!

    The AI will also be able to be multi threaded, since my core data is USTRUCT, below the UOBJECT level.

    You can't multi thread changes to UObject data, so my entire pathing system is a series of USTRUCTS.

    Several arrays inside of arrays inside of some more arrays actually

    The result of staying at the USTRUCT level is that I can easily multi-thread my entire AI system!

    This means maximum performance for high speed gameplay with fast and intelligent AI units!

    Enjoy the video!

    ~~~

    Rama's Multi Threaded Pathing System With Physics Support, In Action!


    Here it is!

    My own pathing system which I wrote from scratch, which has fully physics support and does dynamic recalculations whenever needed by each AI unit!

    My system supports 400 units using it simultaneously, maintaining 60fps!

    I wrote this whole thing from scratch, the only interaction I have with UE4 movement code is the fact that I am applying velocity to the character movement component (which replicates by the way)!

    Everything else is being done by my own system!


    Enjooy!



    Rama
    Last edited by Rama; 08-02-2014, 02:59 PM.
    100+ UE4 C++ Tutorials on the UE4 Code Wiki, including UE4 Multi-Threading!

    UE4 Marketplace: Melee Weapon Plugin & Compressed Binary Save System Plugin | Rama's C++ AI Jumping Videos | Vertex Snap Editor Plugin

    Visit www.ue4code.com to see lots of videos about my C++ Creations! ♥ Rama

    #2
    This is awesome Rama! In fact, this is exactly what I've been looking for!

    Will you ever release this to the public? Thanks!

    Comment


      #3
      This is really cool!
      Great work!
      Twitter | dylan@incandescentimaging.net | View Caffeine On IndieDB

      Comment


        #4
        Originally posted by KoldKam View Post
        This is awesome Rama! In fact, this is exactly what I've been looking for!

        Will you ever release this to the public? Thanks!
        Once the system is in a more complete form we can discuss this some more! I am glad you like it !



        Originally posted by DylserX View Post
        This is really cool!
        Great work!
        Hee hee!



        Rama
        100+ UE4 C++ Tutorials on the UE4 Code Wiki, including UE4 Multi-Threading!

        UE4 Marketplace: Melee Weapon Plugin & Compressed Binary Save System Plugin | Rama's C++ AI Jumping Videos | Vertex Snap Editor Plugin

        Visit www.ue4code.com to see lots of videos about my C++ Creations! ♥ Rama

        Comment


          #5
          This is indeed pretty cool
          Keep it up!

          Comment


            #6
            Really nice work! Thanks for posting the video as well!

            Quick question:
            Would it be possible to run AI behaviors dynamically based on whether or not they are in a zone that will contain collision?

            Let me explain:
            Example - AI is running through a wide hallway with no objects obstructing their path. Then parts of the cieling begin to fall to the floor. If the AI is below one of the chunks, could you build the AI to be able to analyze the size of the falling object and the best route it needs to take in order to run a few steps and dive out of the way into a safe zone? This I feel would make gameplay very unique and lifelike. If you were able to build such an ability, you could really take advantage of games where the player has dynamic destruction control over the environment or large scale environmental changes such as terraforming a level.

            I feel something like this would have made games such as Fracture much more unique and enjoyable:
            Last edited by JBaldwin; 07-31-2014, 03:43 PM.
            Portfolio
            UE3 - Advanced FX Masterclass Part 1 DVD
            UE3 - Advanced FX Masterclass Part 2 DVD

            Comment


              #7
              Originally posted by JBaldwin View Post
              Example - AI is running through a wide hallway with no objects obstructing their path. Then parts of the cieling begin to fall to the floor. If the AI is below one of the chunks, could you build the AI to be able to analyze the size of the falling object and the best route it needs to take in order to run a few steps and dive out of the way into a safe zone? This I feel would make gameplay very unique and lifelike. If you were able to build such an ability, you could really take advantage of games where the player has dynamic destruction control over the environment or large scale environmental changes such as terraforming a level.
              Dear Jeremy,

              Sure! Absolutely I can do that!

              Since your goal is very fast reaction time, and the creature is known to be an open space based on my pathing spaces, I would do a Actor Iterator search to find all physics simulating meshes in the environment and detect their proximity to the creature. This is simpler than doing traces / is less costly on the CPU

              If the physics simulating object is deemed to be a threat by the creature, I would then measure the collision bounds of the physics object and then tell the creature to move to nearby safe zones as determined by my pathing system, using the collision size of the physics object to know which of my pathing spaces will soon be obstructed.

              It's actually not that complicated!

              You're right it would make the AI look super cool and smart

              Keep an eye on this thread, I will be posting a video of my AI dynamically re-routing itself based on physics colliding objects very soon!

              Rama
              100+ UE4 C++ Tutorials on the UE4 Code Wiki, including UE4 Multi-Threading!

              UE4 Marketplace: Melee Weapon Plugin & Compressed Binary Save System Plugin | Rama's C++ AI Jumping Videos | Vertex Snap Editor Plugin

              Visit www.ue4code.com to see lots of videos about my C++ Creations! ♥ Rama

              Comment


                #8
                Wow! That would be really neat to see something like that in action
                I will definitely keep an eye on the thread and look forward to your video!
                Portfolio
                UE3 - Advanced FX Masterclass Part 1 DVD
                UE3 - Advanced FX Masterclass Part 2 DVD

                Comment


                  #9
                  Originally posted by JBaldwin View Post
                  Wow! That would be really neat to see something like that in action
                  I will definitely keep an eye on the thread and look forward to your video!
                  Well here is my next video!

                  In this video I am showing how my pathing system recalculates the path pretty much instantly to account for physics objects that I drop into the world!

                  First I demo basic pathing, including pathing down a bunch of rocks, over a ramp, and around a 3-directional wall block to get the goal!





                  Enjoy!

                  Rama
                  100+ UE4 C++ Tutorials on the UE4 Code Wiki, including UE4 Multi-Threading!

                  UE4 Marketplace: Melee Weapon Plugin & Compressed Binary Save System Plugin | Rama's C++ AI Jumping Videos | Vertex Snap Editor Plugin

                  Visit www.ue4code.com to see lots of videos about my C++ Creations! ♥ Rama

                  Comment


                    #10
                    You are making my brain hurt again, Rama. Amazing stuff as always!
                    FREE VR Drum Kit Project
                    FREE Color LUT Collection
                    FREE Physics Driven Spacecraft Project
                    FREE GTA Style Vehicle Interaction
                    Dynamic DoF(Depth of Field)
                    Camera Crossfade

                    Comment


                      #11
                      Wow! Now that is awesome
                      It is truly fast!

                      Out of curiosity, is it possible to apply "FX" to this data? For instance, what if the path needed to be seen by the player (Like a GPS).
                      Portfolio
                      UE3 - Advanced FX Masterclass Part 1 DVD
                      UE3 - Advanced FX Masterclass Part 2 DVD

                      Comment


                        #12
                        I liked the dwarf-dropping ability.

                        Oh and the dynamic pathing too!

                        hehehe
                        Jefferson Pinheiro

                        Comment


                          #13
                          Originally posted by Jacky View Post
                          You are making my brain hurt again, Rama. Amazing stuff as always!
                          Great to hear from you Jacky, hee heeee!

                          Originally posted by Ixiguis View Post
                          I liked the dwarf-dropping ability.

                          Oh and the dynamic pathing too!

                          hehehe

                          Ixiguis! How did you know I've been honing my dwarf dropping abilities over many months?!

                          Rama
                          100+ UE4 C++ Tutorials on the UE4 Code Wiki, including UE4 Multi-Threading!

                          UE4 Marketplace: Melee Weapon Plugin & Compressed Binary Save System Plugin | Rama's C++ AI Jumping Videos | Vertex Snap Editor Plugin

                          Visit www.ue4code.com to see lots of videos about my C++ Creations! ♥ Rama

                          Comment


                            #14
                            Originally posted by JBaldwin View Post
                            Wow! Now that is awesome
                            It is truly fast!

                            Out of curiosity, is it possible to apply "FX" to this data? For instance, what if the path needed to be seen by the player (Like a GPS).
                            Ahh! FX! Your amazing strength Jeremy!

                            Sure!

                            I love to expose my fancy C++ mechanics to Blueprints, I do it all the time!

                            So I could easily make a BP Event that would say "here's all the points and the line directions between the points for the most recent calculated path"

                            I could easily give you the start points and end points for a series of Beam Particles!

                            Optionally I could set the particle data myself in the C++ if supplied with the Beam and the name of the start and end parameters.

                            But you could use anything really, doesnt have to be Beams. I could supply a whole series of points if you wanted to use point particles effects, or even GPU particles!

                            ~~~

                            The Best Path

                            Also I am about to make the final set of code where the "Best Path" is chosen by the AI and will not change too often, so it will look even better visually!

                            ~~~

                            The Power of BP and C++ Combined

                            So yes, by using the power of Blueprints I can expose the core C++ data to be used in Blueprints however an amazing FX Engineer like you deems fit!

                            All the debug info can be turned off at any time so only the FX that you are choose are used, changeable any time in BP!

                            That's what I love about BP, gives everyone access and allows me to enable people to customize my handiwork in C++ any way they want in BP!



                            Rama
                            Last edited by Rama; 08-01-2014, 01:03 PM.
                            100+ UE4 C++ Tutorials on the UE4 Code Wiki, including UE4 Multi-Threading!

                            UE4 Marketplace: Melee Weapon Plugin & Compressed Binary Save System Plugin | Rama's C++ AI Jumping Videos | Vertex Snap Editor Plugin

                            Visit www.ue4code.com to see lots of videos about my C++ Creations! ♥ Rama

                            Comment


                              #15
                              @Rama - It's tools like this that make me drool ^_^
                              Thanks for the examples and I can't wait to see the Best Path!

                              Keep up the awesome work
                              Portfolio
                              UE3 - Advanced FX Masterclass Part 1 DVD
                              UE3 - Advanced FX Masterclass Part 2 DVD

                              Comment

                              Working...
                              X