theonlydude / RandomMetroidSolver

VARIA Randomizer, Solver and Tracker for Super Metroid
http://randommetroidsolver.pythonanywhere.com
MIT License
45 stars 27 forks source link

Autotracking: Read inventory from memory instead of visited locations #111

Open DorkmasterFlek opened 1 year ago

DorkmasterFlek commented 1 year ago

I noticed that the autotracking functionality does not read your current inventory from memory, instead relying on looking at the contents of each location and whether you've visited it or not. This doesn't work for e.g. multiworld seeds where the items at each location are not necessarily your own. I understand this is outside of the normal scope of VARIA, but as far as I can tell it looks like making it read what you actually have in inventory would make the tracker work for this use case, even unofficially/zero warranty/etc.

I believe I have enough knowledge to implement this myself and submit a PR if necessary. I'm just wondering if there is a specific reason why it was done this way I should be aware of?

theonlydude commented 1 year ago

hello, the solver, the tracker build on it and the auto-tracker built on the tracker indeed use locations and not the inventory. despite being how it works internally we also handle locations and not the inventory because you can start the autotracker after starting your seed, so the auto tracker needs to know which locations have already been visited as we display available locations in the tracker (that's the core of the tracker). also if the user dies and load a save we need to know which locations are no longer visited, if we were to read only the inventory we wouldn't have this information.

to handle this with the VARIA auto-tracker as base you could: -read in ROM if seed is multiworld -handle locations like before but if it's multiworld don't update the inventory when visiting a location -if it's multiworld also read the inventory from RAM and use it to compute logic (by adding it in the state of the autotracker that's sent to the backend)

you may ask why not always do that in the auto-tracker as it'll still work with VARIA seeds and that's a good point. I'm adding it to the todo list.

DorkmasterFlek commented 1 year ago

Yes I would not want to remove the location marking logic. Only add reading the inventory memory locations and populate inventory based on that instead of visited locations. Thanks! I will mess with adding this in a fork and open a PR. 👍