From fc3a62e511daa576634ff967adf52f788bbc67fb Mon Sep 17 00:00:00 2001 From: ivan tkachenko Date: Thu, 14 Aug 2025 14:48:33 +0300 Subject: [PATCH] Rename Start segment to Intro to reduce some confusion Confusingly, "start" may refer to too many things in different places, while "intro" would unambiguously refer to an audio clip that plays first before the loop starts. --- ...{BeefLiverStart.ogg => BeefLiverIntro.ogg} | 0 ...hereshnyaStart.ogg => ChereshnyaIntro.ogg} | 0 ...estroyStart.ogg => DeployDestroyIntro.ogg} | 0 .../{DurochkaStart.ogg => DurochkaIntro.ogg} | 0 Assets/{GodModeStart.ogg => GodModeIntro.ogg} | 0 .../{GorgorodStart.ogg => GorgorodIntro.ogg} | 0 Assets/{KachStart.ogg => KachIntro.ogg} | 0 ...aZhittyaStart.ogg => MoyaZhittyaIntro.ogg} | 0 ...romcheStart.ogg => MuzikaGromcheIntro.ogg} | 0 Assets/{PWNEDStart.ogg => PWNEDIntro.ogg} | 0 ...etasovkaStart.ogg => PeretasovkaIntro.ogg} | 0 ...ndShineStart.ogg => RiseAndShineIntro.ogg} | 0 Assets/{Song2Start.ogg => Song2Intro.ogg} | 0 .../{VseVZaleStart.ogg => VseVZaleIntro.ogg} | 0 Assets/{YalgaarStart.ogg => YalgaarIntro.ogg} | 0 ...orynichStart.ogg => ZmeiGorynichIntro.ogg} | 0 MuzikaGromche/MuzikaGromche.csproj | 2 +- MuzikaGromche/Plugin.cs | 72 +++++++++---------- 18 files changed, 37 insertions(+), 37 deletions(-) rename Assets/{BeefLiverStart.ogg => BeefLiverIntro.ogg} (100%) rename Assets/{ChereshnyaStart.ogg => ChereshnyaIntro.ogg} (100%) rename Assets/{DeployDestroyStart.ogg => DeployDestroyIntro.ogg} (100%) rename Assets/{DurochkaStart.ogg => DurochkaIntro.ogg} (100%) rename Assets/{GodModeStart.ogg => GodModeIntro.ogg} (100%) rename Assets/{GorgorodStart.ogg => GorgorodIntro.ogg} (100%) rename Assets/{KachStart.ogg => KachIntro.ogg} (100%) rename Assets/{MoyaZhittyaStart.ogg => MoyaZhittyaIntro.ogg} (100%) rename Assets/{MuzikaGromcheStart.ogg => MuzikaGromcheIntro.ogg} (100%) rename Assets/{PWNEDStart.ogg => PWNEDIntro.ogg} (100%) rename Assets/{PeretasovkaStart.ogg => PeretasovkaIntro.ogg} (100%) rename Assets/{RiseAndShineStart.ogg => RiseAndShineIntro.ogg} (100%) rename Assets/{Song2Start.ogg => Song2Intro.ogg} (100%) rename Assets/{VseVZaleStart.ogg => VseVZaleIntro.ogg} (100%) rename Assets/{YalgaarStart.ogg => YalgaarIntro.ogg} (100%) rename Assets/{ZmeiGorynichStart.ogg => ZmeiGorynichIntro.ogg} (100%) diff --git a/Assets/BeefLiverStart.ogg b/Assets/BeefLiverIntro.ogg similarity index 100% rename from Assets/BeefLiverStart.ogg rename to Assets/BeefLiverIntro.ogg diff --git a/Assets/ChereshnyaStart.ogg b/Assets/ChereshnyaIntro.ogg similarity index 100% rename from Assets/ChereshnyaStart.ogg rename to Assets/ChereshnyaIntro.ogg diff --git a/Assets/DeployDestroyStart.ogg b/Assets/DeployDestroyIntro.ogg similarity index 100% rename from Assets/DeployDestroyStart.ogg rename to Assets/DeployDestroyIntro.ogg diff --git a/Assets/DurochkaStart.ogg b/Assets/DurochkaIntro.ogg similarity index 100% rename from Assets/DurochkaStart.ogg rename to Assets/DurochkaIntro.ogg diff --git a/Assets/GodModeStart.ogg b/Assets/GodModeIntro.ogg similarity index 100% rename from Assets/GodModeStart.ogg rename to Assets/GodModeIntro.ogg diff --git a/Assets/GorgorodStart.ogg b/Assets/GorgorodIntro.ogg similarity index 100% rename from Assets/GorgorodStart.ogg rename to Assets/GorgorodIntro.ogg diff --git a/Assets/KachStart.ogg b/Assets/KachIntro.ogg similarity index 100% rename from Assets/KachStart.ogg rename to Assets/KachIntro.ogg diff --git a/Assets/MoyaZhittyaStart.ogg b/Assets/MoyaZhittyaIntro.ogg similarity index 100% rename from Assets/MoyaZhittyaStart.ogg rename to Assets/MoyaZhittyaIntro.ogg diff --git a/Assets/MuzikaGromcheStart.ogg b/Assets/MuzikaGromcheIntro.ogg similarity index 100% rename from Assets/MuzikaGromcheStart.ogg rename to Assets/MuzikaGromcheIntro.ogg diff --git a/Assets/PWNEDStart.ogg b/Assets/PWNEDIntro.ogg similarity index 100% rename from Assets/PWNEDStart.ogg rename to Assets/PWNEDIntro.ogg diff --git a/Assets/PeretasovkaStart.ogg b/Assets/PeretasovkaIntro.ogg similarity index 100% rename from Assets/PeretasovkaStart.ogg rename to Assets/PeretasovkaIntro.ogg diff --git a/Assets/RiseAndShineStart.ogg b/Assets/RiseAndShineIntro.ogg similarity index 100% rename from Assets/RiseAndShineStart.ogg rename to Assets/RiseAndShineIntro.ogg diff --git a/Assets/Song2Start.ogg b/Assets/Song2Intro.ogg similarity index 100% rename from Assets/Song2Start.ogg rename to Assets/Song2Intro.ogg diff --git a/Assets/VseVZaleStart.ogg b/Assets/VseVZaleIntro.ogg similarity index 100% rename from Assets/VseVZaleStart.ogg rename to Assets/VseVZaleIntro.ogg diff --git a/Assets/YalgaarStart.ogg b/Assets/YalgaarIntro.ogg similarity index 100% rename from Assets/YalgaarStart.ogg rename to Assets/YalgaarIntro.ogg diff --git a/Assets/ZmeiGorynichStart.ogg b/Assets/ZmeiGorynichIntro.ogg similarity index 100% rename from Assets/ZmeiGorynichStart.ogg rename to Assets/ZmeiGorynichIntro.ogg diff --git a/MuzikaGromche/MuzikaGromche.csproj b/MuzikaGromche/MuzikaGromche.csproj index 5fd8c2b..b0827bd 100644 --- a/MuzikaGromche/MuzikaGromche.csproj +++ b/MuzikaGromche/MuzikaGromche.csproj @@ -110,7 +110,7 @@ --> - + diff --git a/MuzikaGromche/Plugin.cs b/MuzikaGromche/Plugin.cs index cf08b39..379afae 100644 --- a/MuzikaGromche/Plugin.cs +++ b/MuzikaGromche/Plugin.cs @@ -563,7 +563,7 @@ namespace MuzikaGromche for (int i = 0; i < Tracks.Length; i++) { Track track = Tracks[i]; - requests[i * 2] = UnityWebRequestMultimedia.GetAudioClip($"file://{dir}/{track.FileNameStart}", track.AudioType); + requests[i * 2] = UnityWebRequestMultimedia.GetAudioClip($"file://{dir}/{track.FileNameIntro}", track.AudioType); requests[i * 2 + 1] = UnityWebRequestMultimedia.GetAudioClip($"file://{dir}/{track.FileNameLoop}", track.AudioType); requests[i * 2].SendWebRequest(); requests[i * 2 + 1].SendWebRequest(); @@ -576,10 +576,10 @@ namespace MuzikaGromche for (int i = 0; i < Tracks.Length; i++) { Track track = Tracks[i]; - track.LoadedStart = DownloadHandlerAudioClip.GetContent(requests[i * 2]); + track.LoadedIntro = DownloadHandlerAudioClip.GetContent(requests[i * 2]); track.LoadedLoop = DownloadHandlerAudioClip.GetContent(requests[i * 2 + 1]); #if DEBUG - Debug.Log($"{nameof(MuzikaGromche)} Track {track.Name} {track.LoadedStart.length:N4} {track.LoadedLoop.length:N4}"); + Debug.Log($"{nameof(MuzikaGromche)} Track {track.Name} {track.LoadedIntro.length:N4} {track.LoadedLoop.length:N4}"); #endif } Config = new Config(base.Config); @@ -708,8 +708,8 @@ namespace MuzikaGromche public required Language Language; // Whether this track has NSFW/explicit lyrics. public bool IsExplicit = false; - // Wind-up time can and should be shorter than the Start audio track, - // so that the "pop" effect can be baked into the Start audio and kept away + // Wind-up time can and should be shorter than the Intro audio track, + // so that the "pop" effect can be baked into the Intro audio and kept away // from the looped part. This also means that the light show starts before // the looped track does, so we need to sync them up as soon as we enter the Loop. public required float WindUpTimer; @@ -734,13 +734,13 @@ namespace MuzikaGromche // WAV is OK, but takes a lot of space. Try OGGVORBIS instead. public AudioType AudioType = AudioType.MPEG; - public AudioClip LoadedStart = null!; + public AudioClip LoadedIntro = null!; public AudioClip LoadedLoop = null!; // How often this track should be chosen, relative to the sum of weights of all tracks. public ConfigEntry Weight = null!; - public string FileNameStart => $"{Name}Start.{Ext}"; + public string FileNameIntro => $"{Name}Intro.{Ext}"; public string FileNameLoop => $"{Name}Loop.{Ext}"; private string Ext => AudioType switch { @@ -1111,36 +1111,36 @@ namespace MuzikaGromche class JesterAudioSourcesState { - private readonly float StartClipLength; + private readonly float IntroClipLength; - // Neither start.isPlaying or loop.isPlaying are reliable indicators of which track is actually playing right now: - // start.isPlaying would be true during the loop when Jester chases a player, + // Neither intro.isPlaying or loop.isPlaying are reliable indicators of which track is actually playing right now: + // intro.isPlaying would be true during the loop when Jester chases a player, // loop.isPlaying would be true when it is played delyaed but hasn't actually started playing yet. - private readonly ExtrapolatedAudioSourceState Start = new(); + private readonly ExtrapolatedAudioSourceState Intro = new(); private readonly ExtrapolatedAudioSourceState Loop = new(); // If true, use Start state as a reference, otherwise use Loop. - private bool ReferenceIsStart = true; + private bool ReferenceIsIntro = true; - public bool HasStarted => Start.HasStarted; + public bool HasStarted => Intro.HasStarted; - public bool IsExtrapolated => ReferenceIsStart ? Start.IsExtrapolated : Loop.IsExtrapolated; + public bool IsExtrapolated => ReferenceIsIntro ? Intro.IsExtrapolated : Loop.IsExtrapolated; // Time from the start of the start clip. It wraps when the loop AudioSource loops: // [...start...][...loop...] // ^ | // `----------' - public float Time => ReferenceIsStart - ? Start.Time - : StartClipLength + Loop.Time; + public float Time => ReferenceIsIntro + ? Intro.Time + : IntroClipLength + Loop.Time; - public JesterAudioSourcesState(float startClipLength) + public JesterAudioSourcesState(float introClipLength) { - StartClipLength = startClipLength; + IntroClipLength = introClipLength; } - public void Update(AudioSource start, AudioSource loop, float realtime) + public void Update(AudioSource intro, AudioSource loop, float realtime) { // It doesn't make sense to update start state after loop has started (because start.isPlaying occasionally becomes true). // But always makes sense to update loop, so we can check if it has actually started. @@ -1149,13 +1149,13 @@ namespace MuzikaGromche if (!Loop.HasStarted) { #if DEBUG - Debug.Assert(ReferenceIsStart); + Debug.Assert(ReferenceIsIntro); #endif - Start.Update(start, realtime); + Intro.Update(intro, realtime); } else { - ReferenceIsStart = false; + ReferenceIsIntro = false; } } } @@ -1191,7 +1191,7 @@ namespace MuzikaGromche // // NOTE 1: PlayDelayed also counts as isPlaying, so loop.isPlaying is always true and as such it's useful. // NOTE 2: There is a weird state when Jester has popped and chases a player: - // Start/farAudio isPlaying is true but stays exactly at zero time, so we need to ignore that. + // Intro/farAudio isPlaying is true but stays exactly at zero time, so we need to ignore that. var offset = StartOfLoop + additionalOffset; @@ -1246,15 +1246,15 @@ namespace MuzikaGromche LyricsRandomPerLoop = LyricsRandom.Next(); } this.track = track; - AudioState = new(track.LoadedStart.length); + AudioState = new(track.LoadedIntro.length); WindUpLoopingState = new(track.WindUpTimer, track.LoadedLoop.length, track.Beats); LoopLoopingState = new(track.WindUpTimer + track.LoopOffsetInSeconds, track.LoadedLoop.length, track.Beats); } - public List Update(AudioSource start, AudioSource loop) + public List Update(AudioSource intro, AudioSource loop) { var time = Time.realtimeSinceStartup; - AudioState.Update(start, loop, time); + AudioState.Update(intro, loop, time); if (AudioState.HasStarted) { @@ -1772,7 +1772,7 @@ namespace MuzikaGromche private void SetupEntriesToSkipWinding(ConfigFile configFile) { var syncedEntry = configFile.BindSyncedEntry("General", "Skip Winding Phase", false, - new ConfigDescription("Skip most of the wind-up/intro/start music.\n\nUse this option to test your Loop audio segment.")); + new ConfigDescription("Skip most of the wind-up/intro music.\n\nUse this option to test your Loop audio segment.")); LethalConfigManager.AddConfigItem(new BoolCheckBoxConfigItem(syncedEntry.Entry, Default(new BoolCheckBoxOptions()))); CSyncHackAddSyncedEntry(syncedEntry); syncedEntry.Changed += (sender, args) => apply(); @@ -2073,7 +2073,7 @@ namespace MuzikaGromche } } - // farAudio is during windup, Start overrides popGoesTheWeaselTheme + // farAudio is during windup, Intro overrides popGoesTheWeaselTheme // creatureVoice is when popped, Loop overrides screamingSFX [HarmonyPatch(typeof(JesterAI))] static class JesterPatch @@ -2104,7 +2104,7 @@ namespace MuzikaGromche }; if (__instance.currentBehaviourStateIndex == 2 && __instance.previousState != 2) { - // If just popped out, then override farAudio so that vanilla logic does not stop the modded Start music. + // If just popped out, then override farAudio so that vanilla logic does not stop the modded Intro music. // The game will stop farAudio it during its Update, so we temporarily set it to any other AudioSource // which we don't care about stopping for now. // @@ -2141,7 +2141,7 @@ namespace MuzikaGromche // Override popGoesTheWeaselTheme with Start audio __instance.farAudio.maxDistance = Plugin.AudioMaxDistance; - __instance.farAudio.clip = Plugin.CurrentTrack.LoadedStart; + __instance.farAudio.clip = Plugin.CurrentTrack.LoadedIntro; __instance.farAudio.loop = false; if (Config.ShouldSkipWindingPhase) { @@ -2156,7 +2156,7 @@ namespace MuzikaGromche } __instance.farAudio.Play(); - Debug.Log($"{nameof(MuzikaGromche)} Playing start music: maxDistance: {__instance.farAudio.maxDistance}, minDistance: {__instance.farAudio.minDistance}, volume: {__instance.farAudio.volume}, spread: {__instance.farAudio.spread}"); + Debug.Log($"{nameof(MuzikaGromche)} Playing Intro music: maxDistance: {__instance.farAudio.maxDistance}, minDistance: {__instance.farAudio.minDistance}, volume: {__instance.farAudio.volume}, spread: {__instance.farAudio.spread}"); } if (__instance.previousState != 2 && __state.previousState == 2) @@ -2171,22 +2171,22 @@ namespace MuzikaGromche __instance.farAudio = __state.farAudio; var time = __instance.farAudio.time; - var delay = Plugin.CurrentTrack.LoadedStart.length - time; + var delay = Plugin.CurrentTrack.LoadedIntro.length - time; - // Override screamingSFX with Loop, delayed by the remaining time of the Start audio + // Override screamingSFX with Loop, delayed by the remaining time of the Intro audio __instance.creatureVoice.Stop(); __instance.creatureVoice.maxDistance = Plugin.AudioMaxDistance; __instance.creatureVoice.clip = Plugin.CurrentTrack.LoadedLoop; __instance.creatureVoice.PlayDelayed(delay); - Debug.Log($"{nameof(MuzikaGromche)} Start length: {Plugin.CurrentTrack.LoadedStart.length}; played time: {time}"); + Debug.Log($"{nameof(MuzikaGromche)} Intro length: {Plugin.CurrentTrack.LoadedIntro.length}; played time: {time}"); Debug.Log($"{nameof(MuzikaGromche)} Playing loop music: maxDistance: {__instance.creatureVoice.maxDistance}, minDistance: {__instance.creatureVoice.minDistance}, volume: {__instance.creatureVoice.volume}, spread: {__instance.creatureVoice.spread}, in seconds: {delay}"); } // Manage the timeline: switch color of the lights according to the current playback/beat position. if ((__instance.previousState == 1 || __instance.previousState == 2) && Plugin.BeatTimeState is { } beatTimeState) { - var events = beatTimeState.Update(start: __instance.farAudio, loop: __instance.creatureVoice); + var events = beatTimeState.Update(intro: __instance.farAudio, loop: __instance.creatureVoice); foreach (var ev in events) { switch (ev)