{"id":19753992,"url":"https://github.com/taylorhansen/pokemonshowdown-ai","last_synced_at":"2025-04-30T11:31:19.392Z","repository":{"id":42674454,"uuid":"145503706","full_name":"taylorhansen/pokemonshowdown-ai","owner":"taylorhansen","description":"Reinforcement learning for Pokemon.","archived":false,"fork":false,"pushed_at":"2024-01-16T03:31:17.000Z","size":11935,"stargazers_count":34,"open_issues_count":0,"forks_count":5,"subscribers_count":5,"default_branch":"main","last_synced_at":"2024-01-16T04:53:04.307Z","etag":null,"topics":["ai","neural-network","pokemon","pokemon-showdown","pokemon-showdown-bot","reinforcement-learning","tensorflow","typescript"],"latest_commit_sha":null,"homepage":"","language":"TypeScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/taylorhansen.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null}},"created_at":"2018-08-21T03:53:00.000Z","updated_at":"2023-12-14T03:50:47.000Z","dependencies_parsed_at":"2023-12-04T01:22:05.970Z","dependency_job_id":"45bccc66-62b0-4510-920f-cf734a491d5e","html_url":"https://github.com/taylorhansen/pokemonshowdown-ai","commit_stats":null,"previous_names":[],"tags_count":0,"template":null,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/taylorhansen%2Fpokemonshowdown-ai","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/taylorhansen%2Fpokemonshowdown-ai/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/taylorhansen%2Fpokemonshowdown-ai/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/taylorhansen%2Fpokemonshowdown-ai/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/taylorhansen","download_url":"https://codeload.github.com/taylorhansen/pokemonshowdown-ai/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":224208120,"owners_count":17273674,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["ai","neural-network","pokemon","pokemon-showdown","pokemon-showdown-bot","reinforcement-learning","tensorflow","typescript"],"created_at":"2024-11-12T02:55:56.417Z","updated_at":"2024-11-12T02:55:56.954Z","avatar_url":"https://github.com/taylorhansen.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Pokemon Showdown AI\n\n[![Build](https://github.com/taylorhansen/pokemonshowdown-ai/actions/workflows/build.yml/badge.svg)](https://github.com/taylorhansen/pokemonshowdown-ai/actions/workflows/build.yml)\n[![codecov](https://codecov.io/gh/taylorhansen/pokemonshowdown-ai/branch/main/graph/badge.svg?token=qRdGD5oRzd)](https://codecov.io/gh/taylorhansen/pokemonshowdown-ai)\n\nReinforcement learning project for Pokemon Showdown. Currently only supports the\nGen-4 random battle format.\n\nThis project has three parts:\n\n-   [PsBot](/src/ts/psbot) framework for creating a general Pokemon Showdown bot\n    and setting up the battle interface.\n-   [Battle](/src/ts/battle) state tracker and PS protocol parser.\n-   Neural network [training](/src/py/train.py) script.\n\nhttps://user-images.githubusercontent.com/13547043/184581452-31b33c7e-87d5-4a26-8772-a7c365704109.mp4\n\n_Me (left) vs a model (right) that was trained over ~16k games against itself_\n\n## Build Instructions\n\nMake sure you have at least Node v18 (LTS) and Miniconda 3 installed. Should\nwork on Linux and likely also Windows WSL2.\n\n```sh\n# Download the repository.\ngit clone https://github.com/taylorhansen/pokemonshowdown-ai\ncd pokemonshowdown-ai\n\n# Checkout submodules.\ngit submodule init\ngit submodule update\n\n# Setup Python/TensorFlow.\nconda env create --name psai --file environment.yml\nconda activate psai\n\n# Setup TS.\nnpm install\nnpm run build\n```\n\n## Testing\n\n```sh\n# Run formatter.\nnpm run format\nisort src test\nblack src test\n\n# Run linter.\nnpm run lint\npylint src test\nmypy src test\n\n# Run tests.\nnpm test\npython -m test.unit\n```\n\n## Training\n\n```sh\n# Edit hyperparmeters as needed.\ncp config/train_example.yml config/train.yml\n\npython -m src.py.train\n```\n\nTrains the neural network through self-play. This requires a powerful computer\nand/or GPU, and may take several hours depending on how it's\n[configured](/config/train_example.yml).\n\nTraining logs are saved to `./experiments/` by default.\n\nMetrics such as loss and evaluation scores can be viewed using TensorBoard.\n\n```sh\npip install tensorboard\ntensorboard --logdir experiments\n```\n\n## Running\n\n```sh\n# Edit config as needed.\ncp config/psbot_example.yml config/psbot.yml\n\nnpm run psbot\n```\n\nConnects to the PS server specified in the [config](/config/psbot_example.yml)\nand starts accepting battle challenges in the `gen4randombattle` format, which\nis the only format that this project supports for now. By default it loads the\nmodel from `./experiments/train/model` (assuming a training run was completed)\nand connects to a locally-hosted PS instance (see\n[guide](https://github.com/smogon/pokemon-showdown/blob/master/server/README.md)\non how to set one up). This allows the trained model to take on human\nchallengers or any other outside bots.\n\n## License\n\nSee [LICENSE](/LICENSE).\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftaylorhansen%2Fpokemonshowdown-ai","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ftaylorhansen%2Fpokemonshowdown-ai","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftaylorhansen%2Fpokemonshowdown-ai/lists"}