Browser demo reveals a Clash Royale RL agent’s local optimum

Community discussion Reddit r/MachineLearning · Individual views, not representative.

According to the Reddit community, a new browser demo makes it especially clear how a reinforcement-learning agent can get stuck in a local optimum. The open-source project presents a simplified Clash Royale defense task and compares the agent’s learned choice with a best answer found by brute force.

In the interactive environment, an attacker appears at a random point on the opponent’s side. The agent selects a legal cell for one defending card, then chooses a delay of zero to five seconds. Its reward is the fraction of tower damage prevented compared with using no defense.

The policy has 5,629 parameters and is trained with REINFORCE in JavaScript. Each simulation runs in a C++ engine compiled to WebAssembly; the project says its deployment checks that the WASM and native versions match exactly. For comparison, brute force evaluates every cell and delay combination, requiring up to about 300,000 rollouts per matchup.

Against Giant, the Cannon matchup trapped the policy in a placement worth about 75 percent of the optimum in five of six runs using a constant entropy coefficient. A linearly decreasing coefficient reduced that to one run out of six. One Reddit commenter says that watching the policy stall while the brute-force result pulls ahead is a particularly recognizable illustration of the local-optimum problem. The demo is explicitly a miniature task, not a full match. Interactive demo and project code. Source on Reddit

🇬🇧 https://www.reddit.com/r/MachineLearning/comments/1wsfkwg/browser_demo_of_our_clash_royale_rl_environment_a

Leave a Comment

The weekly brief: selected developments, projects and videos