“Personally, I don’t even think that whole code should exist.
I’d have just 1 idle state returning 1 idle, and play a montage on top of it to handle holding a weapon.”
Ideally, yes! I don’t know how tho? From the char-bp, I’m not seeing how I can do anything but play a montage or run a query against a montage currently playing, it’s position, etc. I don’t see how I could call/blend a montage from the char-bp with what’s going on in the anim-bp. Do I run my idle-state in the char-bp and eschew the anim-bp alltogether?
The reason I have the multiple checks on crouching was the blend-by-enum requires a default pose but I am also blending by bone to basically take the spine_1 (and up) of the weapon and plop it on top of the locomotion, so one can crouch, run, walk, etc with whatever weapon. In practice it works well enough, but I couldn’t seem to sample the crouch-check twice; a pose-output can seemingly only go to one input. Given there would be overhead for making and checking a cached pose and it was only between two animations I already had loaded & sampled, I assumed (hoped!) Unreal wasn’t so inefficient as to double-up on things… Anyways, look at the whole thing like a giant lerp where you blend a and b by a, back onto itself for a smoother blend. If there is a better/more-performant way, I’m open for input 'cause I can’t seem to see it… (sheepish-grin/shrug)
For context, I’ve noodled around with the animation logic before and had previously cobbled together several iterations of what I am working on here. However, I found in my travels, since I had to consume animations vs creating them, no one set seemed to have a cohesive group of idle, walk, run, sprint, crouch, etc… One would have to aggregate multiple animation-sets to solve the problem of “I need a fleshy critter to walk, crawl, run around a space & open doors, pull levers, etc”. I did make this mostly work but the disparate sources for the animations just made it look too awful for even my compromising-standards…
I simply do not have the skills/time to really animate things; I’m just no good at what I’ve tried either. So! I am working with the Amplify Animation Pack (Amplify Animation Pack in Animations - UE Marketplace). It has all the animations I want via done via a single-source so they are all cohesive and as well all the trace-logic for wall-checks, cover-checks, swim, climb, etc. I’m comfortable coding and have had no problems taking state-machines from the anim-bp and getting it to work as logic in the char-bp, moving code around, etc. Even just for the animations themselves, it’s a good collection.
Here, I need to marry several animation products (mainly weapon-stuff) onto the locomotion portion of this code-set. Assume I can do anything in this regard in making what run where, I would like to know a performant way to run this. Fastpath was a perfect response given I can retool the code-set, that’s more a housekeeping thing. Otherwise, I am not looking for a perfect solution, I get that my case is my case, but obvious dumbass things to NOT do, or correct what I explain I am trying to do is appreciated.
Ideally, here is what I need to get working, functionally:
- the legs, left-arm, right-arm, and spine-torso-head would be things holding distinct motions/animations I would want to blend together (4, maybe 5 sections of the critter). Think Dark Souls as a functional-metric. (eg: arms hold weapons/items, legs crouch, run, etc; and the torso just kinda is, to be blended as required for hits, locomotion and the like).
- I’ve already got the top/bottom halves working ala the blend by bone in the picture above and the thought was once I got the ‘best/better’ way to implement that working, I could flesh out the rest of the tree; I’ve already cut the guy in half to get what I want, so making more sub-sections is more of the the same… I already have animations ready to go, just before plopping everything in asking on what don’t I want to waste my time against.
Is it worth creating a state machine for each ‘section’ of my guy (left-arm, right-arm, legs, torso, etc) and just blending them? In each, I assume I’d still have to blend by enum based on what part holds what, but I know that logic (or whatever I need) can be made to run ala Fastpath, and the set of things per state-machine is somewhat limited. For now I am going by weapon-type so all greatswords will share the same path in the animation-logic and I will only have several classes of weapons. I have other ways/logic to make the game combo-interesting, etc, etc. This line of inquiry is strictly for locomotion to get the character to move around an reflect what they are holding.
Just to say, I have a lot of good feedback on this, so I could certainly put together a cheat-sheet for other n00bs. Everything is appreciated.
EDIT: As for the video thanks. The structure of the product is very very similar to what you see in the video. As it’s a marketplace thing, I don’t feel too comfortable posting their code into the thread, but sufficed to say, the breakdown of state-machines around idle, motion, turning in place, and other actions is along the lines for what Laurent breaks-down. Multiple state-machines for different locomotion states blended by enum/bool, all on fastpath. Seems I broke it when I migrated logic to the char-bp and went with refs inside the anim-bp (when I thought to try swapping anim-bps)… I fixed that…