Add appearance sync and late-join replay

Adds optional `appearance` snapshots to transform packets, applies supported appearance data to runtime proxies, and has the server replay stored transforms to newly connected clients so late joiners receive current visuals immediately.
This commit is contained in:
2026-06-29 16:46:50 +12:00
parent ad7f287899
commit 4b8f5246c4
15 changed files with 772 additions and 38 deletions
+2 -1
View File
@@ -32,7 +32,8 @@ namespace F4T::Networking
bool a_weaponDrawn = false,
float a_movementSpeed = 0.0F,
float a_animationGraphSpeed = -1.0F,
std::span<const F4T::RemotePlayerState::RemoteEquippedItem> a_equippedItems = {});
std::span<const F4T::RemotePlayerState::RemoteEquippedItem> a_equippedItems = {},
const F4T::RemotePlayerState::RemoteAppearance* a_appearance = nullptr);
bool SendWorldStatePacket(
float a_gameHour,
float a_gameDaysPassed,
+36
View File
@@ -28,6 +28,40 @@ namespace F4T::RemotePlayerState
std::uint32_t formId{};
};
struct RemoteAppearanceMorph
{
std::uint32_t id{};
float value{};
};
struct RemoteAppearanceTintColor
{
std::uint8_t r{};
std::uint8_t g{};
std::uint8_t b{};
std::uint8_t a{};
};
struct RemoteAppearanceMorphWeight
{
float thin{};
float muscular{};
float large{};
};
struct RemoteAppearance
{
std::uint32_t version{ 1 };
std::uint32_t raceFormId{};
float height{ 1.0F };
RemoteAppearanceMorphWeight morphWeight;
RemoteAppearanceTintColor bodyTintColor;
std::uint32_t hairColorFormId{};
std::uint32_t facialHairColorFormId{};
std::vector<std::uint32_t> headPartFormIds;
std::vector<RemoteAppearanceMorph> morphSliders;
};
struct RemotePlayerState
{
std::uint32_t playerId{};
@@ -50,6 +84,8 @@ namespace F4T::RemotePlayerState
float animationGraphSpeed{ -1.0F };
bool hasEquipmentUpdate{ false };
std::vector<RemoteEquippedItem> equippedItems;
bool hasAppearanceUpdate{ false };
RemoteAppearance appearance;
std::chrono::steady_clock::time_point lastReceivedLocalTime{};
// Phase 2: Actor state and action events (TiltedEvolution alignment)