Skip to content

Commit 1331675

Browse files
Muse Dash: Option Groups and Options Rework (#3434)
* Ensure that included/starter songs only include those within enabled dlcs. * Allow filtering traps by trap instead of by category. * Add in the currently available limited time dlcs to the dlc list. * Add the option group to the webhost and cleanup some errors. * Fix trap list. * Update tests. Add new ones to test correctness of new features. * Remove the old Just As Planned option * Make traps order alphabetically. Also adjust the title for traps. * Adjust new lines to better fit the website. * Style fixes. * Test adjustments and a fix due to test no longer having just as planned dlc. * Undo spacing changes as it breaks yaml generation. * Fix indenting in webhost. * Add the old options in as removed. Also clean up unused import. * Remove references to the old allow_just_as_planned_dlc_songs option in Muse Dash tests. * Add newline to end of file. --------- Co-authored-by: NewSoupVi <57900059+NewSoupVi@users.noreply.github.com>
1 parent f30f2d3 commit 1331675

10 files changed

+209
-104
lines changed

worlds/musedash/MuseDashCollection.py

+19-11
Original file line numberDiff line numberDiff line change
@@ -22,12 +22,15 @@ class MuseDashCollections:
2222
]
2323

2424
MUSE_PLUS_DLC: str = "Muse Plus"
25+
26+
# Ordering matters for webhost. Order goes: Muse Plus, Time Limited Muse Plus Dlcs, Paid Dlcs
2527
DLC: List[str] = [
26-
# MUSE_PLUS_DLC, # To be included when OptionSets are rendered as part of basic settings.
27-
# "maimai DX Limited-time Suite", # Part of Muse Plus. Goes away 31st Jan 2026.
28-
"Miku in Museland", # Paid DLC not included in Muse Plus
29-
"Rin Len's Mirrorland", # Paid DLC not included in Muse Plus
30-
"MSR Anthology", # Now no longer available.
28+
MUSE_PLUS_DLC,
29+
"CHUNITHM COURSE MUSE", # Part of Muse Plus. Goes away 22nd May 2027.
30+
"maimai DX Limited-time Suite", # Part of Muse Plus. Goes away 31st Jan 2026.
31+
"MSR Anthology", # Now no longer available.
32+
"Miku in Museland", # Paid DLC not included in Muse Plus
33+
"Rin Len's Mirrorland", # Paid DLC not included in Muse Plus
3134
]
3235

3336
DIFF_OVERRIDES: List[str] = [
@@ -50,22 +53,24 @@ class MuseDashCollections:
5053
song_items: Dict[str, SongData] = {}
5154
song_locations: Dict[str, int] = {}
5255

53-
vfx_trap_items: Dict[str, int] = {
56+
trap_items: Dict[str, int] = {
5457
"Bad Apple Trap": STARTING_CODE + 1,
5558
"Pixelate Trap": STARTING_CODE + 2,
5659
"Ripple Trap": STARTING_CODE + 3,
5760
"Vignette Trap": STARTING_CODE + 4,
5861
"Chromatic Aberration Trap": STARTING_CODE + 5,
5962
"Background Freeze Trap": STARTING_CODE + 6,
6063
"Gray Scale Trap": STARTING_CODE + 7,
61-
"Focus Line Trap": STARTING_CODE + 10,
62-
}
63-
64-
sfx_trap_items: Dict[str, int] = {
6564
"Nyaa SFX Trap": STARTING_CODE + 8,
6665
"Error SFX Trap": STARTING_CODE + 9,
66+
"Focus Line Trap": STARTING_CODE + 10,
6767
}
6868

69+
sfx_trap_items: List[str] = [
70+
"Nyaa SFX Trap",
71+
"Error SFX Trap",
72+
]
73+
6974
filler_items: Dict[str, int] = {
7075
"Great To Perfect (10 Pack)": STARTING_CODE + 30,
7176
"Miss To Great (5 Pack)": STARTING_CODE + 31,
@@ -78,7 +83,7 @@ class MuseDashCollections:
7883
"Extra Life": 1,
7984
}
8085

81-
item_names_to_id: ChainMap = ChainMap({}, filler_items, sfx_trap_items, vfx_trap_items)
86+
item_names_to_id: ChainMap = ChainMap({}, filler_items, trap_items)
8287
location_names_to_id: ChainMap = ChainMap(song_locations, album_locations)
8388

8489
def __init__(self) -> None:
@@ -171,6 +176,9 @@ def get_songs_with_settings(self, dlc_songs: Set[str], streamer_mode_active: boo
171176

172177
return filtered_list
173178

179+
def filter_songs_to_dlc(self, song_list: List[str], dlc_songs: Set[str]) -> List[str]:
180+
return [song for song in song_list if self.song_matches_dlc_filter(self.song_items[song], dlc_songs)]
181+
174182
def song_matches_dlc_filter(self, song: SongData, dlc_songs: Set[str]) -> bool:
175183
if song.album in self.FREE_ALBUMS:
176184
return True

worlds/musedash/Options.py

+74-35
Original file line numberDiff line numberDiff line change
@@ -1,26 +1,26 @@
1-
from typing import Dict
2-
from Options import Toggle, Option, Range, Choice, DeathLink, ItemSet, OptionSet, PerGameCommonOptions
1+
from Options import Toggle, Range, Choice, DeathLink, ItemSet, OptionSet, PerGameCommonOptions, OptionGroup, Removed
32
from dataclasses import dataclass
43

54
from .MuseDashCollection import MuseDashCollections
65

76

8-
class AllowJustAsPlannedDLCSongs(Toggle):
9-
"""Whether [Muse Plus] DLC Songs, and all the albums included in it, can be chosen as randomised songs.
10-
Note: The [Just As Planned] DLC contains all [Muse Plus] songs."""
11-
display_name = "Allow [Muse Plus] DLC Songs"
12-
13-
147
class DLCMusicPacks(OptionSet):
15-
"""Which non-[Muse Plus] DLC packs can be chosen as randomised songs."""
8+
"""
9+
Choose which DLC Packs will be included in the pool of chooseable songs.
10+
11+
Note: The [Just As Planned] DLC contains all [Muse Plus] songs.
12+
"""
1613
display_name = "DLC Packs"
1714
default = {}
1815
valid_keys = [dlc for dlc in MuseDashCollections.DLC]
1916

2017

2118
class StreamerModeEnabled(Toggle):
22-
"""In Muse Dash, an option named 'Streamer Mode' removes songs which may trigger copyright issues when streaming.
23-
If this is enabled, only songs available under Streamer Mode will be available for randomization."""
19+
"""
20+
In Muse Dash, an option named 'Streamer Mode' removes songs which may trigger copyright issues when streaming.
21+
22+
If this is enabled, only songs available under Streamer Mode will be available for randomization.
23+
"""
2424
display_name = "Streamer Mode Only Songs"
2525

2626

@@ -33,7 +33,8 @@ class StartingSongs(Range):
3333

3434

3535
class AdditionalSongs(Range):
36-
"""The total number of songs that will be placed in the randomization pool.
36+
"""
37+
The total number of songs that will be placed in the randomization pool.
3738
- This does not count any starting songs or the goal song.
3839
- The final song count may be lower due to other settings.
3940
"""
@@ -44,7 +45,8 @@ class AdditionalSongs(Range):
4445

4546

4647
class DifficultyMode(Choice):
47-
"""Ensures that at any chosen song has at least 1 value falling within these values.
48+
"""
49+
Ensures that at any chosen song has at least 1 value falling within these values.
4850
- Any: All songs are available
4951
- Easy: 1, 2 or 3
5052
- Medium: 4, 5
@@ -66,8 +68,11 @@ class DifficultyMode(Choice):
6668

6769
# Todo: Investigate options to make this non randomizable
6870
class DifficultyModeOverrideMin(Range):
69-
"""Ensures that 1 difficulty has at least 1 this value or higher per song.
70-
- Difficulty Mode must be set to Manual."""
71+
"""
72+
Ensures that 1 difficulty has at least 1 this value or higher per song.
73+
74+
Note: Difficulty Mode must be set to Manual.
75+
"""
7176
display_name = "Manual Difficulty Min"
7277
range_start = 1
7378
range_end = 11
@@ -76,16 +81,20 @@ class DifficultyModeOverrideMin(Range):
7681

7782
# Todo: Investigate options to make this non randomizable
7883
class DifficultyModeOverrideMax(Range):
79-
"""Ensures that 1 difficulty has at least 1 this value or lower per song.
80-
- Difficulty Mode must be set to Manual."""
84+
"""
85+
Ensures that 1 difficulty has at least 1 this value or lower per song.
86+
87+
Note: Difficulty Mode must be set to Manual.
88+
"""
8189
display_name = "Manual Difficulty Max"
8290
range_start = 1
8391
range_end = 11
8492
default = 8
8593

8694

8795
class GradeNeeded(Choice):
88-
"""Completing a song will require a grade of this value or higher in order to unlock items.
96+
"""
97+
Completing a song will require a grade of this value or higher in order to unlock items.
8998
The grades are as follows:
9099
- Silver S (SS): >= 95% accuracy
91100
- Pink S (S): >= 90% accuracy
@@ -104,7 +113,9 @@ class GradeNeeded(Choice):
104113

105114

106115
class MusicSheetCountPercentage(Range):
107-
"""Controls how many music sheets are added to the pool based on the number of songs, including starting songs.
116+
"""
117+
Controls how many music sheets are added to the pool based on the number of songs, including starting songs.
118+
108119
Higher numbers leads to more consistent game lengths, but will cause individual music sheets to be less important.
109120
"""
110121
range_start = 10
@@ -121,19 +132,18 @@ class MusicSheetWinCountPercentage(Range):
121132
display_name = "Music Sheets Needed to Win"
122133

123134

124-
class TrapTypes(Choice):
125-
"""This controls the types of traps that can be added to the pool.
135+
class ChosenTraps(OptionSet):
136+
"""
137+
This controls the types of traps that can be added to the pool.
138+
- Traps last the length of a song, or until you die.
126139
- VFX Traps consist of visual effects that play over the song. (i.e. Grayscale.)
127140
- SFX Traps consist of changing your sfx setting to one possibly more annoying sfx.
128-
Traps last the length of a song, or until you die.
141+
129142
Note: SFX traps are only available if [Just as Planned] DLC songs are enabled.
130143
"""
131-
display_name = "Available Trap Types"
132-
option_None = 0
133-
option_VFX = 1
134-
option_SFX = 2
135-
option_All = 3
136-
default = 3
144+
display_name = "Chosen Traps"
145+
default = {}
146+
valid_keys = {trap for trap in MuseDashCollections.trap_items.keys()}
137147

138148

139149
class TrapCountPercentage(Range):
@@ -145,24 +155,49 @@ class TrapCountPercentage(Range):
145155

146156

147157
class IncludeSongs(ItemSet):
148-
"""Any song listed here will be guaranteed to be included as part of the seed.
149-
- Difficulty options will be skipped for these songs.
150-
- If there being too many included songs, songs will be randomly chosen without regard for difficulty.
151-
- If you want these songs immediately, use start_inventory instead.
158+
"""
159+
These songs will be guaranteed to show up within the seed.
160+
- You must have the DLC enabled to play these songs.
161+
- Difficulty options will not affect these songs.
162+
- If there are too many included songs, this will act as a whitelist ignoring song difficulty.
152163
"""
153164
verify_item_name = True
154165
display_name = "Include Songs"
155166

156167

157168
class ExcludeSongs(ItemSet):
158-
"""Any song listed here will be excluded from being a part of the seed."""
169+
"""
170+
These songs will be guaranteed to not show up within the seed.
171+
172+
Note: Does not affect songs within the "Include Songs" list.
173+
"""
159174
verify_item_name = True
160175
display_name = "Exclude Songs"
161176

162177

178+
md_option_groups = [
179+
OptionGroup("Song Choice", [
180+
DLCMusicPacks,
181+
StreamerModeEnabled,
182+
IncludeSongs,
183+
ExcludeSongs,
184+
]),
185+
OptionGroup("Difficulty", [
186+
GradeNeeded,
187+
DifficultyMode,
188+
DifficultyModeOverrideMin,
189+
DifficultyModeOverrideMax,
190+
DeathLink,
191+
]),
192+
OptionGroup("Traps", [
193+
ChosenTraps,
194+
TrapCountPercentage,
195+
]),
196+
]
197+
198+
163199
@dataclass
164200
class MuseDashOptions(PerGameCommonOptions):
165-
allow_just_as_planned_dlc_songs: AllowJustAsPlannedDLCSongs
166201
dlc_packs: DLCMusicPacks
167202
streamer_mode_enabled: StreamerModeEnabled
168203
starting_song_count: StartingSongs
@@ -173,8 +208,12 @@ class MuseDashOptions(PerGameCommonOptions):
173208
grade_needed: GradeNeeded
174209
music_sheet_count_percentage: MusicSheetCountPercentage
175210
music_sheet_win_count_percentage: MusicSheetWinCountPercentage
176-
available_trap_types: TrapTypes
211+
chosen_traps: ChosenTraps
177212
trap_count_percentage: TrapCountPercentage
178213
death_link: DeathLink
179214
include_songs: IncludeSongs
180215
exclude_songs: ExcludeSongs
216+
217+
# Removed
218+
allow_just_as_planned_dlc_songs: Removed
219+
available_trap_types: Removed

worlds/musedash/Presets.py

+3-3
Original file line numberDiff line numberDiff line change
@@ -3,23 +3,23 @@
33
MuseDashPresets: Dict[str, Dict[str, Any]] = {
44
# An option to support Short Sync games. 40 songs.
55
"No DLC - Short": {
6-
"allow_just_as_planned_dlc_songs": False,
6+
"dlc_packs": [],
77
"starting_song_count": 5,
88
"additional_song_count": 34,
99
"music_sheet_count_percentage": 20,
1010
"music_sheet_win_count_percentage": 90,
1111
},
1212
# An option to support Short Sync games but adds variety. 40 songs.
1313
"DLC - Short": {
14-
"allow_just_as_planned_dlc_songs": True,
14+
"dlc_packs": ["Muse Plus"],
1515
"starting_song_count": 5,
1616
"additional_song_count": 34,
1717
"music_sheet_count_percentage": 20,
1818
"music_sheet_win_count_percentage": 90,
1919
},
2020
# An option to support Longer Sync/Async games. 100 songs.
2121
"DLC - Long": {
22-
"allow_just_as_planned_dlc_songs": True,
22+
"dlc_packs": ["Muse Plus"],
2323
"starting_song_count": 8,
2424
"additional_song_count": 91,
2525
"music_sheet_count_percentage": 20,

0 commit comments

Comments
 (0)