Skip to content

Conversation

@LucaPrevi0o
Copy link

@LucaPrevi0o LucaPrevi0o commented Jan 3, 2026

Many sprites for alternate forms just had progressive numbers from 10.000 onwards.
I thought it could be a good idea to progressively fix this by naming thr files to the corresponding NationalDex entry number, followed by the corresponding form:

  • Mega: XXX-mega.png
  • G-Max: XXX-gmax.png
  • Regional form: XXX-<region>.png -> example: XXX-hisui.png - XXX-alola.ong

Other forms just have the corresponding name (for example, 1017-cornerstone.png or 1017-wellspring are 2 of the alternate forms of Ogerpon).

Current progress

Only Gen5 sprites in the global folder for Pokémon sprites have had their names changed.
This work should be progressively continued to fix also shinies and backsprites, in order to mantain continuity.

Changelog

  • Update 1: Some alternate forms of shiny sprites had their names changed
  • Update 2: Part of the API has been updated - still not fully functional
    • Main issue: PokéAPI is used to convert names to indices (entries of the National Dex), but the naming scheme is different from the one used from Showdown servers
    • Automatic conversion of the indices can fail if the Showdown name is used to fetch from PokéAPI

@Naramsim
Copy link
Member

Naramsim commented Jan 7, 2026

Hi! Thank you for the PR. Currently this is not an issue but a quality of life improvement. We had in the past a similar discussion about how we should name the sprites. Before moving on with other sprites let me understand if your suggestion is really worth it.

Could you confirm that by adopting this naming convention all the sprites that you changed are still linked correctly in the API?

@LucaPrevi0o
Copy link
Author

Hi! Thank you for the PR. Currently this is not an issue but a quality of life improvement. We had in the past a similar discussion about how we should name the sprites. Before moving on with other sprites let me understand if your suggestion is really worth it.

Could you confirm that by adopting this naming convention all the sprites that you changed are still linked correctly in the API?

Hi, I still haven't actually looked ad the APIs, thus they're surely not linking at the correct files. If you're OK with leaving the PR open, I'll worry about fixing also the APIs and continuing on editing the file names for other sprite tables.

Just a quick question, I don't remember if other people would be able to contribute to this PR directly, just in case anyone would help in this QoL :)

@LucaPrevi0o
Copy link
Author

API update!

I spent some time learning how the Python script works and how could I improve it in order to help in implementing the PR successfully. The main issue I was facing was having to interface with multiple APIs that returned different names for the same thing - in PokéAPI there's no deoxys, because the base form of Deoxys is actually referred to as deoxys-normal, and of course the same applies to a disgusting lot of other forms.

It's still not finished for sure, and it may contain bugs as well, I'll keep you updated if I'll make useful progress in this sense.

@Naramsim
Copy link
Member

Naramsim commented Jan 7, 2026

Don't spend too much time on this!

@LucaPrevi0o
Copy link
Author

LucaPrevi0o commented Jan 9, 2026

It seems to work!
Don't take my words for golden, but I'm quite sure this version of showdown.py actually fetches the same data as before, but updates the naming scheme accordingly to the National Dex index of the base form.

The idea behind is simple: if we know the name-index association of the base form, because it correctly fetches from the Showdown servers (as all the sprites below 1024 do), we can try and search if there's any match between the name of the alternate form sprite and any sprite already associated with a lower index... and (almost) always it does (...apart from some exceptions, due to the actual sprite not being present on the remote end)!

For this reason, the method used to list all of the indices (which previously assigned indices above 1024 to alternate form sprites) now returns an updated list, in which these sprites have their name correctly mapped as alternate forms of previous sprites. In this way, it's possible to see how every missing file (present in the table printed at the end of execution) always has an associated index in the name, which points directly to the National Entry index of the base form.

There's still a bunch of duplicates left to get rid of, as well as some refactoring I think would benefit future maintenance - for this reason, joined to the fact that I'm still unsure of the actual 100-percent-fully-guaranteed-bulletproof quality of my work, I think there's still a bunch of work left to do :)

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