From a0c91c81fa82579d3ed7983a4cb1a6a922fefa29 Mon Sep 17 00:00:00 2001 From: koritsa Date: Sun, 31 May 2026 16:59:02 +0300 Subject: [PATCH] Adjusted sky update interval, added clothing assets --- .../Blueprints/Data/StartingSaveData.uasset | 4 +- Content/Blueprints/Player/BP_Player.uasset | 4 +- .../Data/Casual/Shoes/Casual_Shoes.uasset | 3 ++ .../Data/Casual/Shoes/DA_Casual_Shoes.uasset | 3 -- .../Skirt/Casual_Skirt_BlackAndWhite.uasset | 3 ++ .../Casual/Stockings/Casual_Stockings.uasset | 3 ++ .../Stockings/DA_Casual_Stockings.uasset | 3 -- .../Data/Casual/Top/Casual_Top.uasset | 3 ++ .../Data/Casual/Top/DA_Casual_Top.uasset | 3 -- .../Data/Laced/Laced_Stockings_White.uasset | 3 ++ .../Default/Materials/MI_Hair_Default.uasset | 4 +- Content/Maps/L_EquipmentPreview.umap | 4 +- Content/Test/Maps/TestLevel.umap | 4 +- Content/UI/MainMenu/WBP_MainMenu.uasset | 4 +- Source/NakedDesire/Global/Constants.h | 6 ++- .../NakedDesire/Global/TimeOfDaySubsystem.cpp | 44 +++++++++++++------ .../NakedDesire/Global/TimeOfDaySubsystem.h | 16 ++++--- .../NakedDesire/Player/NakedDesireCharacter.h | 1 - 18 files changed, 72 insertions(+), 43 deletions(-) create mode 100644 Content/Characters/Yumi/Clothing/Data/Casual/Shoes/Casual_Shoes.uasset delete mode 100644 Content/Characters/Yumi/Clothing/Data/Casual/Shoes/DA_Casual_Shoes.uasset create mode 100644 Content/Characters/Yumi/Clothing/Data/Casual/Skirt/Casual_Skirt_BlackAndWhite.uasset create mode 100644 Content/Characters/Yumi/Clothing/Data/Casual/Stockings/Casual_Stockings.uasset delete mode 100644 Content/Characters/Yumi/Clothing/Data/Casual/Stockings/DA_Casual_Stockings.uasset create mode 100644 Content/Characters/Yumi/Clothing/Data/Casual/Top/Casual_Top.uasset delete mode 100644 Content/Characters/Yumi/Clothing/Data/Casual/Top/DA_Casual_Top.uasset create mode 100644 Content/Characters/Yumi/Clothing/Data/Laced/Laced_Stockings_White.uasset diff --git a/Content/Blueprints/Data/StartingSaveData.uasset b/Content/Blueprints/Data/StartingSaveData.uasset index c300aeea..5a75c7b8 100644 --- a/Content/Blueprints/Data/StartingSaveData.uasset +++ b/Content/Blueprints/Data/StartingSaveData.uasset @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:f921a7c1136774aada952d197ca39c9c39605906f37d22852c64bfc203fe0ca9 -size 1783 +oid sha256:d230290d469c7e59e8a98294865134b5a0716a662fa26014ccd0b1c83d1cb387 +size 2512 diff --git a/Content/Blueprints/Player/BP_Player.uasset b/Content/Blueprints/Player/BP_Player.uasset index 02a75530..95b1f55e 100644 --- a/Content/Blueprints/Player/BP_Player.uasset +++ b/Content/Blueprints/Player/BP_Player.uasset @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:4d8abf574ec762faf4e535a35a5caf9baa91c7f6cbe4917700d64d76962739cf -size 73603 +oid sha256:e0303659a667d62f2f298a9bda9d7aeadc29e38d805f513336cfd0d0d5d9d44b +size 72288 diff --git a/Content/Characters/Yumi/Clothing/Data/Casual/Shoes/Casual_Shoes.uasset b/Content/Characters/Yumi/Clothing/Data/Casual/Shoes/Casual_Shoes.uasset new file mode 100644 index 00000000..3e9a72c7 --- /dev/null +++ b/Content/Characters/Yumi/Clothing/Data/Casual/Shoes/Casual_Shoes.uasset @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:6c75cc2bf69ee6755da2f49ae441a9ea55d5d57c49b60d2f7207e284376fb093 +size 2700 diff --git a/Content/Characters/Yumi/Clothing/Data/Casual/Shoes/DA_Casual_Shoes.uasset b/Content/Characters/Yumi/Clothing/Data/Casual/Shoes/DA_Casual_Shoes.uasset deleted file mode 100644 index fa35163d..00000000 --- a/Content/Characters/Yumi/Clothing/Data/Casual/Shoes/DA_Casual_Shoes.uasset +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:eafd83f3b30e3b95c4a959b017176a764554083c5449e18d84a2db8b1acbebdf -size 3181 diff --git a/Content/Characters/Yumi/Clothing/Data/Casual/Skirt/Casual_Skirt_BlackAndWhite.uasset b/Content/Characters/Yumi/Clothing/Data/Casual/Skirt/Casual_Skirt_BlackAndWhite.uasset new file mode 100644 index 00000000..98c62155 --- /dev/null +++ b/Content/Characters/Yumi/Clothing/Data/Casual/Skirt/Casual_Skirt_BlackAndWhite.uasset @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:a0b2e3f8a203e5526a8d5de8fc998c33ca9602a2b0ca3ef6213383cfd9f5f3da +size 3963 diff --git a/Content/Characters/Yumi/Clothing/Data/Casual/Stockings/Casual_Stockings.uasset b/Content/Characters/Yumi/Clothing/Data/Casual/Stockings/Casual_Stockings.uasset new file mode 100644 index 00000000..cf42a0ca --- /dev/null +++ b/Content/Characters/Yumi/Clothing/Data/Casual/Stockings/Casual_Stockings.uasset @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:f448d37f547a69f1df07454a703eb6877db33c501fa551e09ee70fe6af36b40b +size 3169 diff --git a/Content/Characters/Yumi/Clothing/Data/Casual/Stockings/DA_Casual_Stockings.uasset b/Content/Characters/Yumi/Clothing/Data/Casual/Stockings/DA_Casual_Stockings.uasset deleted file mode 100644 index e50dbd06..00000000 --- a/Content/Characters/Yumi/Clothing/Data/Casual/Stockings/DA_Casual_Stockings.uasset +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:2e30466dfd3c7da8caeaabfb2121411b8fb6279a859ee953ae4f5f4097a4a7bb -size 3249 diff --git a/Content/Characters/Yumi/Clothing/Data/Casual/Top/Casual_Top.uasset b/Content/Characters/Yumi/Clothing/Data/Casual/Top/Casual_Top.uasset new file mode 100644 index 00000000..881992cd --- /dev/null +++ b/Content/Characters/Yumi/Clothing/Data/Casual/Top/Casual_Top.uasset @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:91fb2689fa5dd4f0144b753d59f08f6eeee69ebcd83884f5ce9dc187995f6c90 +size 3655 diff --git a/Content/Characters/Yumi/Clothing/Data/Casual/Top/DA_Casual_Top.uasset b/Content/Characters/Yumi/Clothing/Data/Casual/Top/DA_Casual_Top.uasset deleted file mode 100644 index eb1788a4..00000000 --- a/Content/Characters/Yumi/Clothing/Data/Casual/Top/DA_Casual_Top.uasset +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:65e565989d9a2bb5f76ade68ba77591645677c8cb14f34d2e9e8931374c28dd2 -size 3345 diff --git a/Content/Characters/Yumi/Clothing/Data/Laced/Laced_Stockings_White.uasset b/Content/Characters/Yumi/Clothing/Data/Laced/Laced_Stockings_White.uasset new file mode 100644 index 00000000..c5b8dc94 --- /dev/null +++ b/Content/Characters/Yumi/Clothing/Data/Laced/Laced_Stockings_White.uasset @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:e61878699ad1b87a2c963914e6f25347952c32682677e68c47066a52476305a1 +size 3461 diff --git a/Content/Characters/Yumi/Hair/Default/Materials/MI_Hair_Default.uasset b/Content/Characters/Yumi/Hair/Default/Materials/MI_Hair_Default.uasset index f92a9ff0..83e0d4e1 100644 --- a/Content/Characters/Yumi/Hair/Default/Materials/MI_Hair_Default.uasset +++ b/Content/Characters/Yumi/Hair/Default/Materials/MI_Hair_Default.uasset @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:4b8928ff7df35452ffb1ccf4eb1ce44a0bf98be282a605d881487a4356f9fcbe -size 15369 +oid sha256:43ee2c1c489fad5ca37aaa7e87b8cec853a6cba8ac34d3b73b31b35c30821c58 +size 19750 diff --git a/Content/Maps/L_EquipmentPreview.umap b/Content/Maps/L_EquipmentPreview.umap index 996ed48e..36aece2f 100644 --- a/Content/Maps/L_EquipmentPreview.umap +++ b/Content/Maps/L_EquipmentPreview.umap @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:061365fa98b26a8962428a5b7f098bd898c092a7eb3d3db16c08a9f47aa490de -size 75500 +oid sha256:abcdf01c5244f0599867e2c9062c446afeb462cc3ca5b598a3a5a6b19fc09499 +size 85703 diff --git a/Content/Test/Maps/TestLevel.umap b/Content/Test/Maps/TestLevel.umap index 8c3d7cc2..1c3c4798 100644 --- a/Content/Test/Maps/TestLevel.umap +++ b/Content/Test/Maps/TestLevel.umap @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:60823d9830bf540beb243336604f8df6a4420264bba01ae44113003c2caefe98 -size 149766 +oid sha256:78fe38c31993d33c69adab7bc9bccf7932265013380babb69f0d9b4856d708b3 +size 147142 diff --git a/Content/UI/MainMenu/WBP_MainMenu.uasset b/Content/UI/MainMenu/WBP_MainMenu.uasset index 4caa0c52..bdb66e9c 100644 --- a/Content/UI/MainMenu/WBP_MainMenu.uasset +++ b/Content/UI/MainMenu/WBP_MainMenu.uasset @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:d4567b4aa010be3e3e92628dfaf0b8d360bcc5dd3119a89cb909d890d5192bb6 -size 122661 +oid sha256:0b24eaa44aa2abd3f9536ad9d667548d73763361656bac08588b88fd733ad25e +size 107970 diff --git a/Source/NakedDesire/Global/Constants.h b/Source/NakedDesire/Global/Constants.h index 80a35291..b459fbc1 100644 --- a/Source/NakedDesire/Global/Constants.h +++ b/Source/NakedDesire/Global/Constants.h @@ -9,7 +9,7 @@ inline const FString DefaultSaveSlotName = TEXT("Slot1"); // --- Time of day / calendar (GDD §2.4, §10.1; tuning §21) --- // 1440 in-game minutes elapse over the ~90 real-minute day/night cycle. -inline constexpr float INGAME_MINUTES_PER_REAL_SECOND = 16.0f; +inline constexpr float INGAME_MINUTES_PER_REAL_SECOND = 1.0f; inline constexpr int32 MINUTES_PER_HOUR = 60; inline constexpr int32 MINUTES_PER_DAY = 1440; inline constexpr float DAY_START_HOUR = 8.0f; // 08:00 — day phase begins (§10.1) @@ -20,3 +20,7 @@ inline constexpr int32 CAMPAIGN_LENGTH_DAYS = 90; // §3.3 survive 90 days inline constexpr int32 WEEK_LENGTH_DAYS = 7; // §2.4 rent due each week inline constexpr float WEEKLY_RENT = 20000.0f; // §15.3 early-tier placeholder (§21 tuning) +// How often the current time is pushed to the sky actor. Decoupled from the in-game +// minute so the sun moves smoothly regardless of how fast the clock runs. +inline constexpr double SKY_PUSH_INTERVAL_SECONDS = 1.0 / 30.0; // 30fps + diff --git a/Source/NakedDesire/Global/TimeOfDaySubsystem.cpp b/Source/NakedDesire/Global/TimeOfDaySubsystem.cpp index e14cb9be..a1b833c7 100644 --- a/Source/NakedDesire/Global/TimeOfDaySubsystem.cpp +++ b/Source/NakedDesire/Global/TimeOfDaySubsystem.cpp @@ -4,6 +4,7 @@ #include "TimeOfDaySubsystem.h" #include "Constants.h" #include "Kismet/GameplayStatics.h" +#include "Misc/App.h" #include "Misc/Timecode.h" #include "NakedDesire/Player/NakedDesireCharacter.h" #include "NakedDesire/SaveGame/GlobalSaveGameData.h" @@ -20,7 +21,12 @@ void UTimeOfDaySubsystem::OnWorldBeginPlay(UWorld& InWorld) } bBegunPlay = true; - PushTimeToSky(); // sync the sky to the loaded time immediately + PushTimeToSky(/*bForce=*/true); // sync the sky to the loaded time immediately + + // Sanity-log the clock speed: how long a full 24h in-game day takes in real time. + const double RealMinutesPerDay = MINUTES_PER_DAY / (INGAME_MINUTES_PER_REAL_SECOND * 60.0); + UE_LOG(LogTemp, Warning, TEXT("UTimeOfDaySubsystem: a full in-game day takes %.2f real minutes (%.1f in-game minutes/real second)."), + RealMinutesPerDay, INGAME_MINUTES_PER_REAL_SECOND); } void UTimeOfDaySubsystem::Tick(float DeltaTime) @@ -67,7 +73,8 @@ void UTimeOfDaySubsystem::SkipTime(float Minutes) { if (Minutes > 0.0f) { - AdvanceClock(static_cast(Minutes)); + // Discrete jump — snap the sky to the new time, don't wait for the throttle. + AdvanceClock(static_cast(Minutes), /*bForceSkyPush=*/true); } } @@ -79,7 +86,7 @@ void UTimeOfDaySubsystem::SkipToNextMorning() { Delta += MINUTES_PER_DAY; } - AdvanceClock(Delta); + AdvanceClock(Delta, /*bForceSkyPush=*/true); } void UTimeOfDaySubsystem::Sleep() @@ -101,7 +108,7 @@ void UTimeOfDaySubsystem::PopPause(FName Reason) PauseReasons.Remove(Reason); } -void UTimeOfDaySubsystem::AdvanceClock(double DeltaMinutes) +void UTimeOfDaySubsystem::AdvanceClock(double DeltaMinutes, bool bForceSkyPush) { UGlobalSaveGameData* Save = GetSave(); if (!Save || DeltaMinutes <= 0.0) @@ -125,7 +132,7 @@ void UTimeOfDaySubsystem::AdvanceClock(double DeltaMinutes) } Save->MinuteOfDay = static_cast(Next); - PushTimeToSky(); + PushTimeToSky(bForceSkyPush); } void UTimeOfDaySubsystem::HandleHourBoundary(int32 HourOfDay) @@ -207,20 +214,31 @@ void UTimeOfDaySubsystem::DepositDailyFollowerIncome() // follower attribute yet, so this is intentionally a no-op (payout reads 0). } -void UTimeOfDaySubsystem::PushTimeToSky() +void UTimeOfDaySubsystem::PushTimeToSky(bool bForce) { const UGlobalSaveGameData* Save = GetSave(); if (!Save) return; - const int32 CurMinute = FMath::FloorToInt(Save->MinuteOfDay); - if (CurMinute == LastPushedMinute) + // Throttle continuous updates to 30fps of real time. Discrete jumps (load / skips) + // force a push so the sky snaps to the new time without waiting for the next frame. + const double Now = FApp::GetCurrentTime(); + if (!bForce && LastSkyPushRealTime >= 0.0 && (Now - LastSkyPushRealTime) < SKY_PUSH_INTERVAL_SECONDS) return; - LastPushedMinute = CurMinute; + LastSkyPushRealTime = Now; - const int32 Hours = CurMinute / MINUTES_PER_HOUR; - const int32 Minutes = CurMinute % MINUTES_PER_HOUR; - OnPushTimeToSky.Broadcast(FTimecode(Hours, Minutes, 0, 0, false)); + // Carry sub-minute precision so the sun moves smoothly between minute marks. The + // fractional minute becomes seconds + frames (at the same 30fps cadence). + const double MinuteOfDay = Save->MinuteOfDay; + const int32 Hours = FMath::FloorToInt(MinuteOfDay / MINUTES_PER_HOUR); + const int32 Minutes = FMath::FloorToInt(MinuteOfDay) % MINUTES_PER_HOUR; + + const double FracMinute = MinuteOfDay - FMath::FloorToDouble(MinuteOfDay); + const double FracSeconds = FracMinute * 60.0; + const int32 Seconds = FMath::FloorToInt(FracSeconds); + const int32 Frames = FMath::FloorToInt((FracSeconds - Seconds) * 30.0); + + OnPushTimeToSky.Broadcast(FTimecode(Hours, Minutes, Seconds, Frames, false)); } EDayPhase UTimeOfDaySubsystem::ComputePhase(float InMinuteOfDay) @@ -256,7 +274,7 @@ void UTimeOfDaySubsystem::Autosave() const { if (const UGameInstance* GameInstance = GetWorld()->GetGameInstance()) { - if (USaveSubsystem* SaveSubsystem = GameInstance->GetSubsystem()) + if (const USaveSubsystem* SaveSubsystem = GameInstance->GetSubsystem()) { SaveSubsystem->SaveGame(); } diff --git a/Source/NakedDesire/Global/TimeOfDaySubsystem.h b/Source/NakedDesire/Global/TimeOfDaySubsystem.h index 7c50bc66..6da851ad 100644 --- a/Source/NakedDesire/Global/TimeOfDaySubsystem.h +++ b/Source/NakedDesire/Global/TimeOfDaySubsystem.h @@ -39,9 +39,9 @@ DECLARE_DYNAMIC_MULTICAST_DELEGATE_OneParam(FOnPushTimeToSkySignature, const FTi /** * The single authoritative clock (GDD §2.4, §10.1). Owns time-of-day and the - * calendar in C++ and pushes the current time to the UltraDynamicSky actor each - * in-game minute via ANakedDesireGameMode::SetCurrentTime — inverting the old - * BP-drives-time flow. Persists to UGlobalSaveGameData (MinuteOfDay / DaysPassed). + * calendar in C++ and pushes the current time to the UltraDynamicSky actor at 30fps + * (SKY_PUSH_INTERVAL_SECONDS) via ANakedDesireGameMode::SetCurrentTime — inverting the + * old BP-drives-time flow. Persists to UGlobalSaveGameData (MinuteOfDay / DaysPassed). * * The calendar rolls at 04:00 (DAY_ROLL_HOUR); the day phase flips at 08:00 / 20:00. * Weekly rent is charged every WEEK_LENGTH_DAYS-th roll; follower income deposits @@ -121,13 +121,15 @@ public: FOnPushTimeToSkySignature OnPushTimeToSky; private: - void AdvanceClock(double DeltaMinutes); + // bForceSkyPush bypasses the 30fps throttle for discrete jumps (skips / load), + // so the sky snaps to the new time immediately instead of waiting a frame. + void AdvanceClock(double DeltaMinutes, bool bForceSkyPush = false); void HandleHourBoundary(int32 HourOfDay); // 0–23 void SetPhase(EDayPhase NewPhase); void AdvanceCalendarDay(); void ChargeWeeklyRent(); void DepositDailyFollowerIncome(); - void PushTimeToSky(); + void PushTimeToSky(bool bForce = false); static EDayPhase ComputePhase(float InMinuteOfDay); @@ -135,8 +137,8 @@ private: void RestorePlayerEnergy() const; void Autosave() const; - // Last whole in-game minute pushed to the sky, to throttle the push to ~1/min. - int32 LastPushedMinute = -1; + // Real-time stamp (seconds, FApp clock) of the last sky push, to throttle to 30fps. + double LastSkyPushRealTime = -1.0; EDayPhase CurrentPhase = EDayPhase::Day; TSet PauseReasons; bool bBegunPlay = false; diff --git a/Source/NakedDesire/Player/NakedDesireCharacter.h b/Source/NakedDesire/Player/NakedDesireCharacter.h index 058abbb3..88ddf7a7 100644 --- a/Source/NakedDesire/Player/NakedDesireCharacter.h +++ b/Source/NakedDesire/Player/NakedDesireCharacter.h @@ -8,7 +8,6 @@ #include "InputMappingContext.h" #include "NakedDesire/Clothing/BodyPart.h" #include "NakedDesire/Global/Gait.h" -#include "NakedDesire/Global/NakedDesireUserSettings.h" #include "NakedDesire/Global/Stance.h" #include "Perception/AISightTargetInterface.h" #include "NakedDesireCharacter.generated.h"