• Visit Rebornbuddy
  • Visit Panda Profiles
  • Visit LLamamMagic
  • how to deal with stuck/movement loops tasks?

    Discussion in 'Wildbuddy Developers' started by Maniyak, Nov 27, 2015.

    1. Maniyak

      Maniyak New Member

      Joined:
      Oct 20, 2015
      Messages:
      9
      Likes Received:
      0
      Trophy Points:
      0
      the moveTo/moveWithin tasks seem to do little to nothing to prevent the player from getting stuck. unfortunately i am not able to add such a function since the pathing runs as task and i did not figure out a way to do some checks while moving.

      blacklisting does not work because often the taks never ends so i never have a chance to do it. like when running up a steep slope and the character is running, falling/sliding down a bit, running again -> always resets the pathing because it "falling without jumping - resetting path". not sure why this happens in the first place. would be easy to check for such things, but again, not while the task is running.

      i saw that the moveWithin function has an overload with something that sounds like a condition that could exit the task but i could not figure out how to use it in such a way.

      the only thing i can think of is doing my own version of the pathing functions by manually starting/stopping/running/turning and adjusting the movement every pulse. that together with some path finding and sanity checks should do the trick but is probably more laggy. but that would require a function that tells me if a certain point on the map is within the navigation mesh. is there something like that?

      is there anything i am missing or maybe someone has found a way and wants to point me in the right direction, either way i would really appreciate some help.
       
      Last edited: Nov 27, 2015
    2. Deathdisguise

      Deathdisguise Community Developer

      Joined:
      Mar 7, 2015
      Messages:
      678
      Likes Received:
      6
      Trophy Points:
      0
      Just needs a lambda function! It's possible to do stuck handling inside of it, but you'd see more benefits using a method outside of the coroutine, I'd imagine.

      Code:
      await CommonBehaviors.MoveWithin(
          // Other parameters...
      
          cancellation: () => 
          {
              if (condition)
                  return true;
      
              return false;
          }
      );
      
       
    3. Maniyak

      Maniyak New Member

      Joined:
      Oct 20, 2015
      Messages:
      9
      Likes Received:
      0
      Trophy Points:
      0
      thank you, i guess i could do my checks inside the task and blacklist the area/actor or something if it fails.

      do you know of any way to check if a certain point on the map is within the nav mesh? only way i can think of right now is let moveWithin generate the path to a specific point, exit task as soon as it has started and check if the end/last hop and their locations (which should be close to my specified point) are walkable. but i hope there is an easier and faster way ;)
       
    4. Deathdisguise

      Deathdisguise Community Developer

      Joined:
      Mar 7, 2015
      Messages:
      678
      Likes Received:
      6
      Trophy Points:
      0
      You will probably want to look at the World class. :)
       
    5. Maniyak

      Maniyak New Member

      Joined:
      Oct 20, 2015
      Messages:
      9
      Likes Received:
      0
      Trophy Points:
      0
      perfect, exactly what i was looking for, thanks :)
       

    Share This Page