Skip to content

About

The trainer for RoyaleGym: it teaches your Clash Royale bot by playing battle after battle.

Topics

Resources

Contributing

Stars

0 stars

Watchers

1 watching

Forks

Repository files navigation

The RoyaleLearn logo: a green crown shield with a white graduation cap on it, outlined in gold

RoyaleLearn

CI License Python Docs Discord Last commit

Train a Clash Royale bot in Python, on your own machine: you write the reward, it learns to win. It is the trainer for the battles RoyaleGym runs, and it uses your NVIDIA graphics card.

Install

pip install "royalegym[all]"

This is the [learn] part, for Python 3.12. On Windows with an NVIDIA card, install PyTorch first: Install, step 4.

Try it

from royalegym import TowerHPReward, make_env
from royalelearn import Learner

def build_env():
    return make_env(reward=TowerHPReward())  # what the bot is paid for

if __name__ == "__main__":
    learner = Learner(build_env, save_dir="runs/my_bot")
    learner.learn(total_steps=20_000)  # counts all steps so far: raise it, run again to train more
    learner.save("runs/my_bot/bot")

It prints one line per update. To watch your bot play, see Watch It Play.

Next

MIT licensed. See LICENSE.

About

The trainer for RoyaleGym: it teaches your Clash Royale bot by playing battle after battle.

Topics

Resources

Contributing

Stars

0 stars

Watchers

1 watching

Forks

Releases

Sponsor this project

Packages

Contributors

Languages