using Unity.Entities; using Unity.Mathematics; namespace ProjectM.Simulation { /// /// Server-only per-Husk navigation / anti-stuck state (NOT replicated — clients never simulate enemies, so this /// carries no [GhostField] and does not change the ghost hash). Tracks the enemy's XZ position at the end /// of last tick plus how long it has failed to make progress toward its target, so EnemyAISystem can /// phase-nudge a genuinely stuck enemy (wedged on a cover rock or a rock-vs-boundary pocket) toward the nearest /// player — the guaranteed backstop that keeps an expedition room from ever soft-locking on one unreachable Husk. /// Baked onto every enemy by EnemyAuthoring. Complements the collide-and-slide fixes in /// / EnemyMoveUtil (which make sticking rare in the first place). /// public struct EnemyNavState : IComponentData { /// Enemy XZ position at the end of last tick (progress baseline; Y unused). public float3 LastPos; /// Consecutive ticks the enemy wanted to move toward its target but made ~no progress. public uint StuckTicks; /// While a NetworkTick newer than the current tick is stored here the enemy is phase-nudging /// toward its target (collide-and-slide bypassed) to escape geometry; 0 = not nudging. Routed through /// TickUtil.NonZero so a computed tick never collides with the 0 "inactive" sentinel. public uint NudgeUntilTick; } }