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__5 жыл бұрын
video start from 11:53 (for those who already done with movement)
@andrelucas44733 жыл бұрын
Hey man, do you know how to set a distance between the player and the AI?
@__Hay_Dar__3 жыл бұрын
@@andrelucas4473 just get distance between ai and player on start and when ai reach to the player...
@@andrelucas4473 just increase the acceptance radius thats the easiest way
@taariqmartin7743Ай бұрын
You are very smart I've been looking for a way just like this
@4mash6 жыл бұрын
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 Жыл бұрын
Amazing tutorial! Simple, fast and working. Thanks man!
@jonasmlgaard88846 жыл бұрын
Very neat solution. Thanks for sharing.
@mcslothalot5 жыл бұрын
Thanks a lot! I was looking for hours to get it this working and your solution works perfect for me.
@Xptohz35 жыл бұрын
I am glad it worked. Thanks for your comment.
@GrexDarkLegends6 жыл бұрын
Muito bom professor, ansioso para ver novos e diferentes tutoriais.
@andrelucas44733 жыл бұрын
Ei amigo, vc sabe como definir uma distância entre o player e o AI? Pra eles não ficarem colados...
@mongmong45192 жыл бұрын
Wow this is what I looking for. thanks!
@ArtofWEZ4 жыл бұрын
Thank you Gustavo!
@rafamajcher8929 Жыл бұрын
Thank you, worked
@imagine-games66775 жыл бұрын
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
@Xptohz35 жыл бұрын
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-games66775 жыл бұрын
@@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?
@Xptohz35 жыл бұрын
@@imagine-games6677 I am portuguese. :-)
@RevolverLee3 жыл бұрын
This works so well!
@Xptohz33 жыл бұрын
Thanks buddy!
@blakegt.73265 жыл бұрын
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
@Xptohz35 жыл бұрын
Thank you so much for your support! :-)
@thriveprosper55485 жыл бұрын
SAME!!!!
@reeanimationgaming10342 жыл бұрын
Agree, behavior trees are way too complicated and messy to work with for AI… We rarely do anything complicated with AI anyways,
@elijahgames1922 жыл бұрын
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.
@davidlopezguerrero93413 жыл бұрын
GOD DAAAAAMN MAN FUCKING THANK YOU!
@Gezquester5 жыл бұрын
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.
@Xptohz35 жыл бұрын
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.x28896 жыл бұрын
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?
@Xptohz36 жыл бұрын
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.
@DasAntiNaziBroetchen5 жыл бұрын
@@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-bp7xc9ho1i3 жыл бұрын
so fun 😆
@bigjonas6 жыл бұрын
HYPE
@KadeMarkoux5 жыл бұрын
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?
@Xptohz35 жыл бұрын
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.
@KadeMarkoux5 жыл бұрын
Never done something like this yet but, I believe I understand and thank you for the help.
@Xptohz35 жыл бұрын
Kade Markoux No problem! If you have further questions, just send me an email or add me on facebook. Keep in touch!
@KadeMarkoux5 жыл бұрын
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.
@mcslothalot5 жыл бұрын
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.
@josebenavides18504 жыл бұрын
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.
@sowianskizonierz26934 жыл бұрын
Is there really no other way to make AI jump over things?
@IWillYeah4 жыл бұрын
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).
@Xptohz34 жыл бұрын
You must use nav links for that.
@officialrhythmicthoughts2 жыл бұрын
Instructions unclear accidentally made my ai constantly bhop
@Hato19926 жыл бұрын
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.
@Xptohz36 жыл бұрын
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.
@crossmr5 жыл бұрын
Good video, try to increase the volume of your microphone
@Xptohz35 жыл бұрын
Thanks! This was my first video with this microphone. The other ones don't have this issue.
@andrelucas44733 жыл бұрын
Professor, como definir uma distância entre o player e o AI? Pra eles não ficarem colados...
@Xptohz33 жыл бұрын
No node MoveTo da BT tens lá a opção acceptable radius. :-)
@kenalpha32 жыл бұрын
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.
@kenalpha32 жыл бұрын
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?
@alimughal48975 жыл бұрын
I follow all the things but my AI start bouncing any one help ?
@diamondretro97794 жыл бұрын
Yea mine immediately start jumping when they spawn
@darkassasssin74136 жыл бұрын
Muito bom, só é pena a sua voz estar um pouco baixa, mas de resto está awesome!
@Xptohz36 жыл бұрын
Sim, ficou demasiado baixa. Para o próximo já vou ter isso em conta! :-D
@darkassasssin74136 жыл бұрын
Ficarei à espera pelo próximo video!
@MrChick-hn3os3 жыл бұрын
i dont have the on event possess thing idk
@Xptohz33 жыл бұрын
You must have.
@beat91sms3 жыл бұрын
@@Xptohz3 he dosent have
@beat91sms3 жыл бұрын
did you find alt coz i also dont have
@youngjojo30525 жыл бұрын
Do u have an email address I wanna know if u do freelance work
@Xptohz35 жыл бұрын
Hi! Yes, I have: gustavo.miguel.reis@gmail.com Thanks
@youngjojo30525 жыл бұрын
Thank you
@pwerfer81243 жыл бұрын
bom tutorial vou fazer isso com iteligencia artificial
@andrelucas44733 жыл бұрын
Ei amigo, vc sabe como definir uma distância entre o player e o AI? Pra eles não ficarem colados...
@pwerfer81243 жыл бұрын
no unreal
@beat91sms3 жыл бұрын
da p ver k es tuga XD
@Xptohz33 жыл бұрын
Com muito orgulho! ;-)
@Xptohz33 жыл бұрын
Muito sinceramente, estou-me bem a cagar para a pronúncia. O que me interessa é se consigo ensinar bem. ;-) Abraço