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

Implement bag_sort branch #3938

Closed
wants to merge 13 commits into from
Closed

Conversation

Bassoonian
Copy link
Collaborator

Implements @ghoulslash's bag_sort branch. As such, do NOT squash when merging.

This is still a draft as not all items have received updated categories. I personally believe we should deprecate sItemsByType in favour of an extra field in gItems, but wanted some thoughts on that before I start porting everything over.

Issue(s) that this PR fixes

Fixes #3917

Discord contact info

bassoonian

@Bassoonian Bassoonian changed the title Nowhiteout Implement bag_sort branch Jan 7, 2024
@Jaizu
Copy link

Jaizu commented Jan 7, 2024

Items should have a sort id, otherwise they will follow itemid in their categories
image

@ghoulslash
Copy link
Collaborator

Implements @ghoulslash's bag_sort branch. As such, do NOT squash when merging.

This is still a draft as not all items have received updated categories. I personally believe we should deprecate sItemsByType in favour of an extra field in gItems, but wanted some thoughts on that before I start porting everything over.

Issue(s) that this PR fixes

Fixes #3917

Discord contact info

bassoonian

Agree with adding a new item struct field

@LOuroboros
Copy link
Collaborator

LOuroboros commented Jan 7, 2024

I agree too.

I also think there should be an opt-in config to remember the sorting, because if I'm not misremembering, the bag is reordered when you reload the savefile.

Opt-in because it would likely use at least 1 bit of space in one of the SaveBlocks to remember the current sorting mode.

@pkmnsnfrn
Copy link
Collaborator

pkmnsnfrn commented Jun 3, 2024

@Bassoonian, what exactly is the missing vanilla data? and/or should we make a discord thread for this?

@Bassoonian
Copy link
Collaborator Author

When using bag sorting in vanilla games, the items are ordered in a specific way (per pocket, of course) that does not match item ids. I've been unable to find a complete list (or any list at all, really), so this probably requires a SV save with maxed out items to depart from and then maxed out items saves for other games to fill in the gaps of items unavailable in SV

@pkmnsnfrn
Copy link
Collaborator

I think I can easily get a SV save with all items to test this, but you're going to run into the issue where sort IDs conflict because items have moved pockets between Emerald and SV. For example, X Attack is sort ID 1 for the Battle Items pocket, but that pocket doesn't exist in Emerald.

How would you fix that?

@AlexOn1ine
Copy link
Collaborator

What actually happens when ppl have the better bag branch?

@pkmnsnfrn
Copy link
Collaborator

https://www.pokecommunity.com/threads/more-bag-pockets.424360/

I don't think BetterBag supports sorting out of the box.

@pkmnsnfrn
Copy link
Collaborator

Oh you're asking, what if we implement this sorting and then people merge betterBag? I assume, without looking at any code, that it will sort within the bag pocket using the ID we give it, so it should be fine...?

@AlexOn1ine
Copy link
Collaborator

Oh you're asking, what if we implement this sorting and then people merge betterBag? I assume, without looking at any code, that it will sort within the bag pocket using the ID we give it, so it should be fine...?

yeah, that this is what I meant. It would make sense that they are sorted within the bag.

@Bassoonian
Copy link
Collaborator Author

I think the end point should be the priority of items compared to each other, which I assume is mostly consistent across generations. They can then be sorted within a pocket according to which pocket the user assigned items to, so this shouldn't be an issue.

Submission of vanilla data would be very welcome.

@pkmnsnfrn
Copy link
Collaborator

pkmnsnfrn commented Jun 8, 2024

Start trying to work on this, and then realized that this task won't be as simple as I thought. Then Bulbapedia saved the day. Each page notes how "sort" or "index" works for that game.

The page isn't done for SV yet. I spent the better part of the evening getting SV working on my PC, and I'm certain somebody around here has already emulated SV on their machines...

@Bassoonian
Copy link
Collaborator Author

Oh, I never found these. They're perfect. I'll start working on implementing the order from SwSh and then we can adjust as necessary. Thanks!

@hedara90 hedara90 added the category: items Pertains to items label Jul 26, 2024
@Bassoonian
Copy link
Collaborator Author

I won't be working on this anytime soon, so closing it for now. Others are free to take over if they feel like it

@Bassoonian Bassoonian closed this Oct 11, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
category: items Pertains to items
Projects
None yet
Development

Successfully merging this pull request may close these issues.

7 participants