-
Notifications
You must be signed in to change notification settings - Fork 3
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
Wrong palettes+tiles in metatiles when trying to reuse general primary tiles in a custom secondary tileset #46
Comments
This is perfect, thanks. Should be everything I need to attempt a reproduction. I am pretty busy for the next week or so, but after that I will definitely make time to look in to this. I want to do a 1.0.0 release this year (it's been in beta forever), and fixing bugs is my top priority for that release. Just looking at what you are doing, I have a suspicion I know what the problem is. It may not be a bug per se, but it's definitely a really nasty "gotcha" that users should not have to deal with. So either way, there's potential for improvement here. |
@SPMoo66 Ok looking more carefully at your post. When you decompile the primary general tileset to make changes, you need to recompile it, and import that recompiled primary general as a new tileset in Porymap. So you'll effectively have two primary general sets. The vanilla one, and a recompiled-with-porytiles one. Then you have to make sure that any map in Porymap that is compiled via Porytiles, and which uses one of your custom secondary sets (like the snow one), are using the recompiled-with-porytiles general set, not the original vanilla one. Otherwise you're going to get in to all kinds of trouble. Porytiles completely reorders I know this isn't very well explained at the moment, sorry for the confusion. I am still trying to fill out more of the wiki pages, and eventually have some kind of video tutorial series. Please go ahead and give the above steps a try. If that fixes your problem, I'll close this issue. But I've opened a new feature issue to track some possible improvements, since I don't think what Porytiles is doing here is a good user experience. |
Recompiling the tileset as you recommend fixed the artifacting, but I did have an issue with dual vs triple layer and had to manually edit all the decompiled images. I'm assuming that recompiling a decompiled tileset works well for triple-layer tilesets, but I didn't test it myself. |
@SPMoo66 The decompile command automatically detects the compiled layer type and adjusts accordingly. When it decompiles a dual-layer set, in places where there was no tile information at all (e.g. the middle tile of a This problem you described, was it when you decompiled the vanilla primary set? And recompiled it? The reason you probably had this issue is because, annoyingly, different palettes in the original vanilla primary general set use different transparency colors. The Porytiles decompiler is technically OK with this, it assumes you know what you're doing when you go to recompile things. But Porytiles compilation only supports a single transparency color, which means you either have to manually fix up the tileset (like you did), or supply the decompiler with Go ahead and try decompiling again, this time with |
Oh also, the compiler allows you to adjust which color is treated as transparency via the |
Adding -normalize-transparency worked perfectly. Thank you so much for all of the help! |
Awesome! I'll close this issue. But I opened #47 to track improvements to some of the rough edges you discovered. Thanks! |
After decompiling the general primary tileset for use with a custom secondary tileset it seems that any generated metatiles that should be reusing existing general tiles/palettes may be incorrect. All metatiles using custom palettes/tiles seem to be created correctly.
I am using dual-layer tiles, if that helps at all.
For the overlapping snow/grass metatiles the snow/grass tiles are correct, but any sections that should be reusing palette 2 (or the custom palette generated for the snow/grass tile) and tiles 0x002/0x003 are wrong. Palette 3 is used and tile 0x002 is always flipped horizontally and vertically while tile 0x003 is always flipped vertically.
The vanilla tree+snow/grass overlapping metatiles are rather strange. For the top edge of the vanilla trees, tile 0x0CD should be used with palette 2, but porytiles is generating a tile in the secondary tileset and uses palette 3, while no appropriate palette is generated for that tile.
The inside tiles of the vanilla trees in the secondary tileset all seem to be set to vanilla tiles, but the wrong tiles and wrong palettes, almost like it recognized vanilla tiles but chose wrong. Tiles 0x009, 0x019, and 0x029 with palette 2 all should have worked there.
Command used to decompile general primary tileset:
porytiles decompile-primary -o $HOME/general $HOME/pokeemerald-expansion/data/tilesets/primary/general $HOME/pokeemerald-expansion/include/constants/metatile_behaviors.h
Command being used to compile the secondary tileset:
porytiles compile-secondary -dual-layer -Wall -o $HOME/pokeemerald-expansion/data/tilesets/secondary/snow $HOME/porytiles-snow $HOME/general $HOME/pokeemerald-expansion/include/constants/metatile_behaviors.h
Here are the bottom/middle/top images used in compilation
![top](https://private-user-images.githubusercontent.com/17258424/329405969-1a1d5db5-1283-49af-9562-d68ddda9c29e.png?jwt=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJnaXRodWIuY29tIiwiYXVkIjoicmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbSIsImtleSI6ImtleTUiLCJleHAiOjE3MTk1NDUxMzIsIm5iZiI6MTcxOTU0NDgzMiwicGF0aCI6Ii8xNzI1ODQyNC8zMjk0MDU5NjktMWExZDVkYjUtMTI4My00OWFmLTk1NjItZDY4ZGRkYTljMjllLnBuZz9YLUFtei1BbGdvcml0aG09QVdTNC1ITUFDLVNIQTI1NiZYLUFtei1DcmVkZW50aWFsPUFLSUFWQ09EWUxTQTUzUFFLNFpBJTJGMjAyNDA2MjglMkZ1cy1lYXN0LTElMkZzMyUyRmF3czRfcmVxdWVzdCZYLUFtei1EYXRlPTIwMjQwNjI4VDAzMjAzMlomWC1BbXotRXhwaXJlcz0zMDAmWC1BbXotU2lnbmF0dXJlPWNlYzRhYjQzOGI4M2E2Y2NkODIzMDNiOTUzMWNmYzcwOGVkOTUxZDJmNzA5NmEyMDZhYTBkNGQ4ZjViZDdhY2MmWC1BbXotU2lnbmVkSGVhZGVycz1ob3N0JmFjdG9yX2lkPTAma2V5X2lkPTAmcmVwb19pZD0wIn0.S4pTv4rYwKmdLoJzNeobJohZfSTjbBAKejWeBbBooxM)
Environment (please complete the following information):
The text was updated successfully, but these errors were encountered: