• The moderators of this forum are Austin and pre.
  • Welcome to Smogon! Take a moment to read the Introduction to Smogon for a run-down on everything Smogon.

Programming Random Team Generator

Honko

he of many honks
is a member of the Site Staffis a Programmeris a Top Contributor
http://honko.github.io/pokemon-team-generator/

Want to quickly try out a tier you've never played before and don't have time to build a team? Want to challenge yourself to ladder with a silly team? Want to play a Randbats-like match against your friend in a specific tier? Then I think you might enjoy this.

It's a random team generator. You pick a generation and a tier, click "Shake it up!", and boom, you get a randomly generated team for that tier using Smogon sets. Don't like that team? Shake it up again. If you like a few of the sets but not all of them, you can lock in the ones you like and just keep hitting that Shake it up button until you're satisfied. Then click Export and you can copy + paste your team straight into the PS Teambuilder!

Right now it supports Ubers, OU, UU, RU, NU, PU, and LC in every generation that they exist.

Enjoy!

Q: Will you add <insert currently unsupported tier here>?
A: If enough people ask for it, and it has analyses hosted on Smogon, then yes, eventually. Let me know what tiers you want!

Q: What sort of validation does this thing do? Will I always get a legal team?
A: Right now, it checks species clause, it makes sure you only have one Mega Evolution on your team, and it makes sure you don't get the same move listed twice in the same set. That's pretty much it. It's possible that the generator could give you an illegal set if the Smogon analysis has moves slashed in such a way that an illegal combination is possible. For example, Roserade's DPP Life Orb set is slashed such that Leaf Storm + Spikes looks like a valid combination even though it's illegal. The set comments explain that it's illegal, but the generator can't read, so it doesn't know that. As a result, it will sometimes generate an illegal set for Roserade. I'd like to fix this eventually, but it's a pretty low priority since most move illegalities disappeared for XY so it only really matters for older generations.

Q: I want to generate a set for Dunsparce on my OU team, but when I type in Dunsparce's name and try to lock in, it disappears! What's going on?
A: Since the generator uses Smogon sets, the Pokemon must have an analysis for the tier you've selected. That means that only Pokemon that are good enough to get an OU analysis will show up when you generate a team for OU. This was an intentional choice to keep the generated teams more relevant to a particular tier. If you want to use a random team that isn't tier-specific...why wouldn't you just play Randbats?

Q: What browsers do you support?
A: Up-to-date versions of the following browsers, in order of preference: Firefox, Chrome, Opera, Edge, IE11, Safari.

Q: Hey! I got EVs that aren't divisible by 4 / a misspelled move / a Pokemon without a Nature / etc. Your program is broken!
A: That sounds like it's actually a problem in the Smogon strategy dex, since this pulls all of that data from there. Check the relevant analysis and fix any problems there first, and it'll get fixed in the generator next time I update the sets. If you've checked the analysis and it looks fine but you're still seeing the problem, then let me know.

  • Smarter lead choices in old gens (especially RBY and DPP)
  • Smarter resolving of different slash combinations (e.g. if a special attacker has Explosion slashed, use the non-Attack-lowering nature iff Explosion is chosen)
  • User controls for role restrictions (e.g. team must have hazard removal)
  • Legality checks for slashed combinations (e.g. events or old-gen egg move combos)
  • Option to generate sets from scratch (no smogon)
 
Last edited:

Honko

he of many honks
is a member of the Site Staffis a Programmeris a Top Contributor
Can confirm it doesn't work in Safari. :pirate:
I took a quick stab at fixing the problems for IE11 and it was actually a lot easier than I expected. I think I may have fixed what was broken in Safari as well but I can't test it. Can you take another look and tell me if it's working, and if not, tell me where Safari's dev tools say the problem is? Thanks!
 

The Immortal

They Don't Want None
is a member of the Site Staffis a Battle Simulator Administratoris a Top Smogon Social Media Contributoris a Community Leaderis a Programmeris a Community Contributoris a Live Chat Contributor Alumnusis a Tiering Contributor Alumnus
Other Metas Leader
I took a quick stab at fixing the problems for IE11 and it was actually a lot easier than I expected. I think I may have fixed what was broken in Safari as well but I can't test it. Can you take another look and tell me if it's working, and if not, tell me where Safari's dev tools say the problem is? Thanks!
Works perfectly!
 
  • Like
Reactions: Mq
Hey, nice work man!

I just wanna point something that bothered me when I used your program; when you generate a OU team, it can bring you a team with mons from any tier, like shuckle and typhlosion, I think that only ubers tier should have this, you might wanna change this, just OU/BL when you choose OU, just UU/ BL2 when you choose UU and so on.
 

Honko

he of many honks
is a member of the Site Staffis a Programmeris a Top Contributor
Hey, nice work man!

I just wanna point something that bothered me when I used your program; when you generate a OU team, it can bring you a team with mons from any tier, like shuckle and typhlosion, I think that only ubers tier should have this, you might wanna change this, just OU/BL when you choose OU, just UU/ BL2 when you choose UU and so on.
Shuckle has an OU analysis, so it's considered viable in OU. As long as a Pokemon has an analysis for the tier, it'll show up in the generator. If you think Shuckle isn't good enough to be on OU teams, you could bring that up with OU C&C and see if they agree that the analysis should be removed.

Typhlosion does not have an OU analysis so it should not be showing up in OU. Are you sure you saw Typhlosion in OU? I tried to force the generator to give me a Typhlosion set (by putting in its name manually and locking it), and it's not giving me one, so I think you may have mixed it up with another Pokemon.
 
I guess it needs a better way to choose pokèmon...
..For example: Spinner/defogger or any other schemes that could give it a sense.

I randomized a team and i've seen metagross-m and pidgeot-m.
 

Honko

he of many honks
is a member of the Site Staffis a Programmeris a Top Contributor
Update: I've made some changes to the layout that should make it look a lot better on mobile.

Update: Changed the layout again, and added sprites!
 
Last edited:
This is really great and I applaud you for it but do you think it's possible to remove Kakuna from DPP OU? Also there tends to be too much pure junk for my liking. I'd prefer if it were cut down to (mostly) viable pokes. Thanks again, it's a lot of fun
 

Honko

he of many honks
is a member of the Site Staffis a Programmeris a Top Contributor
Update: ShakeItUp follows the one-mega-per-team rule now.

This is really great and I applaud you for it but do you think it's possible to remove Kakuna from DPP OU? Also there tends to be too much pure junk for my liking. I'd prefer if it were cut down to (mostly) viable pokes. Thanks again, it's a lot of fun
Hah, I forgot about that Kakuna analysis. I've removed it from the generator along with the other joke analyses I could find (Magikarp, Unown, pre-Imposter Ditto, etc). Let me know if there are any others I missed. (Only ones that are clearly jokes or truly useless, though, like those examples I listed.)

I plan on eventually adding a way to weight the selections by viability (probably based on Viability Rankings threads). In the meantime, maybe you can look into getting some of the Smogon analyses for the "pure junk" removed? I've never been a fan of us having analyses for Pokemon that you wouldn't actually recommend using in the tier.

Glad you're enjoying it!
 

Honko

he of many honks
is a member of the Site Staffis a Programmeris a Top Contributor
Update: I've added the ability to weight the generator based on viability rankings. Use the ++/+/=/- buttons to change the weighting. Check it out! There are 4 options:
++ Weights the generator strongly towards picking higher-rank Pokemon and never picks anything below B-rank. This should give you teams that look relatively standard (although there's no attempt at synergy).
+ Weights the generator to favor higher-rank Pokemon and never picks anything below C-rank. This should filter out most of the "junk" and give you teams with viable Pokemon while still being pretty random. This is the default option.
= Does no weighting. This is what the generator always did prior to this update.
- Weights the generator to favor lower-rank and unranked Pokemon and never picks anything above B-rank. If you want to make terrible joke teams, this is the option for you.

I couldn't find any viability rankings for RBY UU, GSC UU, or DPP LC, so those don't do any weighting. If anyone can point me to rankings for those tiers I'd be happy to add them.

If anyone is looking to help out with this project, I'd appreciate someone helping me keep my copy of the viability rankings up-to-date. It's a semi-manual process that takes much longer for me than updating the sets (which I do programmatically). Let me know if you're interested.

(Tagging BKC since this update is relevant to your post.)
 

DTC

I'll be your 1-Up girl
is a Pokemon Researcheris a Battle Simulator Admin Alumnusis a Community Leader Alumnusis a Community Contributor Alumnusis a Live Chat Contributor Alumnusis a Tiering Contributor Alumnusis a Contributor Alumnusis a Smogon Media Contributor Alumnus
This is pretty cool Honko

One simple improvement you could make is ensure every team has 1 Stealth Rock Pokemon (maybe make it so the - option doesn't have to follow this). Yeah there might be that team that uses more or less than 1 SR Pokemon but those are really rare.
 

Honko

he of many honks
is a member of the Site Staffis a Programmeris a Top Contributor
Yeah good call, consistent hazard control will probably be the next thing I add. No more than 1 setter for each hazard, no more than 1 hazard remover, and an option for forcing the team to have certain hazards or hazard removal. I think it makes sense to default to always having SR, but I'll make it an option that can be turned off (mainly in case I ever add tiers where SR is less valuable, like Doubles).
 

Honko

he of many honks
is a member of the Site Staffis a Programmeris a Top Contributor
I finally got around to working on this again. I've added the restriction that every team (in gens 4-6) will always have Stealth Rock.

e: Also made it so the following things will only appear at most once on any team: each hazard, hazard removal, and Choice Scarf.
 
Last edited:

SoulWind

片割れ月
is a Tiering Contributor Alumnusis a Past SPL Champion
Great work overall man, this is an amazing tool.

I know the goal isn't to make superb teams, but could you make it that the DPP OU teams always have at least 1 ground immunity? And 1 ground immunity and 1 dragon resistance (mandatory steel) for BW2 OU teams. I think this would improve the quality of the teams a lot because those are needed in every competitive team.

I could give more details about competitive BW2 OU teams if you'd like to work around it, and I guess others can contribute for another tiers as well.

Thanks for your attention.
 

Honko

he of many honks
is a member of the Site Staffis a Programmeris a Top Contributor
Great work overall man, this is an amazing tool.

I know the goal isn't to make superb teams, but could you make it that the DPP OU teams always have at least 1 ground immunity? And 1 ground immunity and 1 dragon resistance (mandatory steel) for BW2 OU teams. I think this would improve the quality of the teams a lot because those are needed in every competitive team.

I could give more details about competitive BW2 OU teams if you'd like to work around it, and I guess others can contribute for another tiers as well.

Thanks for your attention.
I will definitely do this kind of thing eventually, but it's probably going to be a while. There's a few more general things I want to add first (like being a little smarter about picking leads in older gens) before I get into tier-specific stuff. I'll also want to make it optional when I do it (meaning I'll need to figure out a good way to add it as an option to the UI, which is usually the hardest thing for me to do), and I'll want to get this kind of info for many tiers before I add it to any.

I will get to it at some point though. In the meantime, it'll help me if you or anyone else posts more things that are mandatory (or very close to mandatory) for every competitive team in any particular tier. Every team in tier X needs a Normal resistance, or a sleep inducer, or a Pokemon that outspeeds Jolly Garchomp, or a T-Spikes absorber, or a Pokemon that can 2HKO Snorlax, or whatever.

I'd also appreciate any suggestions someone has about a heuristic for picking decent leads in GSC and ADV. I have a pretty good idea for RBY (fast sleep or fast T-Wave) and DPP (Focus Sash or Fake Out or fast hazards) but know basically nothing for GSC/ADV. My current plan is to just pick the fastest mon, but there's probably something a little better I could do.
 

SoulWind

片割れ月
is a Tiering Contributor Alumnusis a Past SPL Champion
GSC leads are Zapdos/Raikou/Snorlax/Nidoking/Cloyster/Exeggutor (Thief set I think) and I've seen some Tyranitar in SPL as well. But i'll tag here Conflict that knows that better than me.

ADV leads are much more diverse, but the most important ones are: Tyranitar/Skarmory/Metagross/Zapdos/Salamence/Snorlax/Suicune/Forretress. Jolteon and Gengar are less common but seen too. I'll tag McMeghan as well so maybe he can help more.
 
Looks really cool. Try balancing out the types, I took a spin and got three water types (if it's possible, might not be, I'm no coder).
 
Other Pokes that (semi) commonly lead in ADV: Milotic, Aerodactyl, Celebi, Swampert. Less common ones that still exist/are viable, roughly in order of popularity/viability: Flygon, Heracross, Jirachi, Moltres, Starmie, Cloyster, Raikou, Jynx, Venusaur, Smeargle, Regice. Other stuff I've seen (Medicham, Slaking, Blaziken, Charizard, Bliss, P2, Claydol) could be added for lower ranks. You won't see them often but the generator should have all options available imo, although not all of them should be available on the ++ option I think (I'd say cut it off after Jirachi).
 
I will definitely do this kind of thing eventually, but it's probably going to be a while. There's a few more general things I want to add first (like being a little smarter about picking leads in older gens) before I get into tier-specific stuff. I'll also want to make it optional when I do it (meaning I'll need to figure out a good way to add it as an option to the UI, which is usually the hardest thing for me to do), and I'll want to get this kind of info for many tiers before I add it to any.

I will get to it at some point though. In the meantime, it'll help me if you or anyone else posts more things that are mandatory (or very close to mandatory) for every competitive team in any particular tier. Every team in tier X needs a Normal resistance, or a sleep inducer, or a Pokemon that outspeeds Jolly Garchomp, or a T-Spikes absorber, or a Pokemon that can 2HKO Snorlax, or whatever.

I'd also appreciate any suggestions someone has about a heuristic for picking decent leads in GSC and ADV. I have a pretty good idea for RBY (fast sleep or fast T-Wave) and DPP (Focus Sash or Fake Out or fast hazards) but know basically nothing for GSC/ADV. My current plan is to just pick the fastest mon, but there's probably something a little better I could do.
What about making something like user-customizable conditions? Maybe in text format, like:

Format: DPP OU

Lead @ Focus Sash
- Has Stealth Rock
- (Optional) Has Taunt AND Speed > 328
- (Optional) Has Fake Out
- (Optional) Has Spikes OR Has Toxic Spikes
- (Optional) Has Explosion
- (Optional) Has U-Turn
Format: AG

Pokemon
- Has Stealth Rock OR Ability is Magic Bounce
- (Optional) Has Sleep move
- (Optional) Is Fire-type OR Is Ground-type
- (Optional) Ability is Moody
(Not the best examples -particularly the second one-, but...)

This way you wouldn't have to make what is mandatory by yourself. Of course, there's the problem of coding a parser, but it should not be more difficult than actually coding the conditions, which may change over time (Who knows? Maybe it could happen).
 

Honko

he of many honks
is a member of the Site Staffis a Programmeris a Top Contributor
Siggu, that's a really cool idea, but not really the direction that I want to take this yet. The main use case I'm building this for right now is a user who wants to quickly get a team for a tier that they don't necessarily know anything about. Once I'm satisfied with that, then I'll start looking at giving the user options for more control over the team they're getting (with sensible defaults so the user who knows nothing still gets usable teams). Mostly those options will be controlled through the UI (i.e. buttons/dropdowns/etc), but adding a text form for the users who really know what they're doing so they can specify stuff at that level of detail is a good idea as well. The main reason I'm asking for more details about what people consider mandatory right now is to help me decide what user options are highest priority and what their defaults should be.
 

Bughouse

Like ships in the night, you're passing me by
is a member of the Site Staffis a Forum Moderator Alumnusis a CAP Contributor Alumnusis a Tiering Contributor Alumnusis a Contributor Alumnus
Honko, this is really awesome. Only thing I would add at this point that seems relatively easy to program is to add a toggle for "diversity." A button that does "No more than 2 Pokemon of the same type" would probably suffice.
 

Honko

he of many honks
is a member of the Site Staffis a Programmeris a Top Contributor
Honko, this is really awesome. Only thing I would add at this point that seems relatively easy to program is to add a toggle for "diversity." A button that does "No more than 2 Pokemon of the same type" would probably suffice.
Thanks!

I want to be careful about how I add limits that I'm not confident are true for all metas. "No more than 2 of the same type" is probably reasonable for 6th gen teams, but what about older gens? For example, is it usually bad for DPP OU teams to have 3 Steels? (e.g. Jirachi+Forretress+Heatran, or Scizor+Skarmory+Heatran) I'm asking honestly, I don't know DPP OU well enough to be sure. And for an extreme example, I'm pretty sure that it's not true for RBY Ubers, where a good team probably has at least 3 or 4 Psychics, maybe even 5. So that's why I haven't added something like what you suggested yet.
 

Bughouse

Like ships in the night, you're passing me by
is a member of the Site Staffis a Forum Moderator Alumnusis a CAP Contributor Alumnusis a Tiering Contributor Alumnusis a Contributor Alumnus
Thanks!

I want to be careful about how I add limits that I'm not confident are true for all metas. "No more than 2 of the same type" is probably reasonable for 6th gen teams, but what about older gens? For example, is it usually bad for DPP OU teams to have 3 Steels? (e.g. Jirachi+Forretress+Heatran, or Scizor+Skarmory+Heatran) I'm asking honestly, I don't know DPP OU well enough to be sure. And for an extreme example, I'm pretty sure that it's not true for RBY Ubers, where a good team probably has at least 3 or 4 Psychics, maybe even 5. So that's why I haven't added something like what you suggested yet.
There are definitely teams that break this rules in pretty much all gens, but it's just an option that people can use if they value type diversity. I don't think it hurts to offer it as an option.

Like, even though DragMag is a totally valid team style in some metagames, so you can get by even with 4 dragons... you're basically never going to want 3 Fire types.

Anyway, if you're concerned about the "no more than 2" rule, you could just offer a box for no more than 2 as well as a box for no more than 3 as a more conservative option.
 

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

Top