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

Support multiple versions and romhacks for the same title id. #52

Open
wants to merge 9 commits into
base: main
Choose a base branch
from

Conversation

pivotiiii
Copy link
Contributor

Hi,
this allows the generator to select between multiple versions of assets for the same title id, in cases such as romhacks or PAL games that have different banners per language.
To create a version for Pokemon Platinum [CPU_], the assets would need to be saved in the repo as "CPU.1", "CPU.2" etc.
Each of these added versions also needs a "description.txt" file which contains as name for the version (e.g. "Pokemon - Renegade Platinum") that can be displayed to the user. The assets would just be called "CPU.png" and "CPU.wav" again to not cause any trouble. In the future the description.txt could also be used for custom titles for romhacks.

How it currently works is that before downloading anything from Github, the repo is checked for a one of these versions. Since downloading directly from Github is not really the cleanest method, this currently needs the numbers to be consecutive (or only skip one at the most) and start at 1. This means if the first version would be (for whatever reason) CPU.5, it would not be detected. Versions for both the short "CPU" and the long "CPUE" are detected at the same time.

If a different version is detected, the user is presented with a simple selection menu to choose what he wants (including default ofc). If the custom version only provides a banner, the sound will be downloaded from the regular version.

I had to change all the links in the generator.py to point to my fork in order to test stuff and have also uploaded two versions of Platinum for that purpose, this would obv have to be changed to point to the main asset repo.

The main problem with the way this is currently implemented is that it breaks the GUI, since the user input to select a version is mandatory. I could change this so that versions are only checked if an argument is passed, but I think checking versions should eventually become default behaviour.

Idk how this should work with #50, probably just trust the user :D

before checking Github/gametdb
Adds banners for two romhacks for Pokemon Platinum that both use the same ID "CPU" as the main game.
a gamecode.txt may be usefull for custom titles etc.
@lifehackerhansol
Copy link
Collaborator

I think ROM hacks should explicitly be one region only.

Renegade Plat for example only applies to CPUE, Moon Black 2 only applies to IREO, and otherwise. As far as I'm aware, this is the case for pretty much ALL ROM hacks out there. If there happens to be a ROM hack that provides multiple regions, then we can just do it separately. (As is the case for normal ROMs too, if there are multiple regions, then we make a specific directory for that region.

So we can take advantage of this and explicitly only use that region, this way it wouldn't confuse it in the 3-letter version.

To make this easier, we should probably provide some way to show which files actually exist in the assets repository. I'll get to that soon, it shouldn't be too difficult.

@lifehackerhansol
Copy link
Collaborator

I added a directory list in JSON format: https://github.com/YANBForwarder/assets/blob/main/assets.json

It could use some improvement, but maybe it helps here?

@pivotiiii
Copy link
Contributor Author

I thought about that too, but wasn't sure that there aren't any. If hack assets are guaranteed to only go in the 4-letter folders there could be some redundant assets, but I guess thats not the worst. It would be necessary to simplify the code.

@lifehackerhansol
Copy link
Collaborator

We can get to deduplication when we get there. For now, I'm not terribly worried. I'll say just do 4 letters, since multi-region ROM hacks are the anomaly rather than the norm.

@pivotiiii
Copy link
Contributor Author

Tbh I'm not too familiar with JSON handling, but I can see how this would help, especially with actually finding all versions. What do you think about the way the folders are set up currently (CPU.1, CPU.2 ...)? I thought about having them inside of the original CPU folder, but I figured that it is easier to use the way they are now.

@pivotiiii
Copy link
Contributor Author

We can get to deduplication when we get there. For now, I'm not terribly worried. I'll say just do 4 letters, since multi-region ROM hacks are the anomaly rather than the norm.

Alright, shouldn't take too long. Maybe tomorrow though, my midterms are coming up as well and this was a welcome distraction today.

@lifehackerhansol
Copy link
Collaborator

This will definitely need some work over at the assets repo, since we should add descriptions for the ROM hacks etc. We should abstract the "is there a ROM hack present?" checks in the assets side over that json file.

json in python is pretty easy, it's just a Dict object. You'll have to requests.get the file first, obviously.

I'll have to think on how the directory structure is going to work.

@pivotiiii pivotiiii force-pushed the multiple_versions_romhacks branch from f026f0d to 42b1ece Compare February 21, 2023 21:22
@pivotiiii pivotiiii force-pushed the multiple_versions_romhacks branch from 42b1ece to 905142b Compare February 21, 2023 21:45
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