State Tree Complete Introduction Course - BEGINNER FRIENDLY -

แชร์
ฝัง
  • เผยแพร่เมื่อ 26 ก.ย. 2024

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

  • @DevGods
    @DevGods  2 หลายเดือนก่อน

    I recently added these files to github if anyone wants to check their code against mine when having issues.
    github.com/godtier-games/StateTreeCourseFiles

  • @JWhite205
    @JWhite205 หลายเดือนก่อน +1

    Hey brother, just wanted to thank you for all that you showed me in the brief time that we worked together and also good luck to you in the future

  • @thelionszen3352
    @thelionszen3352 8 หลายเดือนก่อน +2

    Thank you! I'll keep supporting your channel

  • @KittehBit
    @KittehBit 6 หลายเดือนก่อน +3

    Nice video! :)
    A bit fast at times for a beginner, but I honestly prefer that to "too slow" vídeos, and I can rewind. :D
    The | symbol is a "pipe" btw. :)

  • @angeloadams8822
    @angeloadams8822 8 หลายเดือนก่อน +3

    Thank u for this

  • @in-HUMAN69
    @in-HUMAN69 2 หลายเดือนก่อน +1

    I really see a god😭😭🔥

  • @whyareless
    @whyareless 8 หลายเดือนก่อน +1

    Nice video bro, cheers :)

  • @danilomontero7935
    @danilomontero7935 2 หลายเดือนก่อน +1

    Hello, I have a problem in case someone has suffered it too. When I believe the actor variable or AI Controller in a task, and I name it in its category as a context; I do not manage to access the variables or functions of this actor from this task; I try the basic, binding to its context within the State Tree, but nothing happens. I am using a tree ai component, does anyone know how they could link the context to the variables admitted? The strange thing is that by printing the name of this reference it does it correctly, but I still do not access its variables, functions, events, etc. Great video, you explain it very clearly

    • @DevGods
      @DevGods  2 หลายเดือนก่อน +1

      Are you setting the actors type explicitly in the context actor variable? For example of the graph runs only on BPYourCustomActor are you plugging in just the actor or your custom one? If it’s the latter you should have access to all of its blueprint variables and public getter functions

    • @danilomontero7935
      @danilomontero7935 2 หลายเดือนก่อน +1

      @@DevGods Thanks dude, I was trying to access personalized events from my context actor, within a Tree Task state; But my mistake was to think that the link was automatic, everything was solved with a cast to my NPC

  • @AetherMomon
    @AetherMomon 2 หลายเดือนก่อน +1

    Great video, this has been really helpful to me! I have a question about State Tree that I can't seem to find any resources for online. How do you create a custom type of state for the State Tree plugin? I need to create a new custom type of state with customized functionality that is selectable in the State Tree UI. I also would like to know how to create custom transition type.

    • @DevGods
      @DevGods  2 หลายเดือนก่อน +1

      Like a state preset? That’s more advanced than this topic here since it requires adding code to the plugin’s editor and runtime module. You essentially need to add an editor action that is added to the state tree editor that will spawn your custom state class into the tree like it does for the other states. Transitions are a bit easier but I don’t think they can be made in blueprints. Pretty much you will have to rewrite some things in the plugin, as far as I know none of the really core things can be overridden

    • @AetherMomon
      @AetherMomon 2 หลายเดือนก่อน

      @@DevGods Thanks for the answer! I was looking through the code for the State Tree plugin, I can’t understand most of the code but from what I could see I was afraid that I would have to customize the plugin itself in order to make custom states & transition types. It would seem that is the case. I don’t want to modify any engine plugins so unfortunately that’s not an option, I do wish they would have made the State Tree plugin more overridable and customizable in C++. It would have been super useful. But I think at this point I’ll need to try to create my own custom solution instead. Most likely I’ll need to create a simpler solution that uses the same core principles as State Tree and is more overridable & customizable in C++

    • @DevGods
      @DevGods  2 หลายเดือนก่อน

      @@AetherMomon You can actually copy the plugin into your projects plugins directory. Luckily state tree has no dependencies. When in your project folder your version will take over the main one. I've actually done something similar for my ability system plugin based on state trees. I still haven't added state presets yet but its on my todo list. Let me know if you get it working.

    • @AetherMomon
      @AetherMomon 2 หลายเดือนก่อน +1

      @@DevGods Thanks, that’s very useful! I didn’t know copying the plugin into my project would take over the main one. I will have to look into that then, though I have no experience with editor modules so it might be difficult for me. But I will let you know if I happen to get it working!
      It’s interesting that you’re creating an ability system based on State Tree, it’s an interesting way to utilize State Tree. I have plans to use an ability system alongside State Tree.

    • @DevGods
      @DevGods  2 หลายเดือนก่อน

      @AetherMomon Ha yeah editor programming is confusing as hell at first but I have faith in you. Your idea is cool. For me it’s just an unfortunate situation. Network prediction requires your code to be written a certain way which has a TON of boiler plate. I wanted to make a generic way to make abilities without having to touch all that boiler plate for both myself and any team members. I first used Flow Graph as the UI/UX but it was too limiting. I also tried creating my own graph editor. State trees has a really good core to extent to your needs so I just went with it. It’s been pretty great so far.

  • @xSp33dy97
    @xSp33dy97 6 หลายเดือนก่อน +1

    Thanks for the video. Can you make a tutorial on how to use/create evaluators, tasks and conditions in c++?

    • @DevGods
      @DevGods  6 หลายเดือนก่อน

      Just look at the source code of other tasks. It’s essentially copy pasta from there

    • @xSp33dy97
      @xSp33dy97 6 หลายเดือนก่อน +1

      @@DevGods Can't find how to access the parameters from StateTree

    • @DevGods
      @DevGods  6 หลายเดือนก่อน

      Like passing a value into your custom task from the state tree object? Or to fetch a value from your custom task inside the state tree

    • @DevGods
      @DevGods  6 หลายเดือนก่อน +1

      There’s a good example of both in UStateTreeTask_FindSlotEntranceLocation. Take a look at the structure they use as instance data and the categories each one of the Uproperties are in

  • @rangerRick9895
    @rangerRick9895 3 หลายเดือนก่อน +1

    Hmm mine crashes on event exit state 14 min in. Event ExitState is called more than once. On the second loop it crashes... On dead state I trigger "On State Completed" transition To "Tree Succeeded". Anyone else having this problem on 5.4?

    • @DevGods
      @DevGods  3 หลายเดือนก่อน

      Do you have debugging symbols installed? You should join my discord and post the crash log in the divine forum channel

  • @PsychotropicDog
    @PsychotropicDog 2 หลายเดือนก่อน +1

    And I found myself annoyed that UE 5.4 still does not have 'Set State Tree'. It is worth it to learn some C++ just to do this custom State Tree with the one function that should already be there in blueprints. (around the 35 min mark)

    • @DevGods
      @DevGods  2 หลายเดือนก่อน

      I’m pro c++ everyday all day. It will only make things better for you in the long run. You’re going to end up needing it eventually and then you’ll be mad at yourself for not doing it sooner. I wasted 8 whole months avoiding it. I regret that every single day.

    • @PsychotropicDog
      @PsychotropicDog 2 หลายเดือนก่อน +1

      @@DevGods I am not anti C++, but I have other suites to explore. There was a link to another obtuse resource from Epic, that wants to send me on a fetch quest for the simplest things.

  • @PaulGeraskin
    @PaulGeraskin 5 หลายเดือนก่อน +1

    Thank you so much! Is it fine to use the State Tree for MainCharacter's states? For a simple single player game.

    • @DevGods
      @DevGods  5 หลายเดือนก่อน +1

      I don’t see why not

  • @Al-Misanthropic-Bundy
    @Al-Misanthropic-Bundy 6 หลายเดือนก่อน +2

    Hello! New viewer here. Thank you for the tutorial.

    • @DevGods
      @DevGods  6 หลายเดือนก่อน +1

      No problem! I hope it helps you better understand state trees! Good luck with your project!

  • @DuneGames
    @DuneGames 6 หลายเดือนก่อน +1

    Appears my other comment got deleted - was it the link to the image of what I'd done?
    Anyway, I was having an issue related to switching states while other state was running. Adding a delay just before the call to set state tree, (which in my c++ code called StopLogic, Set the new tree, then restarted the logic), made it work for me. Thanks, this is great.

    • @DevGods
      @DevGods  6 หลายเดือนก่อน

      If you can join the discord and make a forum post. You can post pics and code so I can help

    • @DuneGames
      @DuneGames 6 หลายเดือนก่อน

      @@DevGods I was going to, but your discord link in the description says for off-topic discussions. I may in the future as I dive into the state trees. The whole idea of having multiple state trees is really going to help. I've heard other youtubers say that doing so would be great but never mentioned how.

  • @xSp33dy97
    @xSp33dy97 6 หลายเดือนก่อน +1

    The state trees with the custom made OurStateTreeSchema don't appear in the details tab for OurStateTreeComponent, any idea why? But if I change it to the default Schema it appears. For the SetStateTree function made it appears

    • @DevGods
      @DevGods  6 หลายเดือนก่อน

      That’s a schema thing. Like I said early in the video the schema is a filter. You can make your own. Check out the state tree schema for an example. Remember that the engine is source available if you see that something works a certain way and yours doesn’t you can dive into it and see what differences there are.

    • @xSp33dy97
      @xSp33dy97 6 หลายเดือนก่อน +1

      Been looking on both UStateTreeSchema from the engine and UStateTreeComponent and I don't see it being filtered anywhere but in the UStateTreeComponent where StateTreeRef property is created and it has between () meta=(Schema="/Script/GameplayStateTreeModule.StateTreeComponentSchema") not sure what this does though.

    • @DevGods
      @DevGods  6 หลายเดือนก่อน

      @xSp33dy97 jump into my discord so I can show you mine

  • @PsychotropicDog
    @PsychotropicDog 3 หลายเดือนก่อน +1

    most XLNT

  • @dead7643
    @dead7643 7 หลายเดือนก่อน +1

    I'm trying to make the same OurStateComponent, but with the ability to use parameters. Do you have any ideas on how to do this?

    • @DevGods
      @DevGods  7 หลายเดือนก่อน

      This is a broad and very vague question. If you want to use parameters then add them.

    • @dead7643
      @dead7643 7 หลายเดือนก่อน

      @@DevGods I want to pass not only the tree, but also its parameters in the SetStateTree function. But FInstancedPropertyBag (parameters) are not available in BP

    • @DevGods
      @DevGods  7 หลายเดือนก่อน +1

      @dead7643 if it’s not a blueprint accessible struct all you need to do is create one that is and have that one create the c++ version. If you are following this in blueprints only I really don’t know.

  • @dead7643
    @dead7643 7 หลายเดือนก่อน +1

    5.3?

    • @DevGods
      @DevGods  7 หลายเดือนก่อน

      Yes

  • @robertadams3925
    @robertadams3925 4 หลายเดือนก่อน +1

    About half way thru this and running into issues with my custom schema in my enemy character blueprint being unable to recognize my custom patrol state tree. Not requesting you help me troubleshoot, but i does raise a better question:
    Can you describe why using cpp and making a custom schema is advantageous, and what you're able to do here that you wouldn't be able to do otherwise just using state trees out of the box with blueprints only? Im about to give up on cpp implementation and push forward in BP because I know how to get them working in BP, could you speak for a moment on this?

    • @DevGods
      @DevGods  4 หลายเดือนก่อน +2

      I program everything I can in c++ it’s just a preference. There are many advantages for using c++ over bp but if it’s a nuisance get it working in BP then migrate over. My channel is focused on building out scalable systems and imho c++ is the foundation for that.
      You are probably running into the issue where the state tree component has specifically set the allowed schema on its “StateTreeRef” to only be state tree schema if you want to set your custom schema’d state tree in your character’s state tree component in blueprints you either need to do it with a custom c++ function that takes a state tree as a parameter or create your own variable, override the initialize function in the state tree component and set the state tree ref to your state tree variable then in bp you can set your variable to be whatever you want.
      The reason you have no problems in bp is because you epic expects you to use only one schema which is the one compatible with the component.

  • @RigelOrionBeta
    @RigelOrionBeta 4 หลายเดือนก่อน +1

    Amazing