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

TAS Inventory management #138

Open
4 of 6 tasks
orkaboy opened this issue Oct 6, 2023 · 4 comments
Open
4 of 6 tasks

TAS Inventory management #138

orkaboy opened this issue Oct 6, 2023 · 4 comments
Assignees

Comments

@orkaboy
Copy link
Collaborator

orkaboy commented Oct 6, 2023

We need to track how much money we are carrying and what items we have in our inventory/equipped. This kind of information can be used to manage the item route.

We could get some of this stuff from memory, but the pickups are also static, so as long as we are following a particular route we can make some assumptions about what we have based on what we have picked up.

Also need to have code for these things:

  • Track when we pick something important up.
  • Equipping items (account for what we have in our inventory, and the party composition).
  • Sequencer shopping (selling items, buying and equipping items).
  • Sequencer node for picking up items.
  • Sequencer node for equipping items.
  • GUI tab for inventory.
@orkaboy orkaboy self-assigned this Oct 9, 2023
@knutwalker
Copy link

In case it might be helpful, I'm tracking a few key items in the auto splitter and I have this for the inventory memory reading: https://github.com/knutwalker/sea-of-stars-autosplitter/blob/6c7a6a1633a528fcdb8ed7a8ff661bb62c027c31/src/data.rs#L2024-L2054

Some observations

  • I haven't really found a item_type field, but every different kind of item has its own subclass of IventoryItem. In order to check what kind an item is, I had to implement an instanceof check. At the end, it's probably easier to build a list of item ids and map them to whatever item type you want (that's what I am doing now as well). Maybe you find a better though
  • the money you have is separate in the CurrencyManager, but I haven't mapped them because I didn't need it for the autosplitter. I did play around with it in CE at one point, it's quite similar to the Inventory at the end
  • I haven't looked at reading weapon stats or anything like that because I only needed to track certain KeyItems for the autosplitter

@Eein
Copy link
Collaborator

Eein commented Oct 9, 2023

In case it might be helpful, I'm tracking a few key items in the auto splitter and I have this for the inventory memory reading: https://github.com/knutwalker/sea-of-stars-autosplitter/blob/6c7a6a1633a528fcdb8ed7a8ff661bb62c027c31/src/data.rs#L2024-L2054

Some observations

  • I haven't really found a item_type field, but every different kind of item has its own subclass of IventoryItem. In order to check what kind an item is, I had to implement an instanceof check. At the end, it's probably easier to build a list of item ids and map them to whatever item type you want (that's what I am doing now as well). Maybe you find a better though
  • the money you have is separate in the CurrencyManager, but I haven't mapped them because I didn't need it for the autosplitter. I did play around with it in CE at one point, it's quite similar to the Inventory at the end
  • I haven't looked at reading weapon stats or anything like that because I only needed to track certain KeyItems for the autosplitter

It seems we came to the same conclusion for how we should handle these item objects

i believe weapons follow a similar setup as items, which we will have to map to ids and add up at runtime.

Thanks for the additional research!

@orkaboy
Copy link
Collaborator Author

orkaboy commented Oct 10, 2023

The code I've written so far is mostly to track and reason about these things, but if we can get some/all info from memory that is ofc better. I think the code will still be useful since we can use it to route and reason about things that we don't have yet.

@orkaboy
Copy link
Collaborator Author

orkaboy commented Nov 20, 2023

Shop inventory has been implemented, but there is a strange behavior in the memory bits when items are sold. This messes up the list exposed to the TAS. A bit unclear what's going on right now.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants