Announcement

Collapse
No announcement yet.

Navmesh Pathfinding

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

    Navmesh Pathfinding

    Hi,

    maybe i'm just a bit too dumb for it, but the information on how to use the UNavigationSystem is pretty sparse.
    I would just like to get the basics on it.

    So, my main questions are:
    How do i initialize the NavSys from code?
    How do i calc the next point to move to for a given destination?

    If the Navigation System works like the one from UE3, is there a NavigationHandle i need to get from somewhere, or do the Pawns generally have support for pathfinding already included and it just needs to be enabled?

    Thanks in advance,
    Indy
    FinalCamera on Marketplace / Web Demo
    TopDown Toolkit on Marketplace / Web Demo

    #2
    Just in case you haven't seen it, there's some information about using the navigation system on this thread:
    UE4 Pathfinding basic AI
    Daniel Broder
    Senior Gameplay Programmer, Epic Games

    Comment


      #3
      Hi Indy,

      Originally posted by indygoof View Post
      How do i initialize the NavSys from code?
      How do i calc the next point to move to for a given destination?
      I'm not sure what you mean. A lot of basic stuff is already being done for you, so Navigation System gets initialized upon creation of UWorld, and "Next Path Point" is picked by PathFollowingComponent.

      Originally posted by indygoof View Post
      If the Navigation System works like the one from UE3
      It's nothing like the one in UE3

      Originally posted by indygoof View Post
      is there a NavigationHandle i need to get from somewhere, or do the Pawns generally have support for pathfinding already included and it just needs to be enabled?
      AI in general is capable of pathfinding, provided it has relevant components: UNavigationComponent and UPathFollowingComponent, both of which are being created for default AIController. The main functions you need to look at regarding movement are AAIController::MoveToActor and AAIController::MoveToLocation. To make a human-player controlled pawn find and follow a path look at UNavigationSystem::SimpleMoveTo[Actor/Location] functions.

      Let me know if you have questions. And share your feedback!

      Cheers,
      --mieszko
      Senior AI Programmer @ Epic Games by day, AI programmer at night!
      My slow-blog on random AI thing (including UE4 AI).
      My no longer active UE4 AI blog.

      Comment


        #4
        Hi,

        that was exactly the information i was searching for!

        For some reason i thought that the flow would be similar to how it was in UE3, but this is really nice and easy now.

        Much Thanks and Cheers,
        Indy
        Last edited by indygoof; 04-01-2014, 02:17 PM.
        FinalCamera on Marketplace / Web Demo
        TopDown Toolkit on Marketplace / Web Demo

        Comment


          #5
          Originally posted by indygoof View Post
          For some reason i thought that the flow would be similar to how it was in UE3, but this is really nice and easy now.
          Glad you like it! In general Keep It Simple is our main principle when it comes to engineering AI code. Whenever you see something that could be done simpler just let us know!

          Cheers,
          --mieszko
          Senior AI Programmer @ Epic Games by day, AI programmer at night!
          My slow-blog on random AI thing (including UE4 AI).
          My no longer active UE4 AI blog.

          Comment

          Working...
          X