Announcement

Collapse
No announcement yet.

UFSM: Finite State Machine

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

    #91
    Hi.
    When I'm creating an asm inside the animation blueprint and adding some states in it, should they automatically update FSM component state list or I have to put them by the hand?
    Anyway, that's great plugin!
    Thanks.

    Comment


      #92
      Originally posted by Peter Shoferistov View Post
      Hi.
      When I'm creating an asm inside the animation blueprint and adding some states in it, should they automatically update FSM component state list or I have to put them by the hand?
      Anyway, that's great plugin!
      Thanks.
      The Animation Blueprint's State Machine will automatically repopulate (replace) all the States list on your FSM Component if you set 'override FSM' to true on your AnimGraph details panel.
      That is if you are using StateMachineAnimBP as a parent class, otherwise it will not replace the States list you have on your FSM Component.
      | Savior | USQLite | FSM | Object Pool | Sound Occlusion | Property Transfer | Magic Nodes | MORE |

      Comment


        #93
        Hmm.. that's odd because I've made it exactly as you told.
        As example I've made a blank c++ project, and added bps + fsm components to it. At anim bp I've created new state machine with few states, set target fsm and asm in class defaults, but still nothing gets updated in fsm component.
        However, if i'll add states by the hand with exact same name as in animation bp's state machine, everything works great (it's ok for me but I was a bit confused at first after the purchase). Is there a bug or I'm missing something, could you please take a look?
        Project download link: https://1drv.ms/u/s!AuyHy4WnaMnUg-MMBv306jhdw-xsPg

        Comment


          #94
          Originally posted by Peter Shoferistov View Post
          Hmm.. that's odd because I've made it exactly as you told.
          As example I've made a blank c++ project, and added bps + fsm components to it. At anim bp I've created new state machine with few states, set target fsm and asm in class defaults, but still nothing gets updated in fsm component.
          However, if i'll add states by the hand with exact same name as in animation bp's state machine, everything works great (it's ok for me but I was a bit confused at first after the purchase). Is there a bug or I'm missing something, could you please take a look?
          Project download link: https://1drv.ms/u/s!AuyHy4WnaMnUg-MMBv306jhdw-xsPg
          I've tested your demo project and it all works... the FSM Component prints on top of panel "TestStateOne", just like the State created inside your AnimBP.
          Which means the AnimBP has successfully overridden the States in the Component (but they won't show in the Blueprint Details panel because the override happens at runtime only).


          If you mean to set the State of an AnimBP from the FSM Component, we can't. Epic has locked this functionality and I am waiting for them to fix it before making possible to sync AnimBP States from a FSM Component:

          https://github.com/EpicGames/UnrealEngine/pull/3515
          Last edited by BrUnO XaVIeR; 05-26-2017, 05:59 PM.
          | Savior | USQLite | FSM | Object Pool | Sound Occlusion | Property Transfer | Magic Nodes | MORE |

          Comment


            #95
            Ah, okay, nevermind Your plugin is great!
            It took me a week to rewrite my past character bp from scratch using ufsm and it was incredibly flexible. No spaghetti, no ridiculous switches, branches etc to check the possibility of performing some specific actions. Previously it was very time-consuming for me to add some new functionality such as cover system or parkour. And with every new feature it was getting harder and harder to add stuff. But with ufsm I can make it much faster. And ****, it looks neat. Sweet!

            Comment


              #96
              Hello! Firstly, thank you for this awesome time saving plugin (that really should just be a part of the engine!)
              Would it be possible for you to add (if you have time of course) a function to cancel the current transition, for example in-between an OnExitState and OnBeginState events? This would be a greatly appreciated functionality. I require the ability to check if the state can even be exited before checking whether or not the next can be entered. I'm sorry if this already exists and I have missed it, but I could not locate any manual way of stopping a transition. Thanks in advance!

              Comment


                #97
                Originally posted by JGagner View Post
                Hello! Firstly, thank you for this awesome time saving plugin (that really should just be a part of the engine!)
                Would it be possible for you to add (if you have time of course) a function to cancel the current transition, for example in-between an OnExitState and OnBeginState events? This would be a greatly appreciated functionality. I require the ability to check if the state can even be exited before checking whether or not the next can be entered. I'm sorry if this already exists and I have missed it, but I could not locate any manual way of stopping a transition. Thanks in advance!
                I usually script these rule checkers inside of the OnExit function itself, so I'd need a somewhat photoshopped concept screenshot of what you aim for; do you mean a "conditional set state" node which cancels the transition in case the condition is not met, just returning to the state already set?!
                There are many different ways of doing what you say, thus I need more specifics.
                | Savior | USQLite | FSM | Object Pool | Sound Occlusion | Property Transfer | Magic Nodes | MORE |

                Comment


                  #98
                  Originally posted by BrUnO XaVIeR View Post
                  do you mean a "conditional set state" node which cancels the transition in case the condition is not met, just returning to the state already set?!
                  Pretty much this, yes. Basically inside of the OnExit function I would like to have the ability to cancel and stay in the current state. That said, a conditional set state node would also be very very useful.

                  Comment


                    #99
                    OK so here is an example of my current situation.



                    Now I know with the blueprint implementable events that it would not be possible to cancel in time due to the nature of how they work. The function you suggested would eliminate the need to use the above workaround (which as a side effect ends up resetting the state timer for obvious reasons.)
                    Last edited by Admiral Frijoles; 06-03-2017, 09:33 PM.

                    Comment


                      Okay, I have to finish a SQL Server service app I was given the task to build and then I will look into this;
                      I've added this to my to do list and will begin studying a solution in few hours once I finish this one db task I'm working on.

                      If I expose the Fsm_Transition struct the way I'm thinking of doing it, you will be able set the transition rule based on conditions you code so if the trans return an "Aborted" state then the Exit trigger can be canceled, not resetting or re-entering actual state.
                      | Savior | USQLite | FSM | Object Pool | Sound Occlusion | Property Transfer | Magic Nodes | MORE |

                      Comment


                        This sounds perfect! Thanks

                        Comment


                          [MENTION=32540]JGagner[/MENTION]

                          So, I came up with this, for the next update of the plugin...


                          There's some new function nodes which you can explicitly control the behaviour of transition rules when calling "Set State" in the FSM Component.
                          They take a 'FSM Transition' enum as input; The FSM will only exit previous State and activate the one you called only if the transition value is 'Succeeded':







                          In case your condition fails, the FSM keeps going without running any Enter/Exit triggers, like in my game project's example here:








                          The 'Evaluate' or 'Eval (...)' nodes are utility functions I have added to compact the check of values and output of a FSM Transition enum, to avoid spaghetti by replacing the use of Branch nodes and Set Enum Value nodes altogether, these are included in a new Blueprint Function Library added to the plugin:






                          I'll send these changes to Epic next monday, cheers.
                          Last edited by BrUnO XaVIeR; 06-30-2017, 02:20 AM.
                          | Savior | USQLite | FSM | Object Pool | Sound Occlusion | Property Transfer | Magic Nodes | MORE |

                          Comment


                            Wow, these are perfect! Thank you so much

                            Comment


                              The update with nodes above is now live on Marketplace (1.6.5 for UE4.15 and UE4.16)
                              | Savior | USQLite | FSM | Object Pool | Sound Occlusion | Property Transfer | Magic Nodes | MORE |

                              Comment


                                Once again, great plugin! Super easily expandable and keeps my blueprints very tidy. Check out feature preview video of Third Person Controller that I've created using ufsm: https://www.youtube.com/watch?v=yt1Wi-c4m04

                                Comment

                                Working...
                                X