-
Notifications
You must be signed in to change notification settings - Fork 0
Wife3 Scoring System.hx
Wife3 Scoring System.hx - API Reference
Wife3 (Wife version 3) is Etterna's timing-based accuracy algorithm.
This script provides comprehensive global callback functions accessible from any Lua or HScript.
- Configuration Functions
- Data Getter Functions
- Judgement Counter Functions
- FC Tier System
- Utility Functions
- Score Text Formats
- Judge Presets
- Grading System
Enable or disable Wife3 scoring system.
wife3_enabled(true) -- Enable (default)
wife3_enabled(false) -- DisableSet difficulty preset (1-9). See Judge Presets for details.
wife3_setJudgePreset(4) -- J4 = Standard difficulty
wife3_setJudgePreset(9) -- J9 = JUSTICE (hardest)Manually set judge scale value (advanced users).
wife3_setJudgeScale(1.0) -- Same as J4
wife3_setJudgeScale(0.4) -- Same as J9Note: Scale range is 0.009 to 0.090. Values outside this range are clamped.
Show/hide color-coded timing feedback display (shows hit accuracy in milliseconds).
wife3_setShowTimingDisplay(true) -- Show timing (default)
wife3_setShowTimingDisplay(false) -- Hide timingEnable/disable replacing Psych Engine's default score text.
wife3_setReplaceScoreText(true) -- Replace score text (default)
wife3_setReplaceScoreText(false) -- Keep Psych Engine score, calculate Wife3 in background. Useful for custom HUDs that doesn't use the scoreTxt object.Switch between Kade Engine style and Wife3/Psych Engine style score text formats.
wife3_setKadeEngineStyle(false) -- Psych Engine style (default)
wife3_setKadeEngineStyle(true) -- Kade Engine styleFormats:
-
Psych Engine Style:
Score: 0 | Misses: 0 | Rating: AAA (98.45%) - MFC -
Kade Engine Style:
Score: 0 | Combo Breaks: 0 | Accuracy: 98.45 % | (MFC) AAA
Choose between Etterna and Psych Engine FC tier naming conventions.
wife3_setUseEtternaFCTiers(false) -- Psych Engine style: SFC (default)
wife3_setUseEtternaFCTiers(true) -- Etterna style: PFCTier Names:
- Etterna: MFC, PFC, GFC, FC, SDCB, Clear
- Psych Engine: MFC, SFC, GFC, FC, SDCB, Clear
Reset all Wife3 counters to zero.
wife3_resetAccuracy()Returns current accuracy percentage (0-100) based on notes hit/missed so far.
local accuracy = wife3_getPercent()
-- Example: 98.45Returns total chart accuracy percentage if all remaining notes are hit perfectly.
local totalAccuracy = wife3_getTotalPercent()
-- Example: 99.12Returns current song score (Wife3 calculated).
local score = wife3_getScore()
-- Example: 987654Returns letter grade for a given accuracy percentage.
local currentAccuracy = wife3_getAccuracy()
local grade = wife3_getGrade(currentAccuracy)
-- Returns: 'AAAAA', 'AAAA', 'AAA', 'AA', 'A', 'B', 'C', 'D', or 'F'Returns the current judge scale value.
local scale = wife3_getJudgeScale()
-- Example: 1.0 (J4), 0.4 (J9)Returns the current judge preset number (1-9), including interpolated values for custom scales.
local preset = wife3_getJudgePreset()
-- Example: 4.0 (J4), 9.0 (J9), 4.5 (between J4 and J5)Returns whether Wife3 score text replacement is enabled.
local isReplacing = wife3_getReplaceScoreText()Returns whether Kade Engine style formatting is enabled.
local isKadeStyle = wife3_getKadeEngineStyle()Returns whether Etterna FC tier naming is enabled.
local isEtternaStyle = wife3_getUseEtternaFCTiers()Returns whether timing display is enabled.
local isTimingVisible = wife3_getShowTimingDisplay()Returns raw Wife3 points accumulated from notes hit.
local currentPoints = wife3_getCurrentAccuracy()
-- Example: 345.67Returns maximum Wife3 points earned so far (current performance ceiling).
local maxPoints = wife3_getMaxAccuracy()
-- Example: 350.00Returns total possible Wife3 points for the entire chart.
local totalPoints = wife3_getTotalAccuracy()
-- Example: 500.00Direct access to song score (same as wife3_getScore()).
local score = wife3_getSongScore()While Wife3 doesn't fully rely on Judgement windows, it still trackS five types of judgements. These counters are useful for detailed accuracy analysis.
Returns the number of marvelous hits (≤ 22ms * judge scale).
local marvelous = wife3_getMarvelousHits()
-- Example: 245Returns the number of perfect hits (≤ 45ms * judge scale).
local perfect = wife3_getPerfectHits()
-- Example: 12Returns the number of great hits (≤ 90ms * judge scale).
local great = wife3_getGreatHits()
-- Example: 3Returns the number of good hits (≤ 135ms * judge scale).
local good = wife3_getGoodHits()
-- Example: 1Returns the number of bad hits (≤ 180ms * judge scale).
local bad = wife3_getBadHits()
-- Example: 0Timing windows scale with the judge preset. At J4 (scale 1.0):
| Judgement | Timing Window | Description |
|---|---|---|
| Marvelous | ≤ 22ms | Perfect timing |
| Perfect | ≤ 45ms | Excellent timing |
| Great | ≤ 90ms | Good timing |
| Good | ≤ 135ms | Acceptable timing |
| Bad | ≤ 180ms | Poor timing |
Example: At J9 (scale 0.4), timing windows are 40% tighter:
- Marvelous: ≤ 8.8ms
- Perfect: ≤ 18ms
- Great: ≤ 36ms
- Good: ≤ 54ms
- Bad: ≤ 72ms
Returns the timing window in milliseconds for a specific judgement type.
local marvelousWindow = wife3_getTimingWindow('marvelous')
-- Returns: 22.0 (at J4)
local perfectWindow = wife3_getTimingWindow('perfect')
-- Returns: 45.0 (at J4)Valid window types: 'marvelous', 'perfect', 'great', 'good', 'bad'
Returns the current FC tier based on performance.
local fcTier = wife3_getRatingFC()
-- Returns: 'MFC', 'PFC'/'SFC', 'GFC', 'FC', 'SDCB', or 'Clear'| Tier | Requirements | Description |
|---|---|---|
| MFC | All Marvelous (no Perfect or worse) | Marvelous Full Combo |
| PFC/SFC | No Great or worse (Perfect and Marvelous only) | Perfect/Sick Full Combo |
| GFC | No Good or worse (Great, Perfect, Marvelous) | Great Full Combo |
| FC | No Bad or worse (Good, Great, Perfect, Marvelous) | Full Combo |
| SDCB | 1-9 misses | Single Digit Combo Break |
| Clear | 10+ misses | Song cleared |
Two naming styles are supported:
Etterna Style (Second tier: PFC)
- Matches Etterna's terminology
- Perfect = Second best judgement
Psych Engine Style (Second tier: SFC)
- Matches Psych Engine's terminology
- Sick = Second best judgement
Toggle between styles:
wife3_setUseEtternaFCTiers(true) -- Use PFC
wife3_setUseEtternaFCTiers(false) -- Use SFC (default)Format a number to 2 decimal places.
local formatted = wife3_formatPercent(98.456789)
-- Returns: '98.46'Manually update the score text display. Called automatically after hits/misses.
wife3_updateScoreText()Wife3 supports two score text formatting styles that can be toggled dynamically.
wife3_setKadeEngineStyle(false)Format:
Score: 987654 | Misses: 5 | Rating: AAA (98.45%) - MFC
Components:
-
Score:- Current song score -
Misses:- Total misses count -
Rating:- Letter grade with percentage in parentheses - FC tier after dash
wife3_setKadeEngineStyle(true)Format:
Score: 987654 | Combo Breaks: 5 | Accuracy: 98.45 % | (MFC) AAA
Components:
-
Score:- Current song score -
Combo Breaks:- Total misses count -
Accuracy:- Percentage with space before % - FC tier in parentheses followed by grade
Before any notes are hit:
Psych Engine Style:
Score: 0 | Misses: 0 | Rating: ?
Kade Engine Style:
Score: 0 | Combo Breaks: 0 | Accuracy: ?
You can disable score text replacement to run Wife3 calculations in the background:
wife3_setReplaceScoreText(false)This keeps Psych Engine's default score text while allowing you to access Wife3 data through getter functions for custom UIs
Judge presets control the timing window difficulty. Lower numbers are easier (wider timing windows), higher numbers are harder (tighter timing windows).
| Preset | Judge | Scale Value | Description | Typical Use Case |
|---|---|---|---|---|
| 1 | J1 | 4.0 | Easiest | Casual play, story mode |
| 2 | J2 | 3.0 | Very Easy | Beginner friendly |
| 3 | J3 | 2.0 | Easy | Learning new charts |
| 4 | J4 | 1.0 | Standard | Default/Competitive baseline |
| 5 | J5 | 0.9 | Slightly Hard | Intermediate challenge |
| 6 | J6 | 0.75 | Hard | Advanced players |
| 7 | J7 | 0.6 | Very Hard | Expert challenge |
| 8 | J8 | 0.5 | Extremely Hard | Mastery testing |
| 9 | J9 | 0.4 | JUSTICE | Hardest possible |
wife3_setJudgePreset(4) -- Standard (default)
wife3_setJudgePreset(9) -- JUSTICE (hardest)For fine-tuned control, use wife3_setJudgeScale():
wife3_setJudgeScale(1.0) -- J4 equivalent
wife3_setJudgeScale(0.6) -- J7 equivalent
wife3_setJudgeScale(0.85) -- Custom (between J5 and J6, so basically J5.5)Wife3 uses a letter grade system based on accuracy percentage:
| Grade | Min % | Description | Tier |
|---|---|---|---|
| AAAAA | 99.70% | Quadstar | Nearly perfect |
| AAAA | 99.50% | Quad | Exceptional |
| AAA | 99.00% | Triple | Excellent |
| AA | 98.00% | Double | Very Good |
| A | 96.50% | Single | Good |
| B | 93.00% | B Tier | Above Average |
| C | 90.00% | C Tier | Average |
| D | 80.00% | D Tier | Below Average |
| F | < 80.00% | Failed | Needs Improvement |
Grades are calculated in real-time based on current accuracy:
local currentAccuracy = wife3_getAccuracy()
local currentGrade = wife3_getGrade(currentAccuracy)
-- Returns current grade based on accuracy
local hypotheticalGrade = wife3_getGrade(97.5)
-- Calculate grade for any percentage