Montage Queue Next Section?

Hi,

I am currently working on a case of an animation montage for swinging a sword. The functionality is quite simple:

  • Button down to draw back the sort in preparation for a swing. (section 1 ending with section 2)
  • Keep the button down to loop the waiting animation (looping section 2)
  • Button up to swing. (section 3 only triggered by input, ends montage)

The idea is that the button events would “queue” the next section of the montage to play ONCE, when the current section ends, without changing the pre-set default order of the sections for the rest of the montage. For example, if the player inputs button down during section 3, I would like the section 1 to play next (not instantly), but only once, not always and forever more.

My problem right now is that I only have 2 options for handling the next section of a montage:

  • ‘JumptoSection’ is a one off action, doesn’t scramble my original setup, which is what I need, but it doesn’t wait for current section to finish, it rips the animations, abolishing any intended smoothness, which is what I can’t have.
  • ‘SetNextSection’ waits for the current section to finish, which is what I want, but it messes up the order of sections I pre-set in the editor permanently, until that instance of the montage is over. I tried to use this, but every time the ‘Next Section’ starts I have to undo what this node did and it’s getting out of hand.

Can you please suggest how I can do this? Do you think it’s a good idea to request a “QueueNextSection” feature?

Kind regards,

Marcin Dudkowski

Hi Marcin,

To handle this I’d probably add a decision branching point notify on the end of the last section which will decide whether to jump back to the first section if the button is down and we should do another wind-up. This would essentially conditionally loop your montage if the user keeps requesting attacks.

Hopefully that’s helpful. If I’ve misunderstood what you’re trying to do or you need more help just let me know.

Thanks,

Benn.

Hi,

We think this post contains useful information which we would like to share with our public UE4 community. With your approval, we would like to make a copy of this post on the public AnswerHub which includes the discussion but strips out your username and company name. Please let us know if you are okay with this.

Thanks!

Hi Benn

My apologies for the late reply. I am currently resolving this with branch points like you mentioned, because I have no other choice. There are however many problems with this approach:

  • I need to create a branch point at the end of every single section in the montage. I don’t know how it looks in your current version of the engine, but I am in 4.6.1 and in mine, sliding branch points into place is a struggle that makes me want to throw my mouse out the window as they constantly just randomly snap to random frames along the timeline for no reason. I would much rather use a much more modular and definite point in time - “the end of the current section” to trigger the event.
  • Branch points do not attach to the sections at all, which means that if I make the slightest change to the length, order, play rate or anything at all within my montage I have to re-adjust all branch points beyond that point, enjoying all the circumstances explained in the previous point.
  • The idea for the “Queue Next Section” was such that the function would do its job at the moment it was called. The player would not have to keep holding the button. When the button is pressed the next section is set, if a different button is pressed before the section ends, it can override what section plays next, but that next queued section will only start playing after the current one is finished. I know this sounds very much like “SetNextSection”, which I mentioned before, but “QueueNextSection” would not change the order of sections in further loops. It would make the section jump once, and when the loops come back around to this point, and no input is used, the montage continues as it was set in the editor, as if nothing ever happened.

I wrote my own function which does this in the animation blueprint. I achieved this functionality by using a name variable called “QueuedSection”, which can be set to a Section name or “None”. I have a branch point at the end of every section which checks the value of “QueuedSection”; if it’s “none” nothing happens; if not, I use “JumpToSection” of the provided name, then set “QueuedSection” back to “None”. Player Input sets the variable to the name of the desired next section; another input calls “ClearQueuedSection” which also sets it to “None”.

Now that it’s clear to me that this is the only way to do this right now, I am still wondering, do you guys think this would be a worthwhile function to add to the bundle of default engine animation functions?

Kind regards,

Marcin

Hi again Marcin,

I’m sure it would be useful to programatically add queued section yes, I’ll raise the issue with the wider animation team and see if that’s something we’d find useful and we’ll add it to our backlog if we think something is missing there.

I wanted to address a few points from your answer to get some more information:

  • “randomly snap to random frames along the timeline for no reason” - Any idea at all what they’re snapping to there? They should only attempt to snap to sections and the begin/end of the track.

  • “Branch points do not attach to the sections at all” - if you select your branching points you should see the picture I’ve added below in the details panel. By setting the link method to proportional or relative the branching points should stay attached to the section they are in. There are one or two issues when reimporting some of the sequences that we are currently investigating but hopefully they should be resolved soon.

44877-animlink.png

Thanks for your feedback!

Benn.

Hi Benn

I wanted to give you more details about this, but it looks like it’s bugging out randomly, because right now I was unable to reproduce either of those 2 issues. I know it’s not much help in this case, but I can tell you all I can remember happening when it was bugging out.

  • Branch point would snap to seemingly random frames in irregular intervals along the timeline, as if there were pre-determined points on the timeline specifically capable of having branch points. Mind you, there were multiple within each Section and animation, in addition to section start and end point.

  • My UI looks a bit different to yours, probably because I’m still in 4.6.1. I didn’t mention it before but I have tried setting the LinkMethod on my branch points. All that did was removing my branch points from the timeline if I used any other setting than Absolute. The branch point would simply disappear until I right-clicked on the timeline and chose SetElementsTo: Absolute. Then they would come back.

44878-ui.jpg

As I said, this time around annoyingly everything is working fine, obeying the old rule that if you want to show someone something is broken it will work, so unfortunately I cannot give you any more details.

Thank you for elevating my queue section node idea.

Kind regards,

Marcin

Hi Ben,

No problem at all.

Thanks