Other Does anyone know where to find the code / formula / logic for random battles team generation?

addon

smogon fangirl
I know it differs from meta game to meta game, but I'm curious to see if it's public. I know the data of each Pokémon's set is, but I'm specifically talking about the generation process of each team. From what I understand the creation of a team is not just pick 6 random mons from the pool and have fun. I know in Gen 7 specifically all randbats teams have 1 mega, (and i think 1 z-move iirc).

If anyone can point me in the right direction, or has any insight, or knows exactly how it works please comment I would appreciate it <3
 
The code for randbats team generation is in the PS Server repo, in data/random-battles/genX/teams.ts. So, for example for Gen 7: https://github.com/smogon/pokemon-showdown/blob/master/data/random-battles/gen7/teams.ts
The relevant entry point is RandomTeam().

For the less technical, everything is explained in this post in the Random Battles subforum in natural language, and you can ask any questions in that same subforum's "Simple Questions/Simple Answers" thread!
Exactly what I was looking for, thank you so much <3
 
Figuring out the logic behind random battles team generation is decoding a puzzle, really interesting but complex. As a student, it reminds me of education essay writing, where understanding structure and reasoning is key. Both require analyzing patterns and making sense of systems, whether it's in game code or academic content
 
Last edited:
Figuring out the logic behind random battles team generation is decoding a puzzle, really interesting but complex. As a student, it reminds me of education essay writing, where understanding structure and reasoning is key. Both require analyzing patterns and making sense of systems, whether it's in game code or academic content
It's funny you say that, it kind of reminded me of "The Password Game" that blew up 2 years ago. The start seems relatively straightforward, but whenever there's rules that make you go back and change your password. (In this case the knowledge.) It was important to just get it right, and make sure I wasn't missing one of those "rules" so to speak.

Luckily, it wasn't too difficult since the "rules" are laid out in the natural language post. Only thing I needed to do was cross reference them with actual code snippets.
 
Back
Top