Smart Enemy AI | (Part 15: Long Range Melee Jump Attack) | Tutorial in Unreal Engine 5 (UE5)

  Рет қаралды 8,601

Ali Elzoheiry

Ali Elzoheiry

Күн бұрын

Learning Goals:
1 - Customizing animations using montages
2 - Blending animations and montages (upper body from montage, blended with lower body from animation BP)
3 - Predictive Jump function to allow the AI to jump to where the player will be in x seconds
4 - Creating Behavior Tree Services
5 - Using multiple attacks in the behavior tree based on distance from the target
To download the full project files from all my videos and use any assets I create in your own games for free, then join my Patreon. Also I would be forever thankful to my early adopters
/ alizoh
Join my Discord server to chat and mingle with the community
/ discord
Link to the full "Smart Enemy AI" Series:
• Smart Enemy AI Tutoria...
Link to the "AOE" tutorial:
• How to do AOE damage a...
Link to the "Damage System" tutorial:
• How to Build a Combat ...
Checkout my other tutorials on my channel:
/ @alielzoheiry
Chapters:
00:00 Outcome of This Part
01:33 Animation/Montage Setup
06:00 Separate Attack Functions/Events
10:15 Explaining Problem With Animation
11:33 Upper/Lower Body Animation Blending
19:10 Jump To Target Functionality
31:28 Enabling Multiple Attacks In The Behavior Tree (based on distance)
47:47 Next Up In Part 16
Assets used:
Sword and shield jump attack (from mixamo): www.mixamo.com/#/?page=1&quer...
About me:
I've been learning game development for a few years now, I do have a background in software engineering, and I also have a background in education, so being able to combine my love of gaming and love of education is the best way to spend my time.
I am currently working on this 3rd person action adventure game as a hobby, but I am also trying to build a community, thus I am creating KZbin tutorials to find others who are interested in game development and design.
If you are interested in learning more or if you are interested in working together, please let me know in the comments.
#unrealengine #unrealengine5 #ue5 #gamedev #smart #enemy #combat #AI #blueprint #tutorial #behavior #tree #behaviortree #melee #jump #attack #longrange

Пікірлер: 99
@rhdiddl4
@rhdiddl4 Ай бұрын
Thank you for always providing great tutorials. The reason "LaunchCharacter" does not work properly in version 5.3 is because the "BrakingDecelerationFalling" value of "Character Movement" is set to 1500. If you change the value to 0, it will behave as in the tutorial. I'm looking forward to more great tutorials from you in the future. ^^
@AliElZoheiry
@AliElZoheiry Ай бұрын
Thank you for the valuable insight! I appreciate you sharing this fix I wasn't aware of that, this is really helpful 🙏
@aureliengomez7623
@aureliengomez7623 Ай бұрын
That has been bothering me since the navlink tutorial, thank you so much for solving this. Also thank you Ali for your amazing tutorials!!
@DaLoveDonkey69420
@DaLoveDonkey69420 Ай бұрын
THIS SAVED ME AN ISSUE JUST NOW! THANK YOU!
@ThiagoUriel
@ThiagoUriel 7 ай бұрын
Bone depth will share the blending across a certain chain of bones defined by the depth. For example, if you are blending from spine01 and set a depth of 3, that means that your blending will be smoothed over 3 bones starting at the origin, so spine1, spine2 and spine3. A value of zero will make the blending happen in the requested bone only and a negative value will remove that bone from the blending.
@AliElZoheiry
@AliElZoheiry 7 ай бұрын
Ahh great explanation, thank you for that, I'm always learning new things 😇🙏
@Snafuey
@Snafuey 7 ай бұрын
Thank you for doing this great service to allow amateur game devs do so really cool stuff. Your hard work is not going unnoticed!
@user-qs3ly8cc6g
@user-qs3ly8cc6g Ай бұрын
Do you realize that, as far as I know, you might be the best KZbin instructor for Unreal Engine? 😅
@AliElZoheiry
@AliElZoheiry Ай бұрын
Thank you so much for your incredibly kind words! I'm truly honored to receive such high praise. Your support means a lot to me, and I'm glad you find my content helpful. If there's anything specific you'd like to see in future videos, just let me know!
@zrmdevelopment7260
@zrmdevelopment7260 7 ай бұрын
So glad that you've mentioned boss fight at the end. I've finally managed to catch up with the videos (still got the spin one tho). Can't wait for the boss fight!!!! Keep it up!
@AliElZoheiry
@AliElZoheiry 7 ай бұрын
Thank you! Glad you're liking everything so far. The boss fight indeed will be the climatic finale of this series, let's see how it goes 😇🙏
@kellowattentertainment
@kellowattentertainment 3 ай бұрын
You said to click XY override on the Launch Character node, but I checked it, the AI character doesn't actually move towards the target, it only jumps and attack. When I leave it unchecked, it worked perfectly. It took me this long to figure out that this is an issue with the animation itself. If the animation wasn't made specifically for the skeleton, the root motion functionality will technically operate in reverse. Or it can work properly in some things and in other things it may not. So for those who are having the same issues, consider this.
@AliElZoheiry
@AliElZoheiry 3 ай бұрын
Hey, thanks for sharing your experience and the findings! It's great that you were able to troubleshoot and identify the issue with the animation affecting the AI's movement. Your insight can definitely help others who might be experiencing similar issues. Good job on figuring it out and thanks for the heads-up!
@kellowattentertainment
@kellowattentertainment 3 ай бұрын
@@AliElZoheiry You're welcome. One more thing. If the animation was imported via FBX for the Skeleton, (SK_Mannequin for example), the root motion should work perfectly. However, if the animation was retargeted inside the Engine to or from a different skeleton, you may have the "issue". There are cases where even if the animation was imported via FBX, you may to have the same issue although, this is not very often.
@shantagmorelbereth1408
@shantagmorelbereth1408 2 ай бұрын
Thanks, you solved my issue too
@mebessusn
@mebessusn 2 ай бұрын
I would've been searching for this all night if it werent for you lol. My character still doesn't jump very far so I may need to increase the X & Y values some more rather than just passing them to the arc node, but at least this is a good start. Thanks a lot!
@kellowattentertainment
@kellowattentertainment 2 ай бұрын
​@@mebessusn the reason why they don't move as far is because of arc value itself and not the XY value per se. if the set the arc value to 0.99, it will jump right to the player character. Be careful though, because if the AI is right next to the character and it jumps near the player, it will look weird. The higher the arc value, the further away AI would need to be when he jumps... or else
@patricktoussaint6038
@patricktoussaint6038 4 ай бұрын
Another great tutorial! thanks so much for all this content. Cant wait to see what series you do after this one. Hoping for inventory and NPCs/quest system :)
@AliElZoheiry
@AliElZoheiry 4 ай бұрын
Thank you again Patrick! Glad you enjoyed it ☺️🙏
@uncheck
@uncheck 7 ай бұрын
Very Interesting. I predict this will be the meta in a few games
@AliElZoheiry
@AliElZoheiry 7 ай бұрын
Hahah it definitely is in a lot of games indeed
@JoMarcos28
@JoMarcos28 7 ай бұрын
It was just what I had in mind Thk Ali
@AliElZoheiry
@AliElZoheiry 7 ай бұрын
Excellent! Glad to hear it's what you were looking for 🙏
@Xsabino1
@Xsabino1 7 ай бұрын
perfect, thanks! I already liked it without even watching the video
@AliElZoheiry
@AliElZoheiry 7 ай бұрын
Thank you as always for your support 🙏💖
@Flexsa
@Flexsa 7 ай бұрын
you are always the best
@AliElZoheiry
@AliElZoheiry 7 ай бұрын
Thank you Flexsa 🙏 I appreciate your kindness
@abhimanyubundela2568
@abhimanyubundela2568 3 ай бұрын
This video series is amazing, one of the best tutorials I ever seen on KZbin. So, you encouraged me to do youtube myself too. For the starting I'm thinking of converting this whole system (Damage, Projectile, AOE, AI) fully replicated. Maybe someday I might start, but have 1 question: Will there be any copyright issue regarding the content? Because this is how I wants to try to make the content. This is also a suggestion for you, if you want to make these fully replicated :p. Btw great content and Thank you
@AliElZoheiry
@AliElZoheiry 3 ай бұрын
Thank you so much for your kind words! I'm thrilled that the series has inspired you to start your own content. As for copyright concerns, if you are using content from my videos, you can simply mention that this is not your own content and link to me channel/videos, then you're free to do whatever else you'd like with it ;) Good luck!
@abhimanyubundela2568
@abhimanyubundela2568 3 ай бұрын
@@AliElZoheiry Perfect Thanks
@Bakahira
@Bakahira 7 ай бұрын
Thank you so much for your awesome tutorials! They have helped me a lot. What I would still find super exciting would be a function where wounded enemies are pulled into cover by uninjured enemies. What do you think? I look forward to many more great tutorials from you. Thank you for your work!
@AliElZoheiry
@AliElZoheiry 7 ай бұрын
Great suggestion! I was thinking of having the mage enemy also act as a support, and heal injured team mates. but pulling them to cover would require synced animations, which would be out of scope of this series, but definitely a cool idea
@tomerhertz8502
@tomerhertz8502 5 ай бұрын
Ali that would be great...to add a functionality so the mage can heal his team members accordingly to set/ changing parameters (i was actually just thinking about it...a wonderful ability, especially if someone wants to develop an rpg combat system)@@AliElZoheiry
@216junn8
@216junn8 4 ай бұрын
It doesn't work when i connected "Owner Controller" In BTS_UpdateDistanceToTarget( When the enemy's position is printed out, it is fixed, but the enemy is still moving. ) but when i connected "Controlled pawn" it works. why happen this issue??
@AliElZoheiry
@AliElZoheiry 4 ай бұрын
It should be off of the pawn indeed, because we want to get the location of the pawn (I mentioned that here at this timestamp kzbin.info/www/bejne/hHOaantqjdKEidksi=Nm3sU_TyPEhrsFcf&t=2069 on screen
@MrAlekVids
@MrAlekVids 2 ай бұрын
For ppl using 5.3 and having problems with the "launch character" - i had to add a "multiply" node the x,y,z to get the needed effect (like x3,x3,x0.5). I checked all the gravity stuff etc. and didnt find why my character wont move without - but kinda fixed it for me. Same with the jump on the "Nav-Jump". But perhaps i got something wrong on the way since i remember the nav-jump did work at the beginning. Well - maybe ppl can use this fix if you got the same problem ;)
@AliElZoheiry
@AliElZoheiry Ай бұрын
Hey, thanks for sharing your workaround! It's always helpful to have different approaches to tackling issues. Glad you were able to figure it out!
@user-oz6mj2bj6j
@user-oz6mj2bj6j Ай бұрын
hey, can you be a bit more specific on how you implemented it? or if you have found why it didnt work in the first place?
@shantagmorelbereth1408
@shantagmorelbereth1408 2 ай бұрын
A small query: while following your (excellent/awesome) trainings, it is easy to miss the "erratum captions" you nicely add when you spot a mistake in your video. Could you considere to add a sound (a kind of "timestamp noise") to make us aware of such caption? For my example, while I am following your training, I can focus on my second screen while listening and actually missing your erratum. It has happened with the "BTS_UpdateDistanceToTarget" and the controlled spawn instead of the owner controller. Thus, I had to rewatch two episods (which is still good for understanding) without knowing why my enemy was Jumping in Kriss Kross style.
@AliElZoheiry
@AliElZoheiry 2 ай бұрын
Hey! That’s an excellent suggestion, I really appreciate the feedback, I’ll make sure to do that in my newer videos
@LEE-uk9pm
@LEE-uk9pm 7 ай бұрын
Thank you for the video. I am planning an AI vs AI game. Even when encountering an enemy, I am curious about how to create an AI that calculates whether it is superior to the enemy and takes aggressive action if it is advantageous, and takes defensive action such as maintaining distance or running away if it is disadvantageous. If you get the chance, please do a tutorial on this as well.
@AliElZoheiry
@AliElZoheiry 7 ай бұрын
You're welcome, glad you liked it. Thank you for the suggestion, I will be thinking of defensive vs aggressive attacks in coming tutorials, which can be used to create defensive or agressive behaviors, which you can switch from based on the current state of the fight
@vidwardio3202
@vidwardio3202 3 ай бұрын
Amazing tutorial. Just one issue, my sword (hand socket) doesn't move with the enemy) upperbody slot anim montage, but works on the default one. Any solution to this?
@AliElZoheiry
@AliElZoheiry 3 ай бұрын
Hey, glad you're enjoying the series. If your socket is moving the sword should move as well. It sounds like you either attached it to a non-moving socket (not attached to the bones of the skeleton) or it isn't attached to the mesh at all
@greatoni8452
@greatoni8452 7 ай бұрын
One question II have a lot of melee enemy AI, but they have different animations, how can I do it? They had one behavior tree, but the melee AI animations were different? I should copy pasting or Inheritance?
@AliElZoheiry
@AliElZoheiry 7 ай бұрын
If only the animations are different, but the functionality itself is the same, then I suggest keeping everything in one class, and have the animations as variables, so you can change the value of those variables per instance
@SeanLaoProductions
@SeanLaoProductions Ай бұрын
Hey Ali! I m following along this series :) Excellent job as always! I have come across a wierd issue where I m not understanding where went wrong; I m using the same jump attack animation with Root Motion Mixamo character retargetted to UE5 Manny. The animation works well, with root motion and when using root lock, it also locks the jump up the animation had. So its pretty much locked in place in all aspects. I have no idea what caused this. It is also fair to mention that its the same situation from the source as well. Ie. if I lock root motion on the mixamo character I use as a source; it locks it in place totally
@SeanLaoProductions
@SeanLaoProductions Ай бұрын
Small update; Managed to make it work! Had to set the root and pelvis bone chains to transform mode -> Absolute and it worked! Still everything happening in place with no upwards movement like yours though. But end result is the same so goodie ^^
@AliElZoheiry
@AliElZoheiry Ай бұрын
Hey there! Glad you fixed the issue. I've been hearing that v5.3 of unreal has made some changes to how "Launch character" works, so if you're on that version you might want to checkout some of the comments
@BoryslavF
@BoryslavF 2 ай бұрын
For my setup I need to know how long it will take the character to actually land at the destination after launching. Is there any ways to calculate the time it will take?
@AliElZoheiry
@AliElZoheiry 2 ай бұрын
Unfortunately to do that, you’ll have to calculate the launch velocity yourself by doing some parabolic math calculations for arc velocity, because that velocity equation takes time as one of the variables, so you can either set a specific time or get the time based on a specific distance
@SergioGonzalez-ig2bw
@SergioGonzalez-ig2bw 5 ай бұрын
Ali, great videos, you are helping me a lot. Btw i have an issue with my behavior tree. My mele enemy does first a short attack and then does always de jump attack. I fixed the problem you had with the selector and if i check the Call Tick on Search Start, the enemy starts with the jump attack and continues with it, never uses the short attack. I have checked if is something about the defense radius and i dont know what im doing wrong. I need your help ;) Anyways you're the best, thanks a lot!
@AliElZoheiry
@AliElZoheiry 5 ай бұрын
Hey Sergio, glad you're enjoying the content. Make sure that your condition for using the jump Attack is that the distance is "greater than" a certain number NOT "less than" this can be a common simple mistake. Also make sure the distanceToTarget variable is actually updating (try printing it in your service to see) If you still can't fix the issue, feel free to join the Discord server and ask your question there
@patricktoussaint6038
@patricktoussaint6038 4 ай бұрын
Not sure if you already solved this but I was also having this problem. I figured out that in the BTS_UpdateDistanceToTarget I had plugged in the Get Actor location into the owner Controller when it seems to only work when plugged into the Controlled Pawn.
@QQ-jt7rs
@QQ-jt7rs 7 ай бұрын
My another question. I am making so much behavior tree for enemies it's bad or good? Yeah enemies work's fine but, I have so much behavior tree? It's not freezing game?
@AliElZoheiry
@AliElZoheiry 7 ай бұрын
Many behavior trees shouldn't have impact on performance, the amount of behavior trees is not an issue on game speed at all, but might be a bit more difficult to maintain if you have many trees
@TheVorlecGame
@TheVorlecGame 3 ай бұрын
bros the best
@AliElZoheiry
@AliElZoheiry 3 ай бұрын
Thank you very much, I appreciate your kind words!
@kasperlarsson7598
@kasperlarsson7598 3 ай бұрын
My force root lock isnt working when i have retargeted the animation to another character, am I forgetting something?
@AliElZoheiry
@AliElZoheiry 3 ай бұрын
Depends on your animation and your character, both should have a root bone for root lock to work
@jarofpickles1246
@jarofpickles1246 7 ай бұрын
Can you do a video covering root motion moving the player toward the enemy when attacking. For example, in the "witcher 3" and in "Zelda BOTW" if the player is not near an enemy and attacks they will move forward only a little bit, but if an enemy is near the player and the player does the same attack it launches the player towards the enemy.
@AliElZoheiry
@AliElZoheiry 7 ай бұрын
If the same character animation moves differently in different situations, then it's most likely not root motion, but a similar calculation to what we did here for the jump, so you can follow the same approach, using montage notifies to move the character forward a certain amount
@user-ym1tf1uo1h
@user-ym1tf1uo1h 6 ай бұрын
does someone know why when I check the boxes on XOverride or YOverride, then during the character's jump, he stops moving along all coordinates except the Z coordinates in launch character? at 30:16? when i disable check function start working, how could this even happen
@AliElZoheiry
@AliElZoheiry 6 ай бұрын
Make sure your debug sphere is being drawn in the correct place, because if not, that would mean the location you are trying to jump to is incorrect. Also make sure that the "Arc" value on the "Suggest projectile velocity" function is 0.5
@QQ-jt7rs
@QQ-jt7rs 7 ай бұрын
Hey when you making damage system for player? I am mean not projectile. My character not have projectile function. Only melee weapons. Or make little tutorial how to connect melee weapons your damage system.
@AliElZoheiry
@AliElZoheiry 7 ай бұрын
I'll most likely add a few melee attacks to the player in the coming tutorials, but I won't be going deep into a player combat system in the AI series because it's mainly about enemies
@thesanestsaint
@thesanestsaint 5 ай бұрын
JumpToAttackTarget make the enemy jump in place, but if i multiply the OutLauchVelocityX and OutLauchVelocityY with 2 before feeding in the LaunchCharacter, the enemy can jump to me. Have they changed some default settings in the engine. I'm using ue5.3.2
@AliElZoheiry
@AliElZoheiry 5 ай бұрын
Hey Quân, not really sure about the behavior in 5.3, because I use 5.2 and the values work fine for me
@WiseThoughts3
@WiseThoughts3 4 ай бұрын
thx bro i was searching 2 hours for this bug, i think there are bugs in the node
@patricktoussaint6038
@patricktoussaint6038 4 ай бұрын
This is very helpful! thank you!!
@trelaskillz
@trelaskillz 4 ай бұрын
Similar issue here as well. Thanks for posting this Aeterrno!
@QQ-jt7rs
@QQ-jt7rs 7 ай бұрын
Ali I have one enemy melee but, how can I am copy pasting so much melee enemies but, different animations?
@QQ-jt7rs
@QQ-jt7rs 7 ай бұрын
When Animation of another melee enemy does not work. My enemy is freezing.?
@QQ-jt7rs
@QQ-jt7rs 7 ай бұрын
I am already fixed. Thank to me
@AliElZoheiry
@AliElZoheiry 7 ай бұрын
Excellent! Glad you managed to fix it 😉
@WiseThoughts3
@WiseThoughts3 4 ай бұрын
on 22:59 the enemy should jump into me but it only jump at place and doesnt launch into me ,i changed the ideal range , but it still the same problem, also with the nav links the enemies jump at place and cant launch them forward into the nav link
@AliElZoheiry
@AliElZoheiry 4 ай бұрын
Hey there, I heard some people having issues with the jump function in 5.3, but in 5.2 it work correctly for me. Are you on v5.3 by any chance?
@WiseThoughts3
@WiseThoughts3 4 ай бұрын
@AliElZoheiry yeah I fixed it , just need to multipy the value of the launch vector , it's some issue with the node
@patricktoussaint6038
@patricktoussaint6038 4 ай бұрын
Did you find a fix for the nav links? this didnt work for me with them but works for the jump to enemy@@WiseThoughts3
@vidwardio3202
@vidwardio3202 3 ай бұрын
@@WiseThoughts3 hey there, i have the same issue, I cant seem to resolve it
@nfrancisj2122
@nfrancisj2122 7 ай бұрын
Blend Depth is the "falloff" . Blend Depth of 4 would reduce the influence of the pose by 25% for the next 4 joints. kzbin.info/www/bejne/nJfYomihYs9jd7s
@AliElZoheiry
@AliElZoheiry 7 ай бұрын
Excellent! Thank you for explaining that. I have a lot to learn when it comes to animations still :D
@screenapple1660
@screenapple1660 7 ай бұрын
Elon Musk right about AI. AI can be scary.... it's crazy.....
@BooneyianLogic
@BooneyianLogic 6 ай бұрын
(SOLVED)I have this issue, when the enemy jumps they stay in place. I made the animation in cascaduer. I dont think they are root animations. They seem to also jump in place for the navlink jumps as well. which makes me think it has something to do with launch character node, Any ideas on what could be causing this? (I made changes to the Movement Component in the Enemy_Base Blueprint, All I had to do was go through that and reset the values I was tweaking)
@AliElZoheiry
@AliElZoheiry 6 ай бұрын
Not sure, but here are some things to check: - Is your CalculateFutureLocation function returning the right location? - If so, then make sure "Enable root motion" is NOT checked in your animation - If that's also the case, I heard someone mention that they had an issue with the jump functionality in v5.3 when they switched the AI controller parent from regular AI controller to "DetourCrowdAIController", not sure if you're using that as well - Finally, try just adding arbitrary values in your "LaunchCharacter" function and see if that works, if it doesn't then you're either trying to launch the wrong character, or something else is preventing your character from moving.
@BooneyianLogic
@BooneyianLogic 5 ай бұрын
what would be causing the NAV-Links to also make the character jump incorrectly? The NavLink jump and the Sword Jump Attack are both exhibiting the same behavior. However, I have the debug sphere at the correct location, launch character is functioning on the correct actor, i have used just 500 on the z in the "launch character" vector. that functioned correctly, Changing the Ai controller in the AIC_Enemy_Base back to AIController from the detrourCrowdAI hasnt fixed the issue. Im going to explore different animation s and see if that is the cause. Thank you for your time, ive been stuck with this for a few days. @@AliElZoheiry
@BooneyianLogic
@BooneyianLogic 5 ай бұрын
Another Weird Factor is, when multiplying the "Out Launch Velocity by something small like 2, I get them to launch with decent results. Why would I need to multiply my velocity, when you do not have to, to achieve the same results? this is puzzling me.@@AliElZoheiry
@AliElZoheiry
@AliElZoheiry 5 ай бұрын
very strange, i dont really know why that is, unless you're overriding the default gravity values, which i dont think you are
@BooneyianLogic
@BooneyianLogic 5 ай бұрын
right, im not sure what the heck I did. but it broke the effect "launch character" is having on the capsule.@@AliElZoheiry
@beyondkhan8459
@beyondkhan8459 7 ай бұрын
미친 튜토리얼
@AliElZoheiry
@AliElZoheiry 7 ай бұрын
Glad you liked it :)
@user-xb1jc7lf8x
@user-xb1jc7lf8x 6 ай бұрын
@AliElZoheiry
@AliElZoheiry 6 ай бұрын
😊🙏😄👍
Unreal Engine 5 Tutorial -  Modular Control Rig UE5.4 Preview
10:48
Conforto para a barriga de grávida 🤔💡
00:10
Polar em português
Рет қаралды 106 МЛН
Do you have a friend like this? 🤣#shorts
00:12
dednahype
Рет қаралды 35 МЛН
The most impenetrable game in the world🐶?
00:13
LOL
Рет қаралды 13 МЛН
Why Dependencies are Bad and How To Avoid Them In Unreal Engine | UE5
26:40
Easy animation retarget in 5.4 - Unreal Engine 5 tutorial
9:25
LeafBranchGames
Рет қаралды 8 М.
The Most Common Mistake Beginners Make in Unreal Engine | UE5
12:17
Ali Elzoheiry
Рет қаралды 85 М.
Watch this A.I. learn to fly like Ironman
17:56
Gonkee
Рет қаралды 365 М.
Пять минут до линейки
0:35
ЛогикЛаб
Рет қаралды 1,5 МЛН
Bananacat and Applecat Pranked Gman #gmod 😹🍌🍎
0:57
MeCoDy
Рет қаралды 18 МЛН
LEGENDARY MUTATION EGG?! #brawlstars #legendary #starrdrop #mythic #viral
0:23
60* Satisfying minecraft pixel art #shorts #gaming #sandart
0:31