Programming Usage-based Core Generator

Hi! I built a core generator that provides a set of Pokémon pairings (or a set of "cores" using the term loosely) that satisfy a list of comma-separated preferences (constraints) supplied by the user. Examples of constraints are "Pokémon should resist types X Y Z" or "Pokémon should have type X". Constraints are satisfied by individual Pokémon in a core. In a core, each constraint supplied by the user must be satisfied by at least one of the included Pokémon for the pairing to be considered satisfactory.

The tool is available to anyone and hosted through a client on pokebrow.se/cores along with a description of supported configuration & types of constraints. The server can also be queried directly by visiting https://pokebrowse-api.herokuapp.com/api/v1/cores.

Possible use case: You are building and testing a team from scratch. You form a core using some basic constraints. You build a team and start testing. Then, you find a pretty clear problem with the team. You describe that problem as a constraint, add it to your existing constraints (and perhaps revise the existing constraints), and generate a new core. Repeat as long as it helps.

Example from the client:
laaaaaatest_sample.png

Looking at the second pairing/"core", it satisfies the constraints because Tapu Fini resists Water+Fighting, Garchomp is immune to electric and Rotom-Wash resists Steel+Ground+Ice.

Some notes:
  1. The generated cores are guided by usage-statistics.
  2. The generator will provide at least one core that satisfies all constraints if one exists.
  3. The generator currently does not enumerate all possible cores, but provides a solid number of them.
  4. Resubmitting the same constraints twice can yield different cores.
  5. The generator generally creates both "more compressed" and "less compressed" cores.
  6. Users are currently specify at most 6 constraints. This can increase in the future if desired.
  7. Sets are not suggested, only Pokémon pairings.
Possible future improvements depending on interest & time:
  1. Support for more (gen > 2) generations & formats. Allowing this option would be a matter of adding more formats into a list of supported formats, so it is not a lot of work; however a limiting factor is memory if lots of formats are to be supported. But in theory the generator could be applied to past & current generation VGC, UU, LC - anything with usage-statistics.
  2. Add more types of constraints. The code is pretty well-equipped to add types constraints if needed, it is mainly a matter of implementing what we want them to do. I'm open to any requests for new constraints!
Feel free to try it out! :)

- TIMELINE/UPDATES -

2022-12-20

  • Added core generator functionality
  • Added support for Gen 8 OU
2022-12-21
  • Added support for Gen 9 OU
  • Added monthly fetch of usage statistics & ban information
  • Ensure that banned Pokémon are not included in cores, even if included in the most recent usage statistics (e.g Flutter Mane, Palafin)
2022-12-23
  • Made some improvements to the client, that should hopefully help when writing constraints
  • Added an option called "allow rare pairings". By default, the generator guarantees that each Pokémon in the core must have at least one other "common partner" in the core, as dictated by usage statistics. Ticking the checkbox "allow rare pairings" removes this restriction.
 
Last edited:
Thanks! Yeah it's not updated with gen9ou yet unfortunately. It would be enough to change usage stats to gen9ou, but the recent gen9ou usage stats include lots of banned mons which could throw off the generation process a bit. Although I could probably add a new constraint type like "exclude <species>" so users have a way to prevent banned mons from being considered during generation. I'd have to think about it a bit more, but the plan is to move to gen9ou soon :)
 
As a followup, generator has been updated now - the changes are:
  1. Generator now works for the past two generations of OU (gen9ou, gen8ou), which format you want to generate for is specified in the client
  2. Added a new constraint type "species" that forces a Pokémon into the generated core. Nice if you want to build around a Pokémon.
  3. Pokémon in current-gen formats that are banned will not appear in generated cores even if they exist in the last available usage statistics.
Do note that the generator only considers relatively viable Pokémon when generating cores (e.g "species Wooper" is impossible to satisfy while being viable), so if you receive no result on your submission, reconsider the constraints and try again! If a list of constraints feels like it should work, feel free to PM me or post the constraints here and I'll take a look at it :)

Ideas or suggestions in general are also welcome of course!
 
Looking good! Personally when I make cores I like to look at stat values (i.e. \ds fe, hp > 89, spdf > 89), then try to maximize the resistance pairing. I was wondering if you have intentions to / could incorporate something like that into the generator; being able to use stat values as criteria, and where it could look at a given species and find good type pairings without the user having to manually input resist/weak/immune data. At this point it is less helpful than Showdown!'s /ds, so I think the merit of this tool would lie in being able to do what it cannot.
Also, I'm not sure your exact intention with the project, but I think limiting it to usage statistics is not very helpful; I think listing from the top 200 mons or something (like alternatively checking boxes for OU, UU, etc) would be nice, and then just listing the resulting pairings in order of usage.
 
Thanks, and appreciate the feedback! Really good idea you had regarding automation of resistance pairing :) Since desirable resistances are meta dependent (depends on what's popular e.g in OU, UU, old gen etc), perhaps I could write some code that does the following:

1. go through the usage of each high-usage (say >1%) Pokémon,
2. look at their most common movesets,
3. extract common coverage (e.g fighting + ground, dark + steel) by scanning said movesets
4. auto-add the most common coverage options as resistance constraints during generation?

Would likely require some experimentation to get it right, but could be interesting to try. I can take a look at it this weekend (or next) if this sounds like what you were looking for? I could also add base stat constraints (e.g hp 100, spe 101) as well since that should be straight forward, although I think those would be difficult to "specify correctly" as a user (e.g which Pokémon in the generated core should have hp > 89? Perhaps you would like to clarify this part).

I agree that the usage statistics are currently not needed beyond the basic usage statistics. Today, they mainly limit the number of Pokémon under consideration similar to what you said (but instead of e.g top 200 in usage, I use a usage percentage cutoff of 1% which in SV OU is roughly the top 50 Pokémon). However if I find a good way to incorporate more usage statistics (teammates, checks & counters, EVs), I'll make sure to add them! The data exists, it's just a matter of using it :)
 
Hey, just a note - I'll be taking down the website & server for the time being, as I would like to put the money towards exploring other topics. Thanks to everyone for trying it out and giving feedback :)
 

Users Who Are Viewing This Thread (Users: 1, Guests: 0)

Top