Code Monkey home page Code Monkey logo

als-refactored's Introduction

Advanced Locomotion System Refactored

Completely reworked and improved С++ version of Advanced Locomotion System V4.

The main goal of this ALS version is a complete and high-quality refactoring of all aspects of the plugin to make it easier to understand, flexible, reliable (especially in network multiplayer), performant, and simply more enjoyable to work with.

Features

  • Reworked plugin structure. Content is separated into 3 categories: ALS - main content, ALSCamera - camera-related content, and ALSExtras - other optional content
  • Use of multiple linked animation blueprints instead of a single monolithic animation blueprint.
  • Use of animation layer interfaces to dynamically switch overlay states at runtime instead of directly referencing them in animation blueprints.
  • Use of the Control Rig plugin for IK and other bone manipulation tasks instead of animation graph nodes.
  • Significantly reduced the number of virtual bones required by the plugin.
  • Added the ability to disable the use of IK bones and use only virtual bones for all bone manipulation tasks, which can be useful in cases where IK bones are not animated in your custom animations.
  • Added a skeleton asset action that can help set up all the necessary skeleton stuff: animation curves, slots, virtual bones, etc. It can be accessed by right-clicking on the skeleton asset -> Scripted Asset Actions -> Setup Als Skeleton.
  • Reworked foot locking to make it more performant and reliable, especially in network multiplayer.
  • Reworked foot and pelvis offset logic for smoother movement of the character on stairs and sloped surfaces.
  • Added Slot overlay animation curves to control the blending of overlay poses with animation montages played in Layering animation slots.
  • Added Blend Curves and Blend Poses by Gameplay Tag animation graph nodes. Blend Curves blends animation curves without the need for the VB curves virtual bone, and Blend Poses by Gameplay Tag is similar to Blend Poses by Enum but uses gameplay tags instead of enum.
  • Moved thread-safe animation instance logic to the worker thread to improve game thread performance.
  • Replaced C++ enums such as EAlsOverlayMode with gameplay tags, allowing new entries to be added without code modification.
  • Reworked UAlsCharacterMovementComponent for better movement synchronization over the network.
  • Reworked mantling. Implemented as root motion source for better movement synchronization over the network.
  • Reworked camera. Implemented as a component similar to the standard camera component, no need for custom APlayerCameraManager or APlayerController classes.
  • Reworked debug mode. Toggled by pressing Shift + [1-8] or using console commands such as ShowDebug ALS.Curves.
  • Use of Push Model for more efficient replication.
  • Use of the MetaSounds and Enhanced Input plugins.
  • Support for Update Rate Optimization (disabled by default) and Large World Coordinates.
  • A lot of other fixes, improvements and refactorings.

For more information, see the Releases. Reading the changelogs is a good way to keep up to date with the newest features of a plugin.

Supported Unreal Engine Versions & Platforms

Plugin Version Unreal Engine Version
4.13 5.3
4.12 5.2
4.11 5.1
4.10 - 4.9 5.0
4.8 and below 4.26, 4.27 and 5.0 Early Access

The plugin is developed and tested primarily on Windows, so use it on other platforms at your own risk.

Quick Start

  1. Clone the repository to your project's Plugins folder, or download the latest release and extract it to your project's Plugins folder.
  2. Merge the DefaultEngine.ini and DefaultInput.ini files from the plugin's Config folder with files from your project's Config folder.
  3. Recompile your project.

Known Issues & Discussion

  • See the Issues page for list of known issues.
  • See the Discussions page to discuss anything about the plugin and ask questions. Please do not open an issue for questions.

License & Contribution

ALS Refactored is licensed under the MIT License, see LICENSE.md for more information. Other developers are encouraged to fork the repository, open issues & pull requests to help the development.

als-refactored's People

Contributors

alex-g avatar ameaninglessname avatar canishelix avatar colorindarkness avatar dobrosun avatar godofmemes avatar sam-tak avatar sixze avatar watsonsong avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

als-refactored's Issues

Reduce nesting in ALSEditor.Build.cs

Inverting the if statment, could improve code readability and maintainability.

Replace

		if (Target.bBuildEditor)
		{
			PublicDependencyModuleNames.AddRange(new[]
			{
				"AnimGraph"
			});

			PrivateDependencyModuleNames.AddRange(new[]
			{
				"BlueprintGraph"
			});
		}
	}

With

		if (!Target.bBuildEditor) return;
		PublicDependencyModuleNames.AddRange(new[]
		{
			"AnimGraph"
		});

		PrivateDependencyModuleNames.AddRange(new[]
		{
			"BlueprintGraph"
		});
	}
}

Camera can go through wall

hey Sixze,
thank you for the great refactor of ALS 👍

I noticed a small issue while testing.
the camera can sometimes go through the wall.
ALS

Issues that I've found.

ALS Refactored

Ragdoll Issues

  • #61
  • Jumping, using ragdoll in less than a second after the jump and getting back to the normal state in mid air launches you futher and can lead to mantle on higher places than usually reachable ones. (This one is more of an enhancement, but it can perhaps fix a small advantage if used in an official game.)

Collision Issues

  • If you go near an object doing a linear movement towards the character, the following object will teleport this one in a glitchy and unusual way by attempting to push.
    Be sure to play with thoses bugs for a little while in order to find some details that might help fixing everything.

Wishing you an amazing day from Canada,
-Simon 👍

Compile error ue5-main

Hi

I just tried to add this to my project which is ue5-main branch.
I cannot compile and not sure what local fix could be.

Attached the error sample.

Let me know if I am doing something wrong.

Thanks
als-error.txt

Collision issue on Linux and Android.

On Linux and Android sometimes you got stuck and you can't move anymore.
If you try to move the camera flies inside you, and you stay in the same position.
It happens randomly, but I noticed that it happens often if the Ai runs into you.

After the latest fixes in the "main" branch it is not possible to pack the project, I checked on 4.26, 4.27

After the latest fixes in the "main" branch it is not possible to pack the project, I checked on 4.26, 4.27

UATHelper: Packaging (Windows (64-bit)): ERROR: Unable to instantiate module 'UnrealEd': Unable to instantiate UnrealEd module for non-editor targets.
UATHelper: Packaging (Windows (64-bit)): (referenced via Target -> ALS.Build.cs -> AnimGraph.Build.cs -> BlueprintGraph.Build.cs -> KismetCompiler.Build.cs)
PackagingResults: Error: Unable to instantiate module 'UnrealEd': Unable to instantiate UnrealEd module for non-editor targets.
UATHelper: Packaging (Windows (64-bit)): Took 0,9541547s to run UnrealBuildTool.exe, ExitCode=6

game target build fails

AlsAnimNode_GameplayTagsBlend.cpp(22): [C3861] "RemovePose": Identifier not found.
AlsAnimNode_GameplayTagsBlend.cpp(29): [C3861] "AddPose": Identifier not found.

these functions are only in WITH_EDITOR builds available.

Rolling problem in main branch

In the main branch version rolling stopped working after a fall from height, in version 4.7 it was still OK, adding a landing event on a character and calling the "try start rolling" function has no effect.

Cant package 4.27

The game works fine in editor, but when I try to package it it gives me this error:
image

ALS Refactored with Smooth Sync

Discussed in #20

Originally posted by emrehan98 September 21, 2021
Hey, Sixze.

I've been trying to implement Smooth Sync with ALS Refactored. Smooth Sync is a plugin that simply smooths player location over network so even in extreme movements, such as climbing, flying etc. it gives you very smooth results over other clients and server with no effort so you don't really worry about custom movement and jittering problems.

But in order to make it work, you need to disable "Replicate Movement".

When I disable "Replicate Movement", ALS Refactored still functions pretty well but one thing that doesn't work is turn-in-place and I couldn't find the reason. I implemented my own variable to fix that problem but it wasn't the perfect solution as the result was jittery. (Animations are jittering, not the rotation.) I'm not CPP programmer, I can just read the code and make sense of it, do some little stuff so my solution is obviously not the best one.

OTVCeggxtL.mp4

Here's what I did.

ILge0SLRIl.mp4

I guess when I disable "Replicate Movement", ViewRotation no longer replicated in other clients so only owner can see animations work properly. I'm not sure if it's out of scope but it would be a huge help to make ViewRotation "Replicate Movement" independent so I could use both plugins. But if you can point me a direction that would be amazing too.

Just sharing utility tool for ALS

ALS-Refactored_utility.zip
image(71)

Sharing a simple utility tool that adds ALS VB and Sockets to the new Skeleton mesh.

PS: Thank you for your amazing work!!!

If I could just recommend is to also work on separating mantle and camera. Something like ALS Community has it. This would make an even much more modular ALS system.

Violation issue when I use Blend Curves.

Hey there.

I was updating ALS and I saw there was new nodes called "Blend Curves". I copied them to my own AnimBP and had no problem. But as soon as I package the game or try to play it in "Standalone" mode it crashed and said there is a violation.

image

If I remove those two nodes there is no problem.

image

Did I broke something while updating the plugin? If any information needed I can provide that.

Thanks!

Sixze ALS vs AlexG ALS

I made a quick diff and noticed that Sixze version seems a little more polished, but AlexG version is mantained as well. Is there any special difference between the two? Thanks

some suggestions

i got some errors fixing in bp that is easly to so for the legs stretching ...
update me and ill send you an example :)

Unable to create new BP based on AlsCharacterExample class.

The CastChecked for the AnimationInstance (AlsCharacter.cpp line 87) gives a hard crash during PostInitializeComponents so the anim instance can never be set up for a new inherited BP. I converted to regular cast and works to let me into the new BP to set it up. Maybe log an error letting the user know what is missing rather than the checks on init?

Compilation error UE5 Final

ALS Refactored (main)

Błąd C2664 "FVector UAlsMath::ClampMagnitude01(const FVector &)": nie można dokonać konwersji argumentu 1 z "UE::Math::TVector" do "const FVector &" ALS_GAS_Refactored E:\UE5\ALS_GAS_Refactored\Plugins\ALS-Refactored-main\Source\ALS\Private\AlsAnimationInstance.cpp 266
Błąd C2664 "FVector UAlsMath::ClampMagnitude01(const FVector &)": nie można dokonać konwersji argumentu 1 z "UE::Math::TVector" do "const FVector &" ALS_GAS_Refactored E:\UE5\ALS_GAS_Refactored\Plugins\ALS-Refactored-main\Source\ALS\Private\AlsAnimationInstance.cpp 272
Błąd MSB3073 Polecenie „C:\UE_5.0\Engine\Build\BatchFiles\Build.bat ALS_GAS_RefactoredEditor Win64 Development -Project="E:\UE5\ALS_GAS_Refactored\ALS_GAS_Refactored.uproject" -WaitMutex -FromMsBuild” zostało zakończone przez kod 6. ALS_GAS_Refactored C:\Program Files\Microsoft Visual Studio\2022\Community\MSBuild\Microsoft\VC\v170\Microsoft.MakeFile.Targets 44

Footsteps on Physical Materials

Discussed in #34

Originally posted by FredlyDaMoose October 19, 2021
Has anyone else experienced problems with the footstep system not working correctly in their project? From what I can tell, the trace that it does in the footstep anim notify doesn't return the physical material. The only time it works for me in on the right foot when jumping. I have all the physical material and surface material information set up correctly.

Mantling onto non-uniformed scaled objects causing teleporting bug

This is a bug that also exist in blueprint version. To reproduce the problem;

1- Put some climbable object into level
2- Scale it like (X=1.000000,Y=-1.250000,Z=1.000000)
3- Try to mantle and you will see the result.

Reicha7 in ALS Discord group describes the issue like

In regards to the #🔧known-issues of " Mantling onto non-uniformed scaled objects causes positioning issues. This is due to the difficulties of vector math when changing the relative space of a location (for mantling onto moving objects)." I offer up this as a fix. The Invert Transform that was there before was not doing what you'd expect which is why the relative transform would be scuffed for any assets that had been scaled and rotated. This gets the actual relative transform and can handle all manner of scaling, rotating, and live movement.
https://cdn.discordapp.com/attachments/674116327283228682/861990451182305300/unknown.png

Also another comment

ORIGINAL FIX BY Moontal, just put everything together to pin it
Hey guys, here's a fix for the incorrectly transformed mantle target when trying to mantle non-uniform scaled primitives. The "Compose Transforms" node does NOT logically apply transformations correctly for non-uniform scaled transforms as you would expect, and so you need to break out and apply WorldToLocal/LocalToWorld transformations independently for location/rotation.
The first change needs to be made to the "ML_ComponentWorldToLocal" macro from ALS_MacroLibrary:
https://cdn.discordapp.com/attachments/671140338521341952/744250226776473640/unknown.png
The second change needs to be made to the "ML_ComponentLocalToWorld" macro from ALS_MacroLibrary:
https://cdn.discordapp.com/attachments/671140338521341952/744250360725766204/unknown.png
Now mantling should work as it was originally intended regardless of whether your meshes are non-uniformly scaled or not, both moving and non-moving objects.

Aiming snap "Problem"

Discussed in #97

Originally posted by Venom-V June 29, 2022
Hey, i just started using this ALS version on my UE5 project, and i was wondering if someone could help me improve the character behaviour when stop aiming :
https://gyazo.com/dbf4d01b3cd1670a3f86a59f472a47f7

The "problem" is the way the character snap back to face toward the input i guess, instead of smoothly lowering the gun while still looking where i was aiming (Like in base ALS). https://gyazo.com/94e55859f2e424eda44c482891cc6b22

Thanks !

After mantling, held items often disappear

If you hold an item then try to mantle an object, the item being held gets hidden during the mantle animation.
Upon finishing the mantle animation the item normally gets un-hidden.

Sometimes the item does not get un-hidden. After some quick testing, I believe the issue is related to packet loss.

Can we have some basic documentations for this refactored ALS?

This project is very different than ALS. So, what goes where is extremely difficult to understand without much guidelines. Like adding Overlay States and what will go where. How GetParentUnsafe and other functions interact with each other. How values are being moved around between linked layers? Would be nice various of it be documented.

Compile error in Unreal Engine 5.0EA2

     2>Module.ALSEditor.cpp.obj : error LNK2001: unresolved external symbol "public: virtual void __cdecl UAnimGraphNode_BlendListBase::GetOutputLinkAttributes(class TArray<class FName,class TInlineAllocator<4,class TSizedDefaultAllocator<32> > > &)const " (?GetOutputLinkAttributes@UAnimGraphNode_BlendListBase@@UEBAXAEAV?$TArray@VFName@@V?$TInlineAllocator@$03V?$TSizedDefaultAllocator@$0CA@@@@@@@@Z) [C:\Projects\FollowMe\Unreal\Intermediate\ProjectFiles\Follow.vcxproj]
     2>Module.ALSEditor.gen.cpp.obj : error LNK2001: unresolved external symbol "public: virtual void __cdecl UAnimGraphNode_BlendListBase::GetOutputLinkAttributes(class TArray<class FName,class TInlineAllocator<4,class TSizedDefaultAllocator<32> > > &)const " (?GetOutputLinkAttributes@UAnimGraphNode_BlendListBase@@UEBAXAEAV?$TArray@VFName@@V?$TInlineAllocator@$03V?$TSizedDefaultAllocator@$0CA@@@@@@@@Z) [C:\Projects\FollowMe\Unreal\Intermediate\ProjectFiles\Follow.vcxproj]

How to replace camera

I want to do two things:

  1. Add children to the camera
  2. Change the camera into a cine camera.

How can one get a hold of the camera component instance or edit the default settings?
It seems to be created by some magic I do not yet understand.
I've tried adding children to the Player's CameraManager, in BeginPlay but the children only appear when I enable the debug ; camera. Seems the only camera settings that are exposed for customisation is FOV. edit: Ahh I've found the rest of the camera settings, but still don't see how to attach children.
Any pointers? I've searched blueprints and C++ for Camera, Camera Manager, Camera Component, etc, but didn't find anything that looked like it actually instantiated a camera.

Modifying Tick Bones messes with Master-Pose

Hi,

Since tick bones is changed in code it'll interfere with using Master-Pose (which needs "Always tick and refresh bones" to work"). Maybe add some secondary bool for that?

CustomCameraBehavior

Where to find an analogue of the original function bool AALSPlayerCameraManager::CustomCameraBehavior(float DeltaTime, FVector& Location, FRotator& Rotation, float& FOV)

from ALSPlayerCameraManager.cpp

Crash Fix on ShowDebug ALS.Curves console commands

Discussed in #93

Originally posted by emaovo June 24, 2022
hi all,

I often had crashes when typing console commands ShowDebug ALS.State or other ALS. functions, due to the DebugData chain not initialized. I added the call to Super and now it works.

Just wanted to let you know in case you want to integrate it.
All the best

void FAlsAnimNode_CurvesBlend::GatherDebugData(FNodeDebugData& DebugData)
{
	DECLARE_SCOPE_HIERARCHICAL_COUNTER_ANIMNODE(GatherDebugData)
	Super::GatherDebugData(DebugData);// add at least one entry in the chain to prevent crash in BranchFlow when NodeChain is empty
	SourcePose.GatherDebugData(DebugData.BranchFlow(1.0f));
	CurvesPose.GatherDebugData(DebugData.BranchFlow(BlendAmount));
}

First person / "serverside" mode

Would you(the author) be interested in adding a "serverside mode" toggle? By that I mean a mode in which ALS functions only for the purpose of providing third person animations for other clients, but not the owner. Out of the box it's not suitable for this because it's adding rotation to the character, which affects the first person view.

Linux, Android builds are failing to compile

Android fix:
AlsAnimNotify_FootstepEffects.cpp

const auto SurfaceType{Hit.PhysMaterial.IsValid() ? Hit.PhysMaterial->SurfaceType : TEnumAsByte<EPhysicalSurface>(SurfaceType_Default)};

Linux fix:
only additional brackets have to be set
image

CanMantle() only effects Grounded Mantling

Would it be possible to make CanMantle() function so it can disable TryStartMantlingInAir() on Tick as well? Currently it only effects Grounded Mantling and there is no way to override it from the Input.

if (CanMantle())
{
TryStartMantlingInAir();
}

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.