Compare commits
2 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| cf31912519 | |||
| 0ff11fe2a9 |
@@ -27,6 +27,31 @@ AnimatorState:
|
|||||||
m_MirrorParameter:
|
m_MirrorParameter:
|
||||||
m_CycleOffsetParameter:
|
m_CycleOffsetParameter:
|
||||||
m_TimeParameter:
|
m_TimeParameter:
|
||||||
|
--- !u!1101 &-8021912079140616559
|
||||||
|
AnimatorStateTransition:
|
||||||
|
m_ObjectHideFlags: 1
|
||||||
|
m_CorrespondingSourceObject: {fileID: 0}
|
||||||
|
m_PrefabInstance: {fileID: 0}
|
||||||
|
m_PrefabAsset: {fileID: 0}
|
||||||
|
m_Name:
|
||||||
|
m_Conditions:
|
||||||
|
- m_ConditionMode: 2
|
||||||
|
m_ConditionEvent: IsHit
|
||||||
|
m_EventTreshold: 0
|
||||||
|
m_DstStateMachine: {fileID: 0}
|
||||||
|
m_DstState: {fileID: 0}
|
||||||
|
m_Solo: 0
|
||||||
|
m_Mute: 0
|
||||||
|
m_IsExit: 1
|
||||||
|
serializedVersion: 3
|
||||||
|
m_TransitionDuration: 0.12
|
||||||
|
m_TransitionOffset: 0
|
||||||
|
m_ExitTime: 0.9
|
||||||
|
m_HasExitTime: 0
|
||||||
|
m_HasFixedDuration: 1
|
||||||
|
m_InterruptionSource: 0
|
||||||
|
m_OrderedInterruption: 1
|
||||||
|
m_CanTransitionToSelf: 1
|
||||||
--- !u!1102 &-6438350710411496961
|
--- !u!1102 &-6438350710411496961
|
||||||
AnimatorState:
|
AnimatorState:
|
||||||
serializedVersion: 6
|
serializedVersion: 6
|
||||||
@@ -230,6 +255,18 @@ AnimatorController:
|
|||||||
m_DefaultInt: 0
|
m_DefaultInt: 0
|
||||||
m_DefaultBool: 0
|
m_DefaultBool: 0
|
||||||
m_Controller: {fileID: 9100000}
|
m_Controller: {fileID: 9100000}
|
||||||
|
- m_Name: IsHit
|
||||||
|
m_Type: 4
|
||||||
|
m_DefaultFloat: 0
|
||||||
|
m_DefaultInt: 0
|
||||||
|
m_DefaultBool: 0
|
||||||
|
m_Controller: {fileID: 9100000}
|
||||||
|
- m_Name: IsHitHeavy
|
||||||
|
m_Type: 4
|
||||||
|
m_DefaultFloat: 0
|
||||||
|
m_DefaultInt: 0
|
||||||
|
m_DefaultBool: 0
|
||||||
|
m_Controller: {fileID: 9100000}
|
||||||
m_AnimatorLayers:
|
m_AnimatorLayers:
|
||||||
- serializedVersion: 5
|
- serializedVersion: 5
|
||||||
m_Name: Base Layer
|
m_Name: Base Layer
|
||||||
@@ -366,10 +403,18 @@ AnimatorStateMachine:
|
|||||||
- serializedVersion: 1
|
- serializedVersion: 1
|
||||||
m_State: {fileID: -6438350710411496961}
|
m_State: {fileID: -6438350710411496961}
|
||||||
m_Position: {x: 305, y: 195, z: 0}
|
m_Position: {x: 305, y: 195, z: 0}
|
||||||
|
- serializedVersion: 1
|
||||||
|
m_State: {fileID: 5717376258036447168}
|
||||||
|
m_Position: {x: 340, y: 260, z: 0}
|
||||||
|
- serializedVersion: 1
|
||||||
|
m_State: {fileID: 6961829067006426100}
|
||||||
|
m_Position: {x: 375, y: 325, z: 0}
|
||||||
m_ChildStateMachines: []
|
m_ChildStateMachines: []
|
||||||
m_AnyStateTransitions:
|
m_AnyStateTransitions:
|
||||||
- {fileID: 5014557051428573475}
|
- {fileID: 5014557051428573475}
|
||||||
- {fileID: -4752793699339494306}
|
- {fileID: -4752793699339494306}
|
||||||
|
- {fileID: 9047675544309619590}
|
||||||
|
- {fileID: 6897112697058370456}
|
||||||
m_EntryTransitions: []
|
m_EntryTransitions: []
|
||||||
m_StateMachineTransitions: {}
|
m_StateMachineTransitions: {}
|
||||||
m_StateMachineBehaviours: []
|
m_StateMachineBehaviours: []
|
||||||
@@ -378,6 +423,91 @@ AnimatorStateMachine:
|
|||||||
m_ExitPosition: {x: 800, y: 120, z: 0}
|
m_ExitPosition: {x: 800, y: 120, z: 0}
|
||||||
m_ParentStateMachinePosition: {x: 800, y: 20, z: 0}
|
m_ParentStateMachinePosition: {x: 800, y: 20, z: 0}
|
||||||
m_DefaultState: {fileID: 8302574255206078140}
|
m_DefaultState: {fileID: 8302574255206078140}
|
||||||
|
--- !u!1102 &5717376258036447168
|
||||||
|
AnimatorState:
|
||||||
|
serializedVersion: 6
|
||||||
|
m_ObjectHideFlags: 1
|
||||||
|
m_CorrespondingSourceObject: {fileID: 0}
|
||||||
|
m_PrefabInstance: {fileID: 0}
|
||||||
|
m_PrefabAsset: {fileID: 0}
|
||||||
|
m_Name: HitReact
|
||||||
|
m_Speed: 1.4
|
||||||
|
m_CycleOffset: 0
|
||||||
|
m_Transitions:
|
||||||
|
- {fileID: 9115654436388425902}
|
||||||
|
m_StateMachineBehaviours: []
|
||||||
|
m_Position: {x: 50, y: 50, z: 0}
|
||||||
|
m_IKOnFeet: 0
|
||||||
|
m_WriteDefaultValues: 1
|
||||||
|
m_Mirror: 0
|
||||||
|
m_SpeedParameterActive: 0
|
||||||
|
m_MirrorParameterActive: 0
|
||||||
|
m_CycleOffsetParameterActive: 0
|
||||||
|
m_TimeParameterActive: 0
|
||||||
|
m_Motion: {fileID: -5694488986427802680, guid: adc1feaf8563f6247989bffd0737b6ad, type: 3}
|
||||||
|
m_Tag:
|
||||||
|
m_SpeedParameter:
|
||||||
|
m_MirrorParameter:
|
||||||
|
m_CycleOffsetParameter:
|
||||||
|
m_TimeParameter:
|
||||||
|
--- !u!1101 &6897112697058370456
|
||||||
|
AnimatorStateTransition:
|
||||||
|
m_ObjectHideFlags: 1
|
||||||
|
m_CorrespondingSourceObject: {fileID: 0}
|
||||||
|
m_PrefabInstance: {fileID: 0}
|
||||||
|
m_PrefabAsset: {fileID: 0}
|
||||||
|
m_Name:
|
||||||
|
m_Conditions:
|
||||||
|
- m_ConditionMode: 1
|
||||||
|
m_ConditionEvent: IsHit
|
||||||
|
m_EventTreshold: 0
|
||||||
|
- m_ConditionMode: 1
|
||||||
|
m_ConditionEvent: IsHitHeavy
|
||||||
|
m_EventTreshold: 0
|
||||||
|
- m_ConditionMode: 2
|
||||||
|
m_ConditionEvent: IsDead
|
||||||
|
m_EventTreshold: 0
|
||||||
|
m_DstStateMachine: {fileID: 0}
|
||||||
|
m_DstState: {fileID: 6961829067006426100}
|
||||||
|
m_Solo: 0
|
||||||
|
m_Mute: 0
|
||||||
|
m_IsExit: 0
|
||||||
|
serializedVersion: 3
|
||||||
|
m_TransitionDuration: 0.05
|
||||||
|
m_TransitionOffset: 0
|
||||||
|
m_ExitTime: 0.75
|
||||||
|
m_HasExitTime: 0
|
||||||
|
m_HasFixedDuration: 1
|
||||||
|
m_InterruptionSource: 0
|
||||||
|
m_OrderedInterruption: 1
|
||||||
|
m_CanTransitionToSelf: 0
|
||||||
|
--- !u!1102 &6961829067006426100
|
||||||
|
AnimatorState:
|
||||||
|
serializedVersion: 6
|
||||||
|
m_ObjectHideFlags: 1
|
||||||
|
m_CorrespondingSourceObject: {fileID: 0}
|
||||||
|
m_PrefabInstance: {fileID: 0}
|
||||||
|
m_PrefabAsset: {fileID: 0}
|
||||||
|
m_Name: HitStagger
|
||||||
|
m_Speed: 1.2
|
||||||
|
m_CycleOffset: 0
|
||||||
|
m_Transitions:
|
||||||
|
- {fileID: -8021912079140616559}
|
||||||
|
m_StateMachineBehaviours: []
|
||||||
|
m_Position: {x: 50, y: 50, z: 0}
|
||||||
|
m_IKOnFeet: 0
|
||||||
|
m_WriteDefaultValues: 1
|
||||||
|
m_Mirror: 0
|
||||||
|
m_SpeedParameterActive: 0
|
||||||
|
m_MirrorParameterActive: 0
|
||||||
|
m_CycleOffsetParameterActive: 0
|
||||||
|
m_TimeParameterActive: 0
|
||||||
|
m_Motion: {fileID: 8724492062134716513, guid: 3af9f677619822043a708e52c79ba040, type: 3}
|
||||||
|
m_Tag:
|
||||||
|
m_SpeedParameter:
|
||||||
|
m_MirrorParameter:
|
||||||
|
m_CycleOffsetParameter:
|
||||||
|
m_TimeParameter:
|
||||||
--- !u!1102 &8302574255206078140
|
--- !u!1102 &8302574255206078140
|
||||||
AnimatorState:
|
AnimatorState:
|
||||||
serializedVersion: 6
|
serializedVersion: 6
|
||||||
@@ -405,3 +535,62 @@ AnimatorState:
|
|||||||
m_MirrorParameter:
|
m_MirrorParameter:
|
||||||
m_CycleOffsetParameter:
|
m_CycleOffsetParameter:
|
||||||
m_TimeParameter:
|
m_TimeParameter:
|
||||||
|
--- !u!1101 &9047675544309619590
|
||||||
|
AnimatorStateTransition:
|
||||||
|
m_ObjectHideFlags: 1
|
||||||
|
m_CorrespondingSourceObject: {fileID: 0}
|
||||||
|
m_PrefabInstance: {fileID: 0}
|
||||||
|
m_PrefabAsset: {fileID: 0}
|
||||||
|
m_Name:
|
||||||
|
m_Conditions:
|
||||||
|
- m_ConditionMode: 1
|
||||||
|
m_ConditionEvent: IsHit
|
||||||
|
m_EventTreshold: 0
|
||||||
|
- m_ConditionMode: 2
|
||||||
|
m_ConditionEvent: IsHitHeavy
|
||||||
|
m_EventTreshold: 0
|
||||||
|
- m_ConditionMode: 2
|
||||||
|
m_ConditionEvent: IsAttacking
|
||||||
|
m_EventTreshold: 0
|
||||||
|
- m_ConditionMode: 2
|
||||||
|
m_ConditionEvent: IsDead
|
||||||
|
m_EventTreshold: 0
|
||||||
|
m_DstStateMachine: {fileID: 0}
|
||||||
|
m_DstState: {fileID: 5717376258036447168}
|
||||||
|
m_Solo: 0
|
||||||
|
m_Mute: 0
|
||||||
|
m_IsExit: 0
|
||||||
|
serializedVersion: 3
|
||||||
|
m_TransitionDuration: 0.05
|
||||||
|
m_TransitionOffset: 0
|
||||||
|
m_ExitTime: 0.75
|
||||||
|
m_HasExitTime: 0
|
||||||
|
m_HasFixedDuration: 1
|
||||||
|
m_InterruptionSource: 0
|
||||||
|
m_OrderedInterruption: 1
|
||||||
|
m_CanTransitionToSelf: 0
|
||||||
|
--- !u!1101 &9115654436388425902
|
||||||
|
AnimatorStateTransition:
|
||||||
|
m_ObjectHideFlags: 1
|
||||||
|
m_CorrespondingSourceObject: {fileID: 0}
|
||||||
|
m_PrefabInstance: {fileID: 0}
|
||||||
|
m_PrefabAsset: {fileID: 0}
|
||||||
|
m_Name:
|
||||||
|
m_Conditions:
|
||||||
|
- m_ConditionMode: 2
|
||||||
|
m_ConditionEvent: IsHit
|
||||||
|
m_EventTreshold: 0
|
||||||
|
m_DstStateMachine: {fileID: 0}
|
||||||
|
m_DstState: {fileID: 0}
|
||||||
|
m_Solo: 0
|
||||||
|
m_Mute: 0
|
||||||
|
m_IsExit: 1
|
||||||
|
serializedVersion: 3
|
||||||
|
m_TransitionDuration: 0.1
|
||||||
|
m_TransitionOffset: 0
|
||||||
|
m_ExitTime: 0.9
|
||||||
|
m_HasExitTime: 0
|
||||||
|
m_HasFixedDuration: 1
|
||||||
|
m_InterruptionSource: 0
|
||||||
|
m_OrderedInterruption: 1
|
||||||
|
m_CanTransitionToSelf: 1
|
||||||
|
|||||||
@@ -42,13 +42,24 @@ namespace ProjectM.Client
|
|||||||
static readonly FastAnimatorParameter k_Speed = new FastAnimatorParameter("Speed");
|
static readonly FastAnimatorParameter k_Speed = new FastAnimatorParameter("Speed");
|
||||||
static readonly FastAnimatorParameter k_IsAttacking = new FastAnimatorParameter("IsAttacking");
|
static readonly FastAnimatorParameter k_IsAttacking = new FastAnimatorParameter("IsAttacking");
|
||||||
static readonly FastAnimatorParameter k_IsDead = new FastAnimatorParameter("IsDead"); // B3: the controller's Death state existed but was never driven
|
static readonly FastAnimatorParameter k_IsDead = new FastAnimatorParameter("IsDead"); // B3: the controller's Death state existed but was never driven
|
||||||
|
static readonly FastAnimatorParameter k_IsHit = new FastAnimatorParameter("IsHit"); // 07-21 hit-react (G5): pulsed off replicated Health-drop edges
|
||||||
|
static readonly FastAnimatorParameter k_IsHitHeavy = new FastAnimatorParameter("IsHitHeavy"); // heavy tier -> HitStagger (aligns with the server's B2 poise break)
|
||||||
|
|
||||||
// prevPos cache (per Husk Entity). Pruned every frame (a vanished Husk = a server-authoritative death).
|
/// <summary>07-21: per-Husk anim cache -- position (velocity derivation), Health (the hit-react damage
|
||||||
NativeParallelHashMap<Entity, float3> _prevPos;
|
/// edge), and the active flinch pulse. Pruned every frame (a vanished Husk = a server-authoritative death).</summary>
|
||||||
|
struct EnemyAnimCache
|
||||||
|
{
|
||||||
|
public float3 Pos;
|
||||||
|
public float Hp;
|
||||||
|
public float ReactUntil; // wall-clock ElapsedTime the flinch pulse ends (0 = none)
|
||||||
|
public bool Heavy; // this pulse is the stagger tier
|
||||||
|
}
|
||||||
|
|
||||||
|
NativeParallelHashMap<Entity, EnemyAnimCache> _prevPos;
|
||||||
|
|
||||||
protected override void OnCreate()
|
protected override void OnCreate()
|
||||||
{
|
{
|
||||||
_prevPos = new NativeParallelHashMap<Entity, float3>(64, Allocator.Persistent);
|
_prevPos = new NativeParallelHashMap<Entity, EnemyAnimCache>(64, Allocator.Persistent);
|
||||||
}
|
}
|
||||||
|
|
||||||
protected override void OnDestroy()
|
protected override void OnDestroy()
|
||||||
@@ -65,6 +76,12 @@ namespace ProjectM.Client
|
|||||||
var job = new EnemyDriveJob
|
var job = new EnemyDriveJob
|
||||||
{
|
{
|
||||||
moveX = k_MoveX, moveZ = k_MoveZ, speed = k_Speed, isAttacking = k_IsAttacking, isDead = k_IsDead,
|
moveX = k_MoveX, moveZ = k_MoveZ, speed = k_Speed, isAttacking = k_IsAttacking, isDead = k_IsDead,
|
||||||
|
isHit = k_IsHit, isHitHeavy = k_IsHitHeavy,
|
||||||
|
// 07-21 hit-react knobs (read main-thread, passed by value -- never FeelConfig inside Burst)
|
||||||
|
el = (float)SystemAPI.Time.ElapsedTime,
|
||||||
|
reactSeconds = math.max(0f, FeelConfig.HitReactSeconds),
|
||||||
|
staggerSeconds = math.max(0f, FeelConfig.HitStaggerSeconds),
|
||||||
|
staggerDamage = math.max(1f, FeelConfig.HitReactStaggerDamage),
|
||||||
dt = dt,
|
dt = dt,
|
||||||
prevPos = _prevPos,
|
prevPos = _prevPos,
|
||||||
seen = seen,
|
seen = seen,
|
||||||
@@ -92,11 +109,12 @@ namespace ProjectM.Client
|
|||||||
[WithAll(typeof(EnemyTag))]
|
[WithAll(typeof(EnemyTag))]
|
||||||
partial struct EnemyDriveJob : IJobEntity
|
partial struct EnemyDriveJob : IJobEntity
|
||||||
{
|
{
|
||||||
public FastAnimatorParameter moveX, moveZ, speed, isAttacking, isDead;
|
public FastAnimatorParameter moveX, moveZ, speed, isAttacking, isDead, isHit, isHitHeavy;
|
||||||
|
public float el, reactSeconds, staggerSeconds, staggerDamage; // 07-21 hit-react (reactSeconds 0 = off)
|
||||||
[Unity.Collections.ReadOnly] public ComponentLookup<IsLunging> isLunging; // A7: a lunge has no AttackWindup; OR it in so the boss/Charger attack anim plays during the committed lunge
|
[Unity.Collections.ReadOnly] public ComponentLookup<IsLunging> isLunging; // A7: a lunge has no AttackWindup; OR it in so the boss/Charger attack anim plays during the committed lunge
|
||||||
|
|
||||||
public float dt;
|
public float dt;
|
||||||
public NativeParallelHashMap<Entity, float3> prevPos;
|
public NativeParallelHashMap<Entity, EnemyAnimCache> prevPos;
|
||||||
public NativeParallelHashSet<Entity> seen;
|
public NativeParallelHashSet<Entity> seen;
|
||||||
|
|
||||||
void Execute(
|
void Execute(
|
||||||
@@ -111,9 +129,23 @@ namespace ProjectM.Client
|
|||||||
seen.Add(e);
|
seen.Add(e);
|
||||||
float3 cur = xform.Position;
|
float3 cur = xform.Position;
|
||||||
float3 vel = float3.zero;
|
float3 vel = float3.zero;
|
||||||
|
var cache = new EnemyAnimCache { Pos = cur, Hp = health.Current };
|
||||||
if (prevPos.TryGetValue(e, out var prev))
|
if (prevPos.TryGetValue(e, out var prev))
|
||||||
vel = (cur - prev) / dt;
|
{
|
||||||
prevPos[e] = cur;
|
vel = (cur - prev.Pos) / dt;
|
||||||
|
cache.ReactUntil = prev.ReactUntil;
|
||||||
|
cache.Heavy = prev.Heavy;
|
||||||
|
// 07-21 hit-react (G5): a replicated Health DROP on a living Husk = the flinch edge. The heavy
|
||||||
|
// tier (>= staggerDamage, e.g. the finisher) plays the stagger -- aligned with the server's B2
|
||||||
|
// poise break, so the anim never claims an interrupt the sim didn't make.
|
||||||
|
float drop = prev.Hp - health.Current;
|
||||||
|
if (drop > 0.01f && health.Current > 0f && reactSeconds > 0f)
|
||||||
|
{
|
||||||
|
cache.Heavy = drop >= staggerDamage;
|
||||||
|
cache.ReactUntil = el + (cache.Heavy ? staggerSeconds : reactSeconds);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
prevPos[e] = cache;
|
||||||
|
|
||||||
float2 facing = AnimParamMath.PlanarForward(xform.Rotation);
|
float2 facing = AnimParamMath.PlanarForward(xform.Rotation);
|
||||||
float3 p = AnimParamMath.LocomotionParams(vel, facing, stats.MoveSpeed);
|
float3 p = AnimParamMath.LocomotionParams(vel, facing, stats.MoveSpeed);
|
||||||
@@ -130,6 +162,10 @@ namespace ProjectM.Client
|
|||||||
if (a.HasParameter(speed)) a.SetParameterValue(speed, p.z);
|
if (a.HasParameter(speed)) a.SetParameterValue(speed, p.z);
|
||||||
if (a.HasParameter(isAttacking)) a.SetParameterValue(isAttacking, attacking);
|
if (a.HasParameter(isAttacking)) a.SetParameterValue(isAttacking, attacking);
|
||||||
if (a.HasParameter(isDead)) a.SetParameterValue(isDead, dead);
|
if (a.HasParameter(isDead)) a.SetParameterValue(isDead, dead);
|
||||||
|
// 07-21 hit-react pulse (a corpse never flinches; the controller adds the windup-honesty gate).
|
||||||
|
bool hitActive = !dead && cache.ReactUntil > 0f && el < cache.ReactUntil;
|
||||||
|
if (a.HasParameter(isHit)) a.SetParameterValue(isHit, hitActive);
|
||||||
|
if (a.HasParameter(isHitHeavy)) a.SetParameterValue(isHitHeavy, hitActive && cache.Heavy);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -163,6 +163,15 @@ namespace ProjectM.Client
|
|||||||
/// <summary>Camera hold frames when the melee FINISHER lands (07-20 G5 impact ladder; light hits use HitStopMaxFrames).</summary>
|
/// <summary>Camera hold frames when the melee FINISHER lands (07-20 G5 impact ladder; light hits use HitStopMaxFrames).</summary>
|
||||||
public static int FinisherHoldFrames;
|
public static int FinisherHoldFrames;
|
||||||
|
|
||||||
|
// ---- 07-21 enemy hit-reacts (G5; the Rukhanka-safe flinch that replaced the cut vibrate) ----
|
||||||
|
/// <summary>Seconds the light flinch pulse holds (0 = hit-reacts OFF).</summary>
|
||||||
|
public static float HitReactSeconds;
|
||||||
|
/// <summary>Seconds the heavy stagger pulse holds.</summary>
|
||||||
|
public static float HitStaggerSeconds;
|
||||||
|
/// <summary>Health drop at/above which the react upgrades to the STAGGER tier (keep aligned with the
|
||||||
|
/// server's B2 poise math: the finisher should stagger, a light hit should not).</summary>
|
||||||
|
public static float HitReactStaggerDamage;
|
||||||
|
|
||||||
|
|
||||||
/// <summary>Master gate for gamepad rumble (no-op on KBM).</summary>
|
/// <summary>Master gate for gamepad rumble (no-op on KBM).</summary>
|
||||||
public static bool RumbleEnabled;
|
public static bool RumbleEnabled;
|
||||||
@@ -290,6 +299,9 @@ namespace ProjectM.Client
|
|||||||
MeleeArcIntensity = 0.8f; // 07-21 HEAVY LOCK: the weapon is the read, the arc recedes further
|
MeleeArcIntensity = 0.8f; // 07-21 HEAVY LOCK: the weapon is the read, the arc recedes further
|
||||||
MeleeArcBubbles = 6;
|
MeleeArcBubbles = 6;
|
||||||
FinisherHoldFrames = 7; // 07-21 HEAVY LOCK: a fatter finisher beat (~117ms, still under the 8-frame ladder cap)
|
FinisherHoldFrames = 7; // 07-21 HEAVY LOCK: a fatter finisher beat (~117ms, still under the 8-frame ladder cap)
|
||||||
|
HitReactSeconds = 0.3f; // 07-21: light flinch pulse (clip plays at 1.4x -> the peak lands inside it)
|
||||||
|
HitStaggerSeconds = 0.55f; // heavy stagger pulse
|
||||||
|
HitReactStaggerDamage = 50f; // finisher (63 seeded) staggers, light (42) flinches -- tracks B2 poise
|
||||||
|
|
||||||
|
|
||||||
RumbleEnabled = true;
|
RumbleEnabled = true;
|
||||||
|
|||||||
@@ -26,6 +26,8 @@ namespace ProjectM.EditorTools
|
|||||||
const string PlayerController = "Assets/_Project/Animation/AC_PlayerTopDown.controller";
|
const string PlayerController = "Assets/_Project/Animation/AC_PlayerTopDown.controller";
|
||||||
const string EnemyController = "Assets/_Project/Animation/AC_EnemyTopDown.controller";
|
const string EnemyController = "Assets/_Project/Animation/AC_EnemyTopDown.controller";
|
||||||
const string AttackClip = "Assets/_Project/Animation/EnemyAttackWindup.anim";
|
const string AttackClip = "Assets/_Project/Animation/EnemyAttackWindup.anim";
|
||||||
|
const string HitReactFbx = "Assets/Synty/AnimationSwordCombat/Animations/Polygon/Hit/HitReact/A_Hit_F_React_Sword.fbx";
|
||||||
|
const string HitStaggerFbx = "Assets/Synty/AnimationSwordCombat/Animations/Polygon/Hit/HitStagger/A_Hit_F_Stagger_Sword.fbx";
|
||||||
|
|
||||||
const string WerewolfAtlas = "Assets/Synty/PolygonWerewolf/Textures/PolygonWerewolf_01_A.png";
|
const string WerewolfAtlas = "Assets/Synty/PolygonWerewolf/Textures/PolygonWerewolf_01_A.png";
|
||||||
const string KaijuAtlas = "Assets/Synty/PolygonKaiju/Textures/PolygonKaiju_01.png";
|
const string KaijuAtlas = "Assets/Synty/PolygonKaiju/Textures/PolygonKaiju_01.png";
|
||||||
@@ -364,5 +366,83 @@ namespace ProjectM.EditorTools
|
|||||||
}
|
}
|
||||||
Debug.LogWarning($"[EnemyRigTools] Field/prop '{name}' not found on {o.GetType().Name}.");
|
Debug.LogWarning($"[EnemyRigTools] Field/prop '{name}' not found on {o.GetType().Name}.");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/// <summary>07-21 hit-react pass (guidelines G5; the Rukhanka-safe flinch replacing the cut vibrate):
|
||||||
|
/// adds IsHit/IsHitHeavy params + HitReact (light flinch) and HitStagger (heavy) Any-State states to
|
||||||
|
/// AC_EnemyTopDown, pulsed by EnemyAnimationDriveSystem off replicated Health-drop edges. HONESTY GATE:
|
||||||
|
/// the light react requires IsAttacking == false so a sub-poise hit never visually cancels a windup the
|
||||||
|
/// server is still running (the telegraph must not lie); a HEAVY hit staggers unconditionally, which
|
||||||
|
/// aligns with the server's B2 poise break (finisher knockback >= the stagger threshold zeroes the
|
||||||
|
/// windup). Idempotent / re-runnable.</summary>
|
||||||
|
[MenuItem("ProjectM/Animation/Enemy - Wire Hit Reacts (LANTERN)")]
|
||||||
|
public static void WireEnemyHitReacts()
|
||||||
|
{
|
||||||
|
var ac = AssetDatabase.LoadAssetAtPath<AnimatorController>(EnemyController);
|
||||||
|
if (ac == null) { Debug.LogError($"[EnemyRigTools] Controller missing: {EnemyController}"); return; }
|
||||||
|
|
||||||
|
AnimationClip Clip(string fbxPath, string clipName)
|
||||||
|
{
|
||||||
|
foreach (var o in AssetDatabase.LoadAllAssetsAtPath(fbxPath))
|
||||||
|
if (o is AnimationClip c && c.name == clipName) return c;
|
||||||
|
Debug.LogError($"[EnemyRigTools] Clip missing: {fbxPath} -> {clipName}");
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
var react = Clip(HitReactFbx, "A_Hit_F_React_Sword");
|
||||||
|
var stagger = Clip(HitStaggerFbx, "A_Hit_F_Stagger_Sword");
|
||||||
|
if (react == null || stagger == null) return;
|
||||||
|
|
||||||
|
void EnsureParam(string n)
|
||||||
|
{
|
||||||
|
foreach (var p in ac.parameters) if (p.name == n) return;
|
||||||
|
ac.AddParameter(n, AnimatorControllerParameterType.Bool);
|
||||||
|
}
|
||||||
|
EnsureParam("IsHit");
|
||||||
|
EnsureParam("IsHitHeavy");
|
||||||
|
|
||||||
|
var sm = ac.layers[0].stateMachine;
|
||||||
|
AnimatorState Find(string n)
|
||||||
|
{
|
||||||
|
foreach (var cs in sm.states) if (cs.state.name == n) return cs.state;
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
|
||||||
|
var hitReact = Find("HitReact");
|
||||||
|
if (hitReact == null)
|
||||||
|
{
|
||||||
|
hitReact = sm.AddState("HitReact");
|
||||||
|
var to = sm.AddAnyStateTransition(hitReact);
|
||||||
|
to.hasExitTime = false; to.duration = 0.05f; to.canTransitionToSelf = false;
|
||||||
|
to.AddCondition(AnimatorConditionMode.If, 0f, "IsHit");
|
||||||
|
to.AddCondition(AnimatorConditionMode.IfNot, 0f, "IsHitHeavy");
|
||||||
|
to.AddCondition(AnimatorConditionMode.IfNot, 0f, "IsAttacking"); // honesty: never cancel a live windup visual
|
||||||
|
to.AddCondition(AnimatorConditionMode.IfNot, 0f, "IsDead");
|
||||||
|
var ex = hitReact.AddExitTransition();
|
||||||
|
ex.hasExitTime = false; ex.duration = 0.10f;
|
||||||
|
ex.AddCondition(AnimatorConditionMode.IfNot, 0f, "IsHit");
|
||||||
|
}
|
||||||
|
hitReact.motion = react;
|
||||||
|
hitReact.speed = 1.4f; // 0.83s clip -> the flinch peak inside the ~0.3s pulse
|
||||||
|
|
||||||
|
var hitStagger = Find("HitStagger");
|
||||||
|
if (hitStagger == null)
|
||||||
|
{
|
||||||
|
hitStagger = sm.AddState("HitStagger");
|
||||||
|
var to = sm.AddAnyStateTransition(hitStagger);
|
||||||
|
to.hasExitTime = false; to.duration = 0.05f; to.canTransitionToSelf = false;
|
||||||
|
to.AddCondition(AnimatorConditionMode.If, 0f, "IsHit");
|
||||||
|
to.AddCondition(AnimatorConditionMode.If, 0f, "IsHitHeavy"); // heavy overrides even a windup (server poise broke it)
|
||||||
|
to.AddCondition(AnimatorConditionMode.IfNot, 0f, "IsDead");
|
||||||
|
var ex = hitStagger.AddExitTransition();
|
||||||
|
ex.hasExitTime = false; ex.duration = 0.12f;
|
||||||
|
ex.AddCondition(AnimatorConditionMode.IfNot, 0f, "IsHit");
|
||||||
|
}
|
||||||
|
hitStagger.motion = stagger;
|
||||||
|
hitStagger.speed = 1.2f; // 1.07s clip -> the lurch inside the ~0.55s pulse
|
||||||
|
|
||||||
|
EditorUtility.SetDirty(ac);
|
||||||
|
AssetDatabase.SaveAssets();
|
||||||
|
Debug.Log("[EnemyRigTools] Hit reacts wired: HitReact (light, windup-honest) + HitStagger (heavy) on AC_EnemyTopDown.");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|||||||
@@ -216,7 +216,7 @@ anticipation floors per G1; one **signature silhouette pose** per kind's windup
|
|||||||
| 1 | **Damage at contact tick** (G2.1) — light melee gains ~0.2 s real windup | DO — it's the honest heavy-weapon model; feel-test behind a knob | ✅ SHIPPED 07-20 (`MeleeCleavePending` schedule-and-consume; knob `MeleeContactTicks`, 0 = legacy) |
|
| 1 | **Damage at contact tick** (G2.1) — light melee gains ~0.2 s real windup | DO — it's the honest heavy-weapon model; feel-test behind a knob | ✅ SHIPPED 07-20 (`MeleeCleavePending` schedule-and-consume; knob `MeleeContactTicks`, 0 = legacy) |
|
||||||
| 2 | **Reach retune** (G2.2) — `MeleeRange` 2.6→2.2, finisher reach ×1.5→×1.25 | DO with #1 as one package | ✅ SHIPPED 07-20 (`MeleeFinisherRangeMult` knob 30) |
|
| 2 | **Reach retune** (G2.2) — `MeleeRange` 2.6→2.2, finisher reach ×1.5→×1.25 | DO with #1 as one package | ✅ SHIPPED 07-20 (`MeleeFinisherRangeMult` knob 30) |
|
||||||
| 3 | **Weapon scale ×1.25 + tip trail** (G2.3) | DO — cheapest honesty win | ✅ SHIPPED 07-20 (axe ×1.25; blade-smear ribbon; arc reveal ends AT contact) |
|
| 3 | **Weapon scale ×1.25 + tip trail** (G2.3) | DO — cheapest honesty win | ✅ SHIPPED 07-20 (axe ×1.25; blade-smear ribbon; arc reveal ends AT contact) |
|
||||||
| 4 | Victim-vibrate + finisher hold ladder (G5) | DO — pure presentation | ✅ hold ladder SHIPPED (`FinisherHoldFrames`); **vibrate CUT** — Rukhanka folds the render child's inverse transform into skinning, an offset is a no-op (review C8); follow-up = additive anim layer |
|
| 4 | Victim-vibrate + finisher hold ladder (G5) | DO — pure presentation | ✅ hold ladder SHIPPED (`FinisherHoldFrames`); vibrate CUT (Rukhanka inverse-fold no-op, review C8) → **superseded 07-21 by the enemy HIT-REACT pass**: React/Stagger anim tiers off Health-drop edges, windup-honesty gated ([[2026-07-21_Hit_React_Pass_G]]) |
|
||||||
| 5 | Input buffer 6–10t (G7) — a small predicted-sim change | DO after #1 lands (same system) | ✅ SHIPPED 07-20 (`BufferedAttackTick` GhostField; unlock-edge validity, batch-slack 4) |
|
| 5 | Input buffer 6–10t (G7) — a small predicted-sim change | DO after #1 lands (same system) | ✅ SHIPPED 07-20 (`BufferedAttackTick` GhostField; unlock-edge validity, batch-slack 4) |
|
||||||
| 6 | Class cancel policies (G7) — Bathynaut commit / Harpooner crisp | Ratify as design law | ✅ LAW + Bathynaut side SHIPPED (dash refused pre-contact); Harpooner side lands with the Harpooner |
|
| 6 | Class cancel policies (G7) — Bathynaut commit / Harpooner crisp | Ratify as design law | ✅ LAW + Bathynaut side SHIPPED (dash refused pre-contact); Harpooner side lands with the Harpooner |
|
||||||
| 7 | Hades frame-count follow-up session (fill the research gap) | Optional, low priority | ☐ operator |
|
| 7 | Hades frame-count follow-up session (fill the research gap) | Optional, low priority | ☐ operator |
|
||||||
|
|||||||
@@ -46,7 +46,7 @@ Catalog of the Synty Polygon packs under `Assets/Synty/`, produced by the [[DR-0
|
|||||||
|
|
||||||
- **AnimationBaseLocomotion** (original): the 8-direction Run + **Walk** strafe sets (+RootMotion variants), idles, in-air, transitions — **IN USE**: the player's Locomotion tree runs the WALK strafe set (07-16c, `PlayerRigTools.WireUnderwaterFeelClips`); `A_Walk_FwdStrafeF_RootMotion` averageSpeed 1.46 u/s = the `FeelConfig.TrudgeNaturalSpeed` StrideScale reference.
|
- **AnimationBaseLocomotion** (original): the 8-direction Run + **Walk** strafe sets (+RootMotion variants), idles, in-air, transitions — **IN USE**: the player's Locomotion tree runs the WALK strafe set (07-16c, `PlayerRigTools.WireUnderwaterFeelClips`); `A_Walk_FwdStrafeF_RootMotion` averageSpeed 1.46 u/s = the `FeelConfig.TrudgeNaturalSpeed` StrideScale reference.
|
||||||
- **AnimationIdles** (NEW): ~330 masc + feminine idle clips, Polygon + Sidekick rigs. Masculine/Polygon categories (clips): ArmsFolded 6 · **Base 1 (IN USE — the player Idle + Locomotion center since 07-16d)** · Bored 4 · CheckWatch 1 · Drink 6 · Eat 6 · HandsOnHips 6 · HeadNod 4 · HeadShake 3 · Inspect 5 · Lean 27 · Look 8 · PickNose 4 · PlayWithHair 3 · Plead 2 · PointHand 6 · Posture 12 (Aggressive/Dramatic/Shy/Slumped Enter/Loop/Exit) · Pray 7 · Stretch 6 · Sway 3 (Drunk — too wobbly for the diver) · Thoughtful 8 · UsePhone 25 · Wave 9 · WeightShift 2 · Yawn 1. Most stances ship Enter/Loop/Exit triplets → ready-made **idle-fidget rotation** (Bored/Look/WeightShift/Stretch fit the Bathynaut; a random-fidget sub-state machine is the natural follow-up). Props included (phone/cup/donut/comb — needs `Tools/SyntyPropBoneTool`).
|
- **AnimationIdles** (NEW): ~330 masc + feminine idle clips, Polygon + Sidekick rigs. Masculine/Polygon categories (clips): ArmsFolded 6 · **Base 1 (IN USE — the player Idle + Locomotion center since 07-16d)** · Bored 4 · CheckWatch 1 · Drink 6 · Eat 6 · HandsOnHips 6 · HeadNod 4 · HeadShake 3 · Inspect 5 · Lean 27 · Look 8 · PickNose 4 · PlayWithHair 3 · Plead 2 · PointHand 6 · Posture 12 (Aggressive/Dramatic/Shy/Slumped Enter/Loop/Exit) · Pray 7 · Stretch 6 · Sway 3 (Drunk — too wobbly for the diver) · Thoughtful 8 · UsePhone 25 · Wave 9 · WeightShift 2 · Yawn 1. Most stances ship Enter/Loop/Exit triplets → ready-made **idle-fidget rotation** (Bored/Look/WeightShift/Stretch fit the Bathynaut; a random-fidget sub-state machine is the natural follow-up). Props included (phone/cup/donut/comb — needs `Tools/SyntyPropBoneTool`).
|
||||||
- **AnimationSwordCombat** (**IN USE since 07-18** — [[2026-07-18_SwordCombat_Attack_Anims]]): Polygon-rig clips — Attack 42 (Light/Heavy Combo01 chains A/B/C + ReturnToIdle, HeavyStab, HeavyFlourish, LightFencing, LightLeaping; each with RootMotion variants, `*_Sword` suffix, no Masc/Femn split) · Block 13 · Death 8 · Dodge 16 · Hit 19 (React/Stagger/KnockDown/Stun) · Idle 20 (Base/Fidgets/Menacing01/Sheathed). **Wired via `PlayerRigTools.WireSwordCombatAttackClips`:** Swing1/2/3 = LightCombo01 A/B/C, SpecialSlam = HeavyCombo01A, Death = Death_B_01, CombatIdle = looped Menacing01 (InCombat param). NOTE: attack FBX are **multi-take** (full + WindUp/Hit/FollowThrough) — load by exact clip name. Still unused: Hit-react/Block/Dodge sets.
|
- **AnimationSwordCombat** (**IN USE since 07-18** — [[2026-07-18_SwordCombat_Attack_Anims]]): Polygon-rig clips — Attack 42 (Light/Heavy Combo01 chains A/B/C + ReturnToIdle, HeavyStab, HeavyFlourish, LightFencing, LightLeaping; each with RootMotion variants, `*_Sword` suffix, no Masc/Femn split) · Block 13 · Death 8 · Dodge 16 · Hit 19 (React/Stagger/KnockDown/Stun) · Idle 20 (Base/Fidgets/Menacing01/Sheathed). **Wired via `PlayerRigTools.WireSwordCombatAttackClips`:** Swing1/2/3 = LightCombo01 A/B/C, SpecialSlam = HeavyCombo01A, Death = Death_B_01, CombatIdle = looped Menacing01 (InCombat param). NOTE: attack FBX are **multi-take** (full + WindUp/Hit/FollowThrough) — load by exact clip name. 07-21: Hit-react IN USE (React + Stagger onto AC_EnemyTopDown via `EnemyRigTools.WireEnemyHitReacts`). Still unused: Block/Dodge sets, KnockDown/Stun.
|
||||||
- **Tools/SyntyPropBoneTool** (NEW): Synty's prop-to-bone attachment utility (editor tooling for the idle/combat prop clips).
|
- **Tools/SyntyPropBoneTool** (NEW): Synty's prop-to-bone attachment utility (editor tooling for the idle/combat prop clips).
|
||||||
|
|
||||||
## Roadmap hooks (from this catalog)
|
## Roadmap hooks (from this catalog)
|
||||||
|
|||||||
@@ -0,0 +1,39 @@
|
|||||||
|
# 2026-07-21 (G) — Enemy hit-react pass (the last impact layer)
|
||||||
|
|
||||||
|
**The pass** (operator: "proceed with the next pass in its entirety"): enemies FLINCH when hit — the SwordCombat
|
||||||
|
React/Stagger clips, driven off replicated Health-drop edges, replacing the review-killed positional vibrate
|
||||||
|
(Rukhanka inverse-folds render-child transforms; animation is the correct channel).
|
||||||
|
|
||||||
|
## What shipped
|
||||||
|
|
||||||
|
- **Controller** (`EnemyRigTools.WireEnemyHitReacts`, menu `ProjectM/Animation/Enemy - Wire Hit Reacts`, idempotent):
|
||||||
|
`IsHit` + `IsHitHeavy` params; `HitReact` (`A_Hit_F_React_Sword` @1.4x — the flinch peak inside the 0.3s pulse)
|
||||||
|
and `HitStagger` (`A_Hit_F_Stagger_Sword` @1.2x, 0.55s pulse) Any-State states on `AC_EnemyTopDown`; exits on
|
||||||
|
pulse end. **Windup-honesty gate:** the light react requires `IsAttacking == false` — a sub-poise hit never
|
||||||
|
visually cancels a windup the server is still running (the telegraph must not lie). The HEAVY tier staggers
|
||||||
|
unconditionally, which is honest because it tracks the server's B2 poise break (finisher knockback ≥ the stagger
|
||||||
|
threshold zeroes the windup server-side).
|
||||||
|
- **Drive** (`EnemyAnimationDriveSystem`): the per-Husk cache grew from `float3 prevPos` to `EnemyAnimCache`
|
||||||
|
{Pos, Hp, ReactUntil, Heavy}. A Health DROP on a living Husk stamps the pulse; drop ≥
|
||||||
|
`FeelConfig.HitReactStaggerDamage` (50) upgrades to the stagger tier — at the locked heavy tuning that's
|
||||||
|
exactly finisher (63 seeded) staggers / light (42) flinches, mirroring the server poise math. Corpses never
|
||||||
|
flinch (dead gate). FeelConfig knobs: `HitReactSeconds` (0.3, 0 = off), `HitStaggerSeconds` (0.55),
|
||||||
|
`HitReactStaggerDamage` (50) — read main-thread, passed by value into the Bursted job.
|
||||||
|
- All enemies share `AC_EnemyTopDown` → every kind (and the sandbox target dummy) reacts for free; humanoid
|
||||||
|
retarget puts the pack clips on every rig zero-work.
|
||||||
|
|
||||||
|
## Validation
|
||||||
|
|
||||||
|
- L1 console clean · L2 414/414 green (presentation-only; no sim/netcode surface — the damage edge already
|
||||||
|
replicates via Health).
|
||||||
|
- Live vs the sandbox dummy: light hit → visible head-dip flinch (captured mid-swing, axe extended);
|
||||||
|
finisher → dramatic backward stagger lurch (captured with the 42 damage number up). Both tiers distinct.
|
||||||
|
|
||||||
|
## Follow-ups
|
||||||
|
|
||||||
|
- Player hurt flinch (additive layer so it never fights locomotion/swings) — deliberately out of this pass's scope.
|
||||||
|
- KnockDown/Stun sets remain unused (map to future hard-CC mechanics, not presentation).
|
||||||
|
- Per-direction reacts (L/R/B variants ship in the pack) — polish-on-polish; the front react reads fine top-down.
|
||||||
|
|
||||||
|
**Next:** finisher-reach eyes-on (×1.39) · G6 socket telegraphs + SpecialSlam damage-at-contact · G4 co-op
|
||||||
|
saturation budget.
|
||||||
Reference in New Issue
Block a user