SakeTami
Megan Fox
Megan Fox

patreon


Been a minute, so lemme show you my hordes

Sorry for the lack of updates, I've been head down in intense C++ coding land doing, well. THIS. Getting this to work took an absurd number of incremental steps, some of which I'll probably do blogs about later, but BEHOLD. 6k mooks, rushing across a field, all animating and moving independently, at above 30fps, in a scene that's overall also not terribly optimized (that grass and hedge are kind of silly expensive).

Lemme give you an overview at least. This won't tell you exactly how to produce the above, but it'll point you in the right direction.

(also the music in this video is Bloodywood, just what I've been listening to lately - they're GREAT)

The Animated Mooks Themselves

What I'm doing here is Vertex Animation Textures, or VAT for short. The single best video I've found on the subject, from an Unreal context, is this guy right here: https://www.youtube.com/watch?v=vrlFozqB0jA

What he's talking about, AnimToTexture, is a plugin that already exists in Unreal! Has since somewhere around UE5.0.

However.

It's almost entirely undocumented, and lacks the baking tooling necessary to turn animations into the VATs (the textures that contain the animation data) you need to feed into the system. Which is why everyone says "use Houdini!", because Houdini makes VATs pop out really easy. Except that Houdini is terrible for humanoid animation, so this kinda waterfalls everyone down into this assumption that AnimToTexture, and VAT in general, is for when you want to bake the animation of a breaking wall. Or fluids surging around. Or at most a cloud of awkwardly animated crows/etc but it's fine cus they're small and seen at a distance.

All of which being predicated on an incorrect assumption, because oh ho, AnimToTexture DOES contain a baker! But no one really knew about it, because of how specific and hard-coded and obscured it was.

That's what video-guy there is doing. He walks you through what VAT is, and introduces you to a tool he made by ripping apart the stuff already in AnimToTexture to figure out how it works. His tool isn't perfect, it still took me a solid week of fighting with this to get everything working, but it does work. It WORKS.

And now I have 6k mooks surging across a field!

The Movement

You'd be forgiven for thinking these are ACharacters, aka the things in Unreal that have pill bodies and you can give them movement input and they do the thing.

Nope! Those are too expensive. You'll cap out on FPS way, waaay before you get many of them into a scene, especially if they're all running unique AI and Sense components and so on.

So instead, those guys don't exist. I mean that somewhat literally: all those Mooks are just instances of a static mesh. Since VAT is how I pass in the animation data, I pass that in as per-instance CustomData in the Instanced Static Mesh Component. Note that I do explicitly mean an ISM here, not a Hierarchical ISM. The former can use Nanite, the latter can not, and you REALLY want Nanite to make these work.

But anyways, that means these guys are just, points. Literally all they are is points floating in space. The trick to making them move is this:

Not only do you want to drive them purely with traces (I do two traces, one forward for movement and one down for gravity/standing detection), but I run them as async traces. That means I emit the traces at the end of one Tick(), then the following Tick(), I check the results. This technically means that their movement is always lagged a frame, but the results speak for themselves.

The above shows the code for the forward/movement traces, but the gravity is roughly the same, just longer.

You end up having more complicated conditionals on the processing, because to you're faking the vertical collision space of a pill collider here. Means you gotta detect ceilings separate from grounds, apply standing or not, etc, it's a whole thing.

In context, it's pretty simple:

Note that I'm doing a bulk update of the instance transforms here. That's another important bit. The long and short of it is that to pull this off, you'll be working in C++, since neither async traces nor bulk FTransform updates are BP-compliant.

Conclusion

So yeah! That took a while to get working, but it was worth it. Apparently folks didn't realize what kind of game I was working on until I showed this, so, heh, surprise? Maybe? Wasn't a secret, but I'm guessing folks not actually in Musou-space don't have the innate sense of genre for it that they do for other genres. Bit niche. Also I'm not technically making a Musou anyways but, you'll see!

Probably more on this later. Haven't even had coffee yet. Just realized it had been too long since I showed y'all something cool. Sorry about that! Please stick with me though, I swear I will keep showing you Cool Shit. Also, as always, thanks a ton for the support! Y'all really do take the edge off my expenses with what you contribute in here- my burn rate's kinda shockingly low cus of living in the sticks and so on, so even a few bucks really does make a huge difference. So anyways- Toodles!


More Creators