KartulUdus / PoracleJS

NodeJS application for PokémonGo WebHook Discord alarms
https://kartuludus.github.io/PoracleJS/#/
ISC License
96 stars 115 forks source link

how to upgrade monsters.json and locale/* #265

Closed philcerf closed 3 years ago

philcerf commented 3 years ago

Hey.

I've just wanted to do the same what I did for V3 in #252 and #253, i.e. add missing Pokémon and forms and correct typos.

Now first... comparing the pkm names in monsters.json with the list of current official English names: list.en.txt

gives a number of unexpected differences (e.g. use: meld <( grep '^ "name": "' monsters.json | sed 's/^ "name": "//; s/",$//' | uniq ) list.en.txt ).

Including:

Does it even work to have spaces in the names?

I'd like to add the missing stuff did you generated this data from the JSON? Is there some automatic generator or was it done all by hand?

Cheers, Chris.

ccev commented 3 years ago

Apparently Katul lost the script he used to generate monsters.json but I recently made a new one that correctly updates the file. It can be found here. Idk when it's going to be used though

philcerf commented 3 years ago

@ccev Nice... especially that you generate the data directly from the game master.

Can one also generate the other JSONs from that (i.e. the translations)? I Haven't found a real API description from PogoData.

I generated a current version and and diffed it with the one in the repo,...

Much stuff is gone, though,... but this seems to be mostly shadow/purified forms - where I guess they simply don't exist in the master, yet, or were cleaned up again from it?

However, there are some cases:

  1. The Normal form seems to be sometimes gone, too, e.g. Chansey. The old JSON had 113_1056, with form name "Normal", the one one only has 113_0. I guess that's again because there is no longer any other Chansey form in the game, and thus the catch all 113 0 is enough?

  2. This in the new JSON looks also strange?

    "0_0": {
        "form": {
            "id": 0,
            "name": "Genesect_home_form_reversion"
        },
        "id": 0,
        "name": "--",
        "stats": {},
        "types": []
    },
  3. I've also noticed Mr. Rime (mind the R) to be missing... I can find it in the game master (at least traces of it), but it's not in PogoData.mon respectively the name is given as "?".

  4. 6_0 is now "Mega Charizard Y ... shouldn't that be just Charizard? Same for some others like Pidgeot, Gengar, Ampharos, etc.

  5. I guess we'd need to adapt your code to convert e.g. "Nidoran\u2640" to UTF8?

  6. And possibly all spaces to _... and maybe and \u2019 to ASCII ' ?

  7. Some form names are strange, too:

            "name": "Nidoran"
            "name": "Nidoran_normal"
            "name": "Nidoran_purified"
            "name": "Nidoran_shadow"
ccev commented 3 years ago

PogoData is generating Forms based on the GameMaster. WIth e.g. Chansey, it has its Shadow/Purified/Normal form in the Protos, but they have yet to be put in the GameMaster.

  1. Mons that have no NORMAL form have a Form ID of 0. Since Chansey's NORMAL form is just in the Protos, but not the GM, its default Form ID is 0.
  2. This JSON does indeed look strange. Just looked it up and I know why it happens. WIll fix it in an upcoming PogoData release
  3. This happens because PogoData is only reading the APKs translations, but Mr. Rime only appears in the Remote translations. I'll see if I can include those as well!
  4. Idk how Poracle would handle Mega Evolutions. PogoData handles them as normal Mons/Forms, but with an extra temp_evolution_id. I've edited the script in Discord to ignore temp evolutions for now
  5. Saving special characters as unicode like that is something Python does when converting a dict to json. I'd guess it's possible to disable it, would have to look it up
  6. (5 applies)
  7. I said it in Discord, the way the script gets formnames is by subtracing the base_template from the template (BULBASAUR_NORMAL minus BULBASAUR = NORMAL), since both Nidoran are handled very specific, I've edited the script to fix this.

Thank you for lookig through the file and telling me about everything you found, that's really helpful. I'm still working on PogoData, right now it's more of a Beta release. I made half of a quick guide in its readme here

philcerf commented 3 years ago

Yes, that's what I've expected... but since that stuff is anyway not live, AFAIU, it doesn't really matter if we don't see it from the GM.

  1. same as above
  2. great
  3. great :-D
  4. will give it a try
  5. well, as long as Poracle correctly decodes this again,... cause users shouldn't need to set \uxxxx in their rules.
  6. here I meant something different... I think we really should replace these characters so the people can use the normal ' instad of ’ when they enter their commands for poracle. And I'd guess that having a space inside a pokemon name confuses the command parser, too
  7. nice

Please tell me when you've done your changes to PogoData (2) and I'll try and diff again.

ccev commented 3 years ago

The PogoData fixes should now be available on version 0.5.3

philcerf commented 3 years ago

Hey @ccev

I've tried with your newest commits to PogoData and the more recent script from discord...

Looks pretty good.

That:

    "0_0": {
        "name": "--",
        "form": {
            "id": 0,
            "name": "Genesect_home_form_reversion"
        },
        "id": 0,
        "stats": {},
        "types": []
    },

section is completely gone...

Mr. Rime is there, the Megas are gone and even the types/stats are now correct for the *_0 base form - though one could argue, that type/stats don't make much sense for these anyway, as they may vary depending on the form (or on Mega).

I still wonder whether entering a command like /track Mr. Rime iv100 would work at all because of the space.

Other than that... are you going to PR your script for inclusion into PoraclJS? I think it should be properly tracked in a repo. If you want I could add some sugar around it, like argument parsing or so... but didn't want to "steal" your credit ;-)

Cheers.

ccev commented 3 years ago

Hey, sure. Why not. I'll PR it later 🙂

philcerf commented 3 years ago

Have you already done something towards generating the PoracleJS/src/util/locale/*.json stuff via PogoData?

If not I'd have had a look into whether I could get something working,...

I think for that I'd first need to get the whole data for each language, right like:

data_en = PogoData(language="english")
data_de = PogoData(language="german")

Then going through all mon base IDs we have in monsters.json ... or maybe simply through all mons in the respective data set, and then trying to translate...

1) I's there a way to get all available languages? 2) A way to iterate over all mons,... with m=data.get_mon()one would need to hardcode the range...

  1. in the locale object (data.locale) which I'd have then used from each language data set, there are e.g. "pokemon_name_0001": "Bulbasaur", Is there a way to geht from the mon object to "pokemon_name_0001" ?

Cheers

ccev commented 3 years ago

Generating locale files shouldn't be a problem, I can quickly do it myself

philcerf commented 3 years ago

ah great :-D

Petap0w commented 3 years ago

The util/locale/*.json aren’t used anywhere in Poracle (at least in the current version)

jfberry commented 3 years ago

but if they were up to date I guess we'd fix that (as we're working on translation work anyway!) Now to update util.json from your grunt types master with another script?

philcerf commented 3 years ago

Ah, then I guess you use config/locale/<lang>.json to translate the Pokemon names?

I guess for future maintenance it might be easier if the Pokemon/Form/Costume/etc. names were split in their own file (and that generated somehow automatically, as @ccev’s script does for monsters.json. Especially the current version of e.g. config/locale/de.json already lacks a number of Pokemon names which are already in the game (e.g. Mr. Rime).

philcerf commented 3 years ago

for the records, this is tracked in #278

jfberry commented 3 years ago

This is in progress being resolved as part of the multilang PR

jfberry commented 3 years ago

Merged