A Global Animation Base - Lua Driven

I’ve posted about this in the GMod discord a month back and am leaving updates in my own discord, so why not populate the new coding section with something pretty.

I’ve been working on reliably adding animations without needing it to be compiled into the model. It essentially uses a re-written version of Jetboom’s API to run the anims, with more QC-like features added such as blends, weightlists, and some others. How is this different than just Jetboom’s API? I’ve been working on a re-implementation of Bone Manipulation on Gmod that is more optimized and supports no-networking and reduced-networking capabilities, meaning you have hitbox syncing. As a bonus I also made lua-implementations of hitboxes for NPCs or entities that rely on OBB for their traces.

What I Got So Far

  • NPC, Player, pretty-much-any-entity-so-long-as-it-has-bones support
  • Reduced networking traffic on standard server-side bone manipulation [GLOBAL]
  • Ability to completely disable bone manipulation networking for shared manipulation [ENTITY]
  • Replicating QC operations for a more natural work flow. Maybe I can read QCs in the future, IDK
  • SMD parsing for direct importing. Can support lua-based anim definition when parsing ( IE: reference )
  • Bone retargeting in-game ( Not as complicating as it sounds )
  • Lua implemented hitboxes
  • PAC3 / Jetboom Legacy support

Here’s some big ones

The Bone Manipulation
This is probably a huge highlight for most people. Bone manipulation on server-side absolutely eats your server’s performance because of the networking traffic. Outside of sending ALL the bone data ( even those unused ), I think it’s also using Usermessages? I can’t be sure there. So I just suppressed all the original bone manipulation on the server and created my own handler for them.

Here’s a simple before and after with approximately 16 bots having serverside-only bone manip.



All I’ve done for these is use the net library on my handler. I can probably extend this further with actual compression. But the efficiency bonus is high already. The new bone manip should improve all addons that use it if just used in the “improved networking” mode.

Not really gonna put any videos of the “shared-manip” mode since it’s exactly the same, just with no networking. Hitbox doesn’t suffer.

Animation Retargeting
Considering I’ve spent the better of the past few years porting animations, this was pretty much top priority for me. There’s a lot of problems with different skeletal structures, from roll to reference posture. The in-game retargeter is honestly really simple, but really powerful. Take a bone, match it with a different bone, apply offsets/rotations. Here’s an apex animation being retargeted in-game:

You may be screaming WHY IS HE NOT MOVING? Walkframes ARE SUPPORTED but disabled in this video because I needed to show off the hitboxes actually being aligned. It can be defined per animation, or even when calling said animation. Realistically anything that manipulates the root bone becomes an unintentional walkframed animation.

I will probably add caching to the retargeting operations for more commonly used animations. Need to wrap my head around the BEST implementation here.

I also have my own personal Blender scripts for retargeting and bone alignment between different skeleton structures that can cut the middle-man for the above. I’ll probably release it along with an export tool similar to Buu’s

Bottom of the Thread
More media later / when I get back to working on it. The objective is to get a solid basis and then open-source for implementation feedback.

Right now I am working on handling animation layers in a logical way for shared-manip mode. Each layer needs a cycle sync, and there are potentially infinite layers that can be made. Obvious issues.


Woah, I didn’t even know animation retargeting was going to be a thing. Very cool!

1 Like

Yeah it wasn’t that much to add it in. Originally it was just a regular bone name translator but the post processing of the anim is REALLY easy.

I want to make this as dev friendly as possible so I will probably allow you to do the retargeting in-game with an editor. The translations would then need to be appropriately converted but since they are all relative to parent the twists will actually be simple