UE 5.1 Tutorial --- Creating AI using State Trees [With some explanation of State Tree]

แชร์
ฝัง
  • เผยแพร่เมื่อ 2 ธ.ค. 2024

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

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

    I dont know why Epic take so much time making the proper documentation and tutorials on this kind of content but thank god for the community members like you.

    • @jd-foo
      @jd-foo ปีที่แล้ว +1

      Because Epic doesn't give a fuck about the user

    • @YoutubeAccountMan
      @YoutubeAccountMan 28 วันที่ผ่านมา

      Because their target audience is people smart enough to read what's there and figure it out.

    • @p30virus
      @p30virus 28 วันที่ผ่านมา

      @@TH-camAccountMan yeah... probably... or probably the documentation was not even there on the source code for this feature at the time of this post... who would know.

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

    This is an excellent tutorial. Thank you! :) I tried to work with state trees a couple of months ago and quickly realized I had to wait until some actual tutorials came out. This is an excellent starting point, and I'm excited to see more in the future!

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

    Incredible timing on this, just started learning state trees today. Fantastic work

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

    Se você é brasileiro, coloca a Unreal em Inglês, na hora de colocar os Evaluators o programa traduz automaticamente e isso buga, fazendo o State Tree não ler as Saídas/Entradas.
    Fiquei meia hora tentando descobrir o que tava acontecendo, enfim, espero ter ajudado.
    English text:
    If you speak another language, put Unreal in English, when placing the Evaluators the program automatically translates and this causes a bug, causing the State Tree not to read the Outputs/Inputs.
    I spent half an hour trying to figure out what was going on, anyway, I hope I helped.

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

    This great! I'm new to making Ai function and had great results with this tutorial so thank you. So far, state trees are way more intuitive to me than behavior trees. I'm in the process of trying to create some interesting NPCs and think STs may be the route to take. Most AI tutorials (traditionally, behavior trees) teach how to make enemy NPCs search for and attack the player. I've been working on the opposite...how to make NPCs alert to danger and run away from threats. I'm wondering what this would look like in a state tree. This could be applied to animals that scare and run away when they see a player, civilians running away from the scene of a crime, or enemies that retreat from a battle that the player is winning. If you have any ideas like this or use cases, please share!

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

      It would be really simple I think!
      You can have a few states and name them based on the behaviors you would want: ex. "Flee", "Wander".
      You would just have a state tree task(s), that would run the code for running away from a target or something similar, be under a state. Then this state you can just add conditions for when it should switch over to other behaviors/states.
      The only thing is that there could possibly be a bit more complexity for the conditions or for when some code should be run on tick. But you can always use child-states to improve the structure.

  • @coolguy-xb2yn
    @coolguy-xb2yn ปีที่แล้ว +1

    has the mentioned bug been fixed as of 5.2?
    also, could you make a tutorial video about using state trees for player states such as moving? like you would have idle/walk/run/sprint, then maybe a simple dash state. i think it has potential for that, but wouldn't even know where to begin with sending logic back and forth.

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

      yes. you can now set task success in the Enter-function.

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

    Very helpful. Thank you

  • @DrN0VA.
    @DrN0VA. ปีที่แล้ว

    As visually nice as this looks it seems like it might be more trouble than its worth, at least for now.
    Even some basic functionality seems lacking, like blackboard-like features. For example, in my current AI I store a lot of condition variables (such as is target actor set) in the BB. However as far as I can tell it would be more complicated to implement these variables here. Either you need to use the Evaluators or you need to make bespoke conditions for each transition, which blackboards do have but is more straightforward.
    Maybe I'm missing something here but I just don't see the value in attempting to use this feature without some big improvements.

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

      There are actually scenarios where state tree is better over BT. State Tree is Unreal Engines implementation of a finite state machine mixed with behavior tree tasks. Behavior Trees are more task based and are not built with the mindset of jumping from one node to another by user's direct control. So if you want precise control over an AI behavior then a behavior tree is less ideal. I have created boss AI in Unreal Engine and I typically use a behavior tree combined with a blueprint created finite state machine for more precise control over the AI while still having the benefits of BT tasks.
      State Tree has the potential to be the only solution I need. A state tree allows you to access varialbles easily through UE5's new property access tool so a black board isn't as essential as you might think. Tho a black board type of solution for variables related to AI behavior would be nice, maybe they might add it eventually.

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

    Could you tell me when to choose State Trees over Behaviour Trees?
    Thanks in advance and also thank you for this awesome tutorial, especially as it seems to be the only resource for State Trees right now!

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

      Short Version:
      If for your care more about performance and precise control of AI behavior execution. Then state trees area probably the better choice.
      Note that lack of support resources means you might very likely be on your own incase you run into problems. (for now)
      Long Version:
      As far as I know, if you want to focus more on performance then you might want to consider using state trees over behavior trees. That's one of the main appeals for state trees. What I had realized is that with state trees, the AI doesn't have that awkward "pause" I see occur with behavior trees if you set it up right. (not sure if this still happens)
      Furthermore, state trees gives you precise control over how the AI behaviors execution flows. So if you want to really control when and how the execution of the AI (while keeping good performance) changes, then state trees would be better.
      They are also good if you want a bit of an easier overview of the AI behaviors if that's important for you.
      However if you are using the EQS System you might want to stick to behavior trees, as I'm not sure if these work with state trees as I've never tried them.
      I'd personally say its down personal preference or a per-project basis. If you want to practice specifically using state trees, or if your project relies on very precise control of AI execution flow, then state trees are likely better to choose.
      But by default, most other projects should be fine using just behavior trees.
      But keep in mind that is still a rather big lack of documentation, tutorials & any forums for state trees. So if you ever run into problems with state trees you are very likely on your own until more of these tutorials and stuff comes out.

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

      @@uberaugh476 Thanks for the comprehensive anser! :) I like the look and feel of State Trees much more and I am a bit more used to state machines as a concept that generalizes to a lot. I also like to be able to run as many tasks in parallel as I wish.
      However, in Behaviour Trees, the highlighting of active branches and leaves when playing in editor is a really nice debug feature. And as you just said, documention is much better. So I go with Behavior Trees for now and switch to State Trees when necessary. Event I'd really like to ditch Behaviour Trees.

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

      @@donnyjoe7653 Yes you are indeed right!
      I forgot to mention the part where behavior trees do have much better debugging features like you said. And this is something that I think is probably holding state trees back as a more viable option. Since I have run into issues debugging with state trees due to the lack of debug features that I know it contains.

    • @MrShaggyww
      @MrShaggyww ปีที่แล้ว +4

      Generally StateTrees will probably replace BT at same point, they can do all the same and much more/better from what I can see, just a matter of getting polished, quality of life improvements, bug fixes. I think you can still do the debbuging of AI behaviours with other debugger tools like VisualLogger/GameplayDebugger. Though if you are planning on adding upon complexity to your game, different types of AI etc/tasks, it seems much cleaner and more flexible with State Trees - well you gotta learn them one day anyway so it might be just better to start off as soon as possible :)

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

    Thanks!

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

    Have you got any feedback on that enter state bug - There isn't anything on the issues forum?

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

      Heard nothing so far about it, I'm not even entirely sure if its a bug or not but I believe it is. Maybe it might be fixed in some future updates.

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

    Hi thanks for the vid. I wonder if this will be part of unreal in the future or is it worth sticking to behavior trees? A bit hesitant about learning something that may not be supported down the line.
    It also seems that there is a lot of tick events being called. Would this not effect performance?
    Thanks

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

      As of now its likely better to stick with behavior trees due to the lack of documentation and debug features for state trees. Behavior trees are simply a more polished feature.
      However, if you are willing to make your own methods of debugging or once debug features get added to state trees by unreal then I think its worth learning state trees! Though if you really want precise control over your AI then state trees will help you a bit more here.
      As for the future plans of unreal and state trees, I can't answer that since I don't know, but it seems they might keep it for now.
      And the Ontick event stuff, currently the main aspect being on tick would be that workaround for the "Enter State" bug, but if Unreal fixes this bug then State Trees should have less code on tick compared to behavior trees, so performance should be better in theory!

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

      I definitely think this is sticking due to its general purpose. This is not only an AI tool. I've used it for other actors and it makes for nicely structured code, often taking complexity from a big actor and splitting it out into separate simpler bps. As for AI use, I'm struggling a bit to get the grips on the order of events.. and how things are executed.. so def something to be learned. It is not as simple as it looks, imo.

  • @kushs-labs
    @kushs-labs ปีที่แล้ว

    Thanks a ton for this. Been searching a bit in depth guide for State Tree. Thanks a lot again.
    If you don't mind me asking, Any future plans regarding the same?

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

      By the same I assume you mean if there will be more tutorials about State Trees?
      Unfortunately as of now I don't have any plans for any more tutorials regarding state trees (Or other kind of tutorials).
      Maybe if there is plenty of demand for a specific tutorial I could look into it. You could start giving me ideas if you'd like!
      I would need to consider if I have the necessary knowledge to actually create a tutorial though as I don't want to teach wrong information and I'm still learning things in unreal myself :)
      But if I feel confident enough I can create more whenever I have the time!

    • @kushs-labs
      @kushs-labs ปีที่แล้ว

      @@uberaugh476 That's very kind of you to be so upfront. I appreciate your point of view regarding this. I'll be contacting you here (or if you've other means) regarding my progress with State Trees, with the hope that we both can learn from each other ☺️

  • @dragontein9955
    @dragontein9955 8 หลายเดือนก่อน

    TY
    but please do something with your audio
    you are mega quiet and still mic is poping

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

    You have me watch 5 minutes of this video, then tell me you don't know what 'parameters' are used for?