Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Request for Assistance with Locking a Party of 6 Pokemon #367

Open
gogorogon opened this issue Feb 17, 2024 · 4 comments
Open

Request for Assistance with Locking a Party of 6 Pokemon #367

gogorogon opened this issue Feb 17, 2024 · 4 comments

Comments

@gogorogon
Copy link

Hello,

I am very impressed with your project and have successfully run your repository on Windows Subsystem for Linux (WSL). It works wonderfully.

I am currently looking to lock a party of 6 Pokemon within the application. Could you guide me on which part of the code I should modify to achieve this?

Thank you for your time and assistance.

@taylorhansen
Copy link
Owner

Hi, thanks for checking out my project!

Good to know that it works on WSL. As long as you can get TensorFlow (preferably with GPU) working it should be able to run anywhere.

As for changing the format of the game used for training the model, much of the code assumes the Gen-4 random battles format from Showdown, but it could be hacked to support a non-random team (outside of Gen-4 requires a lot more work though). Some pointers:

  • In the worker script used to manage training battles, remove the await lookup() call at the bottom which is used to improve the neural network input during random battles and set the variable to undefined. If you're just pitting the same team against itself, you could instead replace it with an object describing the team to improve learning as it will better specialize to facing just that team (here's the object format).
  • In simulateBattle() which actually calls into Pokemon Showdown's code to run the training battles, change the formatid field in the startOptions object to the Showdown format you're using. You'll also have to add a team field to the playerOptions objects to specify the team, represented as either a JS object or as a packed-format string (see doc).
  • In the PsBot runner script used to connect a trained model to a server for manual testing, change the string "gen4randombattle" to the format you're using in the bot.acceptChallenges() call. Also remove the await lookup() call or do the same thing as the first point.

Lemme know if anything comes up.

@gogorogon
Copy link
Author

I wanted to extend my sincere thanks for your detailed guidance!

Following your advice, I have successfully locked 9 strong candidates in Gen 4.
(gengar, zapdos, suicune, tyranitar, salamence, metagross, latios, infernape, garchomp)

20240218_6_strong_pokemons

I made edits to three key parts of the project:

For pokemon-showdown, I modified the files at:
Gen 4 Random Sets
Limited pokemons to 9 candidates (gengar,zapdos,suicune,tyranitar,salamence,metagross,latios,infernape,garchomp)

Gen 5 Random Teams
Comment out error about number of pokemons.

For pokemonshowdown-ai, changes were made in:
node_modules > @pkmn > randoms > build > index.js
Limited pokemons to 9 candidates (gengar,zapdos,suicune,tyranitar,salamence,metagross,latios,infernape,garchomp)

I am now in the process of training the model. I will continue to study and contribute to this project as much as I can.

I really appreciate your help and am grateful for the opportunity to learn and contribute.

Thank you once again!

@taylorhansen
Copy link
Owner

I see, interesting.

By the way the code in node_modules/ comes from the project's outside dependencies, the one you modified being from @pkmn/ps/randoms which is used to randomly generate a team of Pokemon while also balancing the levels, movesets, etc. based on the Pokemon's inherent strengths.

I'd also encourage that you take a look at this list of Pokemon AI projects that other people made, mentioned in this issue, which have a lot of other interesting ideas.

I'll also update the READMEs and example configs soon with better numbers/settings and usage guides.

Good luck in your efforts!

@gogorogon
Copy link
Author

Thank you for your comment.
I didn't know there were several Pokemon AI projects.
They look very useful, and I try to improve model based on them.
If strong model is created, I will soon share it to you!

I'm very looking forward to progress of your project!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants