Skip to content
Open

6fret #1470

Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
71 commits
Select commit Hold shift + click to select a range
25a8159
add SixFretGuitarPreset to EnginePreset
theli-ua Apr 20, 2026
aa0cb5c
make FiveFretGuitarPlayer overridable for 6-fret
theli-ua Apr 20, 2026
cb44318
create SixFretGuitarPlayer inheriting from FiveFretGuitarPlayer
theli-ua Apr 20, 2026
dad0fba
create SixFretGuitarNoteElement inheriting from FiveFretGuitarNoteEle…
theli-ua Apr 20, 2026
254fda7
wire SixFretGuitar into ThemeComponent, create prefab, and wire Gamep…
theli-ua Apr 20, 2026
9ee1c43
fix 6-fret build errors: remove SixFretRangeShift, fix NoteElement in…
theli-ua Apr 21, 2026
32018f1
add .meta files for new 6-fret files
theli-ua Apr 21, 2026
bae7fdd
add SixFretGuitar to profile game mode dropdown
theli-ua Apr 21, 2026
0834f4b
remove range shift setting from 6-fret guitar profile settings
theli-ua Apr 21, 2026
f9d4059
fix instrument names for 6-fret guitar with (6-Fret) suffix
theli-ua Apr 21, 2026
5fdc7fc
add 6-fret icon resource names and generate sprite sheet assets
theli-ua Apr 21, 2026
b10afc5
replace elite drums ring with 6-fret guitar ring in library sidebar
theli-ua Apr 21, 2026
dee96b1
refactor: regenerate 6-fret sprite sheet assets with correct positioning
theli-ua Apr 22, 2026
298055e
fix: use unique y positions for 6-fret icons in sprite sheet
theli-ua Apr 22, 2026
f84c3c2
fix: correct PIL/Unity Y coordinate conversion for 6-fret icons
theli-ua Apr 22, 2026
e497f54
commit core
theli-ua Apr 22, 2026
e9a7772
fix: show elite drums in ring 7 when no 6-fret tracks present
theli-ua Apr 22, 2026
629d7c7
format sprite sheet meta
theli-ua Apr 23, 2026
44494cd
remove temp files
theli-ua Apr 23, 2026
2168a7b
fix: 6-fret guitar frontend integration fixes
Apr 24, 2026
3de4cab
Update FontSprites for 6fret instruments
theli-ua Apr 25, 2026
a20af7e
fix(themes): assign sixFret notes/fret fields to theme prefabs
theli-ua Apr 25, 2026
fcfe7f2
fix(6fret): wire note pool to correct prefab
theli-ua Apr 25, 2026
53c12c8
fix(score-screen): handle SixFretGuitar in CreateScoreCards
theli-ua Apr 26, 2026
1ea5af2
fix(score-screen): add SixFretGuitar to modifier icon spawning
theli-ua Apr 26, 2026
1236379
fix(l10n): add missing 6-fret color profile labels
theli-ua Apr 26, 2026
8451272
Update core pointer
theli-ua Apr 26, 2026
7449761
fix(i18n): add missing 6-fret guitar binding names
theli-ua Apr 26, 2026
242309f
deleted doc that was not supposed to be committed
theli-ua Apr 26, 2026
39d8a7a
feat: 6-fret combined lane view (phases 1-6)
theli-ua Apr 26, 2026
9afb6ce
Format
theli-ua Apr 27, 2026
8d2717c
Wire up lane format for six fret
theli-ua Apr 27, 2026
169f990
fix: rename 6-fret split lanes toggle to match ProfileSettingStrings
theli-ua Apr 27, 2026
4ddf981
Wire up lane format for six fret toggle
theli-ua Apr 27, 2026
9afcb78
fix: widen 6-fret sustain lines to match combined lane span
theli-ua Apr 27, 2026
d24c2ff
leave sustains alone in six fret, they're fine as is
theli-ua Apr 27, 2026
896ffc2
Fix warning
theli-ua Apr 27, 2026
9aa94f7
reset core to upstream
theli-ua Apr 27, 2026
115c1fc
Merge remote-tracking branch 'upstream/dev' into 6fret
theli-ua Apr 27, 2026
2c2efa3
fix(themes): add SixFretGuitar to Circular and AprilFools supported s…
Apr 27, 2026
1bb9237
feat(preview): add 6-fret guitar to fake track player
theli-ua Apr 27, 2026
6324e3e
Merge remote-tracking branch 'upstream/dev' into 6fret
theli-ua Apr 28, 2026
e1562c5
Make six fret inherit from 5 fret
theli-ua Apr 28, 2026
ec273b2
reset core to upstream
theli-ua Apr 28, 2026
2e72052
Merge remote-tracking branch 'upstream/dev' into 6fret
theli-ua Apr 28, 2026
0ee4ba1
refactor(6fret): cut CreateEngine duplication via virtual hooks
theli-ua Apr 28, 2026
93f4e72
Merge remote-tracking branch 'upstream/dev' into 6fret
theli-ua Apr 29, 2026
579a91c
submodule: bump YARG.Core to 1353d73 (6-fret HOPO fix)
theli-ua May 1, 2026
9914875
Merge remote-tracking branch 'upstream/dev' into 6fret
theli-ua May 1, 2026
2a0dce6
refactor(six-fret): rename FindPairInChord to FindPairInBarre
theli-ua May 3, 2026
f8b18d0
Phase 1: Foundation for 3-lane 6-fret highway
theli-ua May 3, 2026
0825670
Update YARG.Core submodule to remove SixFretSplitLanes
theli-ua May 3, 2026
92b7b23
Phase 2: Core 3-lane highway refactor
theli-ua May 3, 2026
942bdcc
Phase 3: Fret array dual-half support
theli-ua May 3, 2026
d3d8a6e
Phase 4: UI cleanup for 6-fret GHL overhaul
theli-ua May 3, 2026
5e709bb
Phase 5: Update 6-fret preview to 3 lanes
theli-ua May 3, 2026
a281e9a
Update documentation to reflect completed GHL 3-lane overhaul
theli-ua May 3, 2026
0e4e890
Fix build errors for 3-lane 6-fret overhaul
theli-ua May 3, 2026
8bfbbd3
Fix FakeTrackPlayer: properly add 6-fret 3-lane preview
theli-ua May 3, 2026
04bfc7f
Fix LINQ in hot paths: move Select into Initialize()
theli-ua May 4, 2026
3bc5436
Use separate shader properties for secondary color
theli-ua May 4, 2026
03a7136
Fix Fret.cs secondary color to use dedicated shader properties
theli-ua May 4, 2026
83738ee
Use placeholder 6fret models
theli-ua May 4, 2026
2701936
6fret up/down/barre notes
theli-ua May 5, 2026
eaeef11
6fret hopos notes
theli-ua May 5, 2026
a55dc06
Merge branch 'dev' into 6fret
theli-ua May 5, 2026
e5311bd
6fret tap notes
theli-ua May 5, 2026
a2e22a6
core pointer
theli-ua May 5, 2026
9140d8b
reset core to upstream
theli-ua May 5, 2026
c864da8
help the merge perhaps
theli-ua May 5, 2026
2741697
Merge remote-tracking branch 'upstream/dev' into 6fret
theli-ua May 5, 2026
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
173 changes: 173 additions & 0 deletions .pi/six_fret.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,173 @@
# 6-Fret Guitar — Agent Prompt

> **UI overhaul in progress**: See [`.pi/six_fret_ui.md`](./six_fret_ui.md) for the GHL-style 3-lane highway plan. The combined/split lane mode below is **superseded** — the target is 3 lanes (one per black+white pair), not 6.

## Core Philosophy

6-fret guitar support is **fully based on 5-fret guitar** in both engine and visuals. Engine remains 6 frets internally. Frontend maps to **3 visual lanes** (GHL-style), one per black+white fret pair.

## 6-Fret Guitar Layout (Target — GHL-Style)

- **3 visual lanes**: each lane = one black+white fret pair
- Lane 0: Black1 + White1
- Lane 1: Black2 + White2
- Lane 2: Black3 + White3
- **2 colors only**: black fret and white fret (no 5-color scheme)
- **Note types**: "up" (one row), "down" (other row), "barre" (both rows)
- **No range shift indicators** — range shift is a 5-lane-only mechanic
- **No input viewer** — 6-fret guitar has no input viewer HUD element
- **Engine unchanged**: still 6 frets (`SixFretGuitarFret` enum), same `GuitarNote` data

## Architecture

### Inheritance Chain

| Layer | 5-Fret (base) | 6-Fret (derived) | Relationship |
|-------|---------------|------------------|--------------|
| Engine (YARG.Core) | `YargFiveFretGuitarEngine` | `YargSixFretGuitarEngine` | Inherits, overrides fret mask + coda fret count (6) |
| Player (frontend) | `FiveFretGuitarPlayer` | `SixFretGuitarPlayer` | Inherits, overrides lane count (6), fret mapping, highway ordering |
| Note Element | `FiveFretGuitarNoteElement` | `SixFretGuitarNoteElement` | Inherits from `NoteElement<GuitarNote, SixFretGuitarPlayer>`, mirrors 5-fret note logic |
| Color Profile | `FiveFretGuitarColors` | `SixFretGuitarColors` | Separate class, 2-color scheme (black/white) |
| Engine Preset | `FiveFretGuitarPreset` | `FiveFretGuitarPreset` (reused) | 6-fret reuses the same preset type |
| Visual Style | `VisualStyle.FiveFretGuitar` | `VisualStyle.SixFretGuitar` | Separate enum value, same theme model structure |

### Key Enums

- `SixFretGuitarFret`: Black1(1), Black2, Black3, White1, White2, White3, Open, Wildcard
- `GuitarAction` aliases: Black1Fret=Fret1, Black2Fret=Fret2, Black3Fret=Fret3, White1Fret=Fret4, White2Fret=Fret5, White3Fret=Fret6
- **Lane mapping** (target): Black1+White1→lane 0, Black2+White2→lane 1, Black3+White3→lane 2
- **Up/Down**: normal mode black=UP/white=DOWN; lefty flip swaps (white=UP/black=DOWN)

### What 6-Fret Shares with 5-Fret

- Engine preset type (`FiveFretGuitarPreset` reused directly)
- Note types (Strum, HOPO, Tap, Open, Wildcard, Sustain)
- Fret array system (same `FretArray` component, different lane count)
- Stem mixing (Rhythm/Bass stem logic)
- Star Power, whammy, sustain mute, overstrum
- BRE (Beginner/Big Rock Ending) lane logic
- Coda section handling
- Score card display
- Replay frame construction
- Theme model assignment (Normal, HOPO, Tap, Open, OpenHOPO, Wildcard)
- Fake track player (color preset live preview)

### GHL-Style 3-Lane Highway (Target)

> Supersedes the old combined/split lane mode. See `.pi/six_fret_ui.md` for full plan.

3 visual lanes. Each lane = one black+white fret pair. Notes in a lane display as:
- **Up**: single note from "up" row (black in normal, white in lefty flip)
- **Down**: single note from "down" row (white in normal, black in lefty flip)
- **Barre**: both black+white in same pair — dual-color note (black + white)
- **Open/Wildcard**: full-width bar across all 3 lanes (same as 5-fret)

Fret array: single `sixFretFret` prefab per lane, dual halves (top=black, bottom=white). Each half animates independently on press/sustain.

### What 6-Fret Excludes

- **Range shift** — no `SixFretRangeShift`, no range indicator pools, no shift indicator pools, no `RANGE_DISABLE` profile setting
- **Input viewer** — no `SixFretInputViewer`; the `BaseInputViewer` in `BasePlayer` is not wired for 6-fret
- **5-color scheme** — only black and white

## What Is Already Implemented

### YARG.Core (backend engine)

- [x] `YargSixFretGuitarEngine` — inherits `YargFiveFretGuitarEngine`, overrides `GetChordLowestFretMask` (iterates GreenFret→White3Fret), `CreateCodaFretMask` (6 bytes), `GetCodaFretCount` (6)
- [x] `SixFretGuitarColors` — 2-color profile (BlackFret/WhiteFret, BlackNote/WhiteNote, etc.) in `ColorProfile.SixFretGuitar.cs`
- [x] `ColorProfile` — `SixFretGuitar` sub-section wired into serialization/deserialization/copy
- [x] `EnginePreset` — `SixFretGuitar` field (type `FiveFretGuitarPreset`) wired into serialization/deserialization/copy
- [x] `SixFretGuitarFret` enum — Black1–Black3, White1–White3, Open, Wildcard
- [x] `GuitarAction` aliases — Black1Fret–White3Fret mapped to Fret1–Fret6

### Frontend (Unity)

- [x] `SixFretGuitarPlayer` — inherits `FiveFretGuitarPlayer`, overrides `LaneCount` (6), fret mapping, highway ordering, engine creation (`YargSixFretGuitarEngine`), note/lane initialization with `SixFretGuitarColors`, fret array init with 6 lanes
- [x] `FiveFretGuitarPlayer` refactored — made `sealed` → non-sealed, key members `virtual`/`protected virtual` (`LaneCount`, `GetFretFromAction`, `GetFretIndex`, `GetDefaultHighwayOrdering`, `GetFretActionMax`), `LANE_COUNT` const → `LaneCount` property
- [x] `SixFretGuitarNoteElement` — inherits `NoteElement<GuitarNote, SixFretGuitarPlayer>`, mirrors 5-fret note element with 6-fret fret types and colors
- [x] `SixFretGuitarVisual.prefab` — gameplay visual prefab with `SixFretGuitarPlayer` component
- [x] `GameManager.Loading.cs` — `_sixFretGuitarPrefab` field wired into prefab instantiation switch
- [x] `GameModeExtensions.cs` — `ToResourceName()` returns `"guitar6"` for 6-fret; `PossibleProfileSettings` excludes `RANGE_DISABLE`
- [x] `InstrumentExtensions.cs` — resource name mappings for SixFretGuitar/Bass/Rhythm/CoopGuitar (guitar6, bass6, rhythm6, coop6)
- [x] `ThemeComponent.cs` — `VisualStyle.SixFretGuitar` cases for note and fret model selection
- [x] `ThemeManager.cs` — `VisualStyle.SixFretGuitar` enum value
- [x] `ProfileSidebar.cs` — `GameMode.SixFretGuitar` in game mode dropdown
- [x] `Sidebar.cs` (MusicLibrary) — ring 7 shows 6-fret variants (guitar6, bass6, rhythm6, coop6) with fallback to elite drums
- [x] `GuitarScoreCard.cs` — 6-fret instruments in icon switch
- [x] `PresetSubTab.Generic.cs` — `SixFretGuitar` color profile preview mapping
- [x] `GameManager.Debug.cs` — `SixFretGuitarPlayer` case in player type switch
- [x] `TrackPlayer.cs` — `SixFretBass` in bass instrument check
- [x] `BindingCollection.SixFretGuitar.cs` — default gameplay and menu bindings for 6-fret guitar controller
- [x] `en-US.json` — instrument names with "(6-Fret)" suffix
- [x] `InstrumentIcons.png` / `NoInstrumentIcons.png` — sprite entries for guitar6, bass6, rhythm6, coop6
- [x] `FontSprites.asset` — font sprite updates for 6-fret instruments
- [x] `Gameplay.unity` — `_sixFretGuitarPrefab` reference wired

### Combined/Split Lane Mode

- [x] `YargProfile.SixFretSplitLanes` — profile field (default `false` = combined), serialized, `PROFILE_VERSION` bumped to 8
- [x] `ProfileSettingStrings.SIX_FRET_SPLIT_LANES` — string constant
- [x] `GameModeExtensions.PossibleProfileSettings` — setting wired for `GameMode.SixFretGuitar`
- [x] `ProfileSidebar.cs` — "Split Lanes" toggle wired to `profile.SixFretSplitLanes`, visible only for 6-fret game modes
- [x] `SixFretGuitarPlayer` — `COMBINED_PAIR_INDEX`, `GetPairIndex`, `FindPairInBarre`, `InitializeSpawnedNote` sets `element.IsPaired`, `InitializeSpawnedLane(note)` calls `lane.SetCombinedSpan(!isPaired)`
- [x] `SixFretGuitarNoteElement` — `IsPaired` field, `GetPairedLane`, `GetCombinedCenterX`, combined center position + `SINGLE_NOTE_MULTIPLIER` (1.95x) scale for solo notes, `HideElement` resets X scales
- [x] `LaneElement` — `_isCombinedSpan` flag, `SetCombinedSpan(bool)`, `RenderScale` doubles X scale when combined
- [x] Lefty flip — pairs remain adjacent (even, odd) in reversed ordering, `GetPairedLane` works correctly

### Fake Track Player (Color Preview)

- [x] `FakeTrackPlayer` — `GameMode.SixFretGuitar` entry in `_gameModeInfos`: 6 lanes, `SixFretGuitarPlayer.DEFAULT_HIGHWAY_ORDERING`, `SixFretGuitarColors` fret+note color providers, `enginePreset.SixFretGuitar.HitWindow`, fake note generator (frets 1-6, Normal/HOPO/Tap/Open types)
- [x] `PresetSubTab.Generic.cs` — `ColorProfile.SixFretGuitar` → `GameMode.SixFretGuitar` preview builder mapping (already present from base 6-fret work)

## What Remains (GHL-Style 3-Lane Overhaul)

> See `.pi/six_fret_ui.md` for detailed implementation plan.

### Phase 1: Foundation ✅ [Completed 2026-05-02]

- [x] `ThemeNoteType` enum — add SixFretUp, SixFretDown, SixFretBarre, SixFretUpHOPO, SixFretDownHOPO, SixFretUpTap, SixFretDownTap
- [x] `ThemeNote` — add `ColoredSecondaryMaterials` field for dual-color barre notes
- [x] `NoteGroup` — add `SetSecondaryColor` method (existing methods untouched)
- [x] `YargProfile` — remove `SixFretSplitLanes`, bump `PROFILE_VERSION` to 9

### Phase 2: Core (3-lane highway) ✅ [Completed 2026-05-02]

- [x] `SixFretGuitarPlayer` — `LaneCount` → 3, lane mapping, up/down/barre determination
- [x] `SixFretGuitarNoteElement` — new note type selection, dual-color support, 3-lane positioning
- [x] `LaneElement` — remove combined span logic
- [x] `SustainLine` — dual-color blend for barre sustain

### Phase 3: Fret array ✅ [Completed 2026-05-02]

- [x] `Fret.cs` — add dual-half support (press only), secondary color/animation methods
- [x] `FretArray.cs` — 3-lane init with dual-state frets, `SetPressedSecondary`
- [x] `FiveFretGuitarPlayer.UpdateFretArray()` → `protected virtual`

### Phase 4: UI cleanup ✅ [Completed 2026-05-02]

- [x] `ProfileSidebar` — remove split lanes toggle
- [x] `GameModeExtensions` — remove `SIX_FRET_SPLIT_LANES`
- [x] `ProfileSettingStrings` — remove constant

### Phase 5: Preview + polish ✅ [Completed 2026-05-02]

- [x] `FakeTrackPlayer` / `FakeNote` — 3-lane 6-fret preview
- [ ] Default theme — create 6-fret note/fret models for all new types (deferred: Unity editor task)
- [ ] Testing — all note types, lefty flip, BRE, replay, sustain, color preview (deferred: manual testing)

### Superseded (old combined/split mode — DO NOT implement)

- ~~`SustainLine.SetWidthMultiplier()` for combined mode~~ — not needed, 3 lanes have proper width
- ~~Combined lane testing~~ — replaced by 3-lane testing

> Track unfinished work here as the project evolves.

## Rules

1. **Always inherit from 5-fret** — 6-fret is a specialization of 5-fret, not a parallel implementation. When in doubt, mirror `FiveFretGuitarPlayer` / `FiveFretGuitarNoteElement` patterns.
2. **No range shift** — never add range shift logic to 6-fret. It's a 5-lane mechanic.
3. **No input viewer** — 6-fret has no input viewer.
4. **2 colors** — black frets and white frets only. No green/red/yellow/blue/orange.
5. **3 visual lanes** — highway has 3 lanes (one per black+white pair). Engine still 6 frets internally.
6. **Update this doc** — whenever a feature is implemented or a design decision is made, update this document with what was done and why. Do not add this document to git.
Loading