From 51d36ea25e11466de297457cca75caba65e0556e Mon Sep 17 00:00:00 2001 From: EliteMasterEric Date: Sun, 24 Mar 2024 04:53:05 -0400 Subject: [PATCH 01/15] Work in progress on fixing Boyfriend's spook/tv animations --- .../graphics/adobeanimate/FlxAtlasSprite.hx | 17 +++ source/funkin/ui/freeplay/DJBoyfriend.hx | 133 ++++++++++++++---- source/funkin/ui/freeplay/FreeplayState.hx | 56 ++++---- 3 files changed, 145 insertions(+), 61 deletions(-) diff --git a/source/funkin/graphics/adobeanimate/FlxAtlasSprite.hx b/source/funkin/graphics/adobeanimate/FlxAtlasSprite.hx index c5a3a3771..5394bce1a 100644 --- a/source/funkin/graphics/adobeanimate/FlxAtlasSprite.hx +++ b/source/funkin/graphics/adobeanimate/FlxAtlasSprite.hx @@ -79,6 +79,23 @@ class FlxAtlasSprite extends FlxAnimate return this.currentAnimation; } + /** + * `anim.finished` always returns false on looping animations, + * but this function will return true if we are on the last frame of the looping animation. + */ + public function isLoopFinished():Bool + { + if (this.anim == null) return false; + if (!this.anim.isPlaying) return false; + + // Reverse animation finished. + if (this.anim.reversed && this.anim.curFrame == 0) return true; + // Forward animation finished. + if (!this.anim.reversed && this.anim.curFrame >= (this.anim.length - 1)) return true; + + return false; + } + /** * Plays an animation. * @param id A string ID of the animation to play. diff --git a/source/funkin/ui/freeplay/DJBoyfriend.hx b/source/funkin/ui/freeplay/DJBoyfriend.hx index 8cd63dba1..c77762d73 100644 --- a/source/funkin/ui/freeplay/DJBoyfriend.hx +++ b/source/funkin/ui/freeplay/DJBoyfriend.hx @@ -4,6 +4,7 @@ import flixel.FlxSprite; import flixel.util.FlxSignal; import funkin.util.assets.FlxAnimationUtil; import funkin.graphics.adobeanimate.FlxAtlasSprite; +import funkin.audio.FunkinSound; import flixel.util.FlxTimer; import funkin.audio.FunkinSound; import funkin.audio.FlxStreamSound; @@ -26,8 +27,8 @@ class DJBoyfriend extends FlxAtlasSprite var gotSpooked:Bool = false; - static final SPOOK_PERIOD:Float = 120.0; - static final TV_PERIOD:Float = 180.0; + static final SPOOK_PERIOD:Float = 10.0; + static final TV_PERIOD:Float = 10.0; // Time since dad last SPOOKED you. var timeSinceSpook:Float = 0; @@ -87,20 +88,21 @@ class DJBoyfriend extends FlxAtlasSprite timeSinceSpook = 0; case Idle: // We are in this state the majority of the time. - if (getCurrentAnimation() != 'Boyfriend DJ' || anim.finished) + if (getCurrentAnimation() != 'Boyfriend DJ') { - if (timeSinceSpook > SPOOK_PERIOD && !gotSpooked) + playFlashAnimation('Boyfriend DJ', true); + } + + if (getCurrentAnimation() == 'Boyfriend DJ' && this.isLoopFinished()) + { + if (timeSinceSpook >= SPOOK_PERIOD && !gotSpooked) { currentState = Spook; } - else if (timeSinceSpook > TV_PERIOD) + else if (timeSinceSpook >= TV_PERIOD) { currentState = TV; } - else - { - playFlashAnimation('Boyfriend DJ', false); - } } timeSinceSpook += elapsed; case Confirm: @@ -111,6 +113,7 @@ class DJBoyfriend extends FlxAtlasSprite { onSpook.dispatch(); playFlashAnimation('bf dj afk', false); + gotSpooked = true; } timeSinceSpook = 0; case TV: @@ -119,6 +122,34 @@ class DJBoyfriend extends FlxAtlasSprite default: // I shit myself. } + + if (FlxG.keys.pressed.CONTROL) + { + if (FlxG.keys.justPressed.LEFT) + { + this.offsetX -= FlxG.keys.pressed.ALT ? 0.1 : (FlxG.keys.pressed.SHIFT ? 10.0 : 1.0); + } + + if (FlxG.keys.justPressed.RIGHT) + { + this.offsetX += FlxG.keys.pressed.ALT ? 0.1 : (FlxG.keys.pressed.SHIFT ? 10.0 : 1.0); + } + + if (FlxG.keys.justPressed.UP) + { + this.offsetY -= FlxG.keys.pressed.ALT ? 0.1 : (FlxG.keys.pressed.SHIFT ? 10.0 : 1.0); + } + + if (FlxG.keys.justPressed.DOWN) + { + this.offsetY += FlxG.keys.pressed.ALT ? 0.1 : (FlxG.keys.pressed.SHIFT ? 10.0 : 1.0); + } + + if (FlxG.keys.justPressed.SPACE) + { + currentState = (currentState == Idle ? TV : Idle); + } + } } function onFinishAnim():Void @@ -139,11 +170,15 @@ class DJBoyfriend extends FlxAtlasSprite case "Boyfriend DJ watchin tv OG": var frame:Int = FlxG.random.bool(33) ? 112 : 166; - if (FlxG.random.bool(10)) + + // BF switches channels when the video ends, or at a 10% chance each time his idle loops. + if (FlxG.random.bool(5)) { frame = 60; // boyfriend switches channel code? + // runTvLogic(); } + trace('Replay idle: ${frame}'); anim.play("Boyfriend DJ watchin tv OG", true, false, frame); // trace('Finished confirm'); } @@ -152,24 +187,31 @@ class DJBoyfriend extends FlxAtlasSprite public function resetAFKTimer():Void { timeSinceSpook = 0; + gotSpooked = false; } + var offsetX:Float = 0.0; + var offsetY:Float = 0.0; + function setupAnimations():Void { - // animation.addByPrefix('intro', "boyfriend dj intro", 24, false); - addOffset('boyfriend dj intro', 8, 3); + // Intro + addOffset('boyfriend dj intro', 8.0 - 1.3, 3.0 - 0.4); - // animation.addByPrefix('idle', "Boyfriend DJ0", 24, false); + // Idle addOffset('Boyfriend DJ', 0, 0); - // animation.addByPrefix('confirm', "Boyfriend DJ confirm", 24, false); + // Confirm addOffset('Boyfriend DJ confirm', 0, 0); - // animation.addByPrefix('spook', "bf dj afk0", 24, false); - addOffset('bf dj afk', 0, 0); + // AFK: Spook + addOffset('bf dj afk', 649.5, 58.5); + + // AFK: TV + addOffset('Boyfriend DJ watchin tv OG', 0, 0); } - var cartoonSnd:FlxStreamSound; + var cartoonSnd:Null = null; public var playingCartoon:Bool = false; @@ -178,39 +220,47 @@ class DJBoyfriend extends FlxAtlasSprite if (cartoonSnd == null) { // tv is OFF, but getting turned on - FunkinSound.playOnce(Paths.sound('tv_on')); - - cartoonSnd = new FlxStreamSound(); - FlxG.sound.defaultSoundGroup.add(cartoonSnd); + // Eric got FUCKING TROLLED there is no `tv_on` or `channel_switch` sound! + // FunkinSound.playOnce(Paths.sound('tv_on'), 1.0, function() { + // }); + loadCartoon(); } else { // plays it smidge after the click - new FlxTimer().start(0.1, function(_) { - FunkinSound.playOnce(Paths.sound('channel_switch')); - }); + // new FlxTimer().start(0.1, function(_) { + // // FunkinSound.playOnce(Paths.sound('channel_switch')); + // }); + cartoonSnd.destroy(); + loadCartoon(); } - // cartoonSnd.loadEmbedded(Paths.sound("cartoons/peck")); - // cartoonSnd.play(); - loadCartoon(); + // loadCartoon(); } function loadCartoon() { - cartoonSnd.loadEmbedded(Paths.sound(getRandomFlashToon()), false, false, function() { + cartoonSnd = FunkinSound.load(Paths.sound(getRandomFlashToon()), 1.0, false, true, true, function() { anim.play("Boyfriend DJ watchin tv OG", true, false, 60); }); - cartoonSnd.play(true, FlxG.random.float(0, cartoonSnd.length)); + + // Fade out music to 40% volume over 1 second. + // This helps make the TV a bit more audible. + FlxG.sound.music.fadeOut(1.0, 0.4); + + // Play the cartoon at a random time between the start and 5 seconds from the end. + cartoonSnd.time = FlxG.random.float(0, Math.max(cartoonSnd.length - (5 * Constants.MS_PER_SEC), 0.0)); } - var cartoonList:Array = openfl.utils.Assets.list().filter(function(path) return path.startsWith("assets/sounds/cartoons/")); + final cartoonList:Array = openfl.utils.Assets.list().filter(function(path) return path.startsWith("assets/sounds/cartoons/")); function getRandomFlashToon():String { var randomFile = FlxG.random.getObject(cartoonList); + // Strip folder prefix randomFile = randomFile.replace("assets/sounds/", ""); + // Strip file extension randomFile = randomFile.substring(0, randomFile.length - 4); return randomFile; @@ -244,10 +294,31 @@ class DJBoyfriend extends FlxAtlasSprite var daOffset = animOffsets.get(AnimName); if (animOffsets.exists(AnimName)) { - offset.set(daOffset[0], daOffset[1]); + var xValue = daOffset[0]; + var yValue = daOffset[1]; + if (AnimName == "Boyfriend DJ watchin tv OG") + { + xValue += offsetX; + yValue += offsetY; + } + + offset.set(xValue, yValue); } else + { offset.set(0, 0); + } + } + + public override function destroy():Void + { + super.destroy(); + + if (cartoonSnd != null) + { + cartoonSnd.destroy(); + cartoonSnd = null; + } } } diff --git a/source/funkin/ui/freeplay/FreeplayState.hx b/source/funkin/ui/freeplay/FreeplayState.hx index 249c7ffae..55c36e03f 100644 --- a/source/funkin/ui/freeplay/FreeplayState.hx +++ b/source/funkin/ui/freeplay/FreeplayState.hx @@ -688,14 +688,6 @@ class FreeplayState extends MusicBeatSubState if (FlxG.keys.justPressed.T) typing.hasFocus = true; - if (FlxG.sound.music != null) - { - if (FlxG.sound.music.volume < 0.7) - { - FlxG.sound.music.volume += 0.5 * elapsed; - } - } - lerpScore = MathUtil.coolLerp(lerpScore, intendedScore, 0.2); lerpCompletion = MathUtil.coolLerp(lerpCompletion, intendedCompletion, 0.9); @@ -733,9 +725,9 @@ class FreeplayState extends MusicBeatSubState { if (busy) return; - var upP:Bool = controls.UI_UP_P; - var downP:Bool = controls.UI_DOWN_P; - var accepted:Bool = controls.ACCEPT; + var upP:Bool = controls.UI_UP_P && !FlxG.keys.pressed.CONTROL; + var downP:Bool = controls.UI_DOWN_P && !FlxG.keys.pressed.CONTROL; + var accepted:Bool = controls.ACCEPT && !FlxG.keys.pressed.CONTROL; if (FlxG.onMobile) { @@ -809,10 +801,8 @@ class FreeplayState extends MusicBeatSubState } #end - if (controls.UI_UP || controls.UI_DOWN) + if (!FlxG.keys.pressed.CONTROL && (controls.UI_UP || controls.UI_DOWN)) { - spamTimer += elapsed; - if (spamming) { if (spamTimer >= 0.07) @@ -829,7 +819,24 @@ class FreeplayState extends MusicBeatSubState } } } - else if (spamTimer >= 0.9) spamming = true; + else if (spamTimer >= 0.9) + { + spamming = true; + } + else if (spamTimer <= 0) + { + if (controls.UI_UP) + { + changeSelection(-1); + } + else + { + changeSelection(1); + } + } + + spamTimer += elapsed; + dj.resetAFKTimer(); } else { @@ -837,29 +844,18 @@ class FreeplayState extends MusicBeatSubState spamTimer = 0; } - if (upP) - { - dj.resetAFKTimer(); - changeSelection(-1); - } - if (downP) - { - dj.resetAFKTimer(); - changeSelection(1); - } - if (FlxG.mouse.wheel != 0) { dj.resetAFKTimer(); changeSelection(-Math.round(FlxG.mouse.wheel / 4)); } - if (controls.UI_LEFT_P) + if (controls.UI_LEFT_P && !FlxG.keys.pressed.CONTROL) { dj.resetAFKTimer(); changeDiff(-1); } - if (controls.UI_RIGHT_P) + if (controls.UI_RIGHT_P && !FlxG.keys.pressed.CONTROL) { dj.resetAFKTimer(); changeDiff(1); @@ -1227,8 +1223,8 @@ class DifficultySelector extends FlxSprite override function update(elapsed:Float):Void { - if (flipX && controls.UI_RIGHT_P) moveShitDown(); - if (!flipX && controls.UI_LEFT_P) moveShitDown(); + if (flipX && controls.UI_RIGHT_P && !FlxG.keys.pressed.CONTROL) moveShitDown(); + if (!flipX && controls.UI_LEFT_P && !FlxG.keys.pressed.CONTROL) moveShitDown(); super.update(elapsed); } From e84fdf9fac2def3e6b880732b767585477ae5cc9 Mon Sep 17 00:00:00 2001 From: EliteMasterEric Date: Tue, 26 Mar 2024 19:38:42 -0400 Subject: [PATCH 02/15] Resolve FlxG.sound.music crash --- source/funkin/play/PlayState.hx | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/source/funkin/play/PlayState.hx b/source/funkin/play/PlayState.hx index a8cb879a3..62801028f 100644 --- a/source/funkin/play/PlayState.hx +++ b/source/funkin/play/PlayState.hx @@ -2941,7 +2941,7 @@ class PlayState extends MusicBeatSubState if (overrideMusic) { // Stop the music. Do NOT destroy it, something still references it! - FlxG.sound.music.pause(); + if (FlxG.sound.music != null) FlxG.sound.music.pause(); if (vocals != null) { vocals.pause(); @@ -2951,7 +2951,7 @@ class PlayState extends MusicBeatSubState else { // Stop and destroy the music. - FlxG.sound.music.pause(); + if (FlxG.sound.music != null) FlxG.sound.music.pause(); if (vocals != null) { vocals.destroy(); From 9ebb253b53a931c019a54794b0805a4d3a830654 Mon Sep 17 00:00:00 2001 From: EliteMasterEric Date: Tue, 26 Mar 2024 19:38:56 -0400 Subject: [PATCH 03/15] Fix music updating issue. --- source/funkin/audio/FunkinSound.hx | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/source/funkin/audio/FunkinSound.hx b/source/funkin/audio/FunkinSound.hx index 687860265..9d6dee6ef 100644 --- a/source/funkin/audio/FunkinSound.hx +++ b/source/funkin/audio/FunkinSound.hx @@ -50,6 +50,11 @@ class FunkinSound extends FlxSound implements ICloneable */ static var pool(default, null):FlxTypedGroup = new FlxTypedGroup(); + /** + * Calculate the current time of the sound. + * NOTE: You need to `add()` the sound to the scene for `update()` to increment the time. + */ + // public var muted(default, set):Bool = false; function set_muted(value:Bool):Bool @@ -392,8 +397,6 @@ class FunkinSound extends FlxSound implements ICloneable // Call onLoad() because the sound already loaded if (onLoad != null && sound._sound != null) onLoad(); - FlxG.sound.list.remove(FlxG.sound.music); - return sound; } From 291a9f630d9a29406d75fe8a50b49a24ab07bd2d Mon Sep 17 00:00:00 2001 From: EliteMasterEric Date: Tue, 26 Mar 2024 19:39:02 -0400 Subject: [PATCH 04/15] Update assets submodule --- assets | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/assets b/assets index 8bb6214e1..d2946604e 160000 --- a/assets +++ b/assets @@ -1 +1 @@ -Subproject commit 8bb6214e16c823b8b5a522a39b7a7e01d6283abf +Subproject commit d2946604e1dfb4fb80f6bf3cb73da8538963eade From 0e93f2ab278a8f4ff863ea267a037b026af97333 Mon Sep 17 00:00:00 2001 From: EliteMasterEric Date: Tue, 26 Mar 2024 21:30:08 -0400 Subject: [PATCH 05/15] Improve error logging when the game can't find a chart file. --- source/funkin/data/song/SongRegistry.hx | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/source/funkin/data/song/SongRegistry.hx b/source/funkin/data/song/SongRegistry.hx index d82e184a5..4fdf5d0df 100644 --- a/source/funkin/data/song/SongRegistry.hx +++ b/source/funkin/data/song/SongRegistry.hx @@ -431,7 +431,11 @@ class SongRegistry extends BaseRegistry { variation = variation == null ? Constants.DEFAULT_VARIATION : variation; var entryFilePath:String = Paths.json('$dataFilePath/$id/$id-metadata${variation == Constants.DEFAULT_VARIATION ? '' : '-$variation'}'); - if (!openfl.Assets.exists(entryFilePath)) return null; + if (!openfl.Assets.exists(entryFilePath)) + { + trace(' [WARN] Could not locate file $entryFilePath'); + return null; + } var rawJson:Null = openfl.Assets.getText(entryFilePath); if (rawJson == null) return null; rawJson = rawJson.trim(); From d373e1bfed44bb38daef38c43615bafdde14ba6c Mon Sep 17 00:00:00 2001 From: EliteMasterEric Date: Tue, 26 Mar 2024 21:30:25 -0400 Subject: [PATCH 06/15] Implement a bunch of updated charts. --- assets | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/assets b/assets index 5f1726f1b..08e095b6e 160000 --- a/assets +++ b/assets @@ -1 +1 @@ -Subproject commit 5f1726f1b0c11fc747b7473708cf4e5f28be05f1 +Subproject commit 08e095b6e876b9241a0634a4021e9fbb14fe1304 From 6b35898ed9235c5f205aebc4fee3d9693dccb049 Mon Sep 17 00:00:00 2001 From: EliteMasterEric Date: Tue, 26 Mar 2024 23:24:59 -0400 Subject: [PATCH 07/15] Fix some issues with Weekend 1. --- assets | 2 +- source/funkin/audio/FunkinSound.hx | 18 +++++++++++------- source/funkin/audio/SoundGroup.hx | 9 ++++++--- source/funkin/audio/VoicesGroup.hx | 2 ++ source/funkin/play/PlayState.hx | 8 +++++--- 5 files changed, 25 insertions(+), 14 deletions(-) diff --git a/assets b/assets index 5f1726f1b..0a2b524a8 160000 --- a/assets +++ b/assets @@ -1 +1 @@ -Subproject commit 5f1726f1b0c11fc747b7473708cf4e5f28be05f1 +Subproject commit 0a2b524a8dd1d94909e2f078dbdcb191e1b55b8c diff --git a/source/funkin/audio/FunkinSound.hx b/source/funkin/audio/FunkinSound.hx index 687860265..6520ff27f 100644 --- a/source/funkin/audio/FunkinSound.hx +++ b/source/funkin/audio/FunkinSound.hx @@ -1,17 +1,18 @@ package funkin.audio; -import flixel.sound.FlxSound; import flixel.group.FlxGroup.FlxTypedGroup; -import flixel.util.FlxSignal.FlxTypedSignal; +import flixel.math.FlxMath; +import flixel.sound.FlxSound; import flixel.system.FlxAssets.FlxSoundAsset; -import funkin.util.tools.ICloneable; +import flixel.tweens.FlxTween; +import flixel.util.FlxSignal.FlxTypedSignal; +import funkin.audio.waveform.WaveformData; +import funkin.audio.waveform.WaveformDataParser; import funkin.data.song.SongData.SongMusicData; import funkin.data.song.SongRegistry; -import funkin.audio.waveform.WaveformData; -import openfl.media.SoundMixer; -import funkin.audio.waveform.WaveformDataParser; -import flixel.math.FlxMath; +import funkin.util.tools.ICloneable; import openfl.Assets; +import openfl.media.SoundMixer; #if (openfl >= "8.0.0") import openfl.utils.AssetType; #end @@ -325,6 +326,7 @@ class FunkinSound extends FlxSound implements ICloneable if (FlxG.sound.music != null) { + FlxG.sound.music.fadeTween?.cancel(); FlxG.sound.music.stop(); FlxG.sound.music.kill(); } @@ -401,6 +403,8 @@ class FunkinSound extends FlxSound implements ICloneable { // trace('[FunkinSound] Destroying sound "${this._label}"'); super.destroy(); + FlxTween.cancelTweensOf(this); + this._label = 'unknown'; } /** diff --git a/source/funkin/audio/SoundGroup.hx b/source/funkin/audio/SoundGroup.hx index 9a754049b..020d5f5bb 100644 --- a/source/funkin/audio/SoundGroup.hx +++ b/source/funkin/audio/SoundGroup.hx @@ -152,9 +152,12 @@ class SoundGroup extends FlxTypedGroup */ public function stop() { - forEachAlive(function(sound:FunkinSound) { - sound.stop(); - }); + if (members != null) + { + forEachAlive(function(sound:FunkinSound) { + sound.stop(); + }); + } } public override function destroy() diff --git a/source/funkin/audio/VoicesGroup.hx b/source/funkin/audio/VoicesGroup.hx index 5daebc89d..91054cfb0 100644 --- a/source/funkin/audio/VoicesGroup.hx +++ b/source/funkin/audio/VoicesGroup.hx @@ -160,7 +160,9 @@ class VoicesGroup extends SoundGroup public override function destroy():Void { playerVoices.destroy(); + playerVoices = null; opponentVoices.destroy(); + opponentVoices = null; super.destroy(); } } diff --git a/source/funkin/play/PlayState.hx b/source/funkin/play/PlayState.hx index 169809a63..6dc41e3f9 100644 --- a/source/funkin/play/PlayState.hx +++ b/source/funkin/play/PlayState.hx @@ -1925,14 +1925,14 @@ class PlayState extends MusicBeatSubState FlxG.sound.music.play(true, startTimestamp - Conductor.instance.instrumentalOffset); FlxG.sound.music.pitch = playbackRate; - // I am going insane. + // Prevent the volume from being wrong. FlxG.sound.music.volume = 1.0; - FlxG.sound.music.fadeTween?.cancel(); trace('Playing vocals...'); add(vocals); vocals.play(); + vocals.volume = 1.0; vocals.pitch = playbackRate; resyncVocals(); @@ -2927,6 +2927,9 @@ class PlayState extends MusicBeatSubState // If the camera is being tweened, stop it. cancelAllCameraTweens(); + // Dispatch the destroy event. + dispatchEvent(new ScriptEvent(DESTROY, false)); + if (currentConversation != null) { remove(currentConversation); @@ -2970,7 +2973,6 @@ class PlayState extends MusicBeatSubState { remove(currentStage); currentStage.kill(); - dispatchEvent(new ScriptEvent(DESTROY, false)); currentStage = null; } From 5ec3546bbc8f25e7131b8de6460720e6ca310fbb Mon Sep 17 00:00:00 2001 From: FabsTheFabs Date: Wed, 27 Mar 2024 04:31:03 +0000 Subject: [PATCH 08/15] fixed song delay and made volume consistent across all tracks --- assets | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/assets b/assets index 5f1726f1b..18af5434e 160000 --- a/assets +++ b/assets @@ -1 +1 @@ -Subproject commit 5f1726f1b0c11fc747b7473708cf4e5f28be05f1 +Subproject commit 18af5434e9aaaec5cdd1b20c4cfe11786db303d8 From 4209c5156ee6e211463808d83e0d34ec0769318b Mon Sep 17 00:00:00 2001 From: EliteMasterEric Date: Wed, 27 Mar 2024 00:39:48 -0400 Subject: [PATCH 09/15] Readd a missing sound in the story menu --- source/funkin/ui/story/StoryMenuState.hx | 3 +++ 1 file changed, 3 insertions(+) diff --git a/source/funkin/ui/story/StoryMenuState.hx b/source/funkin/ui/story/StoryMenuState.hx index d3aa68c49..5881ef624 100644 --- a/source/funkin/ui/story/StoryMenuState.hx +++ b/source/funkin/ui/story/StoryMenuState.hx @@ -438,6 +438,8 @@ class StoryMenuState extends MusicBeatState } } + FunkinSound.playOnce(Paths.sound('scrollMenu'), 0.4); + updateText(); updateBackground(previousLevelId); updateProps(); @@ -481,6 +483,7 @@ class StoryMenuState extends MusicBeatState if (hasChanged) { buildDifficultySprite(); + FunkinSound.playOnce(Paths.sound('scrollMenu'), 0.4); // Disable the funny music thing for now. // funnyMusicThing(); } From 982616e2ba1b2338f5bd5e03b1255730f0abba21 Mon Sep 17 00:00:00 2001 From: Cameron Taylor Date: Wed, 27 Mar 2024 01:05:53 -0400 Subject: [PATCH 10/15] assets submod --- assets | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/assets b/assets index 0a2b524a8..90d7bcfaf 160000 --- a/assets +++ b/assets @@ -1 +1 @@ -Subproject commit 0a2b524a8dd1d94909e2f078dbdcb191e1b55b8c +Subproject commit 90d7bcfaf9f46303c1b644bd36350de80df9f2c6 From b3076c7ec479f70255155878358fadad3508963e Mon Sep 17 00:00:00 2001 From: Cameron Taylor Date: Wed, 27 Mar 2024 01:07:37 -0400 Subject: [PATCH 11/15] assets submod --- assets | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/assets b/assets index 18af5434e..fda21459b 160000 --- a/assets +++ b/assets @@ -1 +1 @@ -Subproject commit 18af5434e9aaaec5cdd1b20c4cfe11786db303d8 +Subproject commit fda21459bdbf6198c1c39d60e347782d7286eda6 From 75b8336dce4ca4b04f01fd9e8a715af3cdbbe62c Mon Sep 17 00:00:00 2001 From: Cameron Taylor Date: Wed, 27 Mar 2024 01:09:24 -0400 Subject: [PATCH 12/15] assets submod --- assets | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/assets b/assets index 08e095b6e..8013845e3 160000 --- a/assets +++ b/assets @@ -1 +1 @@ -Subproject commit 08e095b6e876b9241a0634a4021e9fbb14fe1304 +Subproject commit 8013845e331015b40c4cc35230f6d02bd2148d52 From 843095e3deb7619bab5d0a97200370072b579acc Mon Sep 17 00:00:00 2001 From: EliteMasterEric Date: Wed, 27 Mar 2024 01:25:38 -0400 Subject: [PATCH 13/15] Add debug logging to Flixel debugger for miss judgements --- source/funkin/play/scoring/Scoring.hx | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/source/funkin/play/scoring/Scoring.hx b/source/funkin/play/scoring/Scoring.hx index edfb2cae7..744091b44 100644 --- a/source/funkin/play/scoring/Scoring.hx +++ b/source/funkin/play/scoring/Scoring.hx @@ -43,7 +43,7 @@ class Scoring case WEEK7: scoreNoteWEEK7(msTiming); case PBOT1: scoreNotePBOT1(msTiming); default: - trace('ERROR: Unknown scoring system: ' + scoringSystem); + FlxG.log.error('Unknown scoring system: ${scoringSystem}'); 0; } } @@ -62,7 +62,7 @@ class Scoring case WEEK7: judgeNoteWEEK7(msTiming); case PBOT1: judgeNotePBOT1(msTiming); default: - trace('ERROR: Unknown scoring system: ' + scoringSystem); + FlxG.log.error('Unknown scoring system: ${scoringSystem}'); 'miss'; } } @@ -145,7 +145,9 @@ class Scoring case(_ < PBOT1_PERFECT_THRESHOLD) => true: PBOT1_MAX_SCORE; default: + // Fancy equation. var factor:Float = 1.0 - (1.0 / (1.0 + Math.exp(-PBOT1_SCORING_SLOPE * (absTiming - PBOT1_SCORING_OFFSET)))); + var score:Int = Std.int(PBOT1_MAX_SCORE * factor + PBOT1_MIN_SCORE); score; @@ -169,6 +171,7 @@ class Scoring case(_ < PBOT1_SHIT_THRESHOLD) => true: 'shit'; default: + FlxG.log.warn('Missed note: Bad timing ($absTiming < $PBOT1_SHIT_THRESHOLD)'); 'miss'; } } @@ -257,6 +260,7 @@ class Scoring case(_ < LEGACY_HIT_WINDOW * LEGACY_SHIT_THRESHOLD) => true: 'shit'; default: + FlxG.log.warn('Missed note: Bad timing ($absTiming < $LEGACY_SHIT_THRESHOLD)'); 'miss'; } } @@ -336,6 +340,7 @@ class Scoring } else { + FlxG.log.warn('Missed note: Bad timing ($absTiming < $WEEK7_HIT_WINDOW)'); return 'miss'; } } From 31817959855104d50f54b814697e0862c1b1901a Mon Sep 17 00:00:00 2001 From: Cameron Taylor Date: Wed, 27 Mar 2024 20:58:58 -0400 Subject: [PATCH 14/15] remove trace() calls from ages ago while im here --- source/funkin/ui/freeplay/DJBoyfriend.hx | 1 - source/funkin/ui/freeplay/SongMenuItem.hx | 2 -- 2 files changed, 3 deletions(-) diff --git a/source/funkin/ui/freeplay/DJBoyfriend.hx b/source/funkin/ui/freeplay/DJBoyfriend.hx index c77762d73..33f264301 100644 --- a/source/funkin/ui/freeplay/DJBoyfriend.hx +++ b/source/funkin/ui/freeplay/DJBoyfriend.hx @@ -49,7 +49,6 @@ class DJBoyfriend extends FlxAtlasSprite }; setupAnimations(); - trace(listAnimations()); FlxG.debugger.track(this); FlxG.console.registerObject("dj", this); diff --git a/source/funkin/ui/freeplay/SongMenuItem.hx b/source/funkin/ui/freeplay/SongMenuItem.hx index c20d81328..bffa821b3 100644 --- a/source/funkin/ui/freeplay/SongMenuItem.hx +++ b/source/funkin/ui/freeplay/SongMenuItem.hx @@ -182,8 +182,6 @@ class SongMenuItem extends FlxSpriteGroup { var charPath:String = "freeplay/icons/"; - trace(char); - // TODO: Put this in the character metadata where it belongs. // TODO: Also, can use CharacterDataParser.getCharPixelIconAsset() switch (char) From 17df6a515fa3c79e2bd25f7fbdd4f9d545564128 Mon Sep 17 00:00:00 2001 From: Cameron Taylor Date: Wed, 27 Mar 2024 22:11:31 -0400 Subject: [PATCH 15/15] assets submod --- assets | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/assets b/assets index d2946604e..485243fdd 160000 --- a/assets +++ b/assets @@ -1 +1 @@ -Subproject commit d2946604e1dfb4fb80f6bf3cb73da8538963eade +Subproject commit 485243fdd44acbc4db6a97ec7bf10a8b18350be9