Announcement

Collapse
No announcement yet.

Logic Driver - State Machine Blueprint Editor

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

    #31
    Originally posted by Recursoft View Post

    Are you calling the parent tick too? Right click on the Tick node and select Add Call to Parent Function. If that's not called the state machine won't be able to update automatically.
    You mean I should add a parent tick after the event tick, right? I did that and still get the same result.

    Comment


      #32
      Originally posted by Kenyon1977 View Post

      You mean I should add a parent tick after the event tick, right? I did that and still get the same result.
      Yes, adding a parent node and connecting it right after the event tick should be all you need. Can you e-mail a screen shot of your event graph to support@recursoft.net?
      Logic Driver - State Machine Blueprint Editor

      Comment


        #33
        Originally posted by Recursoft View Post

        Yes, adding a parent node and connecting it right after the event tick should be all you need. Can you e-mail a screen shot of your event graph to support@recursoft.net?
        Ok, so I tried again. Now I know what's wrong. I should connect the delta time between event tick and parent tick, too. Sorry for the bothering!

        Comment


          #34
          Hi,

          I also asked on https://www.unrealengine.com/marketp...itor/questions but I think it's better copy this here.

          Building a dialogues based on SMachines. I need somehow to keep extra details, which are specific for a given state. Basically every State is a dialogue sentence. Once in that State, I need to grab a string sentence from somewhere in the State and send it to UI.

          The most convenient way would be to create extra properties (local constants or variables???) for narrative artist. Also I am thinking of custom States with custom functionality, which can be used in along with default States. I guess that functionality is not there, but if you share your ideas, I would be very grateful.

          Comment


            #35
            Originally posted by Kenyon1977 View Post

            Ok, so I tried again. Now I know what's wrong. I should connect the delta time between event tick and parent tick, too. Sorry for the bothering!

            No worries and I'm glad it's working! Pretty sure I've forgotten to do that before too. I'll check to see if I can auto create and wire a parent tick node on new state machine creation.


            Originally posted by CRYOMEN View Post
            Hi,

            I also asked on https://www.unrealengine.com/marketp...itor/questions but I think it's better copy this here.

            Building a dialogues based on SMachines. I need somehow to keep extra details, which are specific for a given state. Basically every State is a dialogue sentence. Once in that State, I need to grab a string sentence from somewhere in the State and send it to UI.

            The most convenient way would be to create extra properties (local constants or variables???) for narrative artist. Also I am thinking of custom States with custom functionality, which can be used in along with default States. I guess that functionality is not there, but if you share your ideas, I would be very grateful.


            Local variables per state is currently in development and may do what you want. If your data is constant it could be set as a default value. But if it's constant already, can you just include it in the blueprint node you use to send text to the UI (or another text creation node) rather than redefine it as a variable? Or include it in a data table somewhere and reference that? The individual states weren't really designed for data storage. Blueprint member variables work of course but are state machine wide.

            Another option would be to create a separate state machine for each state and create blueprint variables for the sentence, and reference each state machine in master state machines (basically treat multiple state machines as single states), but that's probably far less convenient.

            If there are other use cases you can share regarding this I can see if they can be met or added with local variable development.
            Logic Driver - State Machine Blueprint Editor

            Comment


              #36
              Originally posted by Recursoft View Post
              .
              Thank you for your reply. I made a deep analysis. Seems like SMachines is a developer oriented solution. Using this for dialogues would be overkill, as it does not allow to extend States/Transition functionality. As long as showing dialog sentences is a repeatable procedure one should copy/paste same code in the States, instead of creating a specific State for the dialogues, reuse it, and allow to change it's settings (character name, sentence, etc) without a code manipulation.


              Just in case. You said local variables are in development. Please could you consider to implement that in such way:
              • Expose State instance. That would be great to have it. It should give access to local variable anyway - right?
              • If you expose State instance, would you allow to create custom States, with a custom functionality? Basically instead of placing all code usual way through the States Machine editor, one could implement this using a blueprint. And then select custom State in the State Machine Editor (similar to "Add State Machine Reference..."). This will catch several rabbits: it will allow private variables and functions. Will make it artist friendly, t.e. developer creates a custom State nodes with extra options for artist to select in the Details window.
              • Same idea for Transitions. Expose Transition instance. Allow local variables and functions. But this guy seems more tricky, t.e. how we gonna select a custom Transition from the list?

              Seems lots work to me. But should you grab it on board that would be awesome.
              Last edited by CRYOMEN; 12-03-2019, 11:36 AM.

              Comment


                #37
                Originally posted by CRYOMEN View Post
                Thank you for your reply. I made a deep analysis. Seems like SMachines is a developer oriented solution. Using this for dialogues would be overkill, as it does not allow to extend States/Transition functionality. As long as showing dialog sentences is a repeatable procedure one should copy/paste same code in the States, instead of creating a specific State for the dialogues, reuse it, and allow to change it's settings (character name, sentence, etc) without a code manipulation.


                Just in case. You said local variables are in development. Please could you consider to implement that in such way:
                • Expose State instance. That would be great to have it. It should give access to local variable anyway - right?
                • If you expose State instance, would you allow to create custom States, with a custom functionality? Basically instead of placing all code usual way through the States Machine editor, one could implement this using a blueprint. And then select custom State in the State Machine Editor (similar to "Add State Machine Reference..."). This will catch several rabbits: it will allow private variables and functions. Will make it artist friendly, t.e. developer creates a custom State nodes with extra options for artist to select in the Details window.
                • Same idea for Transitions. Expose Transition instance. Allow local variables and functions. But this guy seems more tricky, t.e. how we gonna select a custom Transition from the list?

                Seems lots work to me. But should you grab it on board that would be awesome.

                So ideally.. developer creates New State Class (or New Transition Class) blueprints.

                In a state machine blueprint be able to set the state or transition to the created classes. Possibly similar to state machine references. Then be able to set instance values in the details window of each state or transition. And to be clear, you only need instance variables to change, and not the BP logic itself, correct? I ask because that would be extremely difficult.

                If I have that right, I'll consider ways of implementing this (or parts of it). I don't want to commit to anything yet because you're right in that the work to do this isn't trivial and multiple problems would have to be solved like passing the context (and using it from within each state or transition), replication settings, etc. It might be better to see if I can enhance state machine references to set instance values in the details window and then use those as states.

                Also in case it helps, inheritance works for state machines now. You can have a base state machine class with variables and functions, and use those in a child state machine class. Additionally with state machine references you can enable an intermediate graph and set properties of the reference there. All though that is done in a BP graph and not the details window. I'm also not sure how well that will work if you have the same reference multiple times on the same graph.


                But to your first point, this is likely overkill for dialogue systems. I know there are plenty of dialogue editors on the market. Awhile ago I started working on a dialogue system based on logic driver. A blueprint editor where each node is actually a BP graph to construct a dialogue sentence, auto constructed from text or user created. Definitely have me consider working on it again, as a separate plugin or maybe including it in logic driver. I could see mixing state logic with dialogues being handy.

                Click image for larger version

Name:	DialogLogicDriver.PNG
Views:	140
Size:	71.4 KB
ID:	1694259

                Logic Driver - State Machine Blueprint Editor

                Comment


                  #38
                  Originally posted by Recursoft View Post


                  So ideally.. developer creates New State Class (or New Transition Class) blueprints.

                  In a state machine blueprint be able to set the state or transition to the created classes. Possibly similar to state machine references. Then be able to set instance values in the details window of each state or transition. And to be clear, you only need instance variables to change, and not the BP logic itself, correct?
                  To be precise change variables and append logic similar way one can do this in the State editor. Changing internal logic is not needed. Idea is: create a node, append custom logic (aka node with predefined logic), expose variables, use anywhere. Same idea as BTT nodes.

                  Originally posted by Recursoft View Post
                  If I have that right, I'll consider ways of implementing this (or parts of it). I don't want to commit to anything yet because you're right in that the work to do this isn't trivial and multiple problems would have to be solved like passing the context (and using it from within each state or transition), replication settings, etc. It might be better to see if I can enhance state machine references to set instance values in the details window and then use those as states.
                  I think that will do.

                  Originally posted by Recursoft View Post
                  But to your first point, this is likely overkill for dialogue systems. I know there are plenty of dialogue editors on the market. Awhile ago I started working on a dialogue system based on logic driver. A blueprint editor where each node is actually a BP graph to construct a dialogue sentence, auto constructed from text or user created. Definitely have me consider working on it again, as a separate plugin or maybe including it in logic driver. I could see mixing state logic with dialogues being handy.
                  Logic Driver State Machine is indeed very close to the necessary requirements to build a custom logic. By custom I mean being as flexible as possible in building complex interactive scripts. There is Screenwriter asset on the market exactly for that. Sadly it's buggy (the reason we did try States Machine solution), but if you take a closer look you will find how both are solving same tasks using almost similar ways.

                  I think it's not coincidence you did work on both Logic Driver and the dialogues It really allows to build custom and complex dialogues on top of that.

                  Comment


                    #39
                    The next intended feature of Logic Driver was local state variables, but I've reached a point in development where I need to put it on hold. The reason is nearly everything around expanding local variables is off limits in the engine. Classes aren't fully exported and methods that need to be overridden aren't virtual or are static. Despite those limitations local variables are mostly working in a development branch, except in order to achieve this was basically one hack after another. And it's not something I'm comfortable releasing or supporting (or even using myself and I really wanted this feature).

                    Click image for larger version

Name:	LocalVar.PNG
Views:	105
Size:	32.8 KB
ID:	1700233

                    In short, to support local variables properly requires some engine level changes.

                    So in its place I think I'll shift development toward eventually supporting custom state classes similar to what
                    Originally posted by CRYOMEN
                    .
                    suggested. This will allow reusable classes while also naturally supporting member variables. I think this idea can be expanded upon nicely to allow unique types of nodes which could be used for other systems such as dialogues or quests.

                    The first step toward that is adding template support and details view editing for state machine references which should be in the next update.
                    Click image for larger version

Name:	Archetype.PNG
Views:	86
Size:	25.4 KB
ID:	1700234


                    Last note: 4.24 version released earlier this week.

                    Logic Driver - State Machine Blueprint Editor

                    Comment


                      #40
                      Hi, I ran into a situation where I need the Entry of SubStateMachine to branch out conditionally. To do that I put an Entry Conduit as below:



                      The SubStateMachine will exit if no animation is played. Either Slash_UL_L2L and Slash_UR_L2R will trigger their respective animations and kept the SubStateMachine from being exited.

                      The problem is the transition Entry->Slash_UL_L2L is evaluated 1 frame later after SubStateMachine is entered, at which point this SubStateMachine has already transitioned out.

                      I noticed that each Transition takes 1 tick to complete, even for a Transition between State-Conduit. Can you make the transition through Conduit nodes happens instantly instead?
                      Last edited by firzgard; 12-21-2019, 12:33 PM.

                      Comment


                        #41
                        Originally posted by firzgard View Post
                        Hi, I ran into a situation where I need the Entry of SubStateMachine to branch out conditionally. To do that I put an Entry Conduit as below:

                        I noticed that each Transition takes 1 tick to complete, even for a Transition between State-Conduit. Can you make the transition through Conduit nodes happens instantly instead?
                        Yep, you're right that the initial tick calls OnStateBegin and the second tick evaluates transitions. I can also see how you might want that done on a single tick so I just added in an option for all base state nodes to support that. I think defaulting that setting on Conduits to true may make sense as well.

                        I'm happy with how this is testing so far and will include it in the 1.6 update. I don't want to road block you and can provide you a beta build sooner if you would like.
                        Logic Driver - State Machine Blueprint Editor

                        Comment


                          #42
                          Originally posted by Recursoft View Post

                          Yep, you're right that the initial tick calls OnStateBegin and the second tick evaluates transitions. I can also see how you might want that done on a single tick so I just added in an option for all base state nodes to support that. I think defaulting that setting on Conduits to true may make sense as well.

                          I'm happy with how this is testing so far and will include it in the 1.6 update. I don't want to road block you and can provide you a beta build sooner if you would like.
                          That's great. I'm fine waiting for 1.6
                          Thanks.

                          Comment


                            #43
                            I love this plugin. Its made my life easier.

                            Coincidentally, I'm in the same boat as the post above, I need conduit nodes to be able to evaluate transitions out immediately on same frame.
                            Figured I would post support for the plugin and queue up my request for the same feature on UE 4.23.
                            Looking forward to 1.6. Thanks!

                            Comment


                              #44
                              1.6 update is just about wrapped up for 4.22-4.24 and I'll be submitting to Epic soon. With the holidays and their delay from 4.24 processing I wouldn't be surprised if it's not available until after Jan 6th.
                              I updated documentation here https://github.com/Recursoft/LogicDr...-Custom-Builds if anyone wants to try it earlier. I'll be busy myself over the next couple days as well but should be able to provide a build earlier than the 6th if needed.

                              Click image for larger version

Name:	SingleTick.PNG
Views:	77
Size:	36.0 KB
ID:	1701319

                              Every state node will have an advanced check box to enable same tick processing. Each transition node will also have a way of opting out in case you need some transitions to eval right away or others on the next tick. This is mainly to prevent blocking infinite loops (self transitions default to opt out to help prevent that). Conduit default behavior probably won't change so as not to negatively effect existing logic.
                              Logic Driver - State Machine Blueprint Editor

                              Comment


                                #45
                                Awesome! I'm looking forward to it!

                                I have 2 feature requests. v1.7 perhaps?

                                The first is regarding inheriting state machines, ex: B inherits from A.
                                To access the A state Machine from B, I am adding a reference to A inside B. This is based on advice given above. This seems to work and allows me to extend it because the context is passed in automatically and I'm only ever referencing the character directly for variables checked etc. However, I suspect it's not a good way to proceed since if I add variables to the base (A) state machine, I can see and use them in all of the children (B, C, D, etc), but they are not accessible to the referenced instance (A) since its a reference to it's own separate external instance instead of the parent itself...
                                Reading the wiki this morning, I guess I can use an intermediate graph to forward my variables to the reference... but this all has a code smell as they say. Variables defined in A are forwarded back to a reference of A from B... yeah. Just the way the code folded in the end, nothing done wrong here. This would be flawless if not for my desire to share inherited variables.

                                Is it possible to maybe add a node for getting the parent graph? It would be nice to treat the parent like a nested state machine so we can just transition in and out of it..
                                A could contain states like travel, jump, dash, etc which are shared with many characters. B would contain melee states unique to each character . Both can make use of the same global variables defined in A and it's handy to use A as a base class in each character. but again, I'm working around this by keeping variables in the character, which is ok so long as I don't forget they are used only in the state machine when i check reference on them in 6 weeks during code cleanup.
                                I imagine maybe only 1 instance of "parent State Machine" node should be allowed? Food for thought.

                                The second request is to do with the actor component. maybe I missed it, but is there a way to construct a new one from blueprints to assign it a new state machine class reference?
                                If I wanted characters to "change powers" and each power would be its own state machine (which inherits from the basics of A above , I didn't see a way to do that. I've worked around this easily because using variables is so easy (thanks to the clean workflow!) but I think a function to maybe "reset" the actor component and giving it a new class reference as part of it might help recycling the actor component.

                                Neither of these are critical features. Nice to haves to minimize workflow overhead at best.
                                I'm happy to test out and provide feedback if you like. I'll send you an email with my receipt as requested in the link. No rush if you are out for the holidays.

                                Happy Holidays!

                                Comment

                                Working...
                                X