-
Notifications
You must be signed in to change notification settings - Fork 774
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
Stardew Valley: Add tracker text client integrated with UT and commands to explain the logic #4378
base: main
Are you sure you want to change the base?
Stardew Valley: Add tracker text client integrated with UT and commands to explain the logic #4378
Conversation
…ardew-text-client
I haven't reviewed it yet, but I will. Just want to say that this looks friggin amazing, great work! |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
General approval, few questions/suggestions. Amazing work!
|
||
|
||
def parse_explanation(explanation: RuleExplanation) -> list[JSONMessagePart]: | ||
result_regex = r"(\(|\)| & | -> | \| |\d+x | \[|\](?: ->)?\s*| \(\w+\)|\n\s*)" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Any chance this regex could get maybe a comment or some splitting down? Regex are famously unreadable after about 7 seconds after merging
worlds/stardew_valley/stardew.png
Outdated
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I heard something in dev channels recently about not being allowed to use copyrighted icons in the launcher, but some games are doing it. Can we get a confirmation of is this fair use or not?
If needed, I can provide written permission from ConcernedApe's company to use game assets in non-stardew parts of the randomizer
@@ -25,19 +57,25 @@ def __post_init__(self): | |||
self.sub_rules = [] | |||
|
|||
def summary(self, depth=0) -> str: | |||
if self.mode is ExplainMode.CLIENT: | |||
depth *= 2 | |||
|
|||
summary = " " * depth + f"{str(self.rule)} -> {self.result}" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Somehow it makes me a bit uneasy to name the variable the same as the method, with the same casing and all, and Python's lack of formal declaration. Is this considered okay?
…ds to explain the logic (ArchipelagoMW#4378)
I was looking at this again for HK inspiration and wanted to point out the conspicuous lack of |
That does sound like something quite easy to add, as the |
What is this fixing or adding?
This PR is based on #3596, which has been up for a long time now...
This adds a custom client for Stardew Valley that is integrated with Universal Tracker (need to be installed separately).
This leverages the Stardew rule framework to dig into the rules and explain them. We already had functions to explain the logic, but it was only used to debug test failure. Being able to make the rules human-readable helped us a lot while developing, so making the rules available to users to read seems only natural.
The client comes with 4 commands to explain Stardew's deep logic to end users (see screenshots). Universal tracker is required for the Stardew Valley Tracker client to appear in the launcher.
How does it work?
This uses UT ability to generate a world consistently with the player settings and its ability to build a collection state updated with the current multi world. UT uses it to find what locations are currently in logic, but with the Stardew rule framework, since the rules are not lambda but complete objects, we can easily dig into them and find out why they evaluate to True or False.
How was this tested?
Generate multiple explain for different rule types. Made sure colors are correctly applied. See screenshots.
A version of the current
stardew_valley.apworld
was released with the tracker packaged in for players to test. https://github.com/agilbert1412/Archipelago/releases/tag/0.5.1-stardew-6.6.5-trackerIf this makes graphical changes, please attach screenshots.
In case you forgot that tomatoes grow in summer
Working with UT means using UT commands! You can manually collect stuff and the explains will adapt.
Sadly, some rules are not meant for humans...
Ahh, yes, that's where the mine is!
No need to remember location name with fuzzy matching!
Using
explain_missing
will focus on the rules you're missing, and skip explaining what you already have collected.