Announcement

Collapse
No announcement yet.

UFSM: Finite State Machine

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

    #16
    Yeah, I was thinking about it, but this one solved the issues I had so I decided to go only FSM for now, maybe expanding in the future.
    | Finite State Machine | Auto-Save Plugin | USQLite Plugin | Object-Pool | Sound-Occlusion | Anti-Cheat Plugin | Property Transfer Tool | Magic Nodes |

    Comment


      #17
      Originally posted by BrUnO XaVIeR View Post
      The component is setup for replication by default;
      All its UProperties will replicate just fine in an replicated Actor. Current State time, Active State ID, List of existing States, etc, are replicated.
      Source is also open so a programmer can customize multiplayer behavior if project has specific needs.
      Fantastic news. Will be purchasing then. I found it odd that UE4 didn't have it by default, but thanks for the effort and the cost!
      Current Project - *shush shush* Soon. Soon.

      Comment


        #18
        Originally posted by Arixsus View Post
        Fantastic news. Will be purchasing then. I found it odd that UE4 didn't have it by default, but thanks for the effort and the cost!
        Yes, I believe they ditched out FSM because Behavior Trees were added (somewhat a HFSM) and for most cases FSMs are used for AI code thus Epic kinda of 'replaced' FSMs with Behavior Trees; but I wanted to convert Blueprint logic to FSM based and was hitting a lot of annoying issues so I've decided to give it a try and make my own.
        Today I will take some time and begin experimentations with Hierarchical FSM for Blueprints, see if I go anywhere useful with it.
        | Finite State Machine | Auto-Save Plugin | USQLite Plugin | Object-Pool | Sound-Occlusion | Anti-Cheat Plugin | Property Transfer Tool | Magic Nodes |

        Comment


          #19
          After some time playing around with workflows, I turned the simple FSM Component (which is the one published for now) into an spawnable Actor Component asset.
          Just like the components created when you use Add New -> "New Blueprint Script Component", these will be possible to be stored as Blueprint Assets (and will be possible to edit blueprint graphs on them as well).
          Tried a bit with concepts on HFMS... It works, but a limitation I came across is, FSMs created at runtime by the HFSM Component cannot execute any of their own Blueprint graph's functions; they spawn dependant on the HFSM Blueprint graph instead. Other than that, FSM graphs works just fine when attached directly to the owning Actor, not spawned by any HFSM class.
          The weird thing is that the underlying C++ routines still run for both cases, just Blueprint events are never fired when HFSM is the FSM owner.

          Some screenies:









          This is a somewhat comparison of the scenario I was talking, FSM vs HFSM functionality when the matter are Blueprint graphs. If HFSM is the owner, FSMs' BeginPlay or Tick in their own Blueprint Graphs will never fire although all components are registered.
          The HFSM's Blueprint Graph takes ownership of blueprintable events and for FSMs under its domain executes only their C++ functions; I will see if there's a way around this, although maybe is better this way for performance instead of allowing every single child FSM component have an active graph pulsing functions everywhere:

          | Finite State Machine | Auto-Save Plugin | USQLite Plugin | Object-Pool | Sound-Occlusion | Anti-Cheat Plugin | Property Transfer Tool | Magic Nodes |

          Comment


            #20
            Well... This thing has honestly gone way beyond what I was expecting.
            After implementing the final aspects of the HFSM class I realised how powerful it is now that I've rewrote a lot of details to make it work together with Blueprints and its quirks...

            I've pushed update to Gumroad for the devs already using it, but still misses documentation.
            Now there's too many new things, too many possible cases; I will need some time to build a demo project and document well the use cases for this. This will make working on my original "real" project much much easier


            {1.2.0} :

            * HFSM Component class have been carefully implemented.
            * Both FSM and HFSM Components can be stored as an Asset from Content Browser.
            * When creating a FSM Component asset, it will be located under the "Custom" tab within the 'Add New' component button.


            Actual Limitations:

            * Do not add the same HFSM Component class twice to the same Actor. They overlap transient properties.
            * If a HFSM graph is needed more than once for the same Actor, duplicate the Blueprint to use it again as if it were a different Component.
            * Avoid using the same FSM class within HFSM Component owners as well. Duplicate FSM asset if the class is needed for the HFSM more than once.

            /* Docs explaining stuff will come */
            | Finite State Machine | Auto-Save Plugin | USQLite Plugin | Object-Pool | Sound-Occlusion | Anti-Cheat Plugin | Property Transfer Tool | Magic Nodes |

            Comment


              #21
              I've uploaded an update to Gumroad which includes a custom Editor Graph panel.
              Some was having issues trying to figure out FMS/HFSM relationships so I did a graph which automatically generates node trees based on the UComponent's list of FSMs/States.
              To open the visualizer, just push the "Visualize MACHINES" or "Visualize STATES" button on any selected FSM component, from its Details Panel.
              Still working on docs though :s







              Last edited by BrUnO XaVIeR; 08-03-2016, 02:43 PM.
              | Finite State Machine | Auto-Save Plugin | USQLite Plugin | Object-Pool | Sound-Occlusion | Anti-Cheat Plugin | Property Transfer Tool | Magic Nodes |

              Comment


                #22
                Broadcasted Events' signatures have been changed; it now outputs results for a simple transition rule (mainly for when you activate/deactivate a FSM component):



                This will be final version for this tool for a while for now; still waiting on Epic to reply the submission


                WARNING:

                Remove ALL FSM/HFSM Components from all Actor/Character blueprints you have instantiated in ANY of your MAPs. BEFORE updating to 1.3.3;
                This version has changed broadcasting Events signatures to include a 'Transition Rule' field; if you have blueprints with FSM/HFSM using old Event signatures instantiated in you levels, project loading may crash.
                If you're not sure that you've remove ALL FSM components from actors, before updating to last version, make a project backup before updating FSM plugin to 1.3.3!
                | Finite State Machine | Auto-Save Plugin | USQLite Plugin | Object-Pool | Sound-Occlusion | Anti-Cheat Plugin | Property Transfer Tool | Magic Nodes |

                Comment


                  #23
                  It would be nice to have some reference to a book or video about FSM vs HFSM to understand it better (for AI and for other things) or have a doc / tutorial for your plugin explaining the differences and which would apply better to difference real-life scenarios.

                  That's really one thing that keeping me from using this plugin - how to use FSM/HFSM and when to use them (various scenarios in UE4).

                  In my current project, for example, I use a lot of branches just to check stuff (if/else stuff) and I don't even have AI yet.

                  Comment


                    #24
                    Originally posted by motorsep View Post
                    It would be nice to have some reference to a book or video about FSM vs HFSM to understand it better (for AI and for other things) or have a doc / tutorial for your plugin explaining the differences and which would apply better to difference real-life scenarios.

                    That's really one thing that keeping me from using this plugin - how to use FSM/HFSM and when to use them (various scenarios in UE4).

                    In my current project, for example, I use a lot of branches just to check stuff (if/else stuff) and I don't even have AI yet.
                    Hi, yes; I have difficulty when it comes to "teach" stuff because I have zero experience as a tutor. But I am working on docs and will build some of Epic's default Character Controller tutorials remade to use FSM logic so developers will be able to compare by themselves.
                    I just am not good at tutoring like Zak is (and my spoken english is very bad) so I rely a lot on text to explain things; You can develop an entire game purely based on FSM systems so the topic is very very broad and I'm kind lost to explain how/where to use this; but given enough time I will put together a demo project based on Epics tutorials


                    Meanwhile, this video here have a lot of useful information and also some cool examples of why and where would you use FSM or HFSM on your game project, I really liked this video by Jesse Warden:




                    Also EpicGames have a very good summary of what a State Machine is:

                    Last edited by BrUnO XaVIeR; 08-03-2016, 06:40 PM.
                    | Finite State Machine | Auto-Save Plugin | USQLite Plugin | Object-Pool | Sound-Occlusion | Anti-Cheat Plugin | Property Transfer Tool | Magic Nodes |

                    Comment


                      #25
                      Bought it

                      I was surprised Epic didn't integrate a FSM template too.

                      Comment


                        #26
                        Originally posted by shahrizai View Post
                        Bought it

                        I was surprised Epic didn't integrate a FSM template too.
                        Thank you

                        I will start to write a small tutorial today, as soon as I come home from work.
                        I will take the default 3rd Person character blueprint and rewrite its functions to keep exactly the same behavior as before, but implemented completely by FSM Component...
                        And then show how easy it is to expand the controls with additional FSM States, adding double jumping capability and maybe also ladder climbing: without creating a single boolean variable for controller inputs!

                        At least that is the plan for a first tutorial. I'll see how it goes

                        My main goal with this tool was always focusing on keeping the blueprint graphs as clean as possible.
                        I wanted to get rid of all those junk variables scattering all over the place: if this, if that, bool here, branch that... this is not how I program in text code and it was annoying me a lot when using blueprints because it requires too many pointless variables to be created and managed.
                        Will start making the tutorial today, promise!
                        | Finite State Machine | Auto-Save Plugin | USQLite Plugin | Object-Pool | Sound-Occlusion | Anti-Cheat Plugin | Property Transfer Tool | Magic Nodes |

                        Comment


                          #27
                          Okay; So, I've put together a little demo project with input controls based on FSM Component.
                          It's a modification of the default 3rd Person game template to make the Character move and look around the same as before... plus it also can double jump and properly climb up a ladder, all based on FSM rules.
                          I did it one way, there are many other ways you could use the same FSM Component to do exactly the same though. Here's a quicky video of the results:




                          And the main graph for the Character Blueprint, it ended being like this ( no more than 1 Variable to track, the FSM_Input component ):




                          And the FSM Component's main graph, handling all the logic for processing inputs and performing actions while isolating them by State so then you can make many movement modes without any headaches:




                          -----

                          Edit:


                          You can find tutorial for this video and download demo project from here:

                          TUTORIAL AND DEMO PROJECT
                          Last edited by BrUnO XaVIeR; 08-05-2016, 09:08 PM.
                          | Finite State Machine | Auto-Save Plugin | USQLite Plugin | Object-Pool | Sound-Occlusion | Anti-Cheat Plugin | Property Transfer Tool | Magic Nodes |

                          Comment


                            #28
                            Hello,
                            I am very interested in this plugin. I also think this should be integrated in the UE4 core.

                            Best regards,
                            Thank you.

                            Comment


                              #29
                              Originally posted by FreemanCIT View Post
                              Hello,
                              I am very interested in this plugin. I also think this should be integrated in the UE4 core.

                              Best regards,
                              Thank you.
                              Yes from what I've heard this have been asked for to Epic several times for the last 2 years, but for some reason the answer was always something along the lines: "-We don't have FSM for Blueprints, you would have to make your own FSM from scratch for this."; I'm not sure why though.
                              If not for that I would've submitted a pull request instead of making an addon for Marketplace.
                              | Finite State Machine | Auto-Save Plugin | USQLite Plugin | Object-Pool | Sound-Occlusion | Anti-Cheat Plugin | Property Transfer Tool | Magic Nodes |

                              Comment


                                #30
                                Hey there,

                                Do you have any rough indication of when this will get added to the marketplace? I'm wanting to buy this, but I'd prefer not to buy it on gumroad unless a marketplace release is several months away.
                                Twitter: @zerofiftyone_
                                Website: zerofiftyone.net - My game development blog
                                Button Frenzy store page: http://store.steampowered.com/app/454630

                                Comment

                                Working...
                                X