Programming A basic teambuilding script for AG

Geysers

not round
is a Community Contributoris a Team Rater Alumnusis a Tiering Contributor Alumnusis a Contributor Alumnus
This tool has been updated for Galar dex AG.

IMPORTANT:

This is now available as a replit thingy! In order to use it on repl, simply click the link below, and type "npm install" in the console on the right to set it up, followed by "node builder" to build a team! No downloads are required to use this!

https://repl.it/@Geysers/BuilderBot

The other day, I was thinking about AG teambuilding. Building for AG is quite limited thanks to the presence of restrictive offensive threats such as Zacian-C and Yveltal. I decided that, thanks to this extremely linear nature, it wouldn't be too hard to create a script to automatically build AG teams. I set to work earlier today, and was able to create an early version of a teambuilding script, along with an accompanying (rather large) JSON file containing a number of viable sets. To my pleasant surprise, the script produces reasonably usable teams about 25% of the time, which is far better than I had expected going into the project. I've still got a reasonable amount of work to do on it, but I figured I'd share this early version. It can be found on github here: https://github.com/Geyserexe/BuilderBot
If you're interested in helping me out with this, please drop me a dm so I can let you contribute / fork it, assuming that's how it works (this is my first time running a repo lol). I'm open to criticism, so fire away! Thanks!

A brief explanation of how the program builds balance:
So every team starts with a randomly chosen set. Each set has a set of values indicating how well it performs certain roles within a team, from 0 to 10. It checks which role that set is weakest in, and then selects a random Pokemon that has that role value above the cutoff value and adds it to the team. It then adds the role values for each of the Pokemon together, and checks which is now the weakest, then repeats until it has a full team. Once it has a full team, it iterates over each of the role totals and checks if it's above a certain threshold, which is specified by the number after "--r". If any one of the role values is below that number, it rebuilds the team and tries again. There's also a "breaker" role value determining the offensive presence of a set. That operates on a slightly different scale, so its threshold is different. The minimum breaker value for the team is determined by the number after "--b". If the total offensive presence as quantified by summing the breaker role value of each set is less than that number, it rerolls and builds the team again. Once every single role value is above the --r number and the breaker value is above the --b number, it outputs the team. There's a bunch more logic that goes on to ensure that teams have defoggers and stealth rockers, and avoid set duplication or mega duplication, etc, etc, but that would take too long to explain here.


Edit: I've been getting a lot of people asking me how to run it, so here's a quick couple of steps:

To setup in a way that allows updates:
  1. download VSCode, Git and NodeJS
  2. make a folder named "vscode" on your desktop
  3. open the installed git file - it should look like cmd
  4. run "cd desktop/vscode"
  5. run "git clone https://github.com/Geyserexe/BuilderBot.git"
  6. run "cd builderbot"
  7. run "npm install"
  8. open the newly created folder in vscode
  9. read the README and have fun

If you did this, you can install updates by repeating steps 3 and 4, then running "git reset --hard" then "git pull".

To setup the latest version but without updatability:
  1. download VSCode, and NodeJs, which are linked above
  2. make a folder named "vscode" on your dekstop
  3. download the latest release as a .zip file from https://github.com/Geyserexe/BuilderBot/releases
  4. extract that zip into your vscode folder
  5. open cmd / terminal
  6. run "cd desktop/vscode"
  7. run "cd builderbot"
  8. run "npm install"
  9. open the builderbot folder in vscode
  10. read the README and have fun

UPDATE: This is now available as a node.js package! To add it to your project, simply run "npm install teambuilder"! (This package is a tad outdated)


E: better instructions
 
Last edited:
i wonder if there'd be a way to link this to usage stats to make it more accurate. I don't know what resources NatDex AG uses, but maybe Set Compendiums, Check Compendiums, Role compendiums and Compendium all may come in handy with creating a better team
 

Geysers

not round
is a Community Contributoris a Team Rater Alumnusis a Tiering Contributor Alumnusis a Contributor Alumnus
i wonder if there'd be a way to link this to usage stats to make it more accurate. I don't know what resources NatDex AG uses, but maybe Set Compendiums, Check Compendiums, Role compendiums and Compendium all may come in handy with creating a better team
I actually popuated sets.json from the ag set compendium! I've considered trying to use usage stats for it, but at the moment, this current version is fairly consistently producing usable teams on a variety of cutoff levels, so that's not as high on my priorities as, say, updating the available sets.
 

Geysers

not round
is a Community Contributoris a Team Rater Alumnusis a Tiering Contributor Alumnusis a Contributor Alumnus
Huge update
I merged my dev branch into master, which brought a ton of big improvements, most which are listed below.

Major changes
  • Completely reworked the file structure to make it easier for users to improve their own versions, and ensured that builders and set lists are packaged in their own folders
  • Added ability to build teams for Gen7 AG
  • Added ability to build offensive teams, using a pre-set list of viable suicide leads
  • General logic improvements
  • Intelligent routing to allow for easy addition of more builder files
  • Revamped config to be a separate file for ease of use
  • Added ability to build teams in bulk; bulk teams exported in PS!' builder export format
  • Added ability to force builder to avoid certain Pokemon
  • Added ability to force builder to build around a certain Pokemon
Minor changes
  • Fixed numerous typoes throughout the sets files
  • Removed Gliscor and Shedinja from sets files because of overuse
  • Drastically increased chances of a defogger / stealth rocker on a given team
  • Resolved lingering glitches that were resulting in duplicate Pokemon and / or multiple Mega Evolutions or stealth rockers
  • Prevented use of multiple clerics on a team
Still in progress
  • Automatically upload teams to Pokepaste and display team link to user
 

Geysers

not round
is a Community Contributoris a Team Rater Alumnusis a Tiering Contributor Alumnusis a Contributor Alumnus
Huge update

I've added Pokepaste upload functionality! Huge thanks to PartMan for managing to make this work.

Also:

  • Recursive teambuilding to increase team quality
  • Stall building for natdex AG
  • General logic improvements
  • Reworked filestructure
  • Loads of new sets
  • Completely rewritten readme
  • Can now build around a handful of preset cores to increase consistency
  • Some cool experimental settings
https://github.com/Geyserexe/BuilderBot check there for the latest version!
 

Geysers

not round
is a Community Contributoris a Team Rater Alumnusis a Tiering Contributor Alumnusis a Contributor Alumnus
As u can see on this pokepast https://pokepast.es/ad2e5a4b9355088a it sometimes generates teams with two megas. U'll maybe want to fix that. Anyways, this is amazing and u did an incredible job, keep going! -Pobla2
Thanks for the report, I’ve been trying to figure this issue out for ages. I’ll edit this if I manage to fix it.

E: This is fixed.
Note: it’s still possible for there to be two megas on a team because of the way that my logic adds random pokemon if none can be found to fill a certain role. This isn’t remotely likely tho, so this patch should fix most of those issues. In order to update your version of my code, undo all your changes, then run “git pull”.
 
Last edited:
Here I'm to report more errors:
1- It sometimes gives me some errors when I try to create a team with this configuration (same thing with 9 as the cutoff value).
2- It gaves me an error when I try to create a team with this configuration, but it doesn't if i try to create balance with the same configuration.
3- It gives me an error when I try to create a gen 7 stall with this configuration.
If it isn't too much work, an option to force the program to add a defogger would be great
 
Last edited:

Geysers

not round
is a Community Contributoris a Team Rater Alumnusis a Tiering Contributor Alumnusis a Contributor Alumnus
Here I'm to report more errors:
1- It sometimes gives me some errors when I try to create a team with this configuration (same thing with 9 as the cutoff value).
2- It gaves me an error when I try to create a team with this configuration, but it doesn't if i try to create balance with the same configuration.
3- It gives me an error when I try to create a gen 7 stall with this configuration.
If it isn't too much work, an option to force the program to add a defogger would be great
1. Cutoff 10 generally just causes stuff to break. It’s something that should only be used at your own risk tbh, since there just aren’t that many things with 10 values. This isn’t a bug per se, but I probably should make it more clear not to do this.
2. This is because Stall preloads a Magic Bounce user, so you don’t need to specify that you’re starting with one. This causes validator issues which chain back to you. I should probably add smthng to tell this to the user, but just don’t start stall with a Magic Bouncer.
3. I recently reworked some stuff and must have left an extra function call. Thanks for spotting this — I’ll fix it ASAP.

Thanks for the report

Also it’s really hard to force defoggers, but the currently logic reeeeally heavily weights them, so that’s not at the top of my priority list. I might try to do that at some point though.

E: These should all be fixed
E2: Defog is mandatory on any competitive team that isn’t Hyper Offense, and I’ve found a solution to force it on every team, and I’ll merge that in later today.
 
Last edited:

Geysers

not round
is a Community Contributoris a Team Rater Alumnusis a Tiering Contributor Alumnusis a Contributor Alumnus
This has now been updated to work with normal Galar Dex AG!
Please report any bugs or suggest sets in this thread.
Apologies for the triple post, but this is my thread and it's been a few months since my last post so w/e.

The script can be used here, with git stuff found here. Thanks for your time reading / using this.
 
Last edited:

Geysers

not round
is a Community Contributoris a Team Rater Alumnusis a Tiering Contributor Alumnusis a Contributor Alumnus
Hi! This still exists! I recently rediscovered this and have made a bunch of improvements over the last few weeks. Gen8 balance building especially is drastically better, consistently producing solid teams with the holy trinity (etern + ndm + yve) and using a variety of new and updated sets to build teams that fit in nicely in the current meta. Gen7 has seen some very small improvements but hopefully I can do a similar overhaul there at some point soon. I removed gen8 national dex ag because it's no longer playable on PS and as such useless, and removed stall building because my improvements to the set files made stall building much worse than it was (it was already really bad so this isn't a great loss).

The replit is up-to-date with the new changes and functioning. Enjoy!
Gen9 support will probably come some time after home drops once I or a willing volunteer find the motivation to make a proper set file.
 

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

Top