Add crouch state and fix jump sync

Add isCrouching to network, state and animation systems; enable proxy jump syncing with a jump-hold debounce and update animation descriptor and server tooling.

Key changes:
- Networking: F4TNetworking.h/cpp: added a_isCrouching, include "isCrouching" in transform packets and parsing, and logging.
- Remote state: F4TRemotePlayerState.h: added isCrouching field.
- Proxy animation: F4TProxyAnimationSync.*: added crouch fields, enabled jump sync, implemented ApplyJumpHoldState and jump hold timing, wrote crouch/jump bools into descriptors when available, updated event firing and logs.
- Animation descriptor: F4AnimationDescriptor.cpp: added isJumping and isCrouching to bool variable list.
- Local detection: main.cpp: added isCrouching in movement state, stubbed GetCrouchState(), adjusted jump hold timing and included crouch in outgoing transform calls.
- Server/dev tooling: server/dev_server_app.py, fake_client.py, fake_player.py, README.md: added crouch reporting, toggle UI/control and fake client support for crouch, and updated docs/logging.
- Docs: docs/dev-log.md updated with notes on jump/crouch fixes and testing.

Rationale: ensure remote players can report crouch state and make jump animations transition reliably by debouncing jump state on proxies and writing available graph bools; also provide dev-server controls and fake-client support for testing.
This commit is contained in:
2026-06-05 14:22:17 +12:00
parent 7f1aa11281
commit 5ba440ab5d
12 changed files with 464 additions and 67 deletions
+1
View File
@@ -23,6 +23,7 @@ namespace F4T::Networking
bool a_isSprinting = false,
bool a_isSneaking = false,
bool a_isJumping = false,
bool a_isCrouching = false,
bool a_weaponDrawn = false,
float a_movementSpeed = 0.0F,
float a_animationGraphSpeed = -1.0F);
+3
View File
@@ -25,6 +25,7 @@ namespace F4T::ProxyAnimationSync
inline constexpr const char* kSpeedSampled = "speedSampled";
inline constexpr const char* kSpeedDamped = "speedDamped";
inline constexpr const char* kIsSprinting = "IsSprinting";
inline constexpr const char* kInJumpState = "bInJumpState";
}
// Maps network movementSpeed (units/sec) to graph Speed (~0-105). Used when the sender
@@ -38,10 +39,12 @@ namespace F4T::ProxyAnimationSync
bool lastIsSprinting{ false };
bool lastIsSneaking{ false };
bool lastIsJumping{ false };
bool lastIsCrouching{ false };
bool lastWeaponDrawn{ false };
float lastGraphSpeed{ 0.0F };
float lastDirection{ 0.0F };
std::chrono::steady_clock::time_point movingHoldUntil{};
std::chrono::steady_clock::time_point jumpHoldUntil{};
};
void ResetAppliedAnimationState(ProxyAppliedAnimationState& a_state);
+4 -4
View File
@@ -38,16 +38,16 @@ namespace F4T::RemotePlayerState
bool isSprinting{ false };
bool isSneaking{ false };
bool isJumping{ false };
bool isCrouching{ false };
bool weaponDrawn{ false };
float movementSpeed{ 0.0F };
// Authoritative Havok graph Speed from sender when available (>= 0). -1 means unset.
float animationGraphSpeed{ -1.0F };
std::chrono::steady_clock::time_point lastReceivedLocalTime{};
// Phase 2: Actor state and action events (TiltedEvolution alignment)
std::uint32_t actorStateFlags1{}; // ActorState.flags1 (combat, sneaking, etc.)
std::uint32_t actorStateFlags2{}; // ActorState.flags2 (additional state flags)
std::vector<RemoteActionEvent> actionEvents; // Queue of pending action events
std::uint32_t actorStateFlags1{};
std::uint32_t actorStateFlags2{};
std::vector<RemoteActionEvent> actionEvents;
};
void SetAssignedPlayerId(std::uint32_t a_playerId);