UE4 Jumping AI - Follower Bot Tutorial

  Рет қаралды 17,953

Gustavo Reis

Gustavo Reis

6 жыл бұрын

Simple tutorial for Jumping AI. No AI helpers (not even Nav Link proxys), and no C++ at all. Just some naive code in the AI Controller class and a very simple Behavior Tree and a NavMesh.

Пікірлер: 72
@__Hay_Dar__
@__Hay_Dar__ 5 жыл бұрын
video start from 11:53 (for those who already done with movement)
@andrelucas4473
@andrelucas4473 3 жыл бұрын
Hey man, do you know how to set a distance between the player and the AI?
@__Hay_Dar__
@__Hay_Dar__ 3 жыл бұрын
@@andrelucas4473 just get distance between ai and player on start and when ai reach to the player...
@__Hay_Dar__
@__Hay_Dar__ 3 жыл бұрын
@@andrelucas4473 float dist = Vector3.Distance(player.position, transform.position);
@lightyagami6307
@lightyagami6307 2 жыл бұрын
@@andrelucas4473 just increase the acceptance radius thats the easiest way
@taariqmartin7743
@taariqmartin7743 Ай бұрын
You are very smart I've been looking for a way just like this
@4mash
@4mash 6 жыл бұрын
Thank you for this tutorial. I've been searching for an easy way to make my AI jump and this seems like the perfect solution.
@watchvombat3728
@watchvombat3728 Жыл бұрын
Amazing tutorial! Simple, fast and working. Thanks man!
@jonasmlgaard8884
@jonasmlgaard8884 6 жыл бұрын
Very neat solution. Thanks for sharing.
@mcslothalot
@mcslothalot 5 жыл бұрын
Thanks a lot! I was looking for hours to get it this working and your solution works perfect for me.
@Xptohz3
@Xptohz3 5 жыл бұрын
I am glad it worked. Thanks for your comment.
@GrexDarkLegends
@GrexDarkLegends 6 жыл бұрын
Muito bom professor, ansioso para ver novos e diferentes tutoriais.
@andrelucas4473
@andrelucas4473 3 жыл бұрын
Ei amigo, vc sabe como definir uma distância entre o player e o AI? Pra eles não ficarem colados...
@mongmong4519
@mongmong4519 2 жыл бұрын
Wow this is what I looking for. thanks!
@ArtofWEZ
@ArtofWEZ 4 жыл бұрын
Thank you Gustavo!
@rafamajcher8929
@rafamajcher8929 Жыл бұрын
Thank you, worked
@imagine-games6677
@imagine-games6677 5 жыл бұрын
for the noobs out there, you can set up a timer instead of running it on event tick as I can imagine this could get expensive if you have a ton of AI trying to reach you... but the tutorial is great, the simplest solutions are often the best! now I need to adapt this so that they can detect holes in the floor as well to jump over
@Xptohz3
@Xptohz3 5 жыл бұрын
Indeed! Timer is the best option. However, for explanation purposes about the wall detection, I think the event tick fits better. Thanks for your comment! Cheers! :-)
@imagine-games6677
@imagine-games6677 5 жыл бұрын
@@Xptohz3 oh yes, it definitely helped me... i just meant that so people learning about ue4 can avoid using too many things on event tick... but yes for the explanation it was perfectly... also are you brazilian or portuguese?
@Xptohz3
@Xptohz3 5 жыл бұрын
@@imagine-games6677 I am portuguese. :-)
@RevolverLee
@RevolverLee 3 жыл бұрын
This works so well!
@Xptohz3
@Xptohz3 3 жыл бұрын
Thanks buddy!
@blakegt.7326
@blakegt.7326 5 жыл бұрын
Best jumping tutorial ever!!! Please make more AI tutorials! Actually i would like to stop using BTrees and start making BP based AI only, because BTrees, Services and Tasks are hard to redo, copy-paste and addapt to every enemy type and increases ticks per enemy, while BPs are easy to duplicate and edit mesh, i hope more AI BP Tutorials. Thanks
@Xptohz3
@Xptohz3 5 жыл бұрын
Thank you so much for your support! :-)
@thriveprosper5548
@thriveprosper5548 5 жыл бұрын
SAME!!!!
@reeanimationgaming1034
@reeanimationgaming1034 2 жыл бұрын
Agree, behavior trees are way too complicated and messy to work with for AI… We rarely do anything complicated with AI anyways,
@elijahgames192
@elijahgames192 2 жыл бұрын
is there a way to do this without the behavior tree and nav links? i don't want to redo all the AI code i've already done.
@davidlopezguerrero9341
@davidlopezguerrero9341 3 жыл бұрын
GOD DAAAAAMN MAN FUCKING THANK YOU!
@Gezquester
@Gezquester 5 жыл бұрын
I didn't need all the movement stuff as I already followed another tutorial for that so I tried to adapt the rest of it and it sort of works as you need to keep the AI controller also otherwise it seems to get really funny. What I did is copy everything connected to the SphereTraceByChannel node into the character blueprint event graph, deleted the storedpawn variable so it targets self and then connected from the other side of the AI move to mode the SphereTraceByChannel. Then from the false branch add a stop jumping. I'm not sure if this will make sense how I explained it but I am basically a beginner.
@Xptohz3
@Xptohz3 5 жыл бұрын
That works, however that is not the best way to do it. Everything that is AI related should be on the AI controller.
@a.m.x2889
@a.m.x2889 6 жыл бұрын
That's a very interesting way to manage that. Have you checked the type of impact it would have to raise the nav. mesh like that? Is it more optimized than using c++ or Nav Link Proxy's etc?
@Xptohz3
@Xptohz3 6 жыл бұрын
Thanks. As far as I know and as far as I tested, this has no impact on the nav mesh generation and navigation. I would not say that this is more optimized than using C++ and Nav Link Proxies, I would say that this is a different approach. Also, I am supervising a master thesis of a student which is working on Jumping AI based on voxel navigation. Basically, we use invisible voxels to detect where are platforms, their boundaries and so on, and then the NPC navigation is based on the data from those voxels. This is the solution with best results, since it works really well with floating platforms.
@DasAntiNaziBroetchen
@DasAntiNaziBroetchen 5 жыл бұрын
@@Xptohz3 I am using 3D voxel-based path finding in my engine. I would be really interested in reading about your student's findings. Can I find more information about it somewhere?
@user-bp7xc9ho1i
@user-bp7xc9ho1i 3 жыл бұрын
so fun 😆
@bigjonas
@bigjonas 6 жыл бұрын
HYPE
@KadeMarkoux
@KadeMarkoux 5 жыл бұрын
Any idea how I can just set the AI to ignore certain obstacle meshes in an endless runner to pass through them by any chance aside from the 2 walls on either side?
@Xptohz3
@Xptohz3 5 жыл бұрын
Kade Markoux I would use object channels for that. This way, your sphere trace can ignore the obstacle meshes belonging to that specific object channel.
@KadeMarkoux
@KadeMarkoux 5 жыл бұрын
Never done something like this yet but, I believe I understand and thank you for the help.
@Xptohz3
@Xptohz3 5 жыл бұрын
Kade Markoux No problem! If you have further questions, just send me an email or add me on facebook. Keep in touch!
@KadeMarkoux
@KadeMarkoux 5 жыл бұрын
Oh really? That would definitely be helpful, thank you a ton, I might do that but for now I am looking into it more to attempt to figure it out on my own first.
@mcslothalot
@mcslothalot 5 жыл бұрын
How did you manage that the AI is walking off the ledges? Even if I activate it for my enemy he is still going the long way down the stairs instead of just jumping off.
@josebenavides1850
@josebenavides1850 4 жыл бұрын
I know this is super late but for anyone having this issue check your pawn's character movement component for a setting about being able to walking off ledges. It's off by default.
@sowianskizonierz2693
@sowianskizonierz2693 4 жыл бұрын
Is there really no other way to make AI jump over things?
@IWillYeah
@IWillYeah 4 жыл бұрын
I have an issue: I want the ai to drop from any ledge of any height, but still register that it cannot jump to that ledge (as it greater than its possible jump height).
@Xptohz3
@Xptohz3 4 жыл бұрын
You must use nav links for that.
@officialrhythmicthoughts
@officialrhythmicthoughts 2 жыл бұрын
Instructions unclear accidentally made my ai constantly bhop
@Hato1992
@Hato1992 6 жыл бұрын
Very cleaver way to do it. But I won't work with floating platforms right? AI simply try to follow shortest path possible to character and jumps when it have wall in front of it.
@Xptohz3
@Xptohz3 6 жыл бұрын
Thanks! Actually, this approach will not work with floating platforms. However, there are some tricks you can try to accomplish that. You can use nav-link proxies, or some invisible colliders that are beneath the floating platforms. The sphere trace will look for those special colliders and perform the jump on the character. You can also try to do some voxel-based search. To do that, you first generate invisible voxels around the level to know the boundaries of each platform, their distance and so on, and with that create a voxel-based representation of the current level. Then, you can use the A* algorithm for path finding inside that voxel representation. As a matter of fact, I am supervising a student Master that is doing this. Once he has the whole dissertation ready, I will publish all those things.
@crossmr
@crossmr 5 жыл бұрын
Good video, try to increase the volume of your microphone
@Xptohz3
@Xptohz3 5 жыл бұрын
Thanks! This was my first video with this microphone. The other ones don't have this issue.
@andrelucas4473
@andrelucas4473 3 жыл бұрын
Professor, como definir uma distância entre o player e o AI? Pra eles não ficarem colados...
@Xptohz3
@Xptohz3 3 жыл бұрын
No node MoveTo da BT tens lá a opção acceptable radius. :-)
@kenalpha3
@kenalpha3 2 жыл бұрын
UE4.27: My AI does not follow or move at all. It only has idle animation. At 4:14 you didnt explain to set the Blackboard Asset. I had to watch 5 times and pause that 1 frame to see youre automatically set. I was wondering how to link my Blackboard to the Behavior Tree. Also since im using SideScrollerCharacter - I had to set that as the object type (not just Character, which I thought applied to my character). But my AI still does not follow. Update: bot follows now, but doesnt jump, and I get warning errors: Blueprint Runtime Error: "Accessed None trying to read property StoredPawn". Blueprint: AI_ControllerBlueprint Function: Execute Ubergraph AI AIController Blueprint Graph: EventGraph Node: Branch Something wrong with StoredPawn variable. I set it to SideScrollerCharacter. And at 15:41, I cast to SideScrollerCharacter (not Character). And this worked until 16:38, I added the branch node, then I got the above warning error.
@kenalpha3
@kenalpha3 2 жыл бұрын
This is confusing. 18:34 is the code supposed to be performing the Jump on "Our Character" = player? Or you mean our character of the AI bot? That is confusing me. Because you keep saying get Character. I need to know if you mean Player (and thus I need to get SideScrollerCharacter of myself, or the copy I made into a Bot). I got the code to work at 16:37, by putting a IsValid Node before the Branch. And If not valid I have it set the StoredPawn. (Event Tick was triggering so fast before the Event on Posses. IsValid fixed that.) But now when the bot gets behind me and im running - it makes ME jump (storedPawn > Jump). So whats wrong?
@alimughal4897
@alimughal4897 5 жыл бұрын
I follow all the things but my AI start bouncing any one help ?
@diamondretro9779
@diamondretro9779 4 жыл бұрын
Yea mine immediately start jumping when they spawn
@darkassasssin7413
@darkassasssin7413 6 жыл бұрын
Muito bom, só é pena a sua voz estar um pouco baixa, mas de resto está awesome!
@Xptohz3
@Xptohz3 6 жыл бұрын
Sim, ficou demasiado baixa. Para o próximo já vou ter isso em conta! :-D
@darkassasssin7413
@darkassasssin7413 6 жыл бұрын
Ficarei à espera pelo próximo video!
@MrChick-hn3os
@MrChick-hn3os 3 жыл бұрын
i dont have the on event possess thing idk
@Xptohz3
@Xptohz3 3 жыл бұрын
You must have.
@beat91sms
@beat91sms 3 жыл бұрын
@@Xptohz3 he dosent have
@beat91sms
@beat91sms 3 жыл бұрын
did you find alt coz i also dont have
@youngjojo3052
@youngjojo3052 5 жыл бұрын
Do u have an email address I wanna know if u do freelance work
@Xptohz3
@Xptohz3 5 жыл бұрын
Hi! Yes, I have: gustavo.miguel.reis@gmail.com Thanks
@youngjojo3052
@youngjojo3052 5 жыл бұрын
Thank you
@pwerfer8124
@pwerfer8124 3 жыл бұрын
bom tutorial vou fazer isso com iteligencia artificial
@andrelucas4473
@andrelucas4473 3 жыл бұрын
Ei amigo, vc sabe como definir uma distância entre o player e o AI? Pra eles não ficarem colados...
@pwerfer8124
@pwerfer8124 3 жыл бұрын
no unreal
@beat91sms
@beat91sms 3 жыл бұрын
da p ver k es tuga XD
@Xptohz3
@Xptohz3 3 жыл бұрын
Com muito orgulho! ;-)
@Xptohz3
@Xptohz3 3 жыл бұрын
Muito sinceramente, estou-me bem a cagar para a pronúncia. O que me interessa é se consigo ensinar bem. ;-) Abraço
Ai Jumping in UE4 Part 01: Set Up
10:47
Black Dragon Studios
Рет қаралды 10 М.
Sigma Girl Past #funny #sigma #viral
00:20
CRAZY GREAPA
Рет қаралды 29 МЛН
When You Get Ran Over By A Car...
00:15
Jojo Sim
Рет қаралды 8 МЛН
Дибала против вратаря Легенды
00:33
Mr. Oleynik
Рет қаралды 4,3 МЛН
Unreal Engine 4 - AI Roam
9:22
Titanic Games
Рет қаралды 65 М.
Navigation Mesh Agent Radius Tutorial
6:47
Gordon Vart
Рет қаралды 15 М.
Ai Jumping in UE4 Part 02: Smart Nav Links
15:29
Black Dragon Studios
Рет қаралды 26 М.
How to make Stylized Grass in Unreal Engine 4/Blender
11:51
HOW I Created the Cinematic with UNREAL ENGINE 5
12:32
Sako CG
Рет қаралды 212 М.
Unreal Engine 4 Tutorial // NavLinkProxy ( to Jump between NavMesh gaps )
5:24
Unreal Engine Learning
Рет қаралды 4,2 М.
Sigma Girl Past #funny #sigma #viral
00:20
CRAZY GREAPA
Рет қаралды 29 МЛН