BUG: maximum number of State Machine connections?

Using UE 4.7.2

I have a very complex AnimGraph State Machine, which controls all sorts of stuff.

I was messing around making new connections today and noticed that, when I did, I was able to break other connections entirely by accident.

Here’s what I eventually did: I had everything working as expected. I made a new connection between two states, and I set the transition rule to False (i.e., the State Machine should NEVER be able to take this transition), and other transitions in the State Machine started to break; events weren’t firing like they should, transitions were getting interrupted, etc.

Now, correct me if I’m mistaken, but a State Transition with a rule of False should be EXACTLY the same as no transition rule existing. As long as the new transition has a rule of False, why should the behavior change AT ALL?

What’s even stranger is that the desired behavior will eventually work… sometimes. But it’s not reliable. And once I delete this blank connection, everything returns to normal.

Where this gets even weirder: the transition rule itself isn’t on the State that it breaks! The State whose behavior begins doing unexpected things is not the one I’m creating this blank connection on, it’s a completely different state. It’s like the number of connections from this one state has gotten so high that the engine itself just throws its hands up, says “I’m not managing all of that”, and starts ignoring other state transitions it’s supposed to take.

Followup: I tried making the “blank” connection again, and then deleting a different connection from the same node (just to make sure it didn’t have something to do with how UE4 handles always-false transitions); the behavior works as it should again

It seems that no matter what the configuration is, a single State Machine state cannot have more than 9 outgoing connections. Once you add a tenth, other transitions start breaking.

For anyone else facing this, the workaround is just to “pass through” to another conduit or state. If I need A to transition to B but I’ve already got 9 other transitions, I can just have A transition to a Conduit based on the transition rules for A>B OR A>C, and then feed that conduit out to B and C based on the specific rules. At least that’s what worked for me.

Still, if this is a known limitation, it would be nice if the engine alerted you that you had too many connections rather than just dropping them without warning.

Hi RhythmScript,

Can you provide the assets so we can isolate the problem and determine if this a bug with the engine. (Being unable to reproduce the issue here, I posted a “best guest” comment before realizing the best way to accurately gauge this is with the assets themselves.)

Thanks

I’ll put the entire project up on my dropbox tonight with detailed repro steps, but I warn you: my AnimGraph is like a bowl of linguine. My commendations to anyone on Epic staff who can make heads or tails of it even when it DOES work how it’s supposed to :stuck_out_tongue:

okay, so here’s the project.

Play in editor; while moving, hold the shift key. The character should leap through the air, then when he hits the ground (continue holding shift) he should begin to fly along the ground. While flying, press spacebar; the character should do a frontflip-jump, then resume flying along the ground. This is the intended behavior.

In the state machine, when you press Shift while moving, the game sets a bool flag that tells the character to “dodge”. Once the character is in the Dodge state, the game checks to see if the player is still holding the shift key when the character lands; if so, rather than playing the dodge landing, it sets a flag for Initiate Dash which transitions the player to the Dash State (by way of a second Dash Begin state which plays a special anim).

When the player is dashing, pressing jump will set a flag that indicates that the player has double-jumped and transition him to the double-jump state. From this state, the game checks to see if “Resume Dashing” is true; if it is, at anim end, it re-cycles back into the dash state.

Now here’s the bug: from the DODGE state (not the Dash state), create a new connection. You can drag it to any state; you can create a new State, even. The transition rule can also be whatever you like; to prove a point, set the transition rule to False, so that the transition you’ve just created off of the Dodge state cannot EVER be taken.

Now, do the dashing-jump example from the beginning again; note that now, when you try to jump, instead of doing the proper frontflip anim, the game just sort of barely hops the player above the ground without any animation change at all.

Why is this happening? You created a new transition–which cannot even be taken–from the dodge state, and it’s breaking transitions from the dash state.

Hi RhthymScript,

Using your files and following your concise instructions, I was able to reproduce your issue and have reported the issue as a bug in the following report JIRA [UE-11958]. Should this be addressed in a future build, an update will be added to this post.

Meanwhile, you may be able to split the logic between two “Dodge” States (ie. Dodge1 and Dodge2) with around 5 connections each.

Thanks for your detailed report of the issue.