-
Notifications
You must be signed in to change notification settings - Fork 526
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
Pokemon Emerald: Rework tags/dynamically create item and location groups #3263
Open
Zunawe
wants to merge
15
commits into
ArchipelagoMW:main
Choose a base branch
from
Zunawe:emerald-groups
base: main
Could not load branches
Branch not found: {{ refName }}
Could not load tags
Nothing to show
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
…egional location groups
Pokemon Emerald: Defining map regions
github-actions
bot
added
the
waiting-on: peer-review
Issue/PR has not been reviewed by enough people yet.
label
May 4, 2024
Zunawe
added
the
is: enhancement
Issues requesting new features or pull requests implementing new features.
label
May 4, 2024
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Labels
is: enhancement
Issues requesting new features or pull requests implementing new features.
waiting-on: peer-review
Issue/PR has not been reviewed by enough people yet.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
What is this fixing or adding?
Currently, items and locations are both assigned "tags" in the data files that define them. For items, these tags are used to balance the item pool and to avoid creating duplicates of items with the "Unique" tag, as duplicates would have no use to the player. For locations, these tags are used to enable and disable locations. Location tags are essentially used as an enum. All locations have exactly one tag that corresponds with whether they should be included in randomization based on some player option.
So this PR actually converts those existing location tags into a category enum. A script was run on
worlds/pokemon_emerald/data/locations.json
to map the tag to acategory
field, and to empty thetags
list. And that category is used in the same way the tag was. Tags are also no longer copied to actualLocation
s in favor of akey
that can be used to index into the dataclasses.For both items and locations, tags are now converted directly into item and location groups in
worlds/pokemon_emerald/groups.py
. Some item tags were changed to look nicer to humans. Existing item groups were converted to tags and are no longer explicitly defined. The same is true for the "Gym TMs" location group, which is the only change made toworlds/pokemon_emerald/data/locations.json
that wasn't done automatically.For locations, location categories are converted to location groups in
worlds/pokemon_emerald/groups.py
by mapping the enum to a human-friendly label. Every in-game map is also associated with a group name, and since every location belongs to a region, and every region belongs to a map, it can automatically associate every location with a group representing some geographical area. (Pokedex locations are the odd ones out and have to be filtered; the locations themselves are "in Littleroot" because they're locked by events that get placed dynamically based on wild encounter randomization.)A sanity check was added to make sure the maps being used for location groups exist. In case of changes made to the names that get automatically pulled into
extracted_data.json
, or accidental misspellings.Thanks to @Tsukino-uwu for categorizing all the maps.
This PR supersedes the need for #3234.
How was this tested?
Generated a few times with a random yaml and while enabling/disabling options to check that the reported location count made sense. Also scrolled through the data package.