Announcement

Collapse
No announcement yet.

UFSM: Finite State Machine

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

  • replied
    Thanks. I tried to run this code.
    I have created a Character Test_Native which extends FSM_NativeCharacter. I then placed it in the map.
    I don't see the output log "BINDED Begin!'.
    In my project, I have not been able to bind function either. It looks like OnInitializedFSM_implementation is not called

    update: I found din Q/A to use PostInitializeComponents and it's working
    Code:
    void ASwingDoor::PostInitializeComponents()
    {
    
        Super::PostInitializeComponents();
    
        StateMachine->GetState(1)->OnUpdateState.AddDynamic(this, &ASwingDoor::OpenDoor);
        StateMachine->GetState(3)->OnUpdateState.AddDynamic(this, &ASwingDoor::CloseDoor);
    }
    Is there a way to use the StateMachine component within ASwingDoor::OpenDoor()
    For example, OpenDoor() is slowly Opening the door. Once the door is opened, it is setting the Closed state or end the current state
    Last edited by FaSDt1517; 02-24-2020, 09:21 PM.

    Leave a comment:


  • replied
    Originally posted by FaSDt1517 View Post
    hi, Is there a full c++ example?

    but I am a bit confused on how to set up the state transition
    There's this example in demo project (zip above)
    https://forums.unrealengine.com/unre...640#post991640

    Leave a comment:


  • replied
    hi, Is there a full c++ example?
    I m looking at just a swing door demo (open, opening, close, closing, locked)

    I have the states defined. I understand the begin, update, end (= StateMachineBehavior in unity)
    but I am a bit confused on how to set up the state transition

    Leave a comment:


  • replied
    v3.0 released for Unreal 4.24+, you can find updated demo project here:
    UFSM_3.0.0_UE4.24_Demo.zip

    Leave a comment:


  • replied
    Due to requests, in v3 I'm bringing back hierarchical FSMs, but in a "reactive" model (it's very similar to the way Unity's PlayMaker works), action-based.

    This "Reactive Hierarchical State Machine" model is target for gameplay graphs (Blueprints) and isn't very C++ friendly to use (although it's still doable to implement it in pure code classes);
    These nodes can be integrated with the existing FSM Component and can also have nested FSM graphs that can work as a hierarchy of FSMs to have an effective hierarchical state machine solution with editable graphs for each "Action". (I've put a lot of effort to design a system that won't cause infinite loops independent of whatever craziness you do with it)

    The concept is very simple: you can create (R)FSM classes and attach them to a node, each can host how many "Actions" you need which you can also create a Blueprint graph for.
    Once a FSM node is entered by your exec pins, it becomes active and starts executing it's stack of actions every frame until make the FSM exit its state:







    I will also submit the usual demo project for reference, once the update arrives, this is the whole graph for the demo controller:




    Leave a comment:


  • replied
    You probably made changes to the instance of your fsm Blueprint then you made changes to the default asset of your fsm Blueprint.

    Now your state lists are different.
    You should make changes to list in your fsm Blueprint only. I only made it public to "Edit Anywhere" because of a editor bug (I see I must make it defaults only again to avoid this user confusion).

    -----

    I'm working on v3.0 so any changes to that is probably coming only in v3 update.
    (this is fixed on v3, I have no ETA when it will be ready tho)
    Last edited by BrUnO XaVIeR; 01-28-2020, 04:48 PM.

    Leave a comment:


  • replied
    Hi... Thanks for your support
    I'm still getting the 'State ID doesn't exist' error when I try to add new states...
    I can't add new states after 'Rollattack' state in the photo above... what should I do??
    My UFSM plugin version is 2.1.1

    Leave a comment:


  • replied
    Any function trying to access the removed enum item have to be edited to return a valid value from the menu dropdown.
    If it's an empty state function I would just delete the function instead then recompile the Blueprint.

    Leave a comment:


  • replied
    Originally posted by BrUnO XaVIeR View Post
    Demo projects can be upgraded by users, right click uproject file and migrate to latest engine version.
    how to fix the "Unchecked" error?

    Leave a comment:


  • replied
    Demo projects can be upgraded by users, right click uproject file and migrate to latest engine version.

    Leave a comment:


  • replied
    Originally posted by BrUnO XaVIeR View Post
    Submitted v2.1.0 for Unreal 4.22+


    WARNING!!!
    • "UNCHECKED" pin has been removed!
    • I do not recommend upgrading to UFSM 2.1+ in middle of a project, you might have to fix a lot of Blueprint errors if you use the removed "Unchecked" pin for anything (i.e, runtime states generation)
    where's the new example project?

    Leave a comment:


  • replied
    Originally posted by BrUnO XaVIeR View Post
    MaximeDupart

    Oh you say example from first page, that is outdated from plugin 1.x version.

    There's a more up to date example here:
    https://forums.unrealengine.com/unre...640#post991640
    Perfect, thanks !

    Leave a comment:


  • replied
    MaximeDupart

    Oh you say example from first page, that is outdated from plugin 1.x version.

    There's a more up to date example here:
    https://forums.unrealengine.com/unre...640#post991640

    Leave a comment:


  • replied
    Hello Bruno,
    Just updated the plugin after using it for a while and loving it.

    Building the FSM in C++ from pawn constructor using the first post code example, i now trigger the error :

    Code:
    [2019.05.17-12.18.41:513][183]FSMs: Error: [StateMachine]: 'New States' Array is zero sized.
    [2019.05.17-12.18.41:513][183]PIE: Error: {FSM}:: 'New States' Array is zero sized. -->  FSM: Make States: [Function /Script/UFSM.StateMachineComponent:MakeStates at (ShooterPlayerStateMachine /Game/Maps/UEDPIE_0_Highrise.Highrise:PersistentLevel.
    Weirdest part is that the FSM is working.

    Leave a comment:


  • replied
    Submitted v2.1.0 for Unreal 4.22+


    WARNING!!!
    • "UNCHECKED" pin has been removed!
    • I do not recommend upgrading to UFSM 2.1+ in middle of a project, you might have to fix a lot of Blueprint errors if you use the removed "Unchecked" pin for anything (i.e, runtime states generation)

    Leave a comment:

Working...
X