Announcement

Collapse
No announcement yet.

Logic Driver - Easily Design Gameplay Systems with State Machines

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

    #16
    If you want precise control over the tick, you might want to consider managing it yourself. You could disable the tick of the State Machine, then from the tick function you want to use call the Update method of the State Machine actor component. The Update method takes a float DeltaSeconds param you can pass in, effectively allowing another method to tick the State Machine.

    Do you think that would work for you? I'm sort of picturing it from overriding the actor tick. I haven't used FTickFunction before.
    Logic Driver - Easily Design Gameplay Systems - Version 2.0 Now Available!

    Comment


      #17
      Yeah I think that would work too. For now I only need the state machine to update after movement component.

      Comment


        #18
        HI will consoles be supported in the future?

        Comment


          #19
          Originally posted by Kenyon1977 View Post
          HI will consoles be supported in the future?
          The run-time component is designed to be platform independent but I don't have console developer kits to test against.
          I may try to see if it can build for consoles, but I won't be able to officially support it.
          Logic Driver - Easily Design Gameplay Systems - Version 2.0 Now Available!

          Comment


            #20
            Hi Recursoft, I think I have a problem with the State machine... I am using it for a project on the Oculus Quest (android SDK), and when I use the SM I get a critical error. This occurs some time after start- game/SM (independent if I do something in the level or not). The error occurs when the SM is filled of empty.

            I use unreal 4.22.3

            I hope you can help!

            :
            D/UE4 : Script Stack (0 frames):
            D/UE4 :
            D/UE4 : Assertion failed: !IsUnreachable() [File:\Build\++UE4\Sync\Engine\Source\Runtime\CoreUObject\Private\UObject\ScriptCore.cpp] [Line: 1302]
            D/UE4 : SM_NEW_C /Game/DugOutTVT/Maps/MotionController_MergedMap.MotionController_MergedMap:PersistentLevel.DugoutGameMode_C_0.SM_NEW_C_1 Function: '/Script/SMSystem.SMInstance:Tick'
            D/UE4 : [2019.08.22-14.33.17:586][774]Assertion failed: !IsUnreachable() [File:\Build\++UE4\Sync\Engine\Source\Runtime\CoreUObject\Private\UObject\ScriptCore.cpp] [Line: 1302]
            D/UE4 : SM_NEW_C /Game/DugOutTVT/Maps/MotionController_MergedMap.MotionController_MergedMap:PersistentLevel.DugoutGameMode_C_0.SM_NEW_C_1 Function: '/Script/SMSystem.SMInstance:Tick'
            D/UE4 : [2019.08.22-14.33.17:586][774]LogAndroid: Error: === Critical error: ===
            D/UE4 : [2019.08.22-14.33.17:586][774]LogAndroid: Error:
            D/UE4 : [2019.08.22-14.33.17:586][774]LogAndroid: Error: Assertion failed: !IsUnreachable() [File:\Build\++UE4\Sync\Engine\Source\Runtime\CoreUObject\Private\UObject\ScriptCore.cpp] [Line: 1302]
            D/UE4 : [2019.08.22-14.33.17:586][774]LogAndroid: Error: SM_NEW_C /Game/DugOutTVT/Maps/MotionController_MergedMap.MotionController_MergedMap:PersistentLevel.DugoutGameMode_C_0.SM_NEW_C_1 Function: '/Script/SMSystem.SMInstance:Tick'
            D/UE4 : [2019.08.22-14.33.17:586][774]LogAndroid: Error: [Callstack] 0x00000000C589E2B4 (0x00000000039342B4) libUE4.so!FDebug::CheckVerifyFailedImpl(char const*, char const*, int, char16_t const*, ...) []
            D/UE4 : [2019.08.22-14.33.17:586][774]LogAndroid: Error: [Callstack] 0x00000000C994FD64 (0x00000000079E5D64) libUE4.so!void FDebug::CheckVerifyFailed<char16_t [19], char16_t const*, char16_t const*>(char const*, char const*, int, char16_t const (&) [19], char16_t const*, char16_t const*) []
            D/UE4 : [2019.08.22-14.33.17:587][774]LogAndroid: Error: [Callstack] 0x00000000C994E1F4 (0x00000000079E41F4) libUE4.so![Unknown]() []
            D/UE4 : [2019.08.22-14.33.17:587][774]LogAndroid: Error: [Callstack] 0x00000000C5D1AAAC (0x0000000003DB0AAC) libUE4.so!UObject::ProcessEvent(UFunction*, void*) []
            D/UE4 : [2019.08.22-14.33.17:587][774]LogAndroid: Error: [Callstack] 0x00000000C51048B8 (0x000000000319A8B8) libUE4.so!non-virtual thunk to USMInstance::Tick(float) []
            D/UE4 : [2019.08.22-14.33.17:587][774]LogAndroid: Error: [Callstack] 0x00000000C7CF2DF4 (0x0000000005D88DF4) libUE4.so!FTickableGameObject::TickObjects(UWorld*, int, bool, float) []
            D/UE4 : [2019.08.22-14.33.17:587][774]LogAndroid: Error: [Callstack] 0x00000000C7B63B70 (0x0000000005BF9B70) libUE4.so!UGameEngine::Tick(float, bool) []
            D/UE4 : [2019.08.22-14.33.17:587][774]LogAndroid: Error: [Callstack] 0x00000000C50CB6F0 (0x00000000031616F0) libUE4.so!FEngineLoop::Tick() []
            D/UE4 : [2019.08.22-14.33.17:587][774]LogAndroid: Error: [Callstack] 0x00000000C50C2B94 (0x0000000003158B94) libUE4.so!AndroidMain(android_app*) []
            D/UE4 : [2019.08.22-14.33.17:587][774]LogAndroid: Error: [Callstack] 0x00000000C50D1A54 (0x0000000003167A54) libUE4.so!android_main() []
            D/UE4 : [2019.08.22-14.33.17:587][774]LogAndroid: Error: [Callstack] 0x00000000C50F1384 (0x0000000003187384) libUE4.so![Unknown]() []
            D/UE4 : [2019.08.22-14.33.17:587][774]LogAndroid: Error: [Callstack] 0x00000000E7A398D4 (0x00000000000478D4) libc.so![Unknown]() []
            D/UE4 : [2019.08.22-14.33.17:587][774]LogAndroid: Error: [Callstack] 0x00000000E7A0BFE6 (0x0000000000019FE6) libc.so![Unknown]() []
            D/UE4 : [2019.08.22-14.33.17:587][774]LogAndroid: Error:
            D/UE4 : [2019.08.22-14.33.17:587][774]LogAndroid: Error:
            D/UE4 : [2019.08.22-14.33.17:587][774]LogAndroid: Error:
            D/UE4 : [2019.08.22-14.33.17:587][774]LogAndroid: Error:
            D/UE4 : [2019.08.22-14.33.17:587][774]LogAndroid: FAndroidMisc::RequestExit(1)

            Comment


              #21
              Originally posted by TeunVT View Post
              Hi Recursoft, I think I have a problem with the State machine... I am using it for a project on the Oculus Quest (android SDK), and when I use the SM I get a critical error. This occurs some time after start- game/SM (independent if I do something in the level or not). The error occurs when the SM is filled of empty.

              I use unreal 4.22.3

              I hope you can help!
              ...


              Hi TeunVT,

              I spent some time tonight both reading about Oculus Quest and testing the UE 4.22 version with the android SDK and I can't recreate any issues on my end. I don't have an Oculus Quest available so my testing is directly to an android phone. If you can provide more details on how you're using the state machine I might be able to figure out what's going on.

              Is the state machine an actor component or an object on an actor?
              What's the context type?
              The state machine was started successfully for a period of time before the error occurred?

              And did this error just start today? There was an update to the plugin published early this morning for 4.22.

              Please e-mail support@recursoft.net -- it's a little easier that way and the forums don't always send a notification.

              Thanks!
              Logic Driver - Easily Design Gameplay Systems - Version 2.0 Now Available!

              Comment


                #22
                Actually I think I was able to recreate this. It looks like the state machine isn't being destroyed properly when an actor is deleted and once garbage collection occurs it causes a crash when the engine attempts to tick the state machine. Working on a fix now. Nice catch, thanks for reporting it!

                If you want to get around it now, add logic in to stop or shut down the state machine when your actor is destroyed.
                Logic Driver - Easily Design Gameplay Systems - Version 2.0 Now Available!

                Comment


                  #23
                  Update 1.4.1
                  S
                  upports Unreal Engine 4.20 - 4.23
                  (4.23 will be published after official engine release)

                  New Features:
                  New Transition Nodes and Support for Event Triggers
                  • Optional transition nodes have been added to help support transition logic which may need to occur before and after evaluation such as binding to an event.
                    • On Transition Initialized (When the state leading to the transition is entered)
                    • On Transition Shutdown (When the state leading to the transition is exited)
                    • On Transition Pre-Evaluate (Before each evaluation. Performance warning)
                    • On Transition Post-Evaluate (After each evaluation. Performance warning)
                    • Can Transition Evaluate Getter/Setter which can be used in the transition context. If false the transition is never evaluated and can never be taken.

                  Changes:
                  • GetWorld - State machine instances' GetWorld implementation will now only attempt to return the context's world as this is the only world the state machine should care about. Previously it would check GEngine and the outer object. If ImplementsGetWorld was called on the state machine blueprint during design time it would fail.
                  • GetContext - State machine instances' GetContext implementation will only return the context which was set during initialize. Previously it would return the outer object if no context was set. All contexts should be set using the Initialize method.
                  Bug Fixes:
                  • State Machine instances have improved cleanup handling to prevent a possible crash when garbage collection occurs.
                  Logic Driver - Easily Design Gameplay Systems - Version 2.0 Now Available!

                  Comment


                    #24
                    Hi Recursoft,

                    We've got a crash using an addon related to component network replication. It happens, that client receives two RepNotifies in the same tick: R_NetworkedTransitions and R_Instance, in this order. R_Instance is not yet initialzied while trying to process transitions, so R_Instance->GetNodeMap(); returns empty NodeMap which is followed by nullptr access violation.
                    Hope you can help!

                    access violation is here: USMStateMachineComponent::DoProcessTransactions() [client\plugins\logicdriver\source\smsystem\private\smstatemachinecomponent.cpp:359]

                    Thanks!

                    Comment


                      #25
                      Originally posted by BernardTheDevil View Post
                      Hi Recursoft,

                      We've got a crash using an addon related to component network replication. It happens, that client receives two RepNotifies in the same tick: R_NetworkedTransitions and R_Instance, in this order. R_Instance is not yet initialzied while trying to process transitions, so R_Instance-&gt;GetNodeMap(); returns empty NodeMap which is followed by nullptr access violation.
                      Hope you can help!

                      access violation is here: USMStateMachineComponent::DoProcessTransactions() [client\plugins\logicdriver\source\smsystem\private\smstatemachinecomponent.cpp:359]

                      Thanks!

                      Thank you for reporting it and the detailed description. I was able to recreate it and fix it.

                      New behavior is REP_NetworkedTransitions will now queue transitions that are attempting to be processed before the instance is initialized.
                      REP_OnInstanceLoaded will process queued transitions after the instance is initialized.
                      New flag added to StateMachine components 'bDiscardTransitionsBeforeInitialize' which will discard transitions that occur before the instance is initialized. (Basically the old behavior but without crashing!)

                      This has been submitted for 4.21-4.23. Epic may take a day or more to build and publish.

                      Edit:
                      This update is now available as version 1.4.2.
                      Last edited by Recursoft; 09-05-2019, 12:33 PM.
                      Logic Driver - Easily Design Gameplay Systems - Version 2.0 Now Available!

                      Comment


                        #26
                        Update 1.5
                        S
                        upports Unreal Engine 4.21 - 4.23

                        New Features:
                        Intermediate Reference Graphs
                        • State machine references now support an intermediate graph to allow direct control over the reference.
                        • The context of the reference can be changed.
                        • A new optional node `Get State Machine Reference` is available in this graph.
                          • Reference variables can be read or set from here.
                        • An optional entry point `On State Machine Start` is available for initializing properties.
                          • This fires when the root state machine of the blueprint owning the reference starts.


                        Save & Restore States
                        • The guid of the active state can be easily retrieved for serialization.
                          • `GetNestedActiveStateGuid`
                        • To restore a state machine to its previous state it only needs the active guid and will automatically set initial states of all affected state machines.
                          • `LoadFromState`
                        • If the current state of a nested state machine which doesn't contain the active state is important use `GetAllCurrentStateGuids` and `LoadFromMultipleStates`.
                          • Normally nested state machines clear their state on exit. Added `bReuseCurrentState` and `bReuseIfNotEndState` flags to state machine nodes to allow this behavior to change.

                        Editor Settings
                        • Color and debug information can now be configured.


                        Comment Bubbles
                        • State nodes now support standard comment bubbles.


                        Added Helpers to Retrieve State and Transition Information from a State Machine Graph
                        • `GetStateInfo` and `GetTransitionInfo`
                        • Retrieve blueprint friendly read only structs containing helpful information.
                        • Any contained guids can be checked against the instance itself with `TryGetStateInfo` or `TryGetTransitionInfo`.



                        New Common State Machine Events
                        • Added OnTransitionTaken, OnStateChange, and OnStateMachineUpdated events to instances and components.
                        • State and transition events include the new blueprint friendly structs as parameters.

                        Replace With...
                        • Added `Replace With` sub menu for converting the selected node to another type while preserving transitions.
                        • This is destructive to the node and its contents.


                        Changes:
                        • State nodes will better validate and display errors.
                        • State machine references will no longer default to an empty nested state machine when a reference is forcibly deleted and instead stay in an error state to allow the reference to be changed.
                        • Organized blueprint functions into different categories.
                        • Blueprint helper nodes will now display which state they represent.
                        • State machine instances have more general helper functions exposed in C++ and blueprints to retrieve information such as current states or all referenced instances.
                        • Improved descriptions of Tick overrides to better reflect what they actually change.
                          • They have always affected the Update rate of a state machine but do not affect overloaded Tick functions.

                        New Platforms Whitelisted:
                        • Development
                          • Linux
                        • Runtime
                          • Linux
                          • PS4
                          • XboxOne
                          • Switch
                          • TVOS
                        • Linux has been tested and is supported. No testing has been performed on the other platforms.

                        Bug Fixes:
                        • Fixed state machine references ticking independently of the parent which could cause state machines to update twice per tick.
                          • Added `bAllowIndependentTick` which defaults to false and `bCallTickOnManualUpdate` which defaults to true.
                          • The new default behavior should fix the issue while not breaking uses of Tick overload on references. However be sure the Parent Tick is still called if you overload Tick.
                        • Fixed `Promote to Variable` not displaying on some node pins.
                        Logic Driver - Easily Design Gameplay Systems - Version 2.0 Now Available!

                        Comment


                          #27
                          Hi

                          Is there an easy way to access public variables in the state-machine that's referenced in the state machine actor component?

                          Comment


                            #28
                            Originally posted by Kenyon1977 View Post
                            Hi

                            Is there an easy way to access public variables in the state-machine that's referenced in the state machine actor component?
                            Yep, on the actor component call GetInstance and cast that to your correct blueprint type.

                            Logic Driver - Easily Design Gameplay Systems - Version 2.0 Now Available!

                            Comment


                              #29
                              Hi

                              I think I might have encountered a bug. I put a event tick in the event graph of the statemachine, and in the runtime the statemachine will not run, in the statemachine graph, the active time of the current state will remain zero forever. I am using the latest version of the plugin and able to reproduce this in both UE 4.21 and UE 4.23.

                              Comment


                                #30
                                Originally posted by Kenyon1977 View Post
                                Hi

                                I think I might have encountered a bug. I put a event tick in the event graph of the statemachine, and in the runtime the statemachine will not run, in the statemachine graph, the active time of the current state will remain zero forever. I am using the latest version of the plugin and able to reproduce this in both UE 4.21 and UE 4.23.
                                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.
                                Logic Driver - Easily Design Gameplay Systems - Version 2.0 Now Available!

                                Comment

                                Working...
                                X