diff --git a/Docs/Changelog_sm-ssc.txt b/Docs/Changelog_sm-ssc.txt index 19686ce5bc..ccc229b0b6 100644 --- a/Docs/Changelog_sm-ssc.txt +++ b/Docs/Changelog_sm-ssc.txt @@ -13,6 +13,11 @@ _____________________________________________________________________________ sm-ssc $SM5VERSION | 2011???? -------------------------------------------------------------------------------- +20110417 +-------- +* Use lua for all primary score keeping. Course modes right now still use the + old fashioned system. [TeruFSX, Wolfman2000] + 20110409 -------- * [Player] Force hold judgments to take place before setting the score. diff --git a/Themes/_fallback/BGAnimations/ScreenGameplay decorations/default.lua b/Themes/_fallback/BGAnimations/ScreenGameplay decorations/default.lua new file mode 100644 index 0000000000..8282ba3aa6 --- /dev/null +++ b/Themes/_fallback/BGAnimations/ScreenGameplay decorations/default.lua @@ -0,0 +1,11 @@ +local t = Def.ActorFrame {}; + +if( not GAMESTATE:IsCourseMode() ) then +t[#t+1] = Def.Actor{ + JudgmentMessageCommand = function(self, params) + Scoring[GetUserPref("UserPrefScoringMode")](params, + STATSMAN:GetCurStageStats():GetPlayerStageStats(params.Player)) + end; +}; +end; +return t; \ No newline at end of file diff --git a/Themes/_fallback/Languages/en.ini b/Themes/_fallback/Languages/en.ini index 1445c01071..8e8bb89063 100644 --- a/Themes/_fallback/Languages/en.ini +++ b/Themes/_fallback/Languages/en.ini @@ -478,6 +478,9 @@ Edit Course=Edit Course contents. Shuffle=Shuffle the songs around. # GamePrefDefaultFail=Immediate fail causes a player to die when their life bar reaches 0. ImmediateContinue allows you to continue playing afterwards. +# +UserPrefScoringMode=Select the scoring mode to be used when not in a course. + [OptionNames] 0=0 0.25x=0.25x @@ -1049,6 +1052,8 @@ Edit Course=Edit Course Shuffle=Shuffle # GamePrefDefaultFail=Default Fail Type +# +UserPrefScoringMode=Scoring Mode [PaneDisplay] Steps=Steps Holds=Holds diff --git a/Themes/_fallback/Scripts/03 ThemePrefs.lua b/Themes/_fallback/Scripts/03 ThemePrefs.lua index 0a61da5741..dfa9e3e695 100644 --- a/Themes/_fallback/Scripts/03 ThemePrefs.lua +++ b/Themes/_fallback/Scripts/03 ThemePrefs.lua @@ -139,3 +139,40 @@ ThemePrefs = -- global aliases GetThemePref = ThemePrefs.Get SetThemePref = ThemePrefs.Set + + +-- bring in SpecialScoring from default. + +function InitUserPrefs() + if GetUserPref("UserPrefScoringMode") == nil then + SetUserPref("UserPrefScoringMode", 'DDR Extreme'); + end; +end; + +function UserPrefScoringMode() + local baseChoices = { 'DDR 1stMIX', 'DDR 4thMIX', 'DDR Extreme', 'DDR SuperNOVA', 'DDR SuperNOVA 2', 'MIGS' }; --'[SSC] Radar Master' + local t = { + Name = "UserPrefScoringMode"; + LayoutType = "ShowAllInRow"; + SelectType = "SelectOne"; + OneChoiceForAllPlayers = true; + ExportOnChange = false; + Choices = baseChoices; + LoadSelections = function(self, list, pn) + if ReadPrefFromFile("UserPrefScoringMode") ~= nil then + local theValue = ReadPrefFromFile("UserPrefScoringMode"); + local success = false; + for k,v in ipairs(baseChoices) do if v == theValue then list[k] = true success = true break end end; + if success == false then list[1] = true end; + else + WritePrefToFile("UserPrefScoringMode", 'DDR Extreme'); + list[1] = true; + end; + end; + SaveSelections = function(self, list, pn) + for k,v in ipairs(list) do if v then WritePrefToFile("UserPrefScoringMode", baseChoices[k]) break end end; + end; + }; + setmetatable( t, t ); + return t; +end \ No newline at end of file diff --git a/Themes/_fallback/Scripts/04 SpecialScoring.lua b/Themes/_fallback/Scripts/04 Scoring.lua similarity index 68% rename from Themes/_fallback/Scripts/04 SpecialScoring.lua rename to Themes/_fallback/Scripts/04 Scoring.lua index 65748dac25..c0bf2b9bda 100644 --- a/Themes/_fallback/Scripts/04 SpecialScoring.lua +++ b/Themes/_fallback/Scripts/04 Scoring.lua @@ -10,8 +10,7 @@ local ZeroIfNotFound = { __index = function() return 0 end; }; function GetTotalItems(radars) return radars:GetValue('RadarCategory_TapsAndHolds') + radars:GetValue('RadarCategory_Holds') - + radars:GetValue('RadarCategory_Rolls') - + radars:GetValue('RadarCategory_Lifts'); + + radars:GetValue('RadarCategory_Rolls'); end; -- Determine whether marvelous timing is to be considered. @@ -33,21 +32,43 @@ end; r['DDR 1stMIX'] = function(params, pss) local dCombo = math.floor((pss:GetCurrentCombo()+1)/4); local bScore = (dCombo^2+1) * 100; - local multLookup = { ['TapNoteScore_W1']=3, ['TapNoteScore_W2']=3, ['TapNoteScore_W3']=1 }; + local multLookup = + { + ['TapNoteScore_W1']=3, + ['TapNoteScore_W2']=3, + ['TapNoteScore_W3']=1 + }; setmetatable(multLookup, ZeroIfNotFound); --if score increases above the boundaries of a 32-bit signed --(about 2.15 billion), it stops increasing. Conveniently, --1st Mix clamped score as well. - pss:SetScore(clamp(pss:GetScore()+(bScore*multLookup[params.TapNoteScore]),0,999999999)); + local capScore = 999999999; + local bestScore = bScore * multLookup['TapNoteScore_W1']; + local localScore = bScore * multLookup[params.TapNoteScore]; + pss:SetCurMaxScore(clamp(pss:GetCurMaxScore()+(bestScore),0,capScore)); + pss:SetScore(clamp(pss:GetScore()+(localScore),0,capScore)); + end; ----------------------------------------------------------- --DDR 4th Mix/Extra Mix/Konamix/GB3/DDRPC Scoring ----------------------------------------------------------- r['DDR 4thMIX'] = function(params, pss) - local scoreLookupTable = { ['TapNoteScore_W1']=777, ['TapNoteScore_W2']=777, ['TapNoteScore_W3']=555 }; - setmetatable(scoreLookupTable, ZeroIfNotFound); + local scoreLookupTable = + { + ['TapNoteScore_W1']=777, + ['TapNoteScore_W2']=777, + ['TapNoteScore_W3']=555 + }; + setmetatable(scoreLookupTable, ZeroIfNotFound); + -- TODO: Modify this so that current max assumes full combo? local comboBonusForThisStep = (pss:GetCurrentCombo()+1)*333; - pss:SetScore(clamp(pss:GetScore()+scoreLookupTable[params.TapNoteScore]+(scoreLookupTable[params.TapNoteScore] and comboBonusForThisStep or 0),0,999999999)); + local capScore = 999999999; + local bestPoints = scoreLookupTable['TapNoteScore_W1']; + local bestCombo = bestPoints and comboBonusForThisStep or 0; + pss:SeCurMaxScore(clamp(pss:GeCurMaxScore()+bestPoints+bestCombo,0,capScore)); + local localPoints = scoreLookupTable[params.TapNoteScore]; + local localCombo = localPoints and comboBonusForThisStep or 0; + pss:SetScore(clamp(pss:GetScore()+localPoints+localCombo,0,capScore)); end; ----------------------------------------------------------- --DDR MAX2/Extreme Scoring @@ -69,7 +90,10 @@ r['DDR Extreme'] = function(params, pss) Shared.CurrentStep = 0 end; Shared.CurrentStep = Shared.CurrentStep + 1; - local stepLast = math.floor(baseScore / singleStep) * (Shared.CurrentStep); + local stepValue = math.floor(baseScore /singleStep); + local stepLast = stepValue * Shared.CurrentStep; + pss:SetCurMaxScore(pss:GetCurMaxScore() + + (stepLast * judgmentBase['TapNoteScore_W1'])); local judgeScore = 0; if (params.HoldNoteScore == 'HoldNoteScore_Held') then judgeScore = judgmentBase['TapNoteScore_W1']; @@ -80,31 +104,51 @@ r['DDR Extreme'] = function(params, pss) end; end; local stepScore = judgeScore * stepLast; + pss:SetScore(pss:GetScore() + stepScore); if (Shared.CurrentStep >= totalItems) then -- Just in case. + -- TODO: Implement the bonus for the last step? Shared.CurrentStep = 0; -- Reset for the next song. end; - pss:SetScore(pss:GetScore() + stepScore); end; ----------------------------------------------------------- --DDR SuperNOVA(-esque) scoring ----------------------------------------------------------- r['DDR SuperNOVA'] = function(params, pss) - local multLookup = { ['TapNoteScore_W1'] = 1, ['TapNoteScore_W2'] = 1, ['TapNoteScore_W3'] = 0.5 }; + local multLookup = + { + ['TapNoteScore_W1'] = 1, + ['TapNoteScore_W2'] = 1, + ['TapNoteScore_W3'] = 0.5 + }; setmetatable(multLookup, ZeroIfNotFound); local radarValues = GetDirectRadar(params.Player); local totalItems = GetTotalItems(radarValues); - local buildScore = (10000000 / totalItems * multLookup[params.TapNoteScore]) + (10000000 / totalItems * (params.HoldNoteScore == 'HoldNoteScore_Held' and 1 or 0)); + local base = 10000000 / totalItems; + local hold = base * (params.HoldNoteScore == 'HoldNoteScore_Held' and 1 or 0); + local maxScore = (base * multLookup['TapNoteScore_W1']) + hold; + pss:SetCurMaxScore(pss:GetCurMaxScore() + math.round(maxScore)); + local buildScore = (base * multLookup[params.TapNoteScore]) + hold; pss:SetScore(pss:GetScore() + math.round(buildScore)); end; ----------------------------------------------------------- --DDR SuperNOVA 2(-esque) scoring ----------------------------------------------------------- r['DDR SuperNOVA 2'] = function(params, pss) - local multLookup = { ['TapNoteScore_W1'] = 1, ['TapNoteScore_W2'] = 1, ['TapNoteScore_W3'] = 0.5 }; + local multLookup = + { + ['TapNoteScore_W1'] = 1, + ['TapNoteScore_W2'] = 1, + ['TapNoteScore_W3'] = 0.5 + }; setmetatable(multLookup, ZeroIfNotFound); local radarValues = GetDirectRadar(params.Player); local totalItems = GetTotalItems(radarValues); - local buildScore = (100000 / totalItems * multLookup[params.TapNoteScore] - (IsW1Allowed(params.TapNoteScore) and 10 or 0)) + (100000 / totalItems * (params.HoldNoteScore == 'HoldNoteScore_Held' and 1 or 0)); + local base = 100000 / totalItems; + local hold = base * (params.HoldNoteScore == 'HoldNoteScore_Held' and 1 or 0); + local maxScore = (base * multLookup['TapNoteScore_W1']) + hold; + pss:SetCurMaxScore(pss:GetCurMaxScore() + (math.round(maxScore) * 10)); + local preW1 = base * multLookup[params.TapNoteScore]; + local buildScore = (preW1 - (IsW1Allowed(params.TapNoteScore) and 10 or 0)) + hold; pss:SetScore(pss:GetScore() + (math.round(buildScore) * 10)); end; ----------------------------------------------------------- @@ -144,19 +188,28 @@ end; ------------------------------------------------------------ r['MIGS'] = function(params,pss) local curScore = 0; - local tapScoreTable = { ['TapNoteScore_W1'] = 3, ['TapNoteScore_W2'] = 2, ['TapNoteScore_W3'] = 1, ['TapNoteScore_W5'] = -4, ['TapNoteScore_Miss'] = -8 }; + local tapScoreTable = + { + ['TapNoteScore_W1'] = 3, + ['TapNoteScore_W2'] = 2, + ['TapNoteScore_W3'] = 1, + ['TapNoteScore_W5'] = -4, + ['TapNoteScore_Miss'] = -8 + }; for k,v in pairs(tapScoreTable) do curScore = curScore + ( pss:GetTapNoteScores(k) * v ); end; curScore = curScore + ( pss:GetHoldNoteScores('HoldNoteScore_Held') * 6 ); pss:SetScore(clamp(curScore,0,math.huge)); end; -SpecialScoring = {}; -setmetatable(SpecialScoring, { + +-- Formulas end here. +Scoring = {}; +setmetatable(Scoring, { __metatable = { "Letting you change the metatable sort of defeats the purpose." }; __index = function(tbl, key) for v in ivalues(DisabledScoringModes) do - if key == v then return r['DDR 1stMIX']; end; + if key == v then return r['DDR Extreme']; end; end; return r[key]; end; diff --git a/Themes/_fallback/metrics.ini b/Themes/_fallback/metrics.ini index ab4339e527..3f9a5e0371 100644 --- a/Themes/_fallback/metrics.ini +++ b/Themes/_fallback/metrics.ini @@ -448,33 +448,6 @@ PumpRoutineString="Routine" # Difficulty_Edit-StepsType_Pump_Double=Edit # Course=Progressive -[CustomScoring] -# Custom scoring, usually good for custom games. - -# Various tweakers -ComboAboveThresholdAddsToScoreBonus=0 -ComboScoreBonusThreshold=50 -ComboScoreBonusValue=+1000 - -ComboMultiplier=0.0 - -DoubleNoteScoreMultiplier=2.0 -TripleNoteScoreMultiplier=3.0 -QuadOrHigherNoteScoreMultiplier=4.0 -# And what they award you -PointsW1=+50 -PointsW2=+20 -PointsW3=+10 -PointsW4=+5 -PointsW5=0 -PointsMiss=-5 -PointsHitMine=-5 -PointsCheckpointHit=+5 -PointsCheckpointMiss=-5 -PointsNone=0 -PointsHoldHeld=+5 -PointsHoldLetGo=-5 - [DifficultyList] # A list that shows difficulties in a song. CapitalizeDifficultyNames=false @@ -2698,8 +2671,9 @@ Line20="conf,VisualDelaySeconds" Fallback="ScreenOptionsServiceChild" NextScreen="ScreenOptionsExtended" PrevScreen="ScreenOptionsExtended" -LineNames="2,3,4,8,11,13,14,15,16,28,29,30" -Line2="conf,ScoringType" +LineNames="Score,3,4,8,11,13,14,15,16,28,29,30" +#Line2="conf,ScoringType" +LineScore="lua,UserPrefScoringMode()" Line3="conf,TimingWindowScale" Line4="conf,LifeDifficulty" Line8="lua,GamePrefDefaultFail()" diff --git a/Themes/_portKit-sm4/metrics.ini b/Themes/_portKit-sm4/metrics.ini index d8f9ca94c6..9bd0f54a35 100644 --- a/Themes/_portKit-sm4/metrics.ini +++ b/Themes/_portKit-sm4/metrics.ini @@ -4406,30 +4406,6 @@ BodyHeight=38 [ComboGraph] BodyWidth=140 -[CustomScoring] -ComboAboveThresholdAddsToScoreBonus=0 -ComboScoreBonusThreshold=50 -ComboScoreBonusValue=1000 -# this was removed in SM4 -ComboMultiplier=0.0 - -DoubleNoteScoreMultiplier=1.0 -TripleNoteScoreMultiplier=1.0 -QuadOrHigherNoteScoreMultiplier=1.0 - -PointsW1=1000 -PointsW2=1000 -PointsW3=500 -PointsW4=100 -PointsW5=-200 -PointsMiss=-500 -PointsHitMine=-500 -PointsCheckpointHit=1000 -PointsCheckpointMiss=-200 -PointsNone=0 -PointsHoldHeld=1000 -PointsHoldLetGo=-500 - [CustomDifficulty] #See pump theme for an example Names="" diff --git a/Themes/_themekit-piu/metrics.ini b/Themes/_themekit-piu/metrics.ini index 10e3f17d4b..e72fda4fc1 100644 --- a/Themes/_themekit-piu/metrics.ini +++ b/Themes/_themekit-piu/metrics.ini @@ -88,29 +88,6 @@ BackInEventMode="" ;Screwy Names="" -[CustomScoring] -ComboAboveThresholdAddsToScoreBonus=0 -ComboMultiplier=0.0 -ComboScoreBonusThreshold=50 -ComboScoreBonusValue=+1000 - -DoubleNoteScoreMultiplier=1.0 -TripleNoteScoreMultiplier=1.5 -QuadOrHigherNoteScoreMultiplier=2 - -PointsW1=+1000 -PointsW2=+1000 -PointsW3=+500 -PointsW4=+100 -PointsW5=-200 -PointsMiss=-500 -PointsHitMine=-1000 -PointsCheckpointHit=+1000 -PointsCheckpointMiss=-200 -PointsNone=0 -PointsHoldHeld=+1000 -PointsHoldLetGo=-500 - [Gameplay] ComboIsPerRow=true MinScoreToContinueCombo="TapNoteScore_W3" @@ -550,4 +527,4 @@ PrevScreen="ScreenTitleMenu" [ScreenOptionsSystemDirection] Fallback="ScreenOptionsServiceChild" PrevScreen="ScreenOptionsService" -NextScreen="ScreenOptionsService" \ No newline at end of file +NextScreen="ScreenOptionsService" diff --git a/Themes/default/BGAnimations/ScreenGameplay decorations/default.lua b/Themes/default/BGAnimations/ScreenGameplay decorations/default.lua index c86d6323b6..f46c102f86 100644 --- a/Themes/default/BGAnimations/ScreenGameplay decorations/default.lua +++ b/Themes/default/BGAnimations/ScreenGameplay decorations/default.lua @@ -168,11 +168,13 @@ t[#t+1] = Def.ActorFrame { }; CreateStops(); }; -if PREFSMAN:GetPreference("ScoringType") == 'ScoringType_Custom' then - t[#t+1] = Def.Actor{ - JudgmentMessageCommand = function(self, params) - SpecialScoring[GetUserPref("UserPrefSpecialScoringMode")](params, STATSMAN:GetCurStageStats():GetPlayerStageStats(params.Player)) - end; - }; +if( not GAMESTATE:IsCourseMode() ) then +t[#t+1] = Def.Actor{ + JudgmentMessageCommand = function(self, params) + Scoring[GetUserPref("UserPrefScoringMode")](params, + STATSMAN:GetCurStageStats():GetPlayerStageStats(params.Player)) + end; +}; end; + return t diff --git a/Themes/default/Languages/en.ini b/Themes/default/Languages/en.ini index 1afd38fa53..c8212a7ed7 100644 --- a/Themes/default/Languages/en.ini +++ b/Themes/default/Languages/en.ini @@ -78,7 +78,6 @@ TimingDifficulty=Timing Difficulty: %s [OptionTitles] UserPrefAutoSetStyle=Auto Set Style -UserPrefSpecialScoringMode=Special Scoring Mode UserPrefNotePosition=Note Positions UserPrefComboOnRolls=Rolls Increment Combo UserPrefComboUnderField=Combo Under Field @@ -97,7 +96,6 @@ UserPrefComboOnRolls=Choose if rolls should increment the combo or not. UserPrefComboUnderField=Determine if the combo should display under the notes or not. UserPrefGameplayShowScore=Show or Hide the score display in gameplay. -UserPrefSpecialScoringMode=Select the scoring mode to be used if the Special scoring type is selected. UserPrefGameplayShowStepsDisplay=Show or Hide the step information display in gameplay. UserPrefShowLotsaOptions=Choose how many lines/rows of options to choose from. &oq;Few&cq; keeps the list to a minimum. &oq;Many&cq; adds various show-off mods. UserPrefLongFail=Choose between the original sm-ssc fail (Long) or the new sm-ssc fail (Short). diff --git a/Themes/default/Scripts/03 ThemePrefs.lua b/Themes/default/Scripts/03 ThemePrefs.lua index fdc5748a25..f3b91da4e3 100644 --- a/Themes/default/Scripts/03 ThemePrefs.lua +++ b/Themes/default/Scripts/03 ThemePrefs.lua @@ -21,8 +21,8 @@ function InitUserPrefs() if GetUserPref("UserPrefGameplayShowScore") == nil then SetUserPref("UserPrefGameplayShowScore", false); end; - if GetUserPref("UserPrefSpecialScoringMode") == nil then - SetUserPref("UserPrefSpecialScoringMode", 'DDR 1st Mix'); + if GetUserPref("UserPrefScoringMode") == nil then + SetUserPref("UserPrefScoringMode", 'DDR Extreme'); end; if GetUserPrefB("UserPrefShowLotsaOptions") == nil then SetUserPref("UserPrefShowLotsaOptions", true); @@ -230,34 +230,6 @@ function UserPrefShowLotsaOptions() return t; end -function UserPrefSpecialScoringMode() - local baseChoices = { 'DDR 1stMIX', 'DDR 4thMIX', 'DDR Extreme', 'DDR SuperNOVA', 'DDR SuperNOVA 2', 'MIGS' }; --'[SSC] Radar Master' - local t = { - Name = "UserPrefSpecialScoringMode"; - LayoutType = "ShowAllInRow"; - SelectType = "SelectOne"; - OneChoiceForAllPlayers = true; - ExportOnChange = false; - Choices = baseChoices; - LoadSelections = function(self, list, pn) - if ReadPrefFromFile("UserPrefSpecialScoringMode") ~= nil then - local theValue = ReadPrefFromFile("UserPrefSpecialScoringMode"); - local success = false; - for k,v in ipairs(baseChoices) do if v == theValue then list[k] = true success = true break end end; - if success == false then list[1] = true end; - else - WritePrefToFile("UserPrefSpecialScoringMode", 'DDR 1stMIX'); - list[1] = true; - end; - end; - SaveSelections = function(self, list, pn) - for k,v in ipairs(list) do if v then WritePrefToFile("UserPrefSpecialScoringMode", baseChoices[k]) break end end; - end; - }; - setmetatable( t, t ); - return t; -end - function GetDefaultOptionLines() local LineSets = { "1,8,14,2,3,4,5,6,R,7,9,10,11,12,13,15,16,17,18", -- All diff --git a/Themes/default/metrics.ini b/Themes/default/metrics.ini index ddba187e95..36fb28f584 100644 --- a/Themes/default/metrics.ini +++ b/Themes/default/metrics.ini @@ -107,28 +107,6 @@ TextPulseCommand=finishtweening;diffusealpha,1;zoom,0.5*1.025;decelerate,0.05;zo [CustomDifficulty] -[CustomScoring] -# So special scoring works properly, we zero this out -ComboAboveThresholdAddsToScoreBonus=0 -ComboScoreBonusThreshold=0 -ComboScoreBonusValue=0 -ComboMultiplier=0 -DoubleNoteScoreMultiplier=0 -TripleNoteScoreMultiplier=0 -QuadOrHigherNoteScoreMultiplier=0 -PointsW1=0 -PointsW2=0 -PointsW3=0 -PointsW4=0 -PointsW5=0 -PointsMiss=0 -PointsHitMine=0 -PointsCheckpointHit=0 -PointsCheckpointMiss=0 -PointsNone=0 -PointsHoldHeld=0 -PointsHoldLetGo=0 - [DifficultyList] ItemsSpacingY=24 NumShownItems=8 @@ -1252,7 +1230,7 @@ LineFlashyCombo="lua,UserPrefFlashyCombo()" [ScreenOptionsGraphicsSound] [ScreenOptionsAdvanced] -LineNames="2,3,4,8,11,13,14,15,16,28,29,30,RollCombo" +LineNames="Score,3,4,8,11,13,14,15,16,28,29,30,RollCombo" LineRollCombo="lua,UserPrefComboOnRolls()" [ScreenAppearanceOptions] @@ -1267,10 +1245,9 @@ LineRollCombo="lua,UserPrefComboOnRolls()" Fallback="ScreenOptionsServiceChild" NextScreen="ScreenOptionsExtended" PrevScreen="ScreenOptionsExtended" -LineNames="gNotePos,gAuto,gScore,gSScore,gSDisp,gOpts,gLongFail,gComboUnderField,FlashyCombo,GameplayFooter" +LineNames="gNotePos,gAuto,gScore,gSDisp,gOpts,gLongFail,gComboUnderField,FlashyCombo,GameplayFooter" LinegNotePos="lua,UserPrefNotePosition()" LinegScore="lua,UserPrefGameplayShowScore()" -LinegSScore="lua,UserPrefSpecialScoringMode()" LinegSDisp="lua,UserPrefGameplayShowStepsDisplay()" LinegOpts="lua,UserPrefShowLotsaOptions()" LinegAuto="lua,UserPrefAutoSetStyle()" diff --git a/src/Player.cpp b/src/Player.cpp index caac05b7fc..570112bb0e 100644 --- a/src/Player.cpp +++ b/src/Player.cpp @@ -127,8 +127,13 @@ static Preference g_bEnableMineSoundPlayback ( "EnableMineHitSound", true Preference g_fTimingWindowHopo ( "TimingWindowHopo", 0.25 ); // max time between notes in a hopo chain Preference g_fTimingWindowStrum ( "TimingWindowStrum", 0.1f ); // max time between strum and when the frets must match +/** @brief How much life is in a hold note when you start on it? */ ThemeMetric INITIAL_HOLD_LIFE ( "Player", "InitialHoldLife" ); -ThemeMetric MAX_HOLD_LIFE ( "Player", "MaxHoldLife" ); // sm-ssc addition +/** + * @brief How much hold life is possible to have when holding a hold note? + * + * This was an sm-ssc addition. */ +ThemeMetric MAX_HOLD_LIFE ( "Player", "MaxHoldLife" ); ThemeMetric PENALIZE_TAP_SCORE_NONE ( "Player", "PenalizeTapScoreNone" ); ThemeMetric JUDGE_HOLD_NOTES_ON_SAME_ROW_TOGETHER ( "Player", "JudgeHoldNotesOnSameRowTogether" ); /** @@ -174,6 +179,11 @@ ThemeMetric REQUIRE_STEP_ON_MINES ( "Player", "RequireStepOnMines" ); * * For those wishing to make a theme very accurate to In The Groove 2, set this to false. */ ThemeMetric ROLL_BODY_INCREMENTS_COMBO ( "Player", "RollBodyIncrementsCombo" ); +/** + * @brief Are checkpoints and taps considered separate judgments? + * + * If set to true, they are considered separate. + * If set to false, they are considered the same. */ ThemeMetric CHECKPOINTS_TAPS_SEPARATE_JUDGMENT ( "Player", "CheckpointsTapsSeparateJudgment" ); /** * @brief Do we score missed holds and rolls with HoldNoteScores? diff --git a/src/PlayerStageStats.cpp b/src/PlayerStageStats.cpp index d4867b3ee9..6aab543b26 100644 --- a/src/PlayerStageStats.cpp +++ b/src/PlayerStageStats.cpp @@ -234,7 +234,7 @@ float PlayerStageStats::MakePercentScore( int iActual, int iPossible ) int iPercentTotalDigits = 3 + CommonMetrics::PERCENT_SCORE_DECIMAL_PLACES; // "100" + "." + "00" - // TRICKY: printf will round, but we want to truncate. therwise, we may display + // TRICKY: printf will round, but we want to truncate. Otherwise, we may display // a percent score that's too high and doesn't match up with the calculated grade. float fTruncInterval = powf( 0.1f, (float)iPercentTotalDigits-1 ); @@ -250,7 +250,9 @@ RString PlayerStageStats::FormatPercentScore( float fPercentDancePoints ) { int iPercentTotalDigits = 3 + CommonMetrics::PERCENT_SCORE_DECIMAL_PLACES; // "100" + "." + "00" - RString s = ssprintf( "%*.*f%%", iPercentTotalDigits, (int)CommonMetrics::PERCENT_SCORE_DECIMAL_PLACES, fPercentDancePoints*100 ); + RString s = ssprintf( "%*.*f%%", iPercentTotalDigits, + (int)CommonMetrics::PERCENT_SCORE_DECIMAL_PLACES, + fPercentDancePoints*100 ); return s; } @@ -725,7 +727,24 @@ public: static int GetRadarPossible( T* p, lua_State *L ) { p->m_radarPossible.PushSelf(L); return 1; } static int GetRadarActual( T* p, lua_State *L ) { p->m_radarActual.PushSelf(L); return 1; } - static int SetScore( T* p, lua_State *L ) { if( IArg(1) >= 0 ){ p->m_iScore = IArg(1); return 1; } return 0; } + static int SetScore( T* p, lua_State *L ) + { + if( IArg(1) >= 0 ) + { + p->m_iScore = IArg(1); + return 1; + } + return 0; + } + static int SetCurMaxScore( T* p, lua_State *L ) + { + if( IArg(1) >= 0 ) + { + p->m_iCurMaxScore = IArg(1); + return 1; + } + return 0; + } LunaPlayerStageStats() { @@ -763,6 +782,7 @@ public: ADD_METHOD( GetRadarPossible ); ADD_METHOD( GetBestFullComboTapNoteScore ); ADD_METHOD( SetScore ); + ADD_METHOD( SetCurMaxScore ); } }; diff --git a/src/PrefsManager.cpp b/src/PrefsManager.cpp index 3a3a35fa1f..87ec4d8b7f 100644 --- a/src/PrefsManager.cpp +++ b/src/PrefsManager.cpp @@ -125,15 +125,6 @@ XToString( CourseSortOrders ); StringToX( CourseSortOrders ); LuaXType( CourseSortOrders ); -static const char *ScoringTypeNames[] = { - "New", - "Old", - "Custom", -}; -XToString( ScoringType ); -StringToX( ScoringType ); -LuaXType( ScoringType ); - // XXX: Fix fail bug? /* static const char *DefaultFailTypeNames[] = { "Immediate", @@ -263,7 +254,6 @@ PrefsManager::PrefsManager() : m_CourseSortOrder ( "CourseSortOrder", COURSE_SORT_SONGS ), m_bSubSortByNumSteps ( "SubSortByNumSteps", false ), m_GetRankingName ( "GetRankingName", RANKING_ON ), - m_ScoringType ( "ScoringType", SCORING_NEW ), m_sAdditionalSongFolders ( "AdditionalSongFolders", "" ), m_sAdditionalCourseFolders ( "AdditionalCourseFolders", "" ), m_sAdditionalFolders ( "AdditionalFolders", "" ), diff --git a/src/PrefsManager.h b/src/PrefsManager.h index 332da7da08..2d1f564bb3 100644 --- a/src/PrefsManager.h +++ b/src/PrefsManager.h @@ -108,14 +108,6 @@ enum CourseSortOrders NUM_CourseSortOrders, CourseSortOrders_Invalid }; -enum ScoringType -{ - SCORING_NEW, - SCORING_OLD, - SCORING_CUSTOM, - NUM_ScoringType, - ScoringType_Invalid -}; enum DefaultFailType { @@ -266,8 +258,6 @@ public: Preference m_bSubSortByNumSteps; Preference m_GetRankingName; - Preference m_ScoringType; - Preference m_sAdditionalSongFolders; Preference m_sAdditionalCourseFolders; Preference m_sAdditionalFolders; diff --git a/src/ScoreKeeperNormal.cpp b/src/ScoreKeeperNormal.cpp index 7d3450ef4b..b3e106bfaf 100644 --- a/src/ScoreKeeperNormal.cpp +++ b/src/ScoreKeeperNormal.cpp @@ -94,30 +94,6 @@ void ScoreKeeperNormal::Load( //m_vToastyTriggers.Load( "Gameplay", "ToastyTriggersAt" ); m_ToastyTrigger.Load( "Gameplay", "ToastyTriggersAt" ); - // Custom Scoring - m_CustomComboMultiplier.Load( "CustomScoring", "ComboMultiplier" ); - m_CustomTNS_W1.Load( "CustomScoring", "PointsW1" ); - m_CustomTNS_W2.Load( "CustomScoring", "PointsW2" ); - m_CustomTNS_W3.Load( "CustomScoring", "PointsW3" ); - m_CustomTNS_W4.Load( "CustomScoring", "PointsW4" ); - m_CustomTNS_W5.Load( "CustomScoring", "PointsW5" ); - m_CustomTNS_Miss.Load( "CustomScoring", "PointsMiss" ); - m_CustomTNS_HitMine.Load( "CustomScoring", "PointsHitMine" ); - m_CustomTNS_CheckpointHit.Load( "CustomScoring", "PointsCheckpointHit" ); - m_CustomTNS_CheckpointMiss.Load( "CustomScoring", "PointsCheckpointMiss" ); - m_CustomTNS_None.Load( "CustomScoring", "PointsNone" ); - - m_CustomHNS_Held.Load( "CustomScoring", "PointsHoldHeld" ); - m_CustomHNS_LetGo.Load( "CustomScoring", "PointsHoldLetGo" ); - - m_CustomComboBonus.Load( "CustomScoring", "ComboAboveThresholdAddsToScoreBonus" ); - m_CustomComboBonusThreshold.Load( "CustomScoring", "ComboScoreBonusThreshold" ); - m_CustomComboBonusValue.Load( "CustomScoring", "ComboScoreBonusValue" ); - - m_DoubleNoteMultiplier.Load( "CustomScoring", "DoubleNoteScoreMultiplier" ); - m_TripleNoteMultiplier.Load( "CustomScoring", "TripleNoteScoreMultiplier" ); - m_QuadPlusNoteMultiplier.Load( "CustomScoring", "QuadOrHigherNoteScoreMultiplier" ); - // Fill in STATSMAN->m_CurStageStats, calculate multiplier int iTotalPossibleDancePoints = 0; int iTotalPossibleGradePoints = 0; @@ -179,24 +155,7 @@ void ScoreKeeperNormal::Load( MESSAGEMAN->Broadcast( msg ); memset( m_ComboBonusFactor, 0, sizeof(m_ComboBonusFactor) ); - switch( PREFSMAN->m_ScoringType ) - { - case SCORING_NEW: - case SCORING_CUSTOM: - m_iRoundTo = 1; - break; - case SCORING_OLD: - m_iRoundTo = 5; - if (!GAMESTATE->IsCourseMode()) - { - m_ComboBonusFactor[TNS_W1] = 55; - m_ComboBonusFactor[TNS_W2] = 55; - m_ComboBonusFactor[TNS_W3] = 33; - } - break; - DEFAULT_FAIL( int(PREFSMAN->m_ScoringType) ); - } - + m_iRoundTo = 1; } void ScoreKeeperNormal::OnNextSong( int iSongInCourseIndex, const Steps* pSteps, const NoteData* pNoteData ) @@ -247,25 +206,12 @@ void ScoreKeeperNormal::OnNextSong( int iSongInCourseIndex, const Steps* pSteps, } else { - const int iMeter = clamp( pSteps->GetMeter(), 1, 10 ); - // long ver and marathon ver songs have higher max possible scores int iLengthMultiplier = GameState::GetNumStagesMultiplierForSong( GAMESTATE->m_pCurSong ); - switch( PREFSMAN->m_ScoringType ) - { - case SCORING_NEW: - m_iMaxPossiblePoints = iMeter * 10000000 * iLengthMultiplier; - break; - case SCORING_OLD: - m_iMaxPossiblePoints = (iMeter * iLengthMultiplier + 1) * 5000000; - break; - case SCORING_CUSTOM: - /* This is just simple additive/subtractive scoring, but cap the - * score at the size of the score counter */ - m_iMaxPossiblePoints = 10 * 10000000 * iLengthMultiplier; - break; - DEFAULT_FAIL( int(PREFSMAN->m_ScoringType) ); - } + + /* This is no longer just simple additive/subtractive scoring, + * but start with capping the score at the size of the score counter. */ + m_iMaxPossiblePoints = 10 * 10000000 * iLengthMultiplier; } ASSERT( m_iMaxPossiblePoints >= 0 ); m_iMaxScoreSoFar += m_iMaxPossiblePoints; @@ -317,24 +263,12 @@ void ScoreKeeperNormal::AddTapScore( TapNoteScore tns ) void ScoreKeeperNormal::AddHoldScore( HoldNoteScore hns ) { - if( PREFSMAN->m_ScoringType == SCORING_CUSTOM ) - { - int &iScore = m_pPlayerStageStats->m_iScore; - int &iCurMaxScore = m_pPlayerStageStats->m_iCurMaxScore; - - iCurMaxScore += m_CustomHNS_Held; - - if( hns == HNS_Held ) - iScore += m_CustomHNS_Held; - else if ( hns == HNS_LetGo ) - iScore += m_CustomHNS_LetGo; - } - else + if( GAMESTATE->IsCourseMode() ) { if( hns == HNS_Held ) AddScoreInternal( TNS_W1 ); else if ( hns == HNS_LetGo ) - AddScoreInternal( TNS_W4 ); // required for subtractive score display to work properly + AddScoreInternal( TNS_W4 ); // required for subtractive score display to work properly. } } @@ -352,14 +286,6 @@ void ScoreKeeperNormal::HandleTapScoreNone() if( m_pPlayerState->m_PlayerNumber != PLAYER_INVALID ) MESSAGEMAN->Broadcast( enum_add2(Message_CurrentComboChangedP1,m_pPlayerState->m_PlayerNumber) ); - - if( PREFSMAN->m_ScoringType == SCORING_CUSTOM ) - { - int &iScore = m_pPlayerStageStats->m_iScore; - iScore += m_CustomTNS_None; - } - else - AddScoreInternal( TNS_Miss ); } // TODO: networking code @@ -369,47 +295,9 @@ void ScoreKeeperNormal::AddScoreInternal( TapNoteScore score ) { int &iScore = m_pPlayerStageStats->m_iScore; int &iCurMaxScore = m_pPlayerStageStats->m_iCurMaxScore; -/* - Regular scoring: - Let p = score multiplier (W1 = W2 = 10, W3 = 5, other = 0) - - Note on NONSTOP Mode scoring - - Let p = score multiplier (W1 = 10, W2 = 9, W3 = 5, other = 0) - - N = total number of steps and freeze steps - S = The sum of all integers from 1 to N (the total number of steps/freeze steps) - n = number of the current step or freeze step (varies from 1 to N) - Z = Base value of the song (1,000,000 X the number of feet difficulty) - All edit data is rated as 5 feet - So, the score for one step is: - one_step_score = p * (Z/S) * n - - *IMPORTANT* : Double steps (U+L, D+R, etc.) count as two steps instead of one *for your combo count only*, - so if you get a double L+R on the 112th step of a song, you score is calculated for only one step, not two, - as the combo counter might otherwise imply. - - Now, through simple algebraic manipulation: - S = 1+...+N = (1+N)*N/2 (1 through N added together) - - Okay, time for an example. Suppose we wanted to calculate the step score of a W3 on the 57th step of - a 441 step, 8-foot difficulty song (I'm just making this one up): - - S = (1 + 441)*441 / 2 - = 194,222 / 2 - = 97,461 - StepScore = p * (Z/S) * n - = 5 * (8,000,000 / 97,461) * 57 - = 5 * (82) * 57 (The 82 is rounded down from 82.08411...) - = 23,370 - - Remember this is just the score for the step, not the cumulative score up to the 57th step. Also, please note that - I am currently checking into rounding errors with the system and if there are any, how they are resolved in the system. - - Note: if you got all W2s on this song, you would get (p=10)*Z, which is 80,000,000. In fact, the maximum possible - score for any song is the number of feet difficulty X 10,000,000. -*/ - if( PREFSMAN->m_ScoringType != SCORING_CUSTOM || GAMESTATE->IsCourseMode() ) + // See Aaron In Japan for more details about the scoring formulas. + if( GAMESTATE->IsCourseMode() ) { int p = 0; // score multiplier @@ -469,45 +357,7 @@ void ScoreKeeperNormal::AddScoreInternal( TapNoteScore score ) // Custom Scoring else { - int p = 0; // score value - - switch( score ) - { - case TNS_W1: p = m_CustomTNS_W1; break; - case TNS_W2: p = m_CustomTNS_W2; break; - case TNS_W3: p = m_CustomTNS_W3; break; - case TNS_W4: p = m_CustomTNS_W4; break; - case TNS_W5: p = m_CustomTNS_W5; break; - case TNS_Miss: p = m_CustomTNS_Miss; break; - default: p = 0; break; - } - - if( m_CustomComboBonus ) - { - if( m_pPlayerStageStats->m_iCurCombo > m_CustomComboBonusThreshold ) - p += m_CustomComboBonusValue; - } - - p += static_cast(m_pPlayerStageStats->m_iCurCombo * m_CustomComboMultiplier); - - if( m_iNumNotesHitThisRow == 2 ) - p = (int)(p * m_DoubleNoteMultiplier); - else if( m_iNumNotesHitThisRow == 3 ) - p = (int)(p * m_TripleNoteMultiplier); - else if( m_iNumNotesHitThisRow >= 4 ) - p = (int)(p * m_QuadPlusNoteMultiplier); - - if( !m_pPlayerStageStats->m_bFailed ) - { - m_iTapNotesHit++; - - iScore += p; - iCurMaxScore += m_CustomTNS_W1; - } - - // Because the score can drop below 0 if you miss a bunch of notes, cap it off at zero - if( iScore <= 0 ) - iScore = 0; + } ASSERT( iScore >= 0 ); @@ -536,11 +386,6 @@ void ScoreKeeperNormal::HandleTapScore( const TapNote &tn ) if( m_MineHitIncrementsMissCombo ) HandleComboInternal( 0, 0, 1 ); - if( PREFSMAN->m_ScoringType == SCORING_CUSTOM ) - { - int &iScore = m_pPlayerStageStats->m_iScore; - iScore += m_CustomTNS_HitMine; - } } if( tns == TNS_AvoidMine && m_AvoidMineIncrementsCombo ) @@ -564,19 +409,6 @@ void ScoreKeeperNormal::HandleTapScore( const TapNote &tn ) void ScoreKeeperNormal::HandleHoldCheckpointScore( const NoteData &nd, int iRow, int iNumHoldsHeldThisRow, int iNumHoldsMissedThisRow ) { - if( PREFSMAN->m_ScoringType == SCORING_CUSTOM ) - { - int &iScore = m_pPlayerStageStats->m_iScore; - int &iCurMaxScore = m_pPlayerStageStats->m_iCurMaxScore; - - iCurMaxScore += m_CustomTNS_CheckpointHit; - - if( iNumHoldsMissedThisRow == 0 ) - iScore += m_CustomTNS_CheckpointHit; - else - iScore += m_CustomTNS_CheckpointMiss; - } - HandleTapNoteScoreInternal( iNumHoldsMissedThisRow == 0? TNS_CheckpointHit:TNS_CheckpointMiss, TNS_CheckpointHit ); HandleComboInternal( iNumHoldsHeldThisRow, 0, iNumHoldsMissedThisRow, iRow ); } diff --git a/src/ScoreKeeperNormal.h b/src/ScoreKeeperNormal.h index 5c85f20a82..308458a04d 100644 --- a/src/ScoreKeeperNormal.h +++ b/src/ScoreKeeperNormal.h @@ -40,30 +40,6 @@ class ScoreKeeperNormal: public ScoreKeeper ThemeMetric m_MineHitIncrementsMissCombo; ThemeMetric m_AvoidMineIncrementsCombo; - // Custom Scoring Theme Metrics - ThemeMetric m_CustomTNS_W1; - ThemeMetric m_CustomTNS_W2; - ThemeMetric m_CustomTNS_W3; - ThemeMetric m_CustomTNS_W4; - ThemeMetric m_CustomTNS_W5; - ThemeMetric m_CustomTNS_Miss; - ThemeMetric m_CustomTNS_HitMine; - ThemeMetric m_CustomTNS_CheckpointHit; - ThemeMetric m_CustomTNS_CheckpointMiss; - ThemeMetric m_CustomTNS_None; - - ThemeMetric m_CustomHNS_Held; - ThemeMetric m_CustomHNS_LetGo; - - ThemeMetric m_CustomComboBonus; - ThemeMetric m_CustomComboBonusThreshold; - ThemeMetric m_CustomComboBonusValue; - - ThemeMetric m_DoubleNoteMultiplier; - ThemeMetric m_TripleNoteMultiplier; - ThemeMetric m_QuadPlusNoteMultiplier; - ThemeMetric m_CustomComboMultiplier; - //ThemeMetric m_vToastyTriggers; ThemeMetric m_ToastyTrigger; diff --git a/src/ScreenOptionsMasterPrefs.cpp b/src/ScreenOptionsMasterPrefs.cpp index 80aa1969aa..5495de6f86 100644 --- a/src/ScreenOptionsMasterPrefs.cpp +++ b/src/ScreenOptionsMasterPrefs.cpp @@ -718,7 +718,6 @@ static void InitializeConfOptions() g_ConfOptions.back().m_sPrefName = "SongsPerPlay"; ADD( ConfOption( "EventMode", MovePref, "Off","On (recommended)" ) ); - ADD( ConfOption( "ScoringType", MovePref, "New","Old","Custom" ) ); ADD( ConfOption( "TimingWindowScale", TimingWindowScale, "|1","|2","|3","|4","|5","|6","|7","|8","Justice" ) ); ADD( ConfOption( "LifeDifficulty", LifeDifficulty, "|1.2","|1.0","|0.8","|0.6","|0.4","|0.33","|0.25" ) ); g_ConfOptions.back().m_sPrefName = "LifeDifficultyScale";