Announcement

Collapse
No announcement yet.

Logic Driver - State Machine Blueprint Editor

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

    #46
    Update 1.6
    Supports Unreal Engine 4.22 - 4.24


    Full Patch Notes
    This version has changes which may impact current users, please read the patch notes.
    Potential impacted use cases:
    Referencing the same state machine class multiple times in a single blueprint.
    Reloading states by Guid during run-time.

    New Features:
    • Reference Templates (archetypes) are now supported
    • New Parent State Machine Node Available in Child State Machines
    • Optional Same Tick Processing on all State Nodes (Including Conduits)
    Logic Driver - State Machine Blueprint Editor

    Comment


      #47
      Originally posted by Recursoft View Post
      Network replication works by syncing transitions. Say the server takes a transition, it will then notify clients to take the same transition. Transitions can be configured to which domain you want them to evaluate on: server, client, or both. Setting it to server means only the server will evaluate the transition and then update clients. Setting it to client means if the owning client triggers the transition, it will then notify the server which will update the appropriate proxies. State logic can also be configured the same way. So I believe the answer to your question is yes.

      If a client drives the transition, is there server side anti cheat logic too? Like I could have a client side transition to fire a weapon, but I'd want the server to validate that the weapon is fireable as well.

      It could be good for optimistic logic where the client tries to start the state locally and all the animations play so it feels immediate. Then if the server responds with a "No" there could be a way to undo the client transition.

      Comment


        #48
        Originally posted by illYay View Post

        If a client drives the transition, is there server side anti cheat logic too? Like I could have a client side transition to fire a weapon, but I'd want the server to validate that the weapon is fireable as well.

        It could be good for optimistic logic where the client tries to start the state locally and all the animations play so it feels immediate. Then if the server responds with a "No" there could be a way to undo the client transition.
        Not currently, but I agree with you. Allowing the server to evaluate the same transition the client sent and forcing the client back into a previous state if the transition fails makes sense. So does an option for taking the transition optimistically. I'll add this to the backlog.
        Logic Driver - State Machine Blueprint Editor

        Comment


          #49
          Is there a way to get references to transitions and states in the blueprint?

          I saw some blueprint nodes that reference things by guid, but I'm not sure how to get a guid either. I'm wondering if there's something like get guid for transition "Equip to Idle" and set "Can Evaluate" to true when my character's weapon equip animation is done. I see there's a way to get a reference to only the "Current" state or transition if you use "Get State".

          What I'm really trying to do is trigger a transition manually after some time in On State Begin, like when my character's animation is done. Before using this, I had code that manually said, After Timer, Go to state X. I saw there's a function for If X time spent in state, but I wanted to avoid having to know that data in multiple locations. I thought it would be nice to use a Delay node and trigger it from one place in On Begin.
          Last edited by illYay; 01-14-2020, 02:17 PM.

          Comment


            #50
            Originally posted by illYay View Post
            Is there a way to get references to transitions and states in the blueprint?

            I saw some blueprint nodes that reference things by guid, but I'm not sure how to get a guid either. I'm wondering if there's something like get guid for transition "Equip to Idle" and set "Can Evaluate" to true when my character's weapon equip animation is done. I see there's a way to get a reference to only the "Current" state or transition if you use "Get State".

            What I'm really trying to do is trigger a transition manually after some time in On State Begin, like when my character's animation is done. Before using this, I had code that manually said, After Timer, Go to state X. I saw there's a function for If X time spent in state, but I wanted to avoid having to know that data in multiple locations. I thought it would be nice to use a Delay node and trigger it from one place in On Begin.

            In blueprints there isn't a way to get a true reference to a node. The GetStateInfo and GetTransitionInfo provide read only information. This is for a couple reasons: one is technical - how the nodes end up getting compiled into the blueprint makes it difficult to pass references throughout the blueprint, and the other is there really isn't a reason too. If you find yourself needing to manually change a value on a node there's probably a better way to do it.

            For your case I'd consider going about it one of the following ways:
            • You mentioned Time in State - That works in transitions as well and in that case it's actually reading the time from the previous state.
            • Depending what the context is (such as if it's the character in question) you could set a property on there to complete when the animation is finished and transition when that is true. Or add a way to read the max time of the animation and then do Time in State >= Context.EquipTime.
            • You could also take an event based approach: In the transition bind to an event that fires when the animation finishes and set Can Evaluate there. https://github.com/Recursoft/LogicDr...ki/Transitions has an example of that.

            It's worth mentioning that one of the next planned features will be reusable node classes. With those it would be possible to get references to their instances as well as set common logic that might be shared across multiple nodes.


            Logic Driver - State Machine Blueprint Editor

            Comment


              #51
              Oh yeah I'm definitely looking forward to the reusable node classes. I had a similar state machine system a while ago where I just had state classes like in the Unreal Tournament 4 code and having local variables and functions was nice. You can reuse a class for all Shoot weapon states, for example. Do you know when that will be/how hard it is?

              One thing I was considering at first is that for every state I have a boolean in the state machine that gets set to "Done" and the transition waits for the property to be true, but I was hoping to avoid that since the State Machine will be bloated with all these properties.

              The event thing you mentioned could work for now until the reusable node classes. It will be similar to the approach of having a boolean but the class itself won't be bloated with a bunch of bool variables. It'll instead be bloated with events, but those don't get in the way of the code. They just "exist" in the class.

              I also used Gameplay Abilities at one point for weapons because they do networking but it became a nightmare to work with for states so I'm switching to your FSM plugin. In Gameplay Abilities, you can have an ability say it's Ended. I'm not sure if it makes sense to tell a state, it "Ended" and let the transition go. I think in the end, having State Subclasses will make sense since a state can set some property on itself and the transitions out of it can trigger.

              It could also be good to manually trigger transitions out of a state immediately with a blueprint node. There might otherwise be a delay of a game tick. Normally in code I'd say, "Go to state X" which ends up behaving like a State Machine you set up without your UI based plugin. It could be nice to set up transitions with your plugin and have a state know which transitions go out of it. And then have some code within the state manually invoke the transitions that come out of it.
              Last edited by illYay; 01-14-2020, 08:04 PM.

              Comment


                #52
                Custom class development started about a week ago and the bulk of it is already working. You'll be able to extend classes either through C++ or BP, then select the class from a state machine BP.

                Click image for larger version

Name:	StateClass.PNG
Views:	25
Size:	42.6 KB
ID:	1708843

                Click image for larger version

Name:	StateClassDef.PNG
Views:	22
Size:	182.5 KB
ID:	1708844

                It still needs some more work and a lot of testing and is also part of a larger update so I don't want to give an ETA. But when it's ready for beta if you'd like to test it I'd love the feedback. Check out this page if you're interested.

                Another thing with this update that may help your use case is I'm planning on making the state class instance available in the outgoing transitions. That way you can just check the state member variable to see if the transition is allowed.


                Logic Driver - State Machine Blueprint Editor

                Comment


                  #53
                  Sounds great!

                  Comment

                  Working...
                  X