Announcement

Collapse
No announcement yet.

UFSM: Finite State Machine

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

    I was rebuilding the Blueprints I use for development (for tests) in the Demo Project while we speak and unfortunately I cannot reproduce the "out of sync" problem you experience...
    I would have to have access to a project where I can see the problem you have for me to understand what is going on there.
    I've never seen it so far, just remade test Blueprints to see if the problem is new on UE4.19, but nope; working correctly here:





    If you can make a small barebones project to show me the problem I can than take a closer look.
    Usually this kind of thing happens when something was setup wrong (happens often with the Object Pool for example).
    | Finite State Machine | Auto-Save Plugin | USQLite Plugin | Object-Pool | Sound-Occlusion | Anti-Cheat Plugin | Property Transfer Tool | Magic Nodes |

    Comment


      The step I found confusing is in the fsm_component, when we set the enumerator, what enumerator should this be? Click image for larger version

Name:	fsm_component_enum_variable_Space.jpg
Views:	2
Size:	42.5 KB
ID:	1458041


      Are we supposed to just make a new enumerator and list out the states, what order should those states be in when creating this new enumerator? This is where I think I messed up and ordered my states incorrectly while making a new enumerator. I was very careful to make sure the names in the enumerator were the same as the states that are in my anim_bp's FSM.
      Attached Files

      Comment


        ok only double posting because I think I have some easy steps for reproduction of my issue. If you set up your enumerator first, and then change the entry point on the anim fsm graph, it becomes improperly ordered/detatched from the enumerator.

        Comment


          I guess I should change source for Animation BP to set FSM States by Name instead of ID.
          ​​​​​​That would avoid the problem you have; I use ID because it's faster to tell the Anim BP to use IDs instead of FNames...
          I will look into this when I go home.

          Btw, when using FSM Anim BP's to sync FSM Components, the enum workflow is irrelevant because the FSM will erase all the States you've created from that Enum then it will copy the States you have in State Machine of AnimBP.
          This is what the "Override FSM" checkbox does.

          So in that case the Enum is only useful to generate functions in FSM Blueprint.

          Still, just guessing, since I don't really know what is going on in your project.
          I would uncheck the "Override FSM" option and sync with red node posted above, because if I remember right that sync States by Name instead of ID.
          | Finite State Machine | Auto-Save Plugin | USQLite Plugin | Object-Pool | Sound-Occlusion | Anti-Cheat Plugin | Property Transfer Tool | Magic Nodes |

          Comment


            Originally posted by wasti View Post
            ok only double posting because I think I have some easy steps for reproduction of my issue. If you set up your enumerator first, and then change the entry point on the anim fsm graph, it becomes improperly ordered/detatched from the enumerator.
            I've changed FSM Anim BP to sync FSM Component's States by FName instead of by ID.
            Literally just had to change 1 function call, that might solve the problem in your project...

            If I understand right what is going there, then this will resolve the problem.
            When going home I'll PM you about it to show the fix.
            | Finite State Machine | Auto-Save Plugin | USQLite Plugin | Object-Pool | Sound-Occlusion | Anti-Cheat Plugin | Property Transfer Tool | Magic Nodes |

            Comment


              Thank you for the info regarding how the fsm interacts with the enum.

              I think I have it working as desired for now (although that doesn't mean there isn't room for improvement )

              Comment


                I'm having an issue with state changes. The state machine isn't changing to the state requested. Instead once a state change is requested it's going to the next state in the enum.









                OnBeginState is receiving the ID for "charge" but also the name "attack".

                So set-by-name is evaluating wrongly and the name passed through isn't validated against what state is chosen in any case.

                Have I misconfigured something somewhere?

                Also, I'm not the best C++ dev but is it possible that you could use C++ templates to get away from the raw byte IDs and names and use the actual enum in many places?
                Last edited by Antidamage; 04-23-2018, 09:54 AM.

                Comment


                  The Ids in Enums aren't necessarily the Ids generated into the state machine.
                  This is why you get wrong value when comparing to source enum.
                  All the Enum does is feed generated States with their item names.

                  ​​​​​As you can see, in the "FSM States" list the Id of "Attack" is 2.
                  This is why you get the output of index 2 from your "AIState", in the case above: "charge".

                  The indexes in FSM States list doesn't match your enum.
                  You can set Enum to (none) then set the enum again to regenerate "FSM States" list; most likely you've changed the enum and didn't update the FSM States list afterwards.


                  I will see if I can change nodes to use Enum instead of typing names without breaking networking;
                  But that is a big refactoring and I don't know yet if it's a good idea.
                  | Finite State Machine | Auto-Save Plugin | USQLite Plugin | Object-Pool | Sound-Occlusion | Anti-Cheat Plugin | Property Transfer Tool | Magic Nodes |

                  Comment


                    Gotcha, cheers!

                    I did reset the enum in the state several times in that way but it didn't fix the issue. I'll switch to using names instead though.

                    If using a C++ template works (and I'm not sure it will with custom user blueprint data types made in the editor) then it's a very minor syntax change. But a better plan might be to make the ID try to be consistent with the enum byte ID as that's what most people would expect. Alternately ditch the ID as it's not set explicitly and it can change without the developer realising, force everyone to use the name instead.
                    Last edited by Antidamage; 04-23-2018, 10:07 PM.

                    Comment


                      Dynamic enums for Blueprint users would require custom K2_ nodes.

                      If I make these nodes then plugin source code will expand in a magnitude of thousands of extra lines
                      I'm still pending writing docs for an unrelated update (Savior 2 update), but as soon I finish documentation for that system I will work on this.


                      Edit:
                      I will absolutely work on more User Editor features, being not satisfied with this workflow based on "Details Panels" myself as well.
                      I just couldn't properly afford the time to create a "real editor", had to deliver things faster, but this is still in my to do list since the beginning and some day it has to materialize ^^
                      Last edited by BrUnO XaVIeR; 04-24-2018, 04:11 AM.
                      | Finite State Machine | Auto-Save Plugin | USQLite Plugin | Object-Pool | Sound-Occlusion | Anti-Cheat Plugin | Property Transfer Tool | Magic Nodes |

                      Comment


                        Hey. I want to try to use UFSM with this PaperZD plugin for my 2d project https://www.unrealengine.com/marketplace/paperzd
                        I haven't purchased it yet but I think it won't work correctly because it is using it's own anim bp class. So the question is, is there any possible workarounds for using UFSM with custom plugins such as PaperZD? Any ideas?
                        Thanks!
                        Last edited by Peter Shoferistov; 04-26-2018, 07:06 AM.

                        Comment


                          Originally posted by Peter Shoferistov View Post
                          Hey. I want to try to use UFSM with this PaperZD plugin for my 2d project https://www.unrealengine.com/marketplace/paperzd
                          I haven't purchased it yet but I think it won't work correctly because it is using it's own anim bp class. So the question is, is there any possible workarounds for using UFSM with custom plugins such as PaperZD? Any ideas?
                          Thanks!
                          If you look a few posts earlier, you can see a new "red node" for Anim BP that make it possible for you to sync Anim States from ANY Animation Blueprint class.

                          But that node will not "Override" UFSM States, it only tries to sync by Name if the State exists.


                          https://forums.unrealengine.com/unre...90#post1457990
                          Last edited by BrUnO XaVIeR; 04-26-2018, 07:42 AM.
                          | Finite State Machine | Auto-Save Plugin | USQLite Plugin | Object-Pool | Sound-Occlusion | Anti-Cheat Plugin | Property Transfer Tool | Magic Nodes |

                          Comment


                            Originally posted by BrUnO XaVIeR View Post

                            If you look a few posts earlier, you can see a new "red node" for Anim BP that make it possible for you to sync Anim States from ANY Animation Blueprint class.

                            But that node will not "Override" UFSM States, it only tries to sync by Name if the State exists.


                            https://forums.unrealengine.com/unre...90#post1457990
                            Thanks, that's awesome! I love your plugin a lot!)
                            By the way, I've been participating in a latest Ludum Dare event as a Compo (48 hour game in solo) and used UFSM plugin because.. because it's cool and I use it everywhere)
                            Check out the link if you are interested: https://ldjam.com/events/ludum-dare/41/solid-snake/
                            The blueprints are really messy because of lack of time but maybe someone would be interested to check it as a sample. The source link is in the description.
                            This game also got 1st place in 2 out of 3 categories in a local game jam that was going at the same time in Kyiv. Without ufsm it probably would be more time-consuming.
                            Last edited by Peter Shoferistov; 04-26-2018, 01:40 PM.

                            Comment


                              Originally posted by Peter Shoferistov View Post

                              Thanks, that's awesome! I love your plugin a lot!)
                              By the way, I've been participating in a latest Ludum Dare event as a Compo (48 hour game in solo) and used UFSM plugin because.. because it's cool and I use it everywhere)
                              Check out the link if you are interested: https://ldjam.com/events/ludum-dare/41/solid-snake/
                              The blueprints are really messy because of lack of time but maybe someone would be interested to check it as a sample. The source link is in the description.
                              This game also got 1st place in 2 out of 3 categories in a local game jam that was going at the same time in Kyiv. Without ufsm it probably would be more time-consuming.
                              That's a very "cute" and interesting design.
                              I played a bit, it's fun and relaxing!


                              I have plans to begin a major update for the plugin, focusing on implementing better in-editor tools.
                              When not using C++, the workflow is too much centered on the Details Panel and that's not what a Details Panel is made for ^^

                              If everything goes as planned, Savior 2 will be successfully merged into the marketplace package of Savior 1.x plugins (marketplace packages are a little weird to work with), then by the end of this month I will be free to start implementing editor tools for UFSM that I've be willing to add since last year!
                              For now I won't talk about it in details because I don't even know yet if it's going to work at all lol
                              | Finite State Machine | Auto-Save Plugin | USQLite Plugin | Object-Pool | Sound-Occlusion | Anti-Cheat Plugin | Property Transfer Tool | Magic Nodes |

                              Comment


                                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?
                                Last edited by Vaei; 05-09-2018, 10:52 PM.

                                Comment

                                Working...
                                X