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

Script to autogenerate mirrored and rotated assets #217

Merged
merged 2 commits into from
Jan 3, 2024

Conversation

Avasam
Copy link
Contributor

@Avasam Avasam commented Dec 26, 2023

My goals with this PR:

  1. Automate the generation of alternate assets *
  2. Prevent forgetting to create alternate assets (see Add missing Mute PS4 icons #198)
  3. Set a precedent, this script can be extended to generate the "Two Palettes" assets for Add Pitfall: The Lost Expedition / The Big Adventure #171

*Note that this could be made as part of a GitHub Action to ensure we don't forget to run the script, and that manual changes in generated assets are cleared up. You could even automatically apply changes on PR (like an autofixer) using https://pre-commit.ci/ .

I went with Python because:

  1. Wanting to keep this project free of compilation (all scripts are runtime). Performance is not that critical (the script runs in about 8s on my Ryzen 5 2600).
  2. My other options were powershell and node (JS), Python already has great, easy to use C-binding libraries for image manipulation. It ended up easier and faster than the alternatives I could come up with.

@Avasam Avasam force-pushed the autogenerate-mirrored-assets branch from b4500b9 to 1f2ef6b Compare December 26, 2023 23:56
@Avasam Avasam changed the title Script to autogenerate mirrored assets Script to autogenerate mirrored and rotated assets Dec 27, 2023
@Avasam Avasam force-pushed the autogenerate-mirrored-assets branch from 109b959 to 1f66dd6 Compare December 27, 2023 00:40
@Avasam Avasam force-pushed the autogenerate-mirrored-assets branch from 1f66dd6 to 1354e07 Compare December 27, 2023 00:55
@Venomalia
Copy link
Owner

First of all, thank you for your work.

Python would also be my preferred language for this.
The "Two Palettes" are used by many games, I want to make a generic style out of it to support these games as well.

@Avasam
Copy link
Contributor Author

Avasam commented Dec 29, 2023

The "Two Palettes" are used by many games, I want to make a generic style out of it to support these games as well.

Would you like me to do it in this PR as well? Or maybe first come up with a canonical name and representation in the file-system?
I know Pitfall is split in "RG" and "BA", but are there games using a different split?


Is the script name and location good for you? Would you like a GitHub action and/or pre-commit.ci config that checks/autogenerates these? Or maybe later.


From Discord:

Avasam 💻🧙 — 12/26/2023 7:59 PM
This makes me notice that _Rotated assets are strangely lower rez than the original assets??
Venomalia — Today at 3:56 PM
If you mean the quality, it depends very much on the filter and the API that is used. but it's not a big difference.
Avasam 💻🧙 — Today at 10:18 PM
I mean the current existing _Rotated assets in the main branch are half the width and height than their non-rotated counterpart.

For instance:
image

@Venomalia
Copy link
Owner

Name and location are good, you don't have to make any changes to the PR, I'm happy as it is.

I have to admit I'm not super familiar with GitHub action when it comes to scripts, but I don't mind setting it up as an action.

I know Pitfall is split in "RG" and "BA", but are there games using a different split?

Yes, this is used in exactly the same way in several games.
My TextureExtraction Tool and Bigheads Custom Texture Tool PS can now also split and recombine these textures.
sZ4wCPe

The "Two Palettes" are used by many games, I want to make a generic style out of it to support these games as well.

Would you like me to do it in this PR as well? Or maybe first come up with a canonical name and representation in the file-system?

I think Seperart would be better because we also need a new template for the creator tool. I wanted to think about the name but the way you did it in Pitfall is perfectly ok.

The current existing _Rotated assets in the main branch are half the width and height than their non-rotated counterpart.

That's only because they are rarely used to save unnecessary storage space.

@Venomalia Venomalia merged commit 2ff0db2 into Venomalia:main Jan 3, 2024
@Avasam Avasam deleted the autogenerate-mirrored-assets branch January 3, 2024 21:17
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

Successfully merging this pull request may close these issues.

2 participants