Facepunch / sbox-issues

176 stars 12 forks source link

Expose Animgraph motor and goal system to C# #828

Open DrVrej opened 3 years ago

DrVrej commented 3 years ago

What can't you do?

Currently in C# we have no way of changing or accessing an entity's model's animgraph motor and goal inputs. This system is basically Source 2's version of the motor and goal system that exists in Source 1. It's essential for NPCs, as without it, you can't have movement frames (aka walk frames). It's what Valve uses for most of the NPCs in Half-Life Alyx, specifically their movement and turning/facing.

How would you like it to work?

This could be part of AnimEntity, and it would consist of bunch of methods to set or access animgraph's motor and goal inputs. There are many things in this system, but I will list the stuff that I think are essential:

What have you tried?

I tried many things, but was unsuccessful to access anything related to a model's animgraph motor and goal inputs in C#.

Additional context

As mentioned above, most Half-Life Alyx NPCs utilize models with animgraphs that only use this system. Parameters in animgraphs can do many things, but it has trouble with movement frames and very difficult to get it anywhere close to how smooth the motor system is, especially for NPCs. As an example I recorded a video of a combine soldier from Half-Life Alyx which exclusively only utilizes this system for all its movement and turning/facing (Click to go to the video):

TiO2EvoLve commented 1 year ago

That's right, we need it

johncosfm commented 4 months ago

Best as I can tell this still isn't possible, and it makes it way more complicated to set up good looking npc locomotion with intro and exit animations and whatnot (as in you pretty much have to replicate the entire path and facing systems with code and hacky animgraph logic, which sucks to develop and sucks to preview inside animgraph).

Is there any chance that this stuff (especially goal position) could be exposed sooner rather than later?