Has anyone here worked with that?
I’m trying to implement root-motion based locomotion system in C++ (actor is derived from ACharacter). The system is supposed to be driven by AI decision trees, with minimal modifications.
I do have root-motion-based player-controlled character movement, and now need to plug AI in.
The thing is unreal movement system works in rather unexpected way. Move To command (from decision trees) doesn’t perform actual movement, and instead sets “RequestedVelocity” field of UCharacterMovementComponent. Well, to be more precise, it interacts with UPathFollowingComponent which sets RequestedVelocity.
UCharacterMovementComponent alone has 250 kilobytes of code in it and doesn’t look like it was made with extensibility in mind (already had to subclass it to make sure root motion doesn’t override rotation).
To make root motion work I literally need to pinpoint a location where component knows in which direction it wants to go, but haven’t moved yet and I need to set motion control variables at that point.
Has someone here done that?
Working with this portion of code takes a bit too much time for my liking, and it would be nice to have some hints to speed things up.
I’m currently contemplating if dropping ACharacter base class and subclassing APawn instead would be a good idea (single player game, no networking) in those circumstances - I’m not sure if I’m getting any benefit from ACharacter functionality.