-
Notifications
You must be signed in to change notification settings - Fork 0
Wife3 Scoring System.hx
HScript-based scoring system that implements Etterna's Wife3 accuracy calculation.
Can run alongside or replace Psych Engine's default scoring system.
Wife3 (Wife version 3) is Etterna's timing-based accuracy algorithm. This script provides 22 global callback functions accessible from any Lua or HScript.
- Configuration Functions
- Data Getter Functions
- Utility Functions
- Display Modes
- Judge Presets
- Grading System
Enable or disable Wife3 scoring system.
wife3_setEnabled(true) -- Enable (default)
wife3_setEnabled(false) -- DisableControl how Wife3 displays scores.
| Mode | Description |
|---|---|
'default' |
Replace Psych Engine's scoreTxt entirely |
'separate' |
Show Wife3 below Psych's default score (recommended) |
'custom' |
Calculate only, no display (use for custom UI) |
wife3_setDisplayMode('separate')Set 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.
Enable/disable score "bop" animation on hits.
wife3_setScoreZoom(true) -- Enable zoom animation (default)
wife3_setScoreZoom(false) -- Disable animationShow/hide timing feedback (Early/Late display).
wife3_setShowTimingDisplay(true) -- Show timing (default)
wife3_setShowTimingDisplay(false) -- Hide timingSet how long timing display stays visible (in seconds).
wife3_setTimingDisplayDuration(0.5) -- 500ms (default)
wife3_setTimingDisplayDuration(1.0) -- 1 secondReset all Wife3 counters to zero. Useful for practice mode or custom restart mechanics.
wife3_resetAccuracy()Returns current accuracy percentage (0-100) based on notes hit 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 current letter grade based on accuracy.
local grade = wife3_getGrade()
-- Returns: 'AAAAA', 'AAAA', 'AAA', 'AA', 'A', 'B', 'C', 'D', or 'F'Returns the complete formatted display string (same as displayed on screen).
local displayText = wife3_getFormattedString()
-- Example: "Score: 987654 | Acc: 98.45% (AAA)"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()Calculate letter grade for any given percentage value.
local grade = wife3_calculateGrade(99.75)
-- Returns: 'AAAAA'
local grade = wife3_calculateGrade(95.5)
-- Returns: 'A'Format a number to 2 decimal places.
local formatted = wife3_formatPercent(98.456789)
-- Returns: '98.46'Replaces Psych Engine's scoreTxt entirely with Wife3 display.
wife3_setDisplayMode('default')Display Format:
Score: 987654 | Acc: 98.45% (AAA) | Combo: 234
Shows Wife3 display below Psych's default score.
wife3_setDisplayMode('separate')Display Format:
[Psych's default score line]
Score: 987654 | Acc: 98.45% (AAA)
Calculates Wife3 but doesn't display anything. Use this for building custom UIs.
wife3_setDisplayMode('custom')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)Wife3 uses Etterna's 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 currentGrade = wife3_getGrade()
-- Returns current grade based on accuracy
local hypotheticalGrade = wife3_calculateGrade(97.5)
-- Calculate grade for any percentageScript by AutisticLulu | Based on Etterna's Wife3 scoring algorithm