UnrealOni/ALS: Difference between revisions

m
link fix
m (link fix)
 
(11 intermediate revisions by 2 users not shown)
Line 1: Line 1:
This is a mini overview of similarities and differences between versions 2 and 3 of Advanced Locomotion System by LongmireLocomotion when it comes to importing a new character into the system (via FBX).
This is a mini overview of similarities and differences between versions 2 and 3 of Advanced Locomotion System by LongmireLocomotion when it comes to importing a new character into the system (via FBX).
*[https://www.unrealengine.com/marketplace/advanced-locomotion-system-v1 ALS3 on Unreal Marketplace]
*[https://www.fab.com/listings/ef9651a4-fb55-4866-a2d9-1b38b028f9c7 ALS3 on Unreal Marketplace]
*[https://youtu.be/AMG2V3FiQ4U Video demonstration of ALS2]
*[https://www.youtube.com/watch?v=AMG2V3FiQ4U Video demonstration of ALS2]
*[https://youtu.be/yTniZCOCY7o Video demonstration of ALS3]
*[https://www.youtube.com/watch?v=yTniZCOCY7o Video demonstration of ALS3]
 
==Getting foot IK and ragdolling to work==
==Getting foot IK and ragdolling to work==
For simplicity we are discussing characters that have already been carefully adapted for UE4 in Blender or such: the skeleton is assumed to have the same layout as that of Unreal's SK_Mannequin (same bone hierarchy, including the auxiliary IK bones; "twist" bones are optional); the bones are assumed to have the same names as in Unreal's Humanoid rig; the local axes of each bone are supposed to be consistent with UE4's conventions (primary bone axis is either X or -Z, secondary is typically Z or -Z). A good example of such a character can be obtained if you export Unreal's SK_Mannequin to FBX.
For simplicity we are discussing characters that have already been carefully adapted for UE4 in Blender or such, so that no retargeting is needed. That is:
*the skeleton is assumed to have the same layout as that of Unreal's SK_Mannequin (same bone hierarchy, including the auxiliary IK bones; "twist" bones are optional);
*the bones are assumed to have the same names as in Unreal's Humanoid rig;
*the local axes of each bone are supposed to be consistent with UE4's conventions (primary bone axis is either X or -Z, secondary is typically Z or -Z).
A good example of such a character can be obtained if you export Unreal's SK_Mannequin to FBX.


Under the above assumptions, the character FBX can be imported into any project that uses the basic Mannequin (such as a basic ThirdPerson game template, or the ALS2 project, or the ALS3 project). Since the skeleton of the imported character is conventional (same bone names and bone orientations as for the Mannequin), one can typically choosing UE4_Mannequin_Skeleton under Mesh/Skeleton in the "FBX Import Options" dialog. Immediately after that, the new Skeletal Mesh can be set as the Mesh property of the pawn entity (the isolated mannequin in the middle of the level), and the game is immediately playable, i.e. basic locomotion immediately works on the imported character.
Under the above assumptions, the character FBX can be imported into any project that features a basic UE4 Mannequin (such as a basic ThirdPerson game template, or the ALS2 project, or the ALS3 project). Since the skeleton of the imported character is conventional (same bone names and bone orientations as for the Mannequin), one can typically choosing UE4_Mannequin_Skeleton under Mesh/Skeleton in the "FBX Import Options" dialog. Immediately after that, the new Skeletal Mesh can be set as the Mesh property of the pawn entity (the isolated mannequin in the middle of the level), and the game is immediately playable, i.e. basic locomotion immediately works on the imported character.


Two things, however, do not work right away: foot IK and ragdolling. The following explains how to get them both to work, so you can start running around and having fun.
Two things, however, might not work right away: foot IK and ragdolling. The following explains how to get them both to work, so you can start running around and having fun.


For simplicity we assume (for now) that we are working with an exported/reimported FBX mannequin that has exactly the same proportions as the project's original Mannequin.
For simplicity we assume (for now) that we are working with an exported/reimported FBX mannequin that has exactly the same proportions as the project's original Mannequin.
===Ragdolling===
===Ragdolling===
Ragdolling is the easier of the two. The imported character simply needs to have a suitable Physics Asset (collision boxes/cylinders/capsules around the limbs, and joints between them with appropriate rotation constraints.
Ragdolling is the easier of the two. The imported character simply needs to have a suitable Physics Asset (collision boxes/cylinders/capsules around the limbs, and joints between them with appropriate rotation constraints.


(If there is no physics asset, then ALS will typically send the character flying instead of ragdolling. If the physics asset is present but somehow incorrect, the character and flex incorrectly, become separated from the playable character's capsule, get stuck in the ground, etc.)
(If there is no physics asset, then ALS will typically send the character flying instead of ragdolling. If the physics asset is present but somehow incorrect, the character may flex incorrectly, or become separated from the playable character's capsule, or get stuck in the ground, etc.)


A Physics asset can be generated (or chosen from existing ones) at any time, including during the initial import of the FBX character (it's in the same section as where you choose the Skeleton).
A Physics asset can be generated (or chosen from existing ones) at any time, including during the initial import of the FBX character (it's in the same section as where you choose the Skeleton).
Line 21: Line 27:


The above procedure is exactly the same in ALS2 and in ALS3, although there are some differences in the name of the entities, blueprints and assets.
The above procedure is exactly the same in ALS2 and in ALS3, although there are some differences in the name of the entities, blueprints and assets.
===Foot IK===
===Foot IK===
It is very frustrating when you import a Mannequin, make sure its skeletal mesh has exactly the same settings as the included Mannequin (including the Physics Asset), but somehow the foot IK does not seem to work. In ALS3, the new character is actually expected to have correct IK immediately upon import - indeed, the default "Post Process Anim Blueprint" (under the Skeleton Mesh section in Asset Details for the Mesh) is None, which is consistent with the corresponding setting of the included Mannequin mesh. In ALS2, the included SK_Mannequin has, in the same field, the setting "Mannequin_PostProcess_AnimBP", so it is necessary to open the new Skeletal Mesh in the editor, go to Asset Details on the left, scroll to the Skeletal Mesh section, and set "Post Process Anim Blueprint" to "Mannequin_PostProcess_AnimBP". The confusing part is that even after you do this (set the correct "Post Process Anim Blueprint"), and save all the assets in the project (just in case), the new character will still not have working foot IK.
It is very frustrating when you import a Mannequin, make sure its skeletal mesh has exactly the same settings as the included Mannequin (including the Physics Asset), but somehow the foot IK does not seem to work. In ALS3, the new character is actually expected to have correct IK immediately upon import - indeed, the default "Post Process Anim Blueprint" (under the Skeleton Mesh section in Asset Details for the Mesh) is None, which is consistent with the corresponding setting of the included Mannequin mesh. In ALS2, the included SK_Mannequin has, in the same field, the setting "Mannequin_PostProcess_AnimBP", so it is necessary to open the new Skeletal Mesh in the editor, go to Asset Details on the left, scroll to the Skeletal Mesh section, and set "Post Process Anim Blueprint" to "Mannequin_PostProcess_AnimBP". The confusing part is that even after you do this (set the correct "Post Process Anim Blueprint"), and save all the assets in the project (just in case), the new character will still not appear to have working foot IK.


Somehow this crazy situation is resolved if you close the ALS project and open it again. Apparently IK support is properly initialized only for character assets already present in the project when it opens.
Somehow this crazy situation is resolved if you close the ALS project and open it again. Apparently IK support is properly initialized only for those character assets that are already present in the project when it opens.


==Custom body proportions - locomotion (ALS3)==
==Custom body proportions - locomotion (ALS3)==
Line 54: Line 61:


==Custom animations - blueprint fix==
==Custom animations - blueprint fix==
If you want to replace or complement ALS's locomotion animations with your own, and do not want to follow the convention of animated IK bones (ALS expects locomotion animations to have motion tracks for the IK bones that exactly replicate the motion of the actual foot_l and foot_r), you need to modify the animation blueprint (either Mannequin_PostProcess_AnimBP for ALS2, or Mannequin_IK_AnimBP for ALS3), as described [https://forums.unrealengine.com/unreal-engine/marketplace/107921-advanced-locomotion-system-v3?p=1488046#post1488046 HERE] (ALS thread on UE4 forum, post #442). In the Anim Graph, disconnect the "Use cached pose 'Sub-Graph Input'" and "Local To Component" nodes and add two "Copy Bone" nodes between them and the first "Transform (Modify) Bone" node of the "Foot IK" block. For both these new nodes, check "Copy Translation" and "Copy Rotation" and set "Control Space" to "World Space" (in the "Details" panel on the right). Set the source and target bones like on the picture in post #442 (copy from foot_l to ik_foot_l and from foot_r to ik_foot_r).
If you want to replace or complement ALS's locomotion animations with your own, and do not want to follow the convention of animated IK bones (ALS expects locomotion animations to have motion tracks for the IK bones that exactly replicate the motion of the actual foot_l and foot_r), you need to modify the animation blueprint (either Mannequin_PostProcess_AnimBP for ALS2, or Mannequin_IK_AnimBP for ALS3), as described [https://forums.unrealengine.com/t/advanced-locomotion-system-v3/83838#post1488046 HERE] (ALS thread on UE4 forum, post #442). In the Anim Graph, disconnect the "Use cached pose 'Sub-Graph Input'" and "Local To Component" nodes and add two "Copy Bone" nodes between them and the first "Transform (Modify) Bone" node of the "Foot IK" block. For both these new nodes, check "Copy Translation" and "Copy Rotation" and set "Control Space" to "World Space" (in the "Details" panel on the right). Set the source and target bones like on the picture in post #442 (copy from foot_l to ik_foot_l and from foot_r to ik_foot_r).


After you to this, you can configure the animation blueprint to use any locomotion animations, including those that do not contain animation tracks for the IK bones at all. Also, the "Translation Retargeting" value "Animation" (for the Skeleton Asset) becomes completely irrelevant, since the animated position of the IK feet (if available in an animation) will be overridden by that of actual feet immediately before foot IK processing.
After you to this, you can configure the animation blueprint to use any locomotion animations, including those that do not contain animation tracks for the IK bones at all. Also, the "Translation Retargeting" value "Animation" (for the Skeleton Asset) becomes completely irrelevant, since the animated position of the IK feet (if available in an animation) will be overridden by that of actual feet immediately before foot IK processing.
[[Category:Modding tutorials]]