Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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
Parse misc item info #53
base: main
Are you sure you want to change the base?
Parse misc item info #53
Changes from 1 commit
73e3bf6
67480bb
File filter
Filter by extension
Conversations
Jump to
There are no files selected for viewing
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.
What advantage do you see in encapsulating these inside a
MiscInfo
struct, as opposed to splatting them intoItem
?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.
Because the single
Option<MiscInfo>
inItem
encodes the fact that you either have all four fields or none at all because they are all from the same Slippi version. They seem somewhat logically grouped to me too because they all describe specific properties of subsets of items. I wouldn't die on this hill though.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.
From an user perspective, they're pretty distinct imo. They won't always know that they came from the same slippi version. The 2 charge values being lumped makes sense, but it's an odd place to look for missiles and turnips which are unrelated to charge shots and eachother.
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.
How sure are you that these fields are always/only used for these purposes?
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.
They aren't, but other potential uses are unknown or undocumented. I'm pretty sure the data these fields are written from is part of a big union that has different values for different items as shown in the decomp. That's why they are garbage when the item doesn't match.
https://github.com/doldecomp/melee/blob/master/src/melee/it/types.h#L655
https://github.com/project-slippi/slippi-ssbm-asm/blob/master/Recording/SendItemInfo.s#L118
In theory, the exact byte that describes the peach turnip type could be the exact byte that determines some property of some other item, but that would be hard to find out.
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.
If the meanings of these fields vary based on context, I don't think it makes sense to give them semantic names even if there's a "typical" use.
In theory we could provide some way to interpret values contextually instead, but that seems overkill for four independent(?) bytes.
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 understand not giving them their "typical" name, but otherwise the best name would be something like
item_0xd4
referring to the byte offset and then provide uses in documentation.