Announcement

Collapse
No announcement yet.

UFSM: Finite State Machine

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

    I'm getting an aborted state change and I'm not sure why. The state name exists. Is there a way to debug it or push out a reason for the abort?

    Comment


      Originally posted by Antidamage View Post
      I'm getting an aborted state change and I'm not sure why. The state name exists. Is there a way to debug it or push out a reason for the abort?
      I could add PIE Warning there.
      I will take a look today, that will require "Debug" checkbox enabled tho.
      | Finite State Machine | Auto-Save Plugin | USQLite Plugin | Object-Pool | Sound-Occlusion | Anti-Cheat Plugin | Property Transfer Tool | Magic Nodes |

      Comment


        No problemo, cheers! Whereabouts is the debug checkbox?

        You could also output an error string from the state change node instead, which might be a better solution since I'd like to log them at runtime as well.

        Comment


          Sure, I'm almost done with a job task and once I finish this stuff I'm adding that to the plugin's source.
          | Finite State Machine | Auto-Save Plugin | USQLite Plugin | Object-Pool | Sound-Occlusion | Anti-Cheat Plugin | Property Transfer Tool | Magic Nodes |

          Comment


            This is why you're the best developer on the marketplace.

            Comment


              Originally posted by Antidamage View Post
              This is why you're the best developer on the marketplace.
              lol I don't know about that, but thanks a lot!

              Your problem may be something silly like for example overlooking the name you input into a "Set State" node.
              For example you may have a State named "Normal Walk" while on the node you have something like "Normal Walk ".

              To make sure that never happens, I've added a sanitizing function to automatically check spaces.
              Internally "Normal Walk" will now just be "NormalWalk" and the plugin runtime will now always ignore spaces from State names you input into 'Set State' nodes.

              All nodes will now output deeper logs to let you know what is going on internally when a Set State and related functions have failed.
              You have to mark "Debug" check on the FSM Component's Details panel (advanced tab) to have those logs active.

              I just modified the already existing UFSM_Log.h file and now you will get logs on the Output Log panel, PIE Messages panel, or the Visual Logger window.
              If the State set have failed for whatever reason, those debug tools will tell you why:











              The Visual Logger is interesting because it can tell you where and when in the game world the warning has happened.
              You can read more about Visual Logger here:

              https://docs.unrealengine.com/en-us/...s/VisualLogger



              Those changes to UFSM_Log.h will be uploaded for plugin version 1.8.5.
              | Finite State Machine | Auto-Save Plugin | USQLite Plugin | Object-Pool | Sound-Occlusion | Anti-Cheat Plugin | Property Transfer Tool | Magic Nodes |

              Comment


                In this case I'm plugging a stored enum (the same one that defines the states) into the set state by name so there shouldn't be anything wrong with it, hence needing the debug output.

                That is awesome, thank you. Is there any chance I can help you test it before you upload it?

                Comment


                  I've already uploaded to EpicGames when posted images above.
                  Could send you a zip file, but I'm away from Pc for next hours of the day.

                  _____

                  Btw, when you change your BP Enum, changes will not automatically propagate to the array of States on the Component.

                  You have to explicitly clear the Enum slot then add it again to the Details Panel when the Enum has changed.

                  That is because the enum is never checked at runtime, it is only read once in Editor IF you placed a new Enum on Details Panel.
                  (that is the only time it triggers overriding States array on the FSM Component).
                  Last edited by BrUnO XaVIeR; 06-20-2018, 12:39 AM.
                  | Finite State Machine | Auto-Save Plugin | USQLite Plugin | Object-Pool | Sound-Occlusion | Anti-Cheat Plugin | Property Transfer Tool | Magic Nodes |

                  Comment


                    Yeah I'm aware of the enum change propagation issue.

                    No problem, I can wait.

                    Comment


                      Marketplace team already processed update above for Launcher
                      | Finite State Machine | Auto-Save Plugin | USQLite Plugin | Object-Pool | Sound-Occlusion | Anti-Cheat Plugin | Property Transfer Tool | Magic Nodes |

                      Comment


                        They're getting quick!

                        Edit: I guess it takes a few hours for the scheduled releases to go through.
                        Last edited by Antidamage; 06-20-2018, 08:55 PM.

                        Comment


                          Hey Bruno, thanks for putting the enum request in, that was really quick!

                          I have an issue that likely stems from my own lack of understanding. I'm making an inventory. Non-owners simply follow the server's state and don't think much for themselves:



                          Then I override "FSM: On Replicate State ID" and print the resulting state name which is always "NULL". Doesn't seem right, figured maybe it was only replicating the ID and I had to manually set it, so I tried that but it always executes the "Aborted" callback so maybe not.



                          The print string prints '2' which is the state that it is being set to at the point I'm testing, however the debug continues to display the initial state and if I print on tick (for example) it shows the state was never actually set.

                          As you can see, I have debug checked and their states are not updating to the replicated state ID.

                          What am I misunderstanding?
                          Last edited by Vaei; 06-20-2018, 09:14 PM.

                          Comment


                            Vaei not sure if this is your issue, but there's no parity between Enum IDs and State IDs. Sometimes they match up by accident but they can change. The only time you can trust a State ID is if you fetched it from a State originally. I've been using State Name almost exclusively since finding this out.

                            I guess it's possible that the State ID for that state is different on the server.

                            Comment


                              I've been using the state name too, however the replication is only offered for StateID, and I thought it would propogate throughout (so if you set the state ID the corresponding name should be set), so long as the state ID is replicated the name should be too (in my mind). If that isn't the case I can just have a replicated name that sets it, I suppose.

                              Comment


                                Vaei

                                Tha's Unreal Engine's multiplayer weirdness.

                                If you want Owning Clients to replicate State set, you have to execute on Server the "[SERVER] Set State" node.

                                If you want the same of above, but Owning Client has the Authority to change the State instead of Server, then you want to use the "[CLIENT] Set State" node.
                                ​​​​​
                                That RPC will execute OnBegin(), OnUpdate(), and OnExit() on Server + Owning Client.


                                However that is only between Server and Owning Client...
                                If you want everyone to match a State change even for a FSM they don't own, you have to use a "[MULTI] Set State" node on Server.

                                Also make sure on FSM Components' Details Panel you have set Replication Mode to a type relevant to everyone or they won't receive "OnREP_" notification either.


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

                                Comment

                                Working...
                                X