Urgent.News

What's breaking now, across thousands of outlets.

Tech

I found the Clash of Clans API and ended up building a war simulator

I was looking for something to build and came across the Clash of Clans developer API. I didn't have a particular problem I wanted to solve. I just started looking through the API and wondering what I could build with the data it exposes. That eventually turned into WarOracle. The basic idea is to simulate a Clash of Clans war and see how it could play out. For a clan, I look at the current war,…

The Clash of Clans developer API caught the attention of a curious developer, who decided to build a war simulator called WarOracle. The basic concept behind WarOracle is to simulate Clash of Clans wars and provide an estimate of how they might unfold. To achieve this, the developer collects data such as the current war status, players involved, Town Hall levels, heroes, equipment, and previous attack history.

Using this data, WarOracle performs Monte Carlo simulations to generate various outcomes, including win, loss, and draw probabilities, the expected final stars, and the possible final score range and distribution of simulated outcomes. One of the more challenging aspects of the project was handling ongoing wars. Since already completed attacks are known outcomes, the system treats them as fixed values and only simulates the remaining attacks.

The developer also explored using the same data to generate attacker and target assignments, but is still uncertain if this feature is truly valuable. The backend of WarOracle is built using Spring Boot and Java, while the frontend is developed with React. To optimize the simulation engine, the developer is currently experimenting with how much player-specific history should factor into the outcomes versus relying on general historical data.

The project is open-source and can be found at https://waroracle.me. The developer is primarily motivated by curiosity and seeks feedback on whether WarOracle provides value to Clash of Clans players. Additionally, the developer is interested in learning about best practices for modeling limited and noisy data when building simulation and probabilistic systems.

Written by urgent.news from Dev.to's reporting — not their text. Machine-written — may contain errors; check the original before relying on it.

Read the original at dev.to →

More in Tech

The hard part of micro frontends is the contract, not the bundler

Most Module Federation write-ups stop at the config. You add the plugin, you name a few exposes and remotes, the demo loads a button from another build, and the post ends.

  • Contractual agreement between shell and remote modules is the main challenge in micro frontends.
  • Module Federation loads remote modules at runtime, removing build time guarantees.
  • Explicitly defined and versioned boundaries between shell and remote modules mitigate issues.

More from Sunday 27 September →