Announcement

Collapse
No announcement yet.

AI nav question. My head hurts, and my desk is dented.

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

    AI nav question. My head hurts, and my desk is dented.

    Alright, so I'm making a vehicle AI based on the work Peter L Newton has done (https://forums.unrealengine.com/show...-amp-Flying-AI .)
    Basically the AI takes it's current position (vector) and compares that to a target (also, vector) In his example he shows a car driving to set points. Cool, but not exactly exciting.

    I'm trying to shy away from my primitive by comparison AI system (that currently works) which uses things like overlap boxes to detect when something needs to be avoided, and I like the way this works (blackboards, not blueprints)

    Only downside is; it still requires a vector. Which still requires the same clunky overlap boxes (Which randomly stop working after a minute or so, thanks EG)
    Now this guy has figured it out! http://zombpir8ninja.blogspot.com/20...hicles-in.html the answer is the in FindPathToActor(or location)synchronously!

    Except it doesnt work for me. Only way I can get something even remotely close to usable is to use the last index as an integer, and then I get the same result as putting 1 in the get throttle input. (since just uses the last entry being my player as the vector)

    Now I'm not jumping on here, and running for help without trying anything else. I've tried basic math to get it to work better. Ie, get ai location, compare that to the vector in index 1, if they equal out (with some padding) sets a value to true, and the index goes up 1. Should work, but just results in the ai car moving very slowly, and stops working entirely if the path needs to be recalculated.

    Epic is totally useless since I've tried to find forum posts, streams, documentation everything on what should work in the return value (nav path object reference)
    The only thing that seemed to fit the bill was Add Local Navigation Grid for Points, it's got a spot for the array, a place to set the height (height of array I'm assuming?) and a return integer to get just one vector. I assumed this would lay out a grid, and go through points one by one. It just wants to crash everything as unreal goes down to 1 fpm (minute) and then I get an error (exBlueprint Runtime Error: "Attempted to access index 13 from array PathPoints of length 10!". Blueprint: AI_pawn Function: Update Movement Graph: UpdateMovement Node: Set Throttle Input
    )

    So my question, what in the ever loving **** goes in the return pin on the find path to actor node?

    #2
    The return?
    Looks like it outputs into an array of path points, which I'm assuming is the path you want.
    https://i.gyazo.com/6b1409e00b26a201...bfe43ccb54.png

    My bad if I misunderstood the question.

    Comment


      #3
      vehicle ai, I think is one of hardest stuff in ue4, the way they look at vehicle is too realistic to be useable.

      it's like the walking ai would have crazy method like "move right foot x units up" "add velocity to right foot" etc..
      lol 100% of ue4 games would look like the qwop game

      Comment


        #4
        Originally posted by Juice-Tin View Post
        The return?
        Looks like it outputs into an array of path points, which I'm assuming is the path you want.
        https://i.gyazo.com/6b1409e00b26a201...bfe43ccb54.png

        My bad if I misunderstood the question.
        No it's alright, that's basically where I am.

        I can drag the wire out to get an array of path points. But everything I try to get the ai to look at the next array point in comparison to the current location seems to break things.

        The only thing that remotely works close is getting the last index, and that functions the same as just plugging in my player pawn location into the target inputs for steering/throttle/handbrake

        Comment


          #5
          Originally posted by boynet View Post
          vehicle ai, I think is one of hardest stuff in ue4, the way they look at vehicle is too realistic to be useable.

          it's like the walking ai would have crazy method like "move right foot x units up" "add velocity to right foot" etc..
          lol 100% of ue4 games would look like the qwop game
          It is, isn't it? I'm just thankful for people much better with vector math than I am willing to share their knowledge and project files

          Comment

          Working...
          X