Skip to content

Commit

Permalink
took way too long to balance points
Browse files Browse the repository at this point in the history
  • Loading branch information
Snirozu committed Oct 29, 2024
1 parent 7163fc0 commit ef06f60
Show file tree
Hide file tree
Showing 7 changed files with 62 additions and 28 deletions.
4 changes: 2 additions & 2 deletions source/backend/ClientPrefs.hx
Original file line number Diff line number Diff line change
Expand Up @@ -211,8 +211,8 @@ class ClientPrefs {
#end

if (ClientPrefs.data.unlockFramerate) {
FlxG.updateFramerate = 999;
FlxG.drawFramerate = 999;
FlxG.updateFramerate = 1000;
FlxG.drawFramerate = 1000;
} else if(data.framerate > FlxG.drawFramerate) {
FlxG.updateFramerate = data.framerate;
FlxG.drawFramerate = data.framerate;
Expand Down
2 changes: 1 addition & 1 deletion source/openfl/display/FPS.hx
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,7 @@ class FPS extends TextField

var currentCount = times.length;
currentFPS = Math.round((currentCount + cacheCount) / 2);
var optionFramerate = ClientPrefs.data.unlockFramerate ? 999 : ClientPrefs.data.framerate;
var optionFramerate = ClientPrefs.data.unlockFramerate ? 1000 : ClientPrefs.data.framerate;
if (currentFPS > optionFramerate) currentFPS = optionFramerate;

if (currentCount != cacheCount /*&& visible*/)
Expand Down
28 changes: 28 additions & 0 deletions source/options/GameplaySettingsSubState.hx
Original file line number Diff line number Diff line change
Expand Up @@ -109,6 +109,13 @@ class GameplaySettingsSubState extends BaseOptionsMenu
option.changeValue = 0.1;
addOption(option);

var option:Option = new Option('Max FPS', //Name
"If checked, the FPS limit will be set to 1000.\nThis setting makes the input timing more accurate, but in cost of minor graphical issues.", //Description
'unlockFramerate',
'bool');
option.onChange = onChangeFramerate;
addOption(option);

var option:Option = new Option('Disable Note Modchart',
'If checked, strum notes will no longer move or change their opacity to invisible.',
'disableStrumMovement',
Expand All @@ -130,6 +137,27 @@ class GameplaySettingsSubState extends BaseOptionsMenu
super();
}

function onChangeFramerate()
{
if (ClientPrefs.data.unlockFramerate) {
FlxG.updateFramerate = 1000;
FlxG.drawFramerate = 1000;
return;
}


if(ClientPrefs.data.framerate > FlxG.drawFramerate)
{
FlxG.updateFramerate = ClientPrefs.data.framerate;
FlxG.drawFramerate = ClientPrefs.data.framerate;
}
else
{
FlxG.drawFramerate = ClientPrefs.data.framerate;
FlxG.updateFramerate = ClientPrefs.data.framerate;
}
}

function onChangeHitsoundVolume()
{
FlxG.sound.play(Paths.sound('hitsound'), ClientPrefs.data.hitsoundVolume);
Expand Down
13 changes: 2 additions & 11 deletions source/options/GraphicsSettingsSubState.hx
Original file line number Diff line number Diff line change
Expand Up @@ -47,15 +47,6 @@ class GraphicsSettingsSubState extends BaseOptionsMenu

#if !html5 //Apparently other framerates isn't correctly supported on Browser? Probably it has some V-Sync shit enabled by default, idk

if (ClientPrefs.data.debugMode) {
var option:Option = new Option('Unlock FPS', //Name
"If checked, the FPS timer will be set to 999 (this can't be infinite for obvious reasons)", //Description
'unlockFramerate',
'bool');
option.onChange = onChangeFramerate;
addOption(option);
}

var option:Option = new Option('Framerate',
"Pretty self explanatory, isn't it?",
'framerate',
Expand Down Expand Up @@ -86,8 +77,8 @@ class GraphicsSettingsSubState extends BaseOptionsMenu
function onChangeFramerate()
{
if (ClientPrefs.data.unlockFramerate) {
FlxG.updateFramerate = 999;
FlxG.drawFramerate = 999;
FlxG.updateFramerate = 1000;
FlxG.drawFramerate = 1000;
return;
}

Expand Down
2 changes: 1 addition & 1 deletion source/psychlua/FunkinLua.hx
Original file line number Diff line number Diff line change
Expand Up @@ -176,7 +176,7 @@ class FunkinLua {
// Some settings, no jokes
set('downscroll', ClientPrefs.data.downScroll);
set('middlescroll', ClientPrefs.data.middleScroll);
set('framerate', ClientPrefs.data.unlockFramerate ? 999 : ClientPrefs.data.framerate);
set('framerate', ClientPrefs.data.unlockFramerate ? 1000 : ClientPrefs.data.framerate);
set('ghostTapping', ClientPrefs.getGhostTapping());
set('hideHud', ClientPrefs.data.hideHud);
set('timeBarType', ClientPrefs.data.timeBarType);
Expand Down
11 changes: 3 additions & 8 deletions source/states/FreeplayState.hx
Original file line number Diff line number Diff line change
Expand Up @@ -621,14 +621,6 @@ class FreeplayState extends MusicBeatState

listenToSong();
}
else if (controls.UI_LEFT_P) {
changeDiff(-1);
_updateSongLastDifficulty();
}
else if (controls.UI_RIGHT_P) {
changeDiff(1);
_updateSongLastDifficulty();
}
else if (controls.ACCEPT)
{
if (curSelected == -1) {
Expand Down Expand Up @@ -1150,6 +1142,9 @@ class FreeplayState extends MusicBeatState
if (curDifficulty >= Difficulty.list.length)
curDifficulty = 0;

if (songs[curSelected] == null)
return;

#if !switch
intendedScore = Highscore.getScore(songs[curSelected].songName, curDifficulty);
intendedRating = Highscore.getRating(songs[curSelected].songName, curDifficulty);
Expand Down
30 changes: 25 additions & 5 deletions source/states/PlayState.hx
Original file line number Diff line number Diff line change
Expand Up @@ -1937,7 +1937,9 @@ class PlayState extends MusicBeatState
makeEvent(event, i);
}

var densLast:Float = -1;
var tension:Float = 0;
var tenseCombo:Float = 0;
var densLastStrumTime:Float = -1;
for (section in noteData)
{
for (songNotes in section.sectionNotes)
Expand Down Expand Up @@ -1978,11 +1980,29 @@ class PlayState extends MusicBeatState
}

if (songNotes[2] <= 0 && playsAsBF() ? gottaHitNote : !gottaHitNote) {
var lastNoteDiff = (songNotes[0] - densLast) / playbackRate;
if (densLast != -1 && lastNoteDiff > 1 && lastNoteDiff <= 150) {
denseNotes += (150 - (lastNoteDiff)) * 0.00005 / (1 + denseNotes);
var noteDiff = (daStrumTime - densLastStrumTime) / playbackRate;

if (densLastStrumTime != -1 && noteDiff > 10) {
var keepCombo = tenseCombo < 2 || 150 - noteDiff <= tension / tenseCombo + 10;

if (noteDiff <= 150) {
if (keepCombo) {
tenseCombo++;
tension += 150 - noteDiff;
}
denseNotes += (150 - noteDiff) / 15000 / (1 + denseNotes);
}

if (noteDiff > 150 || !keepCombo) {
if (tenseCombo > 0) {
denseNotes += tension / tenseCombo * tenseCombo / 10000 * (1 + Math.max(0, tension / tenseCombo - 60) / 50);
}
tenseCombo = 0;
tension = 0;
}
}
densLast = songNotes[0];

densLastStrumTime = daStrumTime;
}

var oldNote:Note;
Expand Down

0 comments on commit ef06f60

Please sign in to comment.