Files
Project-M/Assets/_Project/Scripts/Simulation/Player/CharacterComponents.cs
T
kronic 7571091394 LANTERN feel pass (DR-052 + gap list): SoD facing, underwater feel, Bathynaut kit, walk/run gait, suit lamp + new Synty anim packs
- SoD facing: PlayerFacing = body-yaw only (move-facing / cast-turn / idle-hold); every fire
  direction re-sourced to FacingMath.ResolveAim (pre-code review blocking catch); TickWindowMath
  shared windows with Movement-skip; reticle/FX coupled to the damage direction; cursor-dash kept.
- Underwater feel: sharpness 15->6, turn 720->360, MoveSpeed 6->4.2; TuningKnob 26-28
  (0 = no-override sentinels, dev-protocol bump on DebugTuningReport); stride footsteps + silt +
  cadence floor; bubbles; underwater ambience bed + distant groans; camera drag + dev scroll zoom.
- Bathynaut kit in-engine: dome/tank/shoulder-lamp + bare head grafted (GraftSmr rigid rebase,
  RecalculateTangents); EmissiveGloamSkinned shader (Rukhanka deformation); shoulder lamp CASTS
  (warm steady spot on body yaw).
- Gait: two-ring walk/run FreeformDirectional tree (walk @0.35, run @1.0) + blended-natural
  StrideScale; additive Posture(Bank) + Lead(chest-lead) layers; idle = AnimationIdles Base;
  banking driven from facing turn rate; flat terrain (Env_SeabedKit seabed squashed - CC is planar).
- New packs: Synty AnimationIdles + AnimationSwordCombat (combat pass queued) + SyntyPropBoneTool;
  four authored clips (sway/trudge/banks/lean) + Anim_Player_Underwater.blend + suit-kit FBX.
- Validation: 411/411 EditMode green; Play smokes (server==client facing, Aim-true projectile,
  bank/stride live-sampled, lamp beam verified); pre-code + post-impl adversarial reviews applied.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
2026-07-16 13:56:02 -07:00

55 lines
2.7 KiB
C#

using System;
using Unity.CharacterController;
using Unity.Entities;
using Unity.Mathematics;
namespace ProjectM.Simulation
{
/// <summary>
/// Tunables for the top-down kinematic character (M5b: Unity Character Controller package). Twin-stick /
/// planar: NO jump, NO air control, NO gravity, NO view pitch. The per-tick target speed comes from the
/// data-driven <see cref="EffectiveCharacterStats.MoveSpeed"/> via <see cref="PlayerControlSystem"/>; this
/// component only carries the smoothing sharpness + step/slope handling the CC processor needs. Authored
/// on the player prefab by <c>PlayerCharacterAuthoring</c>. Not a ghost — movement replicates through the
/// owner-predicted LocalTransform (re-simulated on the owner, interpolated on remotes).
/// </summary>
[Serializable]
public struct CharacterComponent : IComponentData
{
/// <summary>The CC's default grounded-movement smoothing sharpness — the single source for GetDefault, the
/// authoring default, DashSystem's base, and the death-state reset. 07-15 underwater feel: 15 → 6 (slow
/// build-up + glidey stop — the seabed drag read); Player.prefab's serialized value must match (serialized
/// wins over this initializer at bake). Dev-override: TuningKnob.MoveSharpness (0 = this const).</summary>
public const float DefaultGroundedSharpness = 6f;
/// <summary>How quickly RelativeVelocity is lerped toward the target velocity on the ground.</summary>
public float GroundedMovementSharpness;
/// <summary>Step/slope handling params (defaults; planar ground so mostly inert).</summary>
public BasicStepAndSlopeHandlingParameters StepAndSlopeHandling;
public static CharacterComponent GetDefault()
{
return new CharacterComponent
{
GroundedMovementSharpness = DefaultGroundedSharpness,
StepAndSlopeHandling = BasicStepAndSlopeHandlingParameters.GetDefault(),
};
}
}
/// <summary>
/// Per-tick, NON-replicated control for the CC processor, derived each predicted tick from the replicated
/// <see cref="PlayerInput"/> by <see cref="PlayerControlSystem"/>. Derived (not authored, not a ghost): a
/// pure function of replicated input + recomputed stats, so it reproduces identically on server, owning
/// client, and across rollback re-simulation.
/// </summary>
[Serializable]
public struct CharacterControl : IComponentData
{
/// <summary>World-space desired velocity (already scaled by MoveSpeed, Y == 0). The processor lerps
/// RelativeVelocity toward this each tick.</summary>
public float3 MoveVelocity;
}
}