-
Notifications
You must be signed in to change notification settings - Fork 125
Unpack item_icon.narc and refactor pl_item_data #508
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
base: main
Are you sure you want to change the base?
Conversation
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 I envision the new structure:
- An icons/palette order file that specifies the order of the files in the final NARC
- This enum generated automatically from the icons/palettes order file
- Every palette or icon named according to the enum eg. "plate.png" or "flame_plate.pal"
- Every item has its own json file (properties from pl_item_data.csv AND content of sItemArchiveIDs in item.c)
Is there any reason not to go ahead and implement this structure along with decompiling the graphics files themselves? The enum
is a bit superfluous, in that regard, as we will just replace it with the generated constants built when packing the NARC.
There is a good bit of implicit feedback here in that these generated constants are currently bound to the names of the output files emitted by nitrogfx
. Ideally, those would be decoupled... or we could at least output an arbitrary filename and tell nitrogfx
what conversion routine to use as an override.
Alright, I've updated the structure. We now have two json files (one for the cell, one for the anim), png files and pal files. |
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.
Thanks for unpacking this, this is a huge bounty! ❤️
I read on the guidelines that enum values should be uppercased, however I couldn't find a way to make it work and I find it impractical to have filenames in lowercase and then the enum in uppercase
Yes, unfortunately, this is the case; the generated naix
bases the names for packed member-files from the source file's name. Some file systems are case-sensitive, while some are not, so we cannot 100% ensure that two indices would not collide in all cases.
I may revisit that assumption, though, if we can make the semantics of the error clearer than a compilation error about a re-defined preprocessor symbol. 😅
res/items/item_icon/icon_347.png
Outdated
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.
suggestion:
- Can we apply palettes to these icons so that they are easily moddable in a graphics editor that supports indexed PNGs? You can apply the palette using the
-palette
option when convertingNCGR
topng
and providing aNCLR
file as an argument for the option. This will probably require a custom packing-script, but that's okay with me, if the scope of work doesn't feel too bad. - I think it would be valuable to reorganize the folders a bit... I had started working on this in the past, and my aim was to structure
items
similarly topokemon
, where a unique folder exists for each item and contains a (potentially empty) data file and its icon.
res/items/item_icon/icon_709.png
Outdated
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.
suggestion: icon_bag_cancel.png
(or whatever the menu option is called in vanilla)
I've restructured the icons to be similar to pokemon : there is now a folder for every item with a data.json file obtained from pl_item_data.csv (this file is not used for the moment), and an icon.png for items that use their respective palette and icon. For the other icons, their icons and palettes stay in the root folder |
Things left to do are : |
New Enum to document the items icons and palettes from item_icon.narc.
This will be useful later for file naming conventions of PNG and PAL files.
How I envision the new structure:
-An icons/palette order file that specifies the order of the files in the final NARC
-This enum generated automatically from the icons/palettes order file
-Every palette or icon named according to the enum eg. "plate.png" or "flame_plate.pal"
-Every item has its own json file (properties from pl_item_data.csv AND content of sItemArchiveIDs in item.c)
Every NCGR / NCLR is then built in the correct order according to the icons/palettes order file and the item data array is built using the items.txt order (There are some unused items that appear in only one of the two arrays)