Tutorial: AI - Jumping to platforms(Nav links) - Unreal Engine 4 + Unreal Engine 5

แชร์
ฝัง
  • เผยแพร่เมื่อ 28 ก.ย. 2024
  • In this episode we take a look at Simple Nav links and Smart links for AI to be used for traversing between gaps in the nav mesh in Unreal engine 4 and Unreal engine 5.
    Join the Discord server here: / discord
    Support the work of LeafBranchGames on Patreon here: / leafbranchgames

ความคิดเห็น • 99

  • @uavisionx
    @uavisionx ปีที่แล้ว +2

    i want to like this video multiple times.

  • @dutchboisss7490
    @dutchboisss7490 2 ปีที่แล้ว +16

    (DestinationHeight - (StartHeight - (((Power(JumpDuration, 2)) * 0.500000) * Gravity))) / JumpDuration

  • @rena10009
    @rena10009 ปีที่แล้ว

    Wow it works. Thank you. If anyone is having an issue where the "copy end points button" doesn't appear to work...as it did for me: So i was hitting the button and the coordinates WERE updating, but the cylinders were not changing. And when I'd play, the character wouldn't jump. Just hit the "copy end points" button for all your navlink actors, make sure the coordinates update, even if the cylinders don't...then just re open your map. Should work. Just a little buggy in the editor i guess. If not, try restarting the editor.

    • @LeafBranchGames
      @LeafBranchGames  ปีที่แล้ว

      Thank you for sharing this information.

  • @MarcusLunaDeLeon
    @MarcusLunaDeLeon 2 ปีที่แล้ว +3

    It would be nice to have the "JumpDuration" as an equation as well, so that this could be used universally for differing heights or drops.

    • @LeafBranchGames
      @LeafBranchGames  2 ปีที่แล้ว

      Sure, it can for sure be used for that. Although then you likely will not want to have it defined as a variable as I did, but something generic so you get an input for it.

    • @_MauMau_
      @_MauMau_ 11 หลายเดือนก่อน +1

      Hey Marcus, did you manage to make this work with a new equitation? If so, I would love to hear it!

  • @jaberneto
    @jaberneto 2 ปีที่แล้ว +1

    Awesome! Beautifully explained!

  • @ShamaxGD
    @ShamaxGD ปีที่แล้ว +1

    Outstanding! Thanks for the guide!

  • @gatheringmatter4289
    @gatheringmatter4289 11 หลายเดือนก่อน +1

    Good tutorial everything works fine, except for some reason my enemy will do like a double take mid air. He's about to land on the other link and then just turns around mid air and this repeats a few cycles until I move around a lot.

    • @LeafBranchGames
      @LeafBranchGames  11 หลายเดือนก่อน

      Weird, have not heard or seen that before. Sounds like maybe the navigation is having issues determining where to go.

  • @kenalpha3
    @kenalpha3 2 ปีที่แล้ว +3

    Quick question: Is it not possible in 2022, and even UE5 - to get AI to jump using Nav mesh (change RecastNavMesh settings > Agent Max Step Height)????
    Because wtf is the new tech in UE4/5 good for if we cant procedural generate levels that AI can jump in??? We need to manually place 100 Nav points - instead of a Nav mesh. Defeats the purpose of quick level design and smart AI.
    Why didn't Epic put the code in the starter pacts, and the SideScroller template - for AI that knows how to check if something is in front of him, and know his jump ability, and jump if he can???? Ive been searching for answers and no one has addressed this basic function that existing since UE2.
    Srs wtf, they gave us a SideScroller Template but not a bot that knows how to Nav platforms?

    • @kenalpha3
      @kenalpha3 2 ปีที่แล้ว +2

      11:50 This print sprint does not work. UE 4.27.
      10:07 I set the print string code as you showed. 11:07 Enabled the check mark. But the bot does not trigger the text.

    • @LeafBranchGames
      @LeafBranchGames  2 ปีที่แล้ว +1

      I have not used nether UE2 nor UE3, so I can't speak for what features were available there and in what form they exist today in UE4 or UE5 or if they have been removed completely.
      What you are describing sure sounds like a very useful feature, so I would hope they would not have removed such a valuable function.
      With that said, I think the main purpose for max step height would only be to get over a small object or climb a slope that is steep. I don't think it can be used to the same effect as the links. But I have not tried with a huge value to see if it is possible either, so I don't know.
      However, a link doesn't necessarily mean that you are only traveling in height, it can also be a very different place in X and Y axis as well, like in the case of a teleporter. That destination could also have a large gap without a nav mesh connecting the two locations also. In that case a step height would not be very useful.

    • @kenalpha3
      @kenalpha3 2 ปีที่แล้ว

      @@LeafBranchGames Thanks for the reply. Can you answer for my 2nd post? I followed your tut (Im in UE4.27 - newest).
      11:50 This print spring does not work - thus your later code doesnt work either.
      10:07 I set the print string code as you showed. 11:07 Enabled the check mark. But the bot does not trigger the text.
      Ive tried 3 tutorials to get a bot to work. Yours works allong with Nav mesh, so id like to get yours to work. Someone else said set a Higher Step Height. But that didnt work to make my bots jump.
      Am I missing something - does the default [Epic's] AI controller (which I made a copy of) not have code for bots to jump - or not give the bot a desire to jump??? (I did add your jump calculation. But my bot wont jump, nor trigger the Nav link Print string.)

    • @LeafBranchGames
      @LeafBranchGames  2 ปีที่แล้ว +1

      @@kenalpha3 It could be a number of things. Most likely you need to fiddle with the link locations. move them around a bit in X and Y axis but also height and see if you can get it to work. I have done this in both 4.26 and UE5 and it works, so shouldn't be a version problem.
      If you are uncertain if things you have done that differ from the tutorial, then try to do it with a fresh project and see if your results stay the same or start working.
      If neither of those things work, I would suggest re watching the tutorial and see if you missed some other part.

    • @kenalpha3
      @kenalpha3 2 ปีที่แล้ว

      @@LeafBranchGames Hi. So I watched your tut 3 months ago. And wasn't sure of the error. So Ill try a new project.
      Thanks for having P on. I think the other tut did not show that. (But from yours I knew how, thus I was checking the cylinder height. But UE4 doesn't really me if the Point height is too low or high? The green zone was filled in on my ledge.)
      Also someone said they had UE4.27.2 (same) and they had to delete the Simple Link points for the Smart link points (copy of same loc), to work. I also tried that, failed.

  • @bobelvislisa
    @bobelvislisa 2 ปีที่แล้ว +1

    AMAZING please keep making content

  • @jaberneto
    @jaberneto 2 ปีที่แล้ว +1

    I'm trying to find a way to verify if the character have the "jump force" enough to make the jump, but before or during the pathfiding so it doesn't even try to jump nor get stuck in place.
    Having a hard time here, someone have a idea on how I can do that?

    • @jaberneto
      @jaberneto 2 ปีที่แล้ว +1

      Oh, nevermind, just found the answer in the video haha

    • @LeafBranchGames
      @LeafBranchGames  2 ปีที่แล้ว +1

      @@jaberneto Glad to hear it worked out. :)

  • @markuswikstrom3690
    @markuswikstrom3690 ปีที่แล้ว

    Would this be doable based on a set height rather than a set time?
    So it launches to the target location based on height rather than time, which would make the duration longer if the distance was longer.

    • @LeafBranchGames
      @LeafBranchGames  ปีที่แล้ว

      Sure, you can always calculate a different jump path with a different formula.

    • @markuswikstrom3690
      @markuswikstrom3690 ปีที่แล้ว

      ​@@LeafBranchGames Any idea of what that formula would look like?
      I'm trying to make an AI jump to a location close to the player.
      The force and height of the launch would be based on the distance between the locations and a speed modifier.

    • @LeafBranchGames
      @LeafBranchGames  ปีที่แล้ว

      @@markuswikstrom3690 No, sorry.

    • @markuswikstrom3690
      @markuswikstrom3690 ปีที่แล้ว

      @@LeafBranchGames
      Aight thanks anyway 💯
      Been working with this all day and got to a work around where I does the calculation for Z times a JumpHeight value and take the X and Y divided by JumpHeight. This makes the character jump higher.
      Wanted to do something based on distance since it would be more fitting for the character, but this has to do for now.

  • @Miraskede
    @Miraskede ปีที่แล้ว

    Is it possible to add custom jump animation for the "launch character" node. and if so how?

    • @LeafBranchGames
      @LeafBranchGames  ปีที่แล้ว +1

      Sure, the animations are just the ones being played in the animation blueprint that are setup for falling. So you can just replace them with what you want.

    • @Miraskede
      @Miraskede ปีที่แล้ว

      @@LeafBranchGames i am a bit confused. Where do i have to place the montage node

    • @LeafBranchGames
      @LeafBranchGames  ปีที่แล้ว

      @@Miraskede The animation blueprint does no make use of animation montages for the animations during jumping/falling. If you want an example of how it looks, you can open the default third person character and see how they have set it up there.

  • @Maxime66410
    @Maxime66410 ปีที่แล้ว

    I don't know why my AI is not detected with smart link :/

    • @LeafBranchGames
      @LeafBranchGames  ปีที่แล้ว

      It can be a bit finicky at times to figure out how to get it to work.

  • @WeAreNIM
    @WeAreNIM 9 หลายเดือนก่อน

    Can't get this to work. :(

    • @LeafBranchGames
      @LeafBranchGames  9 หลายเดือนก่อน

      Nav links can sometimes be a bit fidgety to get to work I have heard. I have not run into the issue myself though.

  • @fuzzlabinteractive
    @fuzzlabinteractive 2 ปีที่แล้ว +7

    This is the easiest to understand and in-depth tutorial I've seen on the subject, many thanks!

  • @ps5games821
    @ps5games821 3 ปีที่แล้ว +3

    Thank you very much for AI Tutorials
    Make more please

  • @ps5games821
    @ps5games821 3 ปีที่แล้ว +1

    please make a video on creating a shooter with artificial intelligence of enemies who will hide behind cover and shoot

    • @LeafBranchGames
      @LeafBranchGames  3 ปีที่แล้ว +3

      I am currently working on a series for a multiplayer shooter where there will be AI like that coming. Stay tuned!

  • @aff3nm4nn
    @aff3nm4nn ปีที่แล้ว

    bro, nice tutorial, but I hope you gota better noise filter by now. your swallowing sound is killing my nerves. thanks, tho.

    • @LeafBranchGames
      @LeafBranchGames  ปีที่แล้ว

      I don't know. Look at a more recent video and let me know.

  • @mateop607
    @mateop607 11 หลายเดือนก่อน +1

    I like the cat that's meowing in the background!

    • @LeafBranchGames
      @LeafBranchGames  11 หลายเดือนก่อน +1

      Yeah, she wants to be a TH-camr it seems!

  • @lucaneva494
    @lucaneva494 ปีที่แล้ว +1

    Thank you bro, that help me very well ! nice tut !

  • @starrunner3220
    @starrunner3220 2 ปีที่แล้ว +1

    how can i make this if platform is moving?

    • @LeafBranchGames
      @LeafBranchGames  2 ปีที่แล้ว

      Most likely the way to go about doing this is to have a blueprint created of the nav link where you create methods that will change the location, which will get their location from your moving platform and set that.

  • @hawketakao9648
    @hawketakao9648 2 ปีที่แล้ว +1

    Thanks man, exactly what I needed :-)

  • @SLAM_AWAY_GAMES
    @SLAM_AWAY_GAMES ปีที่แล้ว +1

    Great tutorial, thanks!

  • @davdev793
    @davdev793 2 ปีที่แล้ว +1

    Really nice. Thanks!

    • @LeafBranchGames
      @LeafBranchGames  2 ปีที่แล้ว +1

      My pleasure. :)

    • @davdev793
      @davdev793 2 ปีที่แล้ว

      @@LeafBranchGames Do you have any idea why in some situations the "On Smart Link Reached" dosent fire at all? With exact same configs some proxy links fires it amd some others dont. Already tried disable simple link and it still dont fire the event and tries to follow it as it was a simple link.

    • @LeafBranchGames
      @LeafBranchGames  2 ปีที่แล้ว

      @@davdev793 The AI is probably not reaching the actual point where the link determines it has been reached. Try moving it around.

  • @thesteviathan
    @thesteviathan 5 หลายเดือนก่อน

    FYI: As of Unreal 5.3 math expressions consistently cause the editor to crash. You can chain subtract and divide nodes together instead to be safe

    • @LeafBranchGames
      @LeafBranchGames  5 หลายเดือนก่อน

      Do they? Do you have a reproducable example equation for me to test?

    • @thesteviathan
      @thesteviathan 5 หลายเดือนก่อน

      @@LeafBranchGames pretty much any of the expressions from this tutorial caused it to crash for me

    • @thesteviathan
      @thesteviathan 5 หลายเดือนก่อน

      I believe I'm on the latest version, and I'm a beginner so I was going through this using a fresh 3rd-person template project with some light modifications

    • @LeafBranchGames
      @LeafBranchGames  5 หลายเดือนก่อน +1

      @@thesteviathanSeems to be related to using a name of an existing variable. If you use different names and plug them in manually you should be fine.

    • @thesteviathan
      @thesteviathan 5 หลายเดือนก่อน

      @@LeafBranchGames I will have try that tomorrow! I started going down a rabbit hole of adding a custom c++ Blueprint Function Library and hoo boy was that an adventure. Thanks for looking into it.

  • @bnok5237
    @bnok5237 ปีที่แล้ว

    where did you get the formula for the height ?

    • @LeafBranchGames
      @LeafBranchGames  ปีที่แล้ว

      A math friend told me. But you can find ballistic formulas here if you need them: www.fxsolver.com/blog/2016/05/20/top-10-ballistics-equations/

  • @HyperGameDev
    @HyperGameDev ปีที่แล้ว

    Why not use two nav links? One that jumps it down, and another that jumps it up?

    • @LeafBranchGames
      @LeafBranchGames  ปีที่แล้ว

      If you want to have multiple nav links, feel free to. Not sure why you would want to.

    • @HyperGameDev
      @HyperGameDev ปีที่แล้ว

      @@LeafBranchGames I guess for saving dev time versus coding something out.
      Your solution seems great though. I was mostly wondering if maybe there were specific downsides to having multiple nav links, like it bloating the game size or causing instability.

    • @LeafBranchGames
      @LeafBranchGames  ปีที่แล้ว +1

      @@HyperGameDev I must be missing the point. If you can define two way jumping with a single nav link, why would you create two separate nav links for the same purpose.
      Concerning bloat and down sides, it will depend heavily on the amount of nav links used I believe, which is very on a per game basis. I would not worry too much about it until you get to a more finished stage and then have to look over performance.

    • @HyperGameDev
      @HyperGameDev ปีที่แล้ว

      @@LeafBranchGames I don't think you're missing anything. I'm just curious if it would work, and what the downsides would be to do it with two versus blueprinting something.
      Thank you for responding.

    • @LeafBranchGames
      @LeafBranchGames  ปีที่แล้ว

      @@HyperGameDev Glad to hear I was not misunderstanding anything. So you should be fine either way you go about it. Having many single purpose links might make it more clear where you have different up and down spots but might make it a bit cluttered as well. So it is a matter of preference then I think.

  • @davidfruchtman5234
    @davidfruchtman5234 2 ปีที่แล้ว

    dont pin me leaf branch