Announcement

Collapse
No announcement yet.

UFSM: Finite State Machine

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

    Originally posted by Vaei View Post
    Is there some documentation I'm missing? The links provided don't tell you how to do a lot of necessary things such as creating transitions.

    Also does it support states with transition time or do I have to do that manually?

    Also there's no option to disable blueprint auto flow? All it says in the docs is that it's now enabled by default, but doesn't say where the option is and I don't see it anywhere. It doesn't seem to work either, I looked at the source to see what it was expecting, gave it what it was expecting, and still gave a warning saying it couldn't find it.

    In the screenshots on the first page there is an HFSM but is that really outdated or currently not in the plugin?
    A few posts above explain that "auto flow" only works when you create a Blueprint for your FSM Component then attach it to an Actor.

    The settings can be found on Project Settings panel.

    HFsm was removed and being reworked; Will be back only when all bugs are removed and docs redone.
    | Savior | USQLite | FSM | Object Pool | Sound Occlusion | Property Transfer | Magic Nodes | MORE |

    Comment


      Well.. It would appear that i'm now a full-stack "BrUnO XaVIeR" owner. Keep up the goodies dude
      I just grew tired of playing with boolean replication in c++ for all my states, hope your plugin will help !
      Last edited by MaximeDupart; 05-10-2018, 11:45 AM.
      LinkedIn | Link custom Shaders in 4.21/4.22/4.23 | Atmosphere Modelisation | Distance Matching Locomotion | Nvidia GameWorks builds - 4.19.2 : VXGI2.0, Blast, HairWorks, Flow - Plugins: VictoryBP

      Comment


        Originally posted by Maxime.Dupart View Post
        Well.. It would appear that i'm now a full-stack "BrUnO XaVIeR" owner. Keep up the goodies dude
        I just grew tired of playing with boolean replication in c++ for all my states, hope your plugin will help !
        ... This was the reason why I started this thingy at home :/
        We were all "-man I'm sooo tired of creating booleans here and there then checking them here to match that one again... can't we just have something to check animation states here in the BP graph ???"

        Then I did this to stop doing that annoyance with booleans and stop flooding AnimBPs with AnimNotifies as well ^^


        -----

        Oh and thank you very much for the support!
        Last edited by BrUnO XaVIeR; 05-10-2018, 11:58 AM.
        | Savior | USQLite | FSM | Object Pool | Sound Occlusion | Property Transfer | Magic Nodes | MORE |

        Comment


          Originally posted by BrUnO XaVIeR View Post

          A few posts above explain that "auto flow" only works when you create a Blueprint for your FSM Component then attach it to an Actor.

          The settings can be found on Project Settings panel.

          HFsm was removed and being reworked; Will be back only when all bugs are removed and docs redone.
          Thank you - was that in the docs and I just missed it?

          Can I run an idea by you - for using the anim node graph you require a skeletal mesh + anim instance - so what if I add a skeletal mesh component that never has a mesh + an anim instance with a dummy skeleton purely for the use of the state machine? Is there any reason this isn't a good way to do it?

          Perhaps one day in the future you could consider adding a custom graph that doesn't require a skeletal mesh or anim instance but mimics anim instance Dungeon architect might be a good example of reusing graphs for plugin functionality
          Last edited by Vaei; 05-14-2018, 05:51 PM.

          Comment


            Originally posted by Vaei View Post
            Can I run an idea by you - for using the anim node graph you require a skeletal mesh + anim instance - so what if I add a skeletal mesh component that never has a mesh + an anim instance with a dummy skeleton purely for the use of the state machine? Is there any reason this isn't a good way to do it?
            I've seen a designer do something like that before; I'm not sure exactly the "hacks" he did, but it works wonders because he hate to create his own "transition rule" functions in the Blueprint graph.


            Originally posted by Vaei View Post
            Perhaps one day in the future you could consider adding a custom graph that doesn't require a skeletal mesh or anim instance but mimics anim instance Dungeon architect might be a good example of reusing graphs for plugin functionality
            I actually do have a custom Graph. But it's buggy like hell xD
            The problem is I was "taken away" from working on it because a project had to focus on actual gameplay stuff instead of Editor extensions.

            So I can't work on it at the moment to make it really usable, but I didn't give up on that and someday I will make it public
            Meanwhile, I think I can also add to function generator button a way to generate "transition rule" functions in the BP graphs for the non hierarchical FSM Component while I can't work on that one.
            | Savior | USQLite | FSM | Object Pool | Sound Occlusion | Property Transfer | Magic Nodes | MORE |

            Comment


              By the way, I can't subclass Finite State Machine - it's needed for auto-flow right?

              https://i.imgur.com/YEBmUfF.png

              Comment


                Originally posted by Vaei View Post
                By the way, I can't subclass Finite State Machine - it's needed for auto-flow right?

                https://i.imgur.com/YEBmUfF.png
                It needs a custom "Factory".
                To use the custom Asset Factory, you have to right click Asset Browser and click this Icon to create a custom Blueprint:

                | Savior | USQLite | FSM | Object Pool | Sound Occlusion | Property Transfer | Magic Nodes | MORE |

                Comment


                  Originally posted by BrUnO XaVIeR View Post

                  It needs a custom "Factory".
                  To use the custom Asset Factory, you have to right click Asset Browser and click this Icon to create a custom Blueprint:

                  Ahh I get it now. Thanks!

                  One more thing though.. why the byte instead of a float here? Edit: Since you can use FSM: Get time it doesn't matter but I'm curious

                  https://i.imgur.com/kOPocAv.png

                  Edit: My god, blueprints actually feel like a viable option for involved systems with this
                  Last edited by Vaei; 05-14-2018, 08:02 PM.

                  Comment


                    Do you think you could add something for me? To allow us to use a CPP enum instead of a BP enum. Because if I want all the BP auto flow functionality and in rare cases to check values in CPP it means creating same enum twice. I'll provide example logic.


                    .h
                    Code:
                    UPROPERTY(EditDefaultsOnly, BlueprintReadOnly, Category = "Thing")
                    bool bEnumFromCPP;
                    
                    UPROPERTY(EditDefaultsOnly, BlueprintReadOnly, Category = "Thing", meta = (EditCondition = "bEnumFromCPP"))
                    FString EnumName;
                    
                    UPROPERTY(EditDefaultsOnly, BlueprintReadOnly, Category = "Thing", meta = (EditCondition = "!bEnumFromCPP", DisplayName = "Enum"))
                    UEnum* K2_Enum;
                    
                    UPROPERTY()
                    Enum* Enum;
                    
                    #if WITH_EDITOR
                    virtual void PostEditChangeProperty(FPropertyChangedEvent& PropertyChangedEvent) override;
                    #endif  // WITH_EDITOR
                    
                    FORCEINLINE UEnum* GetEnum() const
                    {
                        return (bEnumFromCPP) ? Enum : K2_Enum;
                    }
                    .cpp
                    Code:
                    #if WITH_EDITOR
                    static UEnum* EnumFromString(FString EnumString)
                    {
                        return FindObject<UEnum>((UObject*)ANY_PACKAGE, *EnumString, true);
                    }
                    
                    void UMyThing::PostEditChangeProperty(FPropertyChangedEvent& PropertyChangedEvent)
                    {
                        Super::PostEditChangeProperty(PropertyChangedEvent);
                    
                        const bool bFromToggleCPP = GET_MEMBER_NAME_CHECKED(UMyThing, bEnumFromCPP).IsEqual(PropertyChangedEvent.GetPropertyName());
                        const bool bFromEnumName = GET_MEMBER_NAME_CHECKED(UMyThing, EnumName).IsEqual(PropertyChangedEvent.GetPropertyName());
                    
                        if((bFromToggleCPP && bEnumFromCPP) || bFromEnumName)
                        {
                            Enum = EnumFromString(EnumName);
                        }
                    }
                    #endif  // WITH_EDITOR

                    Comment


                      Yes, no problem.
                      Once I come back from another task I add that.
                      | Savior | USQLite | FSM | Object Pool | Sound Occlusion | Property Transfer | Magic Nodes | MORE |

                      Comment


                        Originally posted by Vaei View Post
                        One more thing though.. why the byte instead of a float here? Edit: Since you can use FSM: Get time it doesn't matter but I'm curious

                        https://i.imgur.com/kOPocAv.png
                        Thank you for showing me this!
                        This is actually a BUG in the #WITH_EDITOR reflection code (where I generate new functions from), I picked wrong type wildcard when that node is generated :s
                        I have fixed and will add to next update as well.
                        | Savior | USQLite | FSM | Object Pool | Sound Occlusion | Property Transfer | Magic Nodes | MORE |

                        Comment


                          I have added automatic State Transitions to the "Auto Flow" schema of FSM Component Blueprints.
                          This has the exactly same result of you creating your own rule functions in Animation BP or BP Graph, but the difference is you don't have to call them ("Set State" nodes) manually if you choose to enable this option for your project.
                          Although having the same effect, the way you design your Graphs might change when going this route:




                          They are grouped in Graph and prefixed with "<T>" followed by the State they are linked to.
                          Whenever the "Condition" result evaluates to "Succeeded" the FSM Component will trigger an Exit from Transition's owner State (if that State is the currently active one) to the target State this trasition rule is pointing to (pretty much what Animation BP does, but with all Blueprint functions available to be used in the Graph).

                          If you choose to go this design pattern then the various helper "Evaluate" nodes are your friends here as well:




                          .

                          To enable this execution mode on your FSM Components, you'll have to check to true the "Blueprint Auto Flow Transitions" on Project Settings Panel, as well as keeping "Blueprint Auto Flow FSM" enabled too:





                          Again, note that this basically inutilizes the "Set States" nodes if you design your FSM with this pattern, but it doesn't prohibits you from keeping using them wherever you see fit. The "+Functions" button (only useful for FSM Blueprints) will also automatically generate transition functions for you if it sees you have checked "Blueprint Auto Flow Transitions" enabled.



                          This and fixed bug mentioned on previous post above will be in version 1.8.0 (for UE4.18+).
                          Last edited by BrUnO XaVIeR; 05-16-2018, 07:13 PM.
                          | Savior | USQLite | FSM | Object Pool | Sound Occlusion | Property Transfer | Magic Nodes | MORE |

                          Comment


                            Hello, the launcher is showing an update to UFSM, what are the changes please?

                            Thanks.

                            Comment


                              Originally posted by MajorFailure View Post
                              Hello, the launcher is showing an update to UFSM, what are the changes please?

                              Thanks.
                              Minor Bug Fix:

                              "Auto Activate" checkbox disabled had no effect on UE4.18 ~ UE4.19.
                              Now if "Auto Activate" on FSM Component is unchecked, the FSM won't run until you call SetActive() function for that FSM Component.

                              In case you uncheck "Auto Activate" in Editor, when enabling the FSM Component again, make sure you do a 'full' initialization, like so:
                              Code:
                              SetActive(true,false);
                              SetIsReplicated(true);
                              SetComponentTickEnabled(true);
                              Last edited by BrUnO XaVIeR; 06-15-2018, 10:23 AM.
                              | Savior | USQLite | FSM | Object Pool | Sound Occlusion | Property Transfer | Magic Nodes | MORE |

                              Comment


                                Great, thanks!

                                Comment

                                Working...
                                X