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

Just revisiting fun video of my success with getting UE4 AI system working with physics simulating rolling balls, hee hee!

there’s no Matinee or tracks or splines in the editor involved here!

is all done via C++ AI system, and I am picking destinations for the AI units to move to and then they are going their!

I also made my own AI Jump volume, which tosses the balls into the air, forcing them to retrace their way back to their chosen destination.

's Physics Character Pathing System

I just had a major AI Victory!

I overrode and rewrote large portions of Epic’s Character AI Pathing system to work with physics simulating characters!

There’s no native support for , but using some of my own functions that I’ve been writing for my physics multiplayer game, I was able to do it!

Epic very nicely exposed as virtual all the functions I needed to override, thank you Epic!

Here is the result!

https://youtube.com/osC5GI_t7Ic

:heart:

@ - sounds like you have everything needed to make a truly dynamic character controller. All that’s left mainly is making the character “walk on raycasts” (use two per foot IMO) to determine when they are falling/in air, and also a center of gravity calculation. If the COG is not over the feet, make the character fall/ragdoll in the direction of the COG. It’s possible to do some extremely awesome stuff with a truly dynamic character like that. You’d want to use the PhAT collision rather than a capsule in that case as well, to get even more out of it.

Lovely to hear from you n00854180t !!

Actually these characters are simulating physics already so they are using PhAT collision, you are talking about the rolling spheres or something else?

:slight_smile:

Great to hear from you!

:heart:

[FONT=Comic Sans MS]Dynamic AI Jumping For Shortcuts

In video I am demonstrating the use of Navigation Mesh Point Projection to identify shortcuts for the navigation path that require jumping!

When you see my AI jump to take shortcuts to their goal in video, it is not pre-determined!

I am dynamically calculating whether the AI should take a shortcut by jumping, and then overriding their normal pathing system so that they pursue the shortcut instead.

Toward the end of the video you will see them jumping pretty high to reach their goal that is on higher ground!

I did all the coding for in C++ in my custom navigation component classes and the character class :slight_smile:

When the AI unit is following the jumping shortcut I do the code in the character class, and turn normal pathing off.

While in normal pathing, I am running my own custom navigation point project line tests to check for shortcuts, which is what those lines of dots are!

I stop as soon as higher ground is found that has pathing on it, and redirect the AI to use shortcut!


**Navigation Point Projection**

involves taking a 3D world space point, and using a volume extent to check if there are any nearby points in the navigation mesh that are within the z value of the extent.

In way I can check if higher or lower ground has pathing, and is thus viable to path to via a jump!

Finding the best shortcuts and telling the AI to use them involved a loooot of C++ coding on my part hee hee!

Thank you to Epic for USTRUCTS so I could expose all of to Blueprints and keep the data organized in code without creating additional classes!

Video

https://youtube.com/JZKjkWQes8I

is impressive, nothing else would I expect from you ^^
As I assume it’s fit for your client needs and will be only available to him/her (at least is what I assume), I do wonder if it worked with custom movement like double jumps or dashing or more accurate how hard would it be to implement?
But as I said: impressive work, keep it up!

That’s pretty impressive. Will your pathfinding become part of UE4 engine ? Why Epic is not hiring you ?

Looking great as always great work. I like the new butterflies in your signature! =)

It would not be hard for me to get the AI to use all kinds of custom abilities, which is what I’ll be doing for Abatron!

But I agree it will require tailoring and tweaking of various settings.

My entire AI system is exposed to BP for tweaking though, so works out just fine!

:slight_smile:

Hee hee!

Nice to hear from you

Hee hee!

Butterflies!

:heart:

Hey how much C++ code have you had to parse thru and write to get all stuff working? I’m probably about to go down a similar route and am glad to see that it’s not impossibly difficult to go deep down into the pathfinding system and override stuff in C++. Any advice on what classes and functions to look out for on that journey? I’m also running into the need for weird pathfinding on dynamically generated terrain with agents that will need to find jump points and such. I thought I was going to have to dynamically generate nav link proxies, but it seems your solution is equally robust as a different option. :slight_smile:

I did everything using just PathFollowingComponent!

I did a lot of calculations in Character class, and that’s about it!

I think you should just get started and see how it goes!

Here’s a wiki tutorial on using a custom PathFollowingComponent (by )

https://wiki.unrealengine.com/Unreal_Engine_AI_Tutorial_-_1_-_Making_AI_Jump_as_a_Part_of_Path_Following


**Video Of 's Jump Pathing AI**

In video, my AI is dynamically finding jumping routes without any help from nav links, runtime-created or placed in the editor!

I could make a whole new level setup in about 5 min and they would perform in the same way they do in video!


/0GX-1x-wACI


:)

Very slick, . Keeping an eye on for sure.

Food for thought

Hi ! :slight_smile:
I’ve been a long time (lurking) watcher of thread and figured I’d say hi and put in some input on your system thus far :smiley:

I think one of the next steps to truly level-up your AI system would be to add cooperative AI goals for AI to accomplish certain tasks they could not do by themselves. You can for example have:

  • Have 2 AI work together to push up the other AI to a previously inaccessible ledge.
  • Detection that a fellow AI is in trouble than seek out & protect it using a swarm/hive-mind type behaviour e.g. a medieval game where all the AI with shields lock into each other when a arrow-storm is upon them :smiley:
  • A physics based object is blocking the path to an objective and the AI can work together in numbers to move the obstacle.
  • And much much more :wink:

I believe another improvement you could make and which would be pretty straightforward to implement, would be the ability for AI to recognise edges of an object when path-finding and depending on whether it is above or below, decide whether to climb up the ledge or drop down the ledge/hole to the level below.

Just for giggles you could perhaps make an ant colony AI path-finding system to allow AI to allign themselves into structures to get to previously inaccessible heights e.g. making a human pyramid/ladder/slop.

Food for thought :wink:

[HR][/HR]
Moreover,
Have you heard of Kythera AI? I’ve been following them since Umbra was first announced as a showcase piece on Crydev.net back in the day :cool:

Star Citizen now uses their middleware as well :smiley:

Anyhow,
My point to all of is that you might be able to gain some new ideas for your own AI path-finding system and perhaps also work out ways to make improved versions of features within Kythera AI for Unreal Engine 4.

Some interesting Case Studies you should consider reading:

[HR][/HR]**
P.S.** How’s things going with your AI pathfinding system by the way, I hope all is well?

Sounds like you were able to dive very deep into the engine.

What are the advantages of over the built in pathfinding using nav meshes?

@Benjaim.Smith

lovely to hear from you Ben!

I am uploading my latest AI Jump Pathing video right now!

I’ve used both, UE4 pathfinding / navmeshes are awesome!

My Custom Support for Huuuge AI Creatures and Terrains!

In the project for my book on UE4 C++ I use both UE4 pathing and my own nav mesh generation system + pathfinding C++ system (multi threaded of course) because the creatures in my game are huge and I wrote my own nav mesh generation algorithm to support huuuuge areas of terrain.

awesome__span.jpg&stc=1

's C++ AI Jumping System

Here’s my latest video of my C++ AI Jump Pathing system!

I prove to you in the video that I am using just multi-threaded C++ to dynamically calculate AI Jump pathsfor my AI units to follow the player through many complex jumping sequences!

  1. I am using just C++ coding, no helpers in the editor!

  2. Listen to me make lots of funny noises as my AI jumps all over the place!

3. Watch my AI do things that amaze me!


**Video**

https://youtube.com/sMMSQdnyt6o

Once again, I am doing all the jumping calculations **dynamically via C++** using the nav areas and my custom path following component!

Mult-Threaded

The code I use in video is multi-threaded using the UE4 C++ Task Graph system:

UE4 Wiki Link

Enjoy!

Great stuff as usual!
would be especially awesome for monster AI, which would make it very challenging for the player to hide or escape. :slight_smile:

Awesome ! :slight_smile:

You gave me a great idea!

I’m going to have the AI simply try to push the player off of ledges!

That’ll be fun!

Hee hee!

:heart:

https://youtube.com/sMMSQdnyt6o

Enjoy video of my most entertaining Jumping AI Work so far!

Full description

:slight_smile: