Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Muse Dash: Add New Game #1723

Merged
merged 88 commits into from
Jun 29, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
88 commits
Select commit Hold shift + click to select a range
53bb19a
Alpha 1 Muse dash stuff.
DeamonHunter Jan 8, 2023
4fcc448
Add in an option to limit to only base game songs.
DeamonHunter Jan 8, 2023
e60273b
Make all items progression instead of progression_skip_balancing.
DeamonHunter Jan 9, 2023
35e5714
Add in extra_goal_song_items to help make runs less about completing …
DeamonHunter Jan 9, 2023
40472ee
Change ID range to be in a more open area, and add some comments.
DeamonHunter Jan 13, 2023
b674cd9
Add in Streamer Mode and difficulty range options. Rearrange data fil…
DeamonHunter Jan 14, 2023
41cf32f
Fix generation issues.
DeamonHunter Jan 14, 2023
b8ec406
Fix up the maximum and remove old option.
DeamonHunter Jan 14, 2023
9073293
Remove empty items and the option to make filler songs empty.
DeamonHunter Jan 16, 2023
184e456
Support emerald hunt mode. Make difficulties an option rather than 2 …
DeamonHunter Jan 21, 2023
d28569f
Fix DLC Song option being inverted.
DeamonHunter Jan 21, 2023
455edda
Merge branch 'main' of https://github.com/ArchipelagoMW/Archipelago i…
DeamonHunter Jan 23, 2023
59ddaa9
Fix item counting being broken if there was more than 1 world.
DeamonHunter Jan 23, 2023
194dda8
Make compatible with .apworld specification.
DeamonHunter Jan 23, 2023
ed588df
Make All item names ASCII compatible.
DeamonHunter Jan 24, 2023
c48bcf9
Add in the additional_item_percentage option.
DeamonHunter Jan 24, 2023
91c0f31
Add a test to ensure the item names are within the normal ascii range.
DeamonHunter Feb 4, 2023
e1abc6d
Add in death link.
DeamonHunter Feb 6, 2023
6b5c747
Remove the album from the item name. Not really needed anymore.
DeamonHunter Feb 6, 2023
6569a26
Add the 2 budget is burning albums under the free songs heading. Adds…
DeamonHunter Feb 6, 2023
815aad7
Sanitise Album names.
DeamonHunter Feb 6, 2023
10c4664
Added the grade needed choice.
DeamonHunter Feb 19, 2023
4026cd3
Update songs to v3.1.0
DeamonHunter Feb 25, 2023
92d794c
Adjust difficulty ranges. Add Expert and Master.
DeamonHunter Feb 25, 2023
5bf1b2d
Fix setup_en.md being out of date.
DeamonHunter Feb 25, 2023
37bda15
Add a manual override.
DeamonHunter Feb 25, 2023
6d69ed4
Add testing for diff ranges. Fix bugs introduced there. Limit option …
DeamonHunter Feb 25, 2023
12a17f2
Merge remote-tracking branch 'ArchipelagoMW/main' into Deamon/MuseDas…
DeamonHunter Feb 25, 2023
fc05921
Remove regions from Muse Dash.
DeamonHunter Feb 25, 2023
f70c205
Some Oops...
DeamonHunter Feb 25, 2023
18dd4f2
Attempt to make tests happy.
DeamonHunter Feb 25, 2023
fd5f8ae
Remove supports weighting false to stop webhost test failing.
DeamonHunter Feb 25, 2023
4985a57
Adjusted settings
DeamonHunter Mar 11, 2023
7f2c076
Merge branch 'main' of https://github.com/ArchipelagoMW/Archipelago i…
DeamonHunter Apr 2, 2023
739024c
Adjust music sheets to use percentages. Various cleanups.
DeamonHunter Apr 2, 2023
eff5dc3
Fixes to new code.
DeamonHunter Apr 2, 2023
1f02cb7
Add Ola Dash Album. Add support for overriding song difficulty. Other…
DeamonHunter Apr 2, 2023
ddebd42
Attempt fix tests.
DeamonHunter Apr 2, 2023
3d39e6e
Ooops missed one.
DeamonHunter Apr 2, 2023
b5657a9
flake8 suggestions.
DeamonHunter Apr 2, 2023
3d7dc1c
Remove FM 17314 SUGAR RADIO as that song is a bit weird.
DeamonHunter Apr 2, 2023
d9aa798
Update document pages.
DeamonHunter Apr 2, 2023
73ce66d
Add trap support
DeamonHunter Apr 8, 2023
b096019
Lower additional song count by 10.
DeamonHunter Apr 8, 2023
94846cc
Tests broke on my end. Using github to test this.
DeamonHunter Apr 10, 2023
b566306
Looks like I was accidentally adding ~.
DeamonHunter Apr 10, 2023
60e0cc8
Fix the one song that crashes OoT hint generation
DeamonHunter Apr 10, 2023
f8ddcd4
Various documentation changes.
DeamonHunter Apr 10, 2023
43972c4
Website documents fixup.
DeamonHunter Apr 16, 2023
010de1d
Merge branch 'main' of https://github.com/ArchipelagoMW/Archipelago i…
DeamonHunter Apr 16, 2023
59d098d
Doc updates part 2.
DeamonHunter Apr 16, 2023
7797336
Oops. Doc updates part 3.
DeamonHunter Apr 16, 2023
31906d3
Add Muse Dash to the apworld list.
DeamonHunter Apr 16, 2023
5a2c618
Add trailing comma.
DeamonHunter Apr 20, 2023
4bca36e
Add a couple plando options.
DeamonHunter Apr 23, 2023
c3aed1f
Set data_version to 1.
DeamonHunter Apr 23, 2023
911c622
Add in some handling incase someone decides a song is both starter an…
DeamonHunter Apr 23, 2023
34e9939
Remove brackets around ifs.
DeamonHunter Apr 23, 2023
e45112f
Oops. Accidentally removed a necessary bracket.
DeamonHunter Apr 23, 2023
8a39889
Fix filtering crash due to me mixing up c# and python .remove().
DeamonHunter Apr 23, 2023
e947275
Add Happy Otaku Pack Vol.17. Also increment data version.
DeamonHunter Apr 28, 2023
2005e98
Update links to melon loader to be the latest.
DeamonHunter May 20, 2023
5e9c9a9
Clean up song selection code by shuffling once then popping.
DeamonHunter May 20, 2023
2fc4c29
Add UID to the Data text file, so the same file can be used client an…
DeamonHunter May 20, 2023
ceac34f
Increment Data Version because some names have changed.
DeamonHunter May 20, 2023
6e20fa3
Merge tag '0.4.1' into Deamon/MuseDashRegions
DeamonHunter May 20, 2023
ee15886
Correct some names.
DeamonHunter May 24, 2023
8ac269d
Update data to v3.4.0 (Addition of Muse Radio FM104)
DeamonHunter May 26, 2023
d2e39da
Add support for SFX traps. Adjusted how traps were setup a bit.
DeamonHunter Jun 18, 2023
06517ca
Update the docs to include a troubleshooting section.
DeamonHunter Jun 18, 2023
533cf37
Merge branch 'main' into Deamon/MuseDashRegions
DeamonHunter Jun 18, 2023
2d7d17b
Small fixes.
DeamonHunter Jun 18, 2023
ed2b958
Remove unnecessary brackets.
DeamonHunter Jun 20, 2023
7742ae5
Add .net downloads to docs.
DeamonHunter Jun 20, 2023
5f12a9e
Avoid failing generation if strict difficulty settings are applied wi…
DeamonHunter Jun 20, 2023
4a55acf
Forgot to add the worst starting song count.
DeamonHunter Jun 20, 2023
43dd24e
Make minimum song count be Starting Songs + 11 instead of Starting So…
DeamonHunter Jun 24, 2023
0853584
Fix up several issues where song count could mismatch the requested a…
DeamonHunter Jun 24, 2023
2e86fc6
Add a test to ensure world size doesn't grow.
DeamonHunter Jun 25, 2023
d74642b
Fix some oversights.
DeamonHunter Jun 25, 2023
aa102d8
Remove unnecessary brackets.
DeamonHunter Jun 25, 2023
44e86e6
Merge branch 'main' into Deamon/MuseDashRegions
DeamonHunter Jun 25, 2023
50e1ba8
Fix up passing the tuple out when just the key would suffice.
DeamonHunter Jun 29, 2023
df0b8fa
Adjust typing based on Phar's suggestions.
DeamonHunter Jun 29, 2023
e6c432d
Apply the rest of Phar's suggestions with minor tweaks to other parts…
DeamonHunter Jun 29, 2023
cb0b0f7
Adjust some more stuff to fit 120 characters.
DeamonHunter Jun 29, 2023
b9f1d2b
Some more pep8 stuff and fix tests.
DeamonHunter Jun 29, 2023
cece9f6
Some pep8 in tests.
DeamonHunter Jun 29, 2023
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
34 changes: 34 additions & 0 deletions worlds/musedash/Items.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
from typing import NamedTuple, Optional, Union
from BaseClasses import Item, ItemClassification


class SongData(NamedTuple):
"""Special data container to contain the metadata of each song to make filtering work."""

code: Optional[int]
song_is_free: bool
streamer_mode: bool
easy: str = Optional[int]
hard: int = Optional[int]
master: int = Optional[int]
secret: int = Optional[int]


class AlbumData(NamedTuple):
"""Special data container to contain the metadata of each album to make filtering work. Currently not used."""

code: Optional[int]


class MuseDashSongItem(Item):
game: str = "Muse Dash"

def __init__(self, name: str, player: int, data: Union[SongData, AlbumData]) -> None:
super().__init__(name, ItemClassification.progression, data.code, player)


class MuseDashFixedItem(Item):
game: str = "Muse Dash"

def __init__(self, name: str, classification: ItemClassification, code: Optional[int], player: int) -> None:
super().__init__(name, classification, code, player)
5 changes: 5 additions & 0 deletions worlds/musedash/Locations.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
from BaseClasses import Location


class MuseDashLocation(Location):
game: str = "Muse Dash"
136 changes: 136 additions & 0 deletions worlds/musedash/MuseDashCollection.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,136 @@
from .Items import SongData, AlbumData
from typing import Dict, List, Optional


def load_text_file(name: str) -> str:
import pkgutil
return pkgutil.get_data(__name__, name).decode()


class MuseDashCollections:
"""Contains all the data of Muse Dash, loaded from MuseDashData.txt."""

MUSIC_SHEET_CODE: int

FREE_ALBUMS = [
"Default Music",
"Budget Is Burning: Nano Core",
"Budget is Burning Vol.1"
]

DIFF_OVERRIDES = [
"MuseDash ka nanika hi",
"Rush-Hour",
"Find this Month's Featured Playlist",
"PeroPero in the Universe",
"CHAOS Glitch"
]

album_items: Dict[str, AlbumData] = {}
album_locations: Dict[str, int] = {}
song_items: Dict[str, SongData] = {}
song_locations: Dict[str, int] = {}

vfx_trap_items: Dict[str, int] = {
"Bad Apple Trap": 1,
"Pixelate Trap": 2,
"Random Wave Trap": 3,
"Shadow Edge Trap": 4,
"Chromatic Aberration Trap": 5,
"Background Freeze Trap": 6,
"Gray Scale Trap": 7,
}

sfx_trap_items: Dict[str, int] = {
"Nyaa SFX Trap": 8,
"Error SFX Trap": 9,
}

def __init__(self, start_item_id: int, items_per_location: int):
self.MUSIC_SHEET_CODE = start_item_id

self.vfx_trap_items = {k: (v + start_item_id) for (k, v) in self.vfx_trap_items.items()}
self.sfx_trap_items = {k: (v + start_item_id) for (k, v) in self.sfx_trap_items.items()}

item_id_index = start_item_id + 50
location_id_index = start_item_id

full_file = load_text_file("MuseDashData.txt")

for line in full_file.splitlines():
line = line.strip()
sections = line.split("|")

if sections[2] not in self.album_items:
self.album_items[sections[2]] = AlbumData(item_id_index)
item_id_index += 1

# Data is in the format 'Song|UID|Album|StreamerMode|EasyDiff|HardDiff|MasterDiff|SecretDiff'
song_name = sections[0]
# [1] is used in the client copy to make sure item id's match.
song_is_free = sections[2] in self.FREE_ALBUMS
steamer_mode = sections[3] == "True"

if song_name in self.DIFF_OVERRIDES:
# Note: These difficulties may not actually be representative of these songs.
# The game does not provide these difficulties so they have to be filled in.
diff_of_easy = 4
diff_of_hard = 7
diff_of_master = 10
else:
diff_of_easy = self.parse_song_difficulty(sections[4])
diff_of_hard = self.parse_song_difficulty(sections[5])
diff_of_master = self.parse_song_difficulty(sections[6])

self.song_items[song_name] = SongData(item_id_index, song_is_free, steamer_mode,
diff_of_easy, diff_of_hard, diff_of_master)
item_id_index += 1

for name in self.album_items.keys():
for i in range(0, items_per_location):
new_name = f"{name}-{i}"
self.album_locations[new_name] = location_id_index
location_id_index += 1

for name in self.song_items.keys():
for i in range(0, items_per_location):
new_name = f"{name}-{i}"
self.song_locations[new_name] = location_id_index
location_id_index += 1

def get_songs_with_settings(self, dlc_songs: bool, streamer_mode_active: bool,
diff_lower: int, diff_higher: int) -> List[str]:
"""Gets a list of all songs that match the filter settings. Difficulty thresholds are inclusive."""
filtered_list = []

for songKey, songData in self.song_items.items():
if not dlc_songs and not songData.song_is_free:
continue

if streamer_mode_active and not songData.streamer_mode:
continue

if songData.easy is not None and diff_lower <= songData.easy <= diff_higher:
filtered_list.append(songKey)
continue

if songData.hard is not None and diff_lower <= songData.hard <= diff_higher:
filtered_list.append(songKey)
continue

if songData.master is not None and diff_lower <= songData.master <= diff_higher:
filtered_list.append(songKey)
continue

return filtered_list

def parse_song_difficulty(self, difficulty: str) -> Optional[int]:
"""Attempts to parse the song difficulty."""
if len(difficulty) <= 0 or difficulty == "?" or difficulty == "¿":
return None

# Curse the 2023 april fools update. Used on 3rd Avenue.
if difficulty == "〇":
return 10

return int(difficulty)
Loading