Announcement

Collapse
No announcement yet.

UFSM: Finite State Machine

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

  • replied
    ok only double posting because I think I have some easy steps for reproduction of my issue. If you set up your enumerator first, and then change the entry point on the anim fsm graph, it becomes improperly ordered/detatched from the enumerator.

    Leave a comment:


  • replied
    The step I found confusing is in the fsm_component, when we set the enumerator, what enumerator should this be? Click image for larger version

Name:	fsm_component_enum_variable_Space.jpg
Views:	76
Size:	42.5 KB
ID:	1458041


    Are we supposed to just make a new enumerator and list out the states, what order should those states be in when creating this new enumerator? This is where I think I messed up and ordered my states incorrectly while making a new enumerator. I was very careful to make sure the names in the enumerator were the same as the states that are in my anim_bp's FSM.
    Attached Files

    Leave a comment:


  • replied
    I was rebuilding the Blueprints I use for development (for tests) in the Demo Project while we speak and unfortunately I cannot reproduce the "out of sync" problem you experience...
    I would have to have access to a project where I can see the problem you have for me to understand what is going on there.
    I've never seen it so far, just remade test Blueprints to see if the problem is new on UE4.19, but nope; working correctly here:





    If you can make a small barebones project to show me the problem I can than take a closer look.
    Usually this kind of thing happens when something was setup wrong (happens often with the Object Pool for example).

    Leave a comment:


  • replied
    Originally posted by wasti View Post
    is that needed if I am using OverrideFSM True?
    No, that is an alternative system.
    If there's a bug hidden in the system you are currently using, maybe this alternate system works the correct way on your project.

    Leave a comment:


  • replied
    is that needed if I am using OverrideFSM True?
    Click image for larger version  Name:	fsm_overridefsm.jpg Views:	2 Size:	17.4 KB ID:	1458002

    I tried using set state and it doesn't seem to change anything. I refer back to one of the images I posted previously, this is still happening, Click image for larger version

Name:	fsm_enum_issue.jpg
Views:	57
Size:	58.4 KB
ID:	1458010
    basically, the anim graph is correct and the state should be on acceptinitialbets, however, the debug (and a printstring attached to the update function for attract_dealcards) confirm that the state machine is running and talking to blueprint correctly, but the state that is being output as the active state is somehow different/detatched from my enumerator. (and now also from the state which the anim bp is in)
    Attached Files
    Last edited by wasti; 04-09-2018, 03:38 PM.

    Leave a comment:


  • replied
    The "red event" node I was referring to is a new node you can use from any Animation Blueprint Class.
    Did you try to use this one?
    It's what we use on our projects instead of re-parenting AnimBPs (to sync FSM States to Animation States):

    Leave a comment:


  • replied
    hmmm, no set state nodes anywhere. I'm currently moving my code from being all in the game mode (and being dependent on that enum) to their respective functions in my newly created bp_fsm_component.

    I would be willing to share more of my project/issues in a more private context as this project/game is going to be released, ect ect. (if you want to know more of the issues I've faced/want some feedback on what could be added to the wiki article to help future users out)

    Leave a comment:


  • replied
    Are you using "Set State..." nodes anywhere?

    When using FSM Animation BP (which is optional btw), on the Pawn/etc you should never use Set State nodes then.
    The Anim BP will always try to control by itself the State your FSM Component is at, so you have to make sure the Target FSM name in your Anim BP is exactly the name of your FSM Component attached to Pawn.
    States out of sync in that case seems to be due to the Anim BP not able to find the FSM Component at all.
    ​​​​​​
    Also, reparenting your Anim BP isn't a requirement anymore. There are new animation nodes (red events) that can be used in any AnimBP Graph now.

    Leave a comment:


  • replied
    It's no problem; I'm used to dealing with a lack of documentation. Definitely helps that you respond so quickly


    I guess the root of my issues is this node Click image for larger version

Name:	fsm_states_enum.jpg
Views:	55
Size:	14.7 KB
ID:	1457952

    Like I was saying, it seems that the state enum being output by any of the fsm component events (onUpdateState, ect) is different than the enumerator that I have created and named Enum_States.
    Attached Files

    Leave a comment:


  • replied
    Originally posted by wasti View Post
    Awesome, I didn't see that in the wiki article. I'll try it and let you know. Thanks
    This is my fault btw...
    I have to learn how to create better documentation. Things seems obvious to me then I don't remember to mention them when writing how-to guides.

    Leave a comment:


  • replied
    Awesome, I didn't see that in the wiki article. I'll try it and let you know. Thanks

    Thank you for the fast replies.


    Well that seems to have cleared up not being able to generate functions. However my enumeration still seems really messed up. Here is a screenshot showing the enum should be on the state "AcceptInitialBets" but in game, the FSM debug is reporting the state to be "Attract_DealCards".
    Click image for larger version

Name:	fsm_enum_issue.jpg
Views:	59
Size:	58.4 KB
ID:	1457944
    Attached Files
    Last edited by wasti; 04-09-2018, 02:35 PM.

    Leave a comment:


  • replied
    Originally posted by wasti View Post
    I downloaded the 4.19 launcher version and then installed to engine via the launcher for 4.19 and then copied the plugin directory from the 4.19 engine/plugins/marketplace to my source built dir.
    {"data-align":"none","data-size":"thumb","data-attachmentid":1457929}
    Hmm... I see in your screenshots that you have attached a "raw" FSM Component to your BP_Pawn asset.

    "+Functions" ( function generator ) only works when you create a Blueprint asset for your FSM Component... (right click Asset Browser --> Synaptech menu --> New FSM Component).
    And then within the new FSM Blueprint created you can generate functions.
    ​​​​​
    If you try to generate functions from your class instead of a Blueprint of type FSM, Unreal ignores you because it knows the Code Reflection system won't work in that case.

    If you don't want to create a FSM Component Blueprint then you have to create all your functions by hand... It's the way Code Reflection works.

    TLDR:
    Attached "raw" FSM Components and FSM Blueprints are different things.
    You can create a FSM Blueprint and still attach it like a normal "raw" Component, so is always better to create a FSM Blueprint asset unless you don't use "Auto-Flow" or go full C++.

    Leave a comment:


  • replied
    As far as generating the functions, I can get away without. My main concern/issue at the moment is the enumeration difference between what is output by the anim bp's state machine, and what my enumerator is.


    I downloaded the 4.19 launcher version and then installed to engine via the launcher for 4.19 and then copied the plugin directory from the 4.19 engine/plugins/marketplace to my source built dir.


    I did just attempt to recopy the 4.19 launcher plugin to my source built directory and it did want to recompile again.
    Last edited by wasti; 04-09-2018, 02:39 PM.

    Leave a comment:


  • replied
    If the button to generate functions doesn't work on 4.19 that means you're not using latest plugin version downloaded from Launcher.
    4.19 only works with latest plugin release, EpicGames changed too many things on 4.19 and older code won't work if you simply recompiled DLLs instead of downloading new plugin source.

    Leave a comment:


  • replied
    Hi Bruno, Thanks for making this, once working, it should solve some implementation problems I was having for a game I'm making.

    I'm using 4.19 built from source from git.

    My generate function's button doesn't seem to do anything.
    Enabling Debug on the FSM component shows me a bunch of warnings about the functions not being found.


    Also, My enumerator just seems to be detached/different than the enumerator being output by the anim bp.



    When playing with debug on, the state that is being output is different than the state defined in my enumerator. I've read the wiki article multiple times and can't seen to find much info on if we are just meant to make our own enumerator in blueprint, define it in c++, or if it gets generated from our anim bp or something like that?
    Last edited by wasti; 04-09-2018, 02:39 PM.

    Leave a comment:

Working...
X