<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:dc="http://purl.org/dc/elements/1.1/">
  <channel>
    <title>DEV Community: Kavinkumar R</title>
    <description>The latest articles on DEV Community by Kavinkumar R (@kavinkumarr).</description>
    <link>https://dev.to/kavinkumarr</link>
    <image>
      <url>https://media2.dev.to/dynamic/image/width=90,height=90,fit=cover,gravity=auto,format=auto/https:%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F4145251%2Fabc3fbb9-fea6-4124-a23b-75fe64549751.png</url>
      <title>DEV Community: Kavinkumar R</title>
      <link>https://dev.to/kavinkumarr</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/kavinkumarr"/>
    <language>en</language>
    <item>
      <title>I found the Clash of Clans API and ended up building a war simulator</title>
      <dc:creator>Kavinkumar R</dc:creator>
      <pubDate>Sun, 27 Sep 2026 08:36:55 +0000</pubDate>
      <link>https://dev.to/kavinkumarr/i-found-the-clash-of-clans-api-and-ended-up-building-a-war-simulator-58n9</link>
      <guid>https://dev.to/kavinkumarr/i-found-the-clash-of-clans-api-and-ended-up-building-a-war-simulator-58n9</guid>
      <description>&lt;p&gt;I was looking for something to build and came across the Clash of Clans developer API.&lt;/p&gt;

&lt;p&gt;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.&lt;/p&gt;

&lt;p&gt;That eventually turned into WarOracle.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Fv52nkjobhw2ilzuxbawf.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Fv52nkjobhw2ilzuxbawf.png" alt="Enter player / clan tag to get the current war line up" width="800" height="600"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2F7iyb5yretl3e89qps70t.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2F7iyb5yretl3e89qps70t.png" alt="Predicted outcome with the simulated war" width="800" height="600"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;The basic idea is to simulate a Clash of Clans war and see how it could play out.&lt;/p&gt;

&lt;p&gt;For a clan, I look at the current war, players, Town Hall levels, heroes/equipment and previous attack history. From that, I build an estimate of how individual attacks might perform.&lt;/p&gt;

&lt;p&gt;Then I run the remaining war through Monte Carlo simulations and aggregate the results.&lt;/p&gt;

&lt;p&gt;It gives things like:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;win/loss/draw probability&lt;/li&gt;
&lt;li&gt;expected final stars&lt;/li&gt;
&lt;li&gt;possible final score range&lt;/li&gt;
&lt;li&gt;distribution of simulated outcomes&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;One part that took more thought than I expected was ongoing wars.&lt;/p&gt;

&lt;p&gt;If a war is already halfway through, I can't just simulate the whole thing from scratch. The attacks that already happened are known outcomes, so I treat them as fixed and only simulate the attacks that are still available.&lt;/p&gt;

&lt;p&gt;I also experimented with using the same data to generate attacker/target assignments. I'm not completely convinced that part is useful yet.&lt;/p&gt;

&lt;p&gt;The backend is Spring Boot/Java and the frontend is React. The simulation engine is multithreaded, and I'm currently experimenting with how much player-specific history should influence the outcome versus using general historical data.&lt;/p&gt;

&lt;p&gt;The project is here:&lt;/p&gt;

&lt;p&gt;&lt;a href="https://waroracle.me" rel="noopener noreferrer"&gt;https://waroracle.me&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;I'm mainly putting this out because I'm curious about two things:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;&lt;p&gt;Does this actually seem useful to a Clash player?&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;If you've built simulation/probabilistic systems before, how would you approach modeling something like this when the available data is limited and pretty noisy?&lt;/p&gt;&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;I'm still figuring out whether I built something people actually need or just an interesting experiment with an API.&lt;/p&gt;

</description>
      <category>showdev</category>
      <category>java</category>
      <category>react</category>
    </item>
  </channel>
</rss>
