[UPDATED 5/16] A.I. Templates - Bot, Car, & +Flying AI

Hey Blue669,

Thanks for that Blue! I’m glad I could help.

There is many different ways to do . First off, yes BT and everything works online. What you have to do get the Pawn Sensing Component which allows your AI to see other pawns, hear other pawns with emitters, and from there you can expand on your sensory system. I assume they would loosely follow paths but priority is the player. I’ve been really everywhere sorry but message me if you need any help!

Hey I love your tutorial on the attack/search/patrol ai, and I’ve gotten it to work flawlessly before, with shooting included. I’ve started a new project, and imported the blueprints, and had to rebuild a few portions of them. As far as my scrutiny can tell, it’s exactly like the one I had before, just context sensitive, but when the bot sees me he just sits there. I checked his AI tree during runtime, and He sees me, has me listed as the enemyactor, but the tree is stuck on BTT_MoveToEnemy. What do you think could be happening?

EDIT: It is also interesting to note that the bot only sees me when I have the BTS_BotDetectEnemy line trace set to camera and not visibility, What’s up with that?

Hi ! First of all thank you for awesome suite of tutorials, is just awesome !

I did your tutorial using UE 4.4 and it seems that the behavior tree isn’t working fine.

issue is the following, on your tutorial I only use the “Move to point” part, I only need for my project to have a pawn walk to different point ( so I only use the left part of the tree ).

Thing is after the first way point, when my pawn arrives, he doesn’t update the route and he seems stuck on the first one, switching to an idle position.

Would you have any idea about it ? I do have the Decoration to update the route.

Thank you again and when bug is resolved I’ll translate all of in C++ :slight_smile:

@SilentX`: plz reupload images in i.imgur.com(with https) or attached it here. all images are down. plz dont use dropbox link :frowning:

Error (509)
account’s public links are generating too much traffic and have been temporarily disabled!

Hi .
I am trying to replicate your CAR AI project in UE version 4.4.3. First I tried to copy the structure of the project but it did not work (I think I have missed something there) . When I try to open your project in v 4.3.1 it runs smoothly. But Can not open it in v 4.4.3 nor can I replicate the project in 4.4.3. Is there a guide line for CAR AI project so I can use in 4.4.3 and future releases.
Thank you.

Thank you thank you Mathis, much appreciated. One possible problem is the way point isn’t near the ground so it can’t project the location on the navmesh properly. If it finds the first one, it should find the next one.

I know! Its been a real mess. Will do!

Interesting. I will have to release a new update soon, but I’m currently in limbo so it been hard to create in general. I do have an updated version of the CAR AI with more advanced measures taken. car will new avoidance measure I attempted and failed, and other examples I’m sure others can learn from. I will make sure to post them as soon as I can properly do so!


Hey guys, thanks again for all the support! I’m currently working on a lot of things IRL, so it has been taken its toll creatively. I’m still very much working in UE4 but don’t have time to post as often. Will make sure to give you guys an update once I’m settled in the new place.

Peace

Hey SilentX ! Thank you for your answer I’m sorry I just saw you replied.

Well it actually stop after finding the first WayPoint, thing is it is really cool because it follows the path using the navmesh, but when it arrives on the WayPoint, the pawn goes on IDLE and on the graph you can see it goes through every nodes.

In the blueprints it seems to be stuck in the For Each loop.

I’m currently in my office so I can’t provide any screenshots yet, I’ll do as soon as I get home tonight.

And once again, Thank you SilentX !

Hello . First off, thanks for the tutorials. Behavior Trees escaped my realm of knowledge before and I just did everything in C++. is much easier to debug.

One thing that confuses me though is when finished is relevant. It seems to be causing a problem in my game. I have a section in my BTS_DetectEnemy that essentially says, if enemy is no longer valid (ie is now dead) go back to the move state. However, never happens and it just kind of sticks in the attack state.

Even though the state is being changed in the above image, the enumerator is not updating on the tree.

Im New to Unreal Engine, I like the idea of programming with nodes, I dont know what Nodes exist to represent code, I tried to modify your example so that when the monster character(JILL) is close to a Unit and starts to attack the unit backs away.

Can u help
Firstly getting the Jill_units location /The Nearest Jill ?
Would you then set a new location target and move to it or maybe a simpler move backwards-no path

I would add a reaction time so that the unit will get hit they cant be god like.

Also how would you add a slight randomness to the Task forces decision to shoot so they dont all shoot at the same time?

For a level of my own using your AI system I would plant Jill_Type ai bots around the level, setting a trigger radius so they only activate once player or task_force units enter that radius.

Also how do u go about making sure the attack animation completes before starting over, want to avoid looping animation too.

if taskforce_unit or player move away the Jill-bot, her attack animation should continue to end then move towards the player/TF
Jills state would need to switch to move to target then back to attack, Can u position TargetPoints from withing the blueprint.

1 more thing can u make it so when objects are placed they number them selves (G-id) that would come in handy for allsorts, We have built menu system hud,Follow /Mini map We just need AI.

If u could comment in the blueprints abit more for beginners, I come from programming background but my pc takes all day to compile engine so I want to learn blueprints ,plus I think its the way forwards.

Is being updated anymore?
I been watching it everyday and not seen any changes.

Many Thanks ,Mince

FoldingCircles@Gmail
these few adjustments will really help

I’m not the developer of project but I think I can help with some of these problems.

The simplest way is to use the get all actors of class node and use the get path length node to see if they are closer to your actor than the previous (always storing the closest one and disregarding if it is further away). Note does not account for line of sight. but if the length is closer, you can then do a ray trace to see if they are visible.

you can use move to actor within a radius if you are attacking. Fleeing you can use move to location or position an actor and move to it. The problem with just moving the character away is that it might move off the nav mesh which essentially moves it out of bounds. as long as your point is on the nav mesh, it should move to it. If it is unreachable, chances are, your character is cornered and should fight for their life.

a random float with a delay node does the trick for reaction time. if it’s when they first notice the enemy, then the they should not be in sync when firing either as each characters AI would have a different float generated.

You could use a sphere overlap actors on your AI bots to act as a trigger. Filter the comando’s class so only they trigger it.

when I play an anim montage, it returns a float. that is the length of the animation playing. Storing that value, I check delta time + time since animation started. If it is greater than the animation length then it is alright to play again. Otherwise, add delta time to time since animation started. and repeat next tick. You can also add a multiplier (mine is 0.8) on the returned float so it gets 80% of the way through the animation before it can start another one. helps blend the animations a bit better.

I’m having trouble with one myself. It seems to get stuck in the attack state for me. see my previous post.

The rest is kind of out of my domain since it’s not my project. Let me know if you need clarification on any of .

Thanks

I am familiar with ray-tracing and path-finding and state machine, but not in Blue Prints, I guess I got to learn the Prints.

My Problem is I dont have a clue what Nodes to use, I know Branch is If and I know how to get and set variables.

“when I play an anim montage, it returns a float. that is the length of the animation playing. Storing that value, I check delta time + time since animation started. If it is greater than the animation length then it is alright to play again. Otherwise, add delta time to time since animation started. and repeat next tick. You can also add a multiplier (mine is 0.8) on the returned float so it gets 80% of the way through the animation before it can start another one. helps blend the animations a bit better.”

If there was 1 Answer u could give me that would make the most difference I would say It would be, How do you pull the Animation_Time_Length.
Getting Time-Started, Would you use on-begin or /do once

if TimeNow>(TimeStart+Anim_TimeLength) Then CanAttack =True

Thanks For The Help

might help. It is what I do for my animations. For me, attack speed is a value depending on what character is attacking As I have commented in the image you can use the return value of the animation instead of attack speed to get it to always finish it’s current animation before starting a new one. The only difference here is that I’m counting time until next attack is available (counting down to 0) and you are counting time since last attack (counting up since time at tick).

Awesome! Thanks for the contribution!

Thank you for your help.

The Major flaw with the above Delay for animation … is The Delay Before The Attack, Need to attack then delay before next attack.

SilentX Been Silent alright.

HELP!
Now my Jills they dont transition from 1 place to another they just appear 3 seconds later in there next location. I know its week but a few minor adjustments by some 1 who, A)> knows how system is put together and, B)> knows what they are doing; us beginners would have sumin we could play with,.

We can add weapons and fx and build levels. We have done some cool Mocap using a Xbox Kinect using IPI Mocap, But adding states to your design so they can be used well that going to take a while.

Do you think there will be any more added to system?

Hi Guys - I get internet today! Isn’t that exciting! Its been a grilling month for me. I’ve been doing a lot at once and sadly my participation in my personal projects were taking a hit. Well that finally changes somewhat, haha! Now that I’m stable again - after I get internet today its just a matter of getting back up to speed. I haven’t stopped working since I lost internet, so don’t think there isn’t anything new! More coming soon!

Thanks for the support guys.

Update##

I’ve updated the thread!

Flying AI?

Have you done any research into Flying AI? I was hoping just getting AI to move to an elevated location, I would just need to activate flying on the actor but it’s not that simple. Methinks is not fully implemented and a custom grid of cubes and pathing algorithms will need to be made. But I don’t really know for sure.

Hi Sluggernot,

Yes I have. There are a few ways you can do it, and they have different advantages for different techniques. So my question is what are they having to do. Just transfer from one location to another location? Fly all the time? would help me give you a better solution.

Ah, yah, fly. Think Real Time Strat space game. So there is hovering but a majority of the movement is going to be flying around asteroids.
Of course, ideally, the asteroids and debris are floating around and rotating and the levels are built dynamically but that can come later. At time I have done all of the research I can find on getting the flying made that every AI has to actually work with the pathing that is built in.

Your thread title boasts Flying AI but it doesn’t have any, right? Please tell me i’m missing something.

You sir are correct. Working to correct that. :slight_smile: