ALS-Refactored
ALS-Refactored copied to clipboard
Integrate Physical Animation Component
Physical Animation
→
When trying to integrate the PhysicalAnimationComponent, I initially tried to define it in a derived class of AlsCharacter to avoid making changes to AlsCharacter. However, this didn’t work well with the ragdoll processing, so I decided to make changes to AlsCharacter itself.
In addition, I made several improvements to the ragdoll processing. I removed all the motor drive settings for the constraints that were being applied to adjust the pose during ragdolling, and unified them under physical animation.
Also, I added a Freeze feature that stops the physical simulation after the movement of the physical body falls below a certain value or after a certain period of time has passed.
Ragdoll
During ragdolling, not only the previous Flail animation but also the Lying down pose after landing is used as the target to drive the physical animation. This makes it easier to converge to a posture that leads to the GetUp action.
In the future, it would be beneficial to make AB_Als_Grounded capable of handling a new state, Lying, and set the physical animation target during ragdolling to the Input Pose itself. This would eliminate the need for any Sequence Player within AB_Als_Ragdolling.
The naming convention for Physical Animation Profile names
If a Physical Animation Profile with a name corresponding to ALS’s LocomotionMode, LocomotionAction, Stance, Gait, and OverlayMode exists, it will be applied. Only the physical bodies included in the Physical Animation Profile will be subject to simulation, and all others will be set to kinematic.
Names should either match exactly with LocomotionMode or LocomotionAction, Stance, Gait, OverlayMode (such as Grounded or Ragdolling), or they should be a concatenation of LocomotionMode or LocomotionAction, Stance, Gait, OverlayMode in that order, separated by :.
For example, if you want a profile to be applied only when LocomotionMode=Grounded, Stance=Standing, and Gait=Running, you would name it Grounded:Standing:Running.
If there is no profile with a name that matches the current state, and there is a profile named “Default”, then the “Default” profile will be selected.
If a name starts with +, it means that the profile is to be added and applied to any other matching profiles.
If a name starts with *, it can overwrite only the physical animation parameters without affecting the on/off state of the physical simulation, after applying other matching profiles.
The *Injured profile, when the overlay mode is Injured, changes only the physical animation parameters without changing the range of physical simulation, after the Default or Mantle profile is applied.
During ragdolling, only profiles named Ragdolling or those containing Ragdolling in their names, such as Ragdolling:Injured, will be applied.
If you only create the Ragdolling profile and do not create a Default profile, the effects of the physical animation will only be applied during ragdolling.
Animation Curve
Added new curves below:
- PALockArmLeft
- PALockArmRight
- PALockLegLeft
- PALockLegRight
- PALockHandLeft
- PALockHandRight
- PALockFootLeft
- PALockFootRight
By setting a value greater than 0 to these animation curves in animation sequence or animation montage, you can temporarily disable the corresponding physical animation without switching profiles.
For example, during Mantling, these curves are set to disable the physical animation of the corresponding parts temporarily, so as not to interfere with the action of lifting the leg high.
@Sixze I think I’ve found a solution to Ragdolling problem at low FPS.
Just turn on 'Substepping' in Physics section of Project Settings.
It seems like there’s no need to change the code.
this is based
Good job. I'll definitely take a closer look at this, but I'm busy right now so it won't be anytime soon.
I fixed the issue where the posture when start ragdolling during strafing was unnatural because it did not match the direction of movement.
This is likely the last commit I will add to this PR, and I don’t expect to add any more commits after this.
Could this be integrated via a derived class such as ALSXT without needing to modify the source or ALS assets?
Could this be integrated via a derived class such as ALSXT without needing to modify the source or ALS assets?
The original ragdolling process collides with PhysicalAnimation, and I think that ragdolling is better impremented with PhysicalAnimation than the conventional method of setting drive to constraints. It’s hard work to keep the original source and assets unchanged, so I don’t have the motivation to do that.
Please close this PR if you don’t like it. I will continue to develop with ALSRefactored customized for myself in the forked repository, so I don’t have any particular reason to want you to merge it.
Please close this PR if you don’t like it. I will continue to develop with ALSRefactored customized for myself in the forked repository, so I don’t have any particular reason to want you to merge it.
I apologize for not looking at this PR, I'm still quite busy. I don't want to make predictions, but I think it will happen only after the release of UE 5.4.
I can't open modified montages, this error occurs:
Error LogWindows appError called: Assertion failed: bRequiresModelPopulation || DataModel != nullptr || DataModelInterface != nullptr [File:D:\build\++UE5\Sync\Engine\Source\Runtime\Engine\Private\Animation\AnimSequenceBase.cpp] [Line: 129]
Error LogWindows Invalid Animation Sequence base state, no data model found past upgrade object version. AnimSequenceBase:/ALS/ALS/Animations/Actions/Mantle/A_Als_Mantle_High.A_Als_Mantle_High
Maybe you saved them under a different version of Unreal Engine?
I tested on UE5.3.2(not source build). I haven't seen this assertion error in my environment. I'll check it again.
I’m sorry, it seems I accidentally mixed in some unnecessary changes. It was strange that there were changes to A_Als_Mantle_High.asset. I have force-pushed a version with the unnecessary changes removed.
The editor still crashes due to the A_Als_LyingDown_Back_Pose and A_Als_LyingDown_Front_Pose animations.
A_Als_LyingDown_Back_Pose and A_Als_LyingDown_Front_Pose are newly added data, so they are necessary. A_Als_LyingDown_Back_Pose is created from the first frame of A_ALs_GetUp_Back, and A_Als_LyingDown_Front_Pose is created from the first frame of A_ALs_GetUp_Front. I don’t get any asserts in my environment. Do you think asserts will occur in someone else’s environment?
@Sixze Could you check if the Animation Data plugin is not turned off? It is a plugin that is on by default from version 5.2 onwards, but it seems that the ascension error mentioned above occurs when it is off.
Could you check if the Animation Data plugin is not turned off? It is a plugin that is on by default from version 5.2 onwards, but it seems that the ascension error mentioned above occurs when it is off.
Yes, it looks like this plugin is the cause of crashes. I had it disabled. Could you please reupload modified animations?
Could you check if the Animation Data plugin is not turned off? It is a plugin that is on by default from version 5.2 onwards, but it seems that the ascension error mentioned above occurs when it is off.
Yes, it looks like this plugin is the cause of crashes. I had it disabled. Could you please reupload modified animations?
In my case, turning it off causes a crash. This is likely a bug that has been present since UE5.2.
https://forums.unrealengine.com/t/ue-5-2s-new-animation-compression-changes-introducing-ddc-invalidation-each-editor-startup/790180/2
If you delete all intermediate files using commands like:
FOR /d /r %%d IN ("Binaries","Build","Intermediate","Saved","DerivedDataCache") DO @IF EXIST "%%d" rd /s /q "%%d"
del *.sln
and then start up, perhaps you can launch with the Animation Data plugin still turned on?
Could you check if the Animation Data plugin is not turned off? It is a plugin that is on by default from version 5.2 onwards, but it seems that the ascension error mentioned above occurs when it is off.
Yes, it looks like this plugin is the cause of crashes. I had it disabled. Could you please reupload modified animations?
In my case, turning it off causes a crash. This is likely a bug that has been present since UE5.2.
https://forums.unrealengine.com/t/ue-5-2s-new-animation-compression-changes-introducing-ddc-invalidation-each-editor-startup/790180/2
If you delete all intermediate files using commands like:
FOR /d /r %%d IN ("Binaries","Build","Intermediate","Saved","DerivedDataCache") DO @IF EXIST "%%d" rd /s /q "%%d" del *.slnand then start up, perhaps you can launch with the Animation Data plugin still turned on?
Ah, sorry, it seems that deleting the cache and intermediate files and rebuilding does not resolve the issue.
In my case, turning it off causes a crash. This is likely a bug that has been present since UE5.2.
I meant that I had that plugin disabled, but after enabling it, the engine no longer crashes, so everything is fine.
Hello, I've reviewed your PR, you did a good job, but I'm not ready to merge it into the plugin.
While physical animations are an interesting topic, they introduce too many different nuances, for example, the character can no longer hold items like a rifle correctly with two hands, hands often get stuck in the world geometry, legs for some reason can stretch in an unnatural way when the character is standing on stairs, and so on.
I'm not sure these problems can be easily fixed, and I'm not ready to spend a lot of time on them.
Also in UE 5.1, Epic introduced the Physics Control Component, which seems to replace the Physical Animation Component, so I think you should take a look at it.
By the way, I like the idea that when the character is lying on the ground, it tries to adopt some specific pose. If it will be possible, I will try to implement this feature separately from this PR and without using Physical Animation Component.
the character can no longer hold items like a rifle correctly with two hands, hands often get stuck in the world geometry, legs for some reason can stretch in an unnatural way when the character is standing on stairs
I apologize for the confusion. The changes to A_Als_Mantle_High.asset and others that were previously retracted due to the assert failure are not unnecessary but essential. I had forgotten about them myself.
The above phenomenon was largely resolved by controlling the application of PhysicsAnimation with the PALock* animation curves. I have reconfigured it and pushed the changes. Could you please try it out?
Also in UE 5.1, Epic introduced the Physics Control Component, which seems to replace the Physical Animation Component
Ah, the Physics Control Component, I wasn’t aware of that. I was wondering how to include accessories like guns in the simulation, but this seems like it could be the solution.
I've looked at your changes, but there are still a lot of issues that I think can only be fixed by limiting the cases where physical animations will have effect.
Most likely you will have to disable collision of physical bodies with other physical bodies inside the physical asset and disable collision with static world geometry, which I think would make physical animations meaningless.
As I said before I'm not ready to spend time on fixing them: I think it will take a lot of time and the final result probably won't be worth it.
Removing the Default profile can completely eliminate the impact, but… Well, I’m tired too, so I’ll withdraw this PR