-
Notifications
You must be signed in to change notification settings - Fork 28
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
Load inventory from game memory data for auto tracking - resolves #111 #114
Load inventory from game memory data for auto tracking - resolves #111 #114
Conversation
hello, |
@@ -292,11 +292,8 @@ def removeItemAt(self, locNameWeb): | |||
# item | |||
item = loc.itemName | |||
|
|||
if self.mode in ['seedless', 'race', 'debug']: |
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.
this is not good. in the regular tracker you can click on a visited location to uncollect it.
and we need to respect the order in which items have been added because later we can also use 'undo last location' and calling remove for a missile will remove the first missile in the list, not the one from the location.
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.
why did you have to change it ? which issue did you have ?
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.
Ah, iirc this was during the state reset when updating from an autotracking game state. Somewhere this function got called along the way, and it was attempting to remove the Nth collected item if we were clearing the Nth location, because it's assuming the collected items directly correspond to the visited locations in the same order.
I could add a flag of some kind when resetting during an import dump if we're reading inventory from memory?
# Inventory | ||
elif dataType == dataEnum["inventory"]: | ||
# Clear collected items if loading from game state. | ||
self.collectedItems.clear() |
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.
same as above comment, doing that we break the regular tracker if a user stops using the auto tracker then want to continue manual tracking.
I'll add to reset all locations to unvisited when the auto tracker ends.
I've pushed your PR in branch pr-114 and commited to it a fix for no energy items in the solver spoiler log |
I've pushed the reset of collected items when the auto tracker ends. |
there's another issue, in collected items we add bosses and mini bosses, I'll handle it. |
I've pushed in the branch the handling of picking/removing items by the autotracker which is compatible with the regular tracker. |
Just tried it with my last MW seed. I got an error when starting the autotracker, and the errors folder had this traceback:
Possibly something with the boss changes recently? |
indeed, I've pushed a fix. |
Okay that seems to be working with a MW seed now, thanks! I noticed two things that are probably based on other changes in the main/beta branch that aren't related to this I wanted to ask about:
|
I've just killed phantoon and its icon has turned grey in the grid. |
Yeah, I figured out what was going on there. The boss icon thing was just me being a dumb dumb and reversing what I thought would happen (they start lit and go out, not the other way around). The other issue I did figure out why it's happening at least. In the new compiled JS/CSS bundle for the tracker, it's adding a CSS class to the location based on the item there. The "Nothing" item has a CSS rule that makes the background the visited icons with the checkmarks. The "NoEnergy" item has no CSS rule at all, so it doesn't change the icon. Is it possible to add a |
Thanks for doing this. I was hoping to get the item autotracker working in seedless mode soon and this is like halfway there.
The bulk of the javascript and css is in a separate repo. If you need to make changes there I can show you how to develop against it (or I can just make the changes for you). I think you can get away with only changing this repo. Unfortunately I don't know much about Multiworld so I can't test this myself. Does the item's html element get the
If it's not getting the |
It is getting the |
I made an alias on the client repo for
You can also rebuild the docker container. |
That sounds perfect, thanks! I was just taking a quick look at the rule, and it looks like the exact background image filename is also generated during the compile so duplicating that rule in the |
Just tried with my MW seed tonight, and it appears to be working great! The locations are using the checked off visited graphics which looks much cleaner and more readable. Thank you both! |
I ended up making a new branch, so the previous PR closed.
This changes the inventory population to read from the game memory as part of the current game state instead of populating based on visited locations and their contents. This makes it so e.g. Archipelago multiworld seeds will work properly where the location contents are items for other people most of the time.
In addition, I also changed the fallback item for such locations to be the "NoEnergy" item instead of spring ball. In a MW seed, the item at most locations is a MW item for another player statistically. This item is not recognized by the tracker, so it was falling back to putting "SpringBall" at every location which doesn't make sense. Initially I tried the "Nothing" item, but the location is marked as visited as soon as it is viewed at all, even if e.g. it's out of reach and the player hasn't actually gotten the item yet. I changed it to "NoEnergy" instead, so it wouldn't affect inventory.