Adding AI to my NPC's - Pathfinding and beginning of daily routines! Devlog#18

Поделиться
HTML-код
  • Опубликовано: 18 дек 2024

Комментарии • 17

  • @Skeffles
    @Skeffles 3 года назад +1

    Very cool to see the NPC walking around the world.

    • @asciim0e880
      @asciim0e880  3 года назад +1

      Thanks Skeffles! And indeed it is :D

  • @tauheedgamedev2388
    @tauheedgamedev2388 3 года назад +1

    Its so cool watching the NPC watering the plants by himself. I need to look into A*, for the simple games I made I could always program the AI myself but maybe its time for a change.

    • @asciim0e880
      @asciim0e880  3 года назад +1

      Thank you tauheed!
      Honestly both is great. If the A* fits your need go use it if not just code your own algorithm. :)

  • @Itsysss
    @Itsysss 3 года назад +1

    Great work AsciiM0e! You did really well on the Npc

  • @epiphanyatnight8732
    @epiphanyatnight8732 3 года назад +1

    Great work as always! I had the animation flickering problem with A* as well. It was mostly (still flickers sometimes) resolved when I used aiPath.desiredVelocity to set the animation. May I ask what you ended up doing to solve that?

    • @asciim0e880
      @asciim0e880  3 года назад +1

      Thanks Epiphany! :)
      I tried using aiPath.desiredVelocity as well but what worked the best for me was not to apply a force but move the rb by using MovePosition and then applying the lookdirection manually (using a custom round and checking in wich direction the rb actually moves) to the animator of the npc. This then triggers the needed animation.
      The acutall flipping of the rb i simply apply by checking if the current look direction on the x axis != 0 and setting the localScale.x of the transofrm to -1 or 1 (CurrLookDirection.x < 0 ? -1:1)
      If you need more (code) detail I can try to upload a sample of my code :)

    • @epiphanyatnight8732
      @epiphanyatnight8732 3 года назад

      @@asciim0e880 Thank you very much, this really helped! I am using aiPath for the actual movement as well because it is compatible by default with the local avoidance and other features of A*. I guess more control you take over, better you can adjust to these bugs, I will try doing it with the rb. :) You're so kind man, it would actually be great to see how you handle that lookdirection vector. Here is mine btw (stripped unnecessary code): gist.github.com/ymansurozer/76246e138a2347ffd32e91afe2e1cd80

  • @Vlad79X
    @Vlad79X 3 года назад +1

    cool stuff bro! good luck! i'm also working on a game btw

  • @pixspaces4777
    @pixspaces4777 3 года назад +1

    Cool stuff, NPC ai is very good..

  • @DevNoob
    @DevNoob 3 года назад +1

    First! =) =) =) I used A* quite a bit. It's incredible

    • @asciim0e880
      @asciim0e880  3 года назад +1

      Thanks for the support DevNoob!
      I am actually having some trouble with the A* pathfinding and might not use it for my NPC after all :D
      But I'll use it for sure for my enemies inside the mine tho!

    • @DevNoob
      @DevNoob 3 года назад +2

      @@asciim0e880 The biggest issue I had with A* was group pathfinding but that was all for my purposes.

    • @DevNoob
      @DevNoob 3 года назад +2

      But keep up the good work! :D