<?xml version="1.0" encoding="UTF-8"?><rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom" version="2.0" xmlns:cc="http://cyber.law.harvard.edu/rss/creativeCommonsRssModule.html">
    <channel>
        <title><![CDATA[Stories by Kunal Sonar on Medium]]></title>
        <description><![CDATA[Stories by Kunal Sonar on Medium]]></description>
        <link>https://medium.com/@little_interactions?source=rss-381f2583cc0e------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/1*QnzzKzNLhe6SYCfvCr1tvQ.png</url>
            <title>Stories by Kunal Sonar on Medium</title>
            <link>https://medium.com/@little_interactions?source=rss-381f2583cc0e------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Fri, 20 Nov 2026 11:02:45 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@little_interactions/feed" rel="self" type="application/rss+xml"/>
        <webMaster><![CDATA[yourfriends@medium.com]]></webMaster>
        <atom:link href="http://medium.superfeedr.com/" rel="hub"/>
        <item>
            <title><![CDATA[Hyperlocal Devblog #1 — Procedural Island Generation]]></title>
            <link>https://medium.com/@little_interactions/hyperlocal-devblog-1-procedural-island-generation-dcda2b62f9fa?source=rss-381f2583cc0e------2</link>
            <guid isPermaLink="false">https://medium.com/p/dcda2b62f9fa</guid>
            <category><![CDATA[games]]></category>
            <category><![CDATA[game-development]]></category>
            <category><![CDATA[game-design]]></category>
            <category><![CDATA[unity]]></category>
            <category><![CDATA[simulation]]></category>
            <dc:creator><![CDATA[Kunal Sonar]]></dc:creator>
            <pubDate>Thu, 18 Sep 2025 10:51:06 GMT</pubDate>
            <atom:updated>2025-09-18T10:51:06.348Z</atom:updated>
            <content:encoded><![CDATA[<h3>Hyperlocal Devblog #1 — Procedural Island Generation</h3><p>Hi Everyone!</p><p>Hyperlocal is a simulation game about delivering groceries in cities. For its operations, urban area maps are required and what better approach than to generate them procedurally to keep things fresh every time you start operating in a new city or need a fresh start after going bankrupt 😅</p><p>In this post, I wanted to share an approach that I am using in this project to generate 2D grid based procedural islands as a base layer for these cities. Maybe someone else has already used it before me, but if not, then I get to name it! 😼</p><h3>What did I need?</h3><p><strong>Objectives</strong> to be accomplished:</p><ol><li>Completely filled singular islands that can act as a base layer to overlay data on top of it to construct a city.</li><li>Easily tweak shape and size along with some flat and clean edges to go well with the overall aesthetic.</li><li>Should be performant for any runtime requirements.</li><li>Just looking for some *quirk* instead of the traditional noise based approach.</li></ol><h3>Why not Noise?</h3><p>The usual approach of using noise along with distance functions or gradient textures did not yield the desirable visual results I was looking for. The additional checks involved to make sure that the island is always connected and adding variations for shape and rotation ended up adding to the pain of having to calibrate a lot of parameters.</p><p>Now it’s possible, I wasn’t calibrating the parameters correctly, but I wanted to do something different anyway.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/540/0*aTWZ0P20XzTdy0yf.gif" /></figure><h3>So what did I do?</h3><p>My approach was to produce base parameters such that the values will sort of lerp between a square and a circular island at extreme ends.</p><p>Here’s what I did,</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*Wp6gCuacxWm95qoqePo0Sg.png" /><figcaption>Seed = 4, Radius = 16, Spokes = 24, MinRadiusMultiplier = 0.5, AngleOffset = 0</figcaption></figure><h4>Base Parameters</h4><pre>[System.Serializable]<br>public class CityGeneratorSettings<br>{<br>    //Seed for initialising System.Random<br>    //Using System.Random instead UnityEngine.Random to produce<br>    //same results for a given seed value<br>    [SerializeField]<br>    private int seed = 0;<br>    public int Seed =&gt; seed;<br><br>    //Max radius of the island<br>    [SerializeField]<br>    [Min(5)]<br>    private int radius = 25;<br>    public int Radius =&gt; radius;<br><br>    //Number of corner points to generate in [Step 1]<br>    [SerializeField]<br>    [Range(4, 32)]<br>    private int spokes = 8;<br>    public int Spokes =&gt; spokes;<br><br>    //Min radius when applying randomness<br>    //to corner points selection in [Step 1]<br>    [SerializeField]<br>    [Range(0.25f, 1f)]<br>    private float minRadiusMultiplier = 0.5f;<br>    public float MinRadiusMultiplier =&gt; minRadiusMultiplier;<br><br>    //Angle offset for corner points selection in [Step 1]<br>    [SerializeField]<br>    [Range(0f, 360f)]<br>    float angleOffset = 0f;<br>    public float AngleOffset =&gt; angleOffset;<br><br>    //Does pathfinding use bias towards a particular direction?<br>    [SerializeField]<br>    bool isUsedBiasedPathfinding = false;<br>    public bool IsUsedBiasedPathfinding =&gt; isUsedBiasedPathfinding;<br>}</pre><h4><strong>Step 1 — Select Corner Points</strong></h4><pre>List&lt;Vector2Int&gt; corners = new List&lt;Vector2Int&gt;();<br><br>for (int i = 0; i &lt; cityGeneratorSettings.Spokes; i++)<br>{<br>    //Uniformly distribute angle based on the number of Spokes<br>    float angle = i * (360f / cityGeneratorSettings.Spokes);<br><br>    //Selecting radius for this corner point<br>    //Lerp between specified Radius and (Radius * MinRadiusMultiplier)<br>    //t for lerp comes from the random initialized at the start<br>    float distance = Mathf.Lerp(cityGeneratorSettings.Radius * cityGeneratorSettings.MinRadiusMultiplier, cityGeneratorSettings.Radius, (float)rand.NextDouble());<br><br>    //Using the formula for point on circumference of a circle<br>    Vector2Int pos = new Vector2Int(Mathf.RoundToInt(Mathf.Cos(angle * Mathf.Deg2Rad) * distance), Mathf.RoundToInt(Mathf.Sin(angle * Mathf.Deg2Rad) * distance));<br><br>    //Add the determined position to a corner points list<br>    //if it has not been selected already<br>    if (!cityTiles.Contains(pos))<br>    {<br>        corners.Add(pos);<br>        cityTiles.Add(pos);<br>    }<br>}</pre><h4><strong>Step 2— Make Boundary</strong></h4><pre>//Using pathfinding to connect the corner points<br>//I have used AStar pathfinding algorithm,<br>//but you can use any other pathfinding algorithm<br>for (int i = 0; i &lt; corners.Count; i++)<br>{<br>    Vector2Int target = corners[(i + 1) % (corners.Count)];<br><br>    float targetAngle = 0f;<br><br>    if (cityGeneratorSettings.IsUsedBiasedPathfinding)<br>    {<br>        targetAngle = Mathf.Atan2(target.y, target.x) * Mathf.Rad2Deg;<br><br>        if (targetAngle &lt; 0f)<br>        {<br>            targetAngle += 360f;<br>        }<br>    }<br>    <br>    //The last parameter allows bias towards a particular direction during pathfinding<br>    //This helps to produce perfect square and circular shaped cities<br>    //Use 0 for better variations<br>    List&lt;Vector2Int&gt; path = AStarVector2Int.GetPath(corners[i], target, cityTiles, (int)(targetAngle / 90));<br>    <br>    //Add the positions obtained from pathfinding to the cityTiles list<br>    for (int j = 1; j &lt; path.Count - 1; j++)<br>    {<br>        if (!cityTiles.Contains(path[j]))<br>        {<br>            cityTiles.Add(path[j]);<br>        }<br>    }<br>}</pre><h4><strong>Step 3— Fill It Up!</strong></h4><pre>//Flood fill was an easier option but it was leaving out<br>//holes in some edge cases, this works for all.<br>Dictionary&lt;int, int&gt; cityTilesMinX = new Dictionary&lt;int, int&gt;();<br>Dictionary&lt;int, int&gt; cityTilesMaxX = new Dictionary&lt;int, int&gt;();<br><br>foreach (Vector2Int pos in cityTiles)<br>{<br>    if (!cityTilesMinX.ContainsKey(pos.y))<br>    {<br>        cityTilesMinX.Add(pos.y, 0);<br>        cityTilesMaxX.Add(pos.y, 0);<br>    }<br><br>    if (pos.x &lt; cityTilesMinX[pos.y])<br>    {<br>        cityTilesMinX[pos.y] = pos.x;<br>    }<br><br>    if (pos.x &gt; cityTilesMaxX[pos.y])<br>    {<br>        cityTilesMaxX[pos.y] = pos.x;<br>    }<br>}<br><br>foreach (int yPos in cityTilesMinX.Keys)<br>{<br>    for (int i = cityTilesMinX[yPos] + 1; i &lt; cityTilesMaxX[yPos]; i++)<br>    {<br>        Vector2Int pos = new Vector2Int(i, yPos);<br><br>        if (!cityTiles.Contains(pos))<br>        {<br>            cityTiles.Add(pos);<br>        }<br>    }<br>}</pre><p><a href="https://github.com/little-interactions/Devblog/tree/e87a973f52cedcf865f08e812570a1394942f40a/HyperlocalDevblog%231"><em>Complete Source Code</em></a></p><h3>Examples</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*Cs6QkcpcHFP-6ckiUyrGmw.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*7SWj-2O2J0a-Bz6d0edKnA.png" /><figcaption>Examples with some random base parameter values</figcaption></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*WNnGj-OWiwwe_4uyeq90ZQ.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*UwEqf518NKFWuL9G4jqfWA.png" /><figcaption>Extreme ends of base parameters!</figcaption></figure><h3>Improvements</h3><p>It seems to be working alright, except a few edge cases where the code enters an infinite loop when playing around with base parameters.</p><p>I hope you enjoyed reading about this <a href="https://en.wikipedia.org/wiki/Jugaad"><em>jugaad</em></a> yet simple approach to generate procedural islands. In next steps, this approach needs to be refined to accomplish all the objectives and overlay data on these tiles to construct a city.</p><p>That’s it for now. More on the current status of the project in the next devblog.</p><p>Thanks for reading!<br>- Kunal</p><p><em>If you found this interesting, please consider supporting the development of this project on Patreon: </em><a href="http://patreon.com/littleinteractions"><strong><em>Become a Patron Today!</em></strong></a></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=dcda2b62f9fa" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Hyperlocal Devblog #0 — Intro]]></title>
            <link>https://medium.com/@little_interactions/hyperlocal-devblog-0-intro-90ee06311aaf?source=rss-381f2583cc0e------2</link>
            <guid isPermaLink="false">https://medium.com/p/90ee06311aaf</guid>
            <category><![CDATA[game-design]]></category>
            <category><![CDATA[games]]></category>
            <category><![CDATA[unity]]></category>
            <category><![CDATA[game-development]]></category>
            <category><![CDATA[simulation]]></category>
            <dc:creator><![CDATA[Kunal Sonar]]></dc:creator>
            <pubDate>Wed, 10 Sep 2025 07:02:31 GMT</pubDate>
            <atom:updated>2025-09-10T07:02:31.416Z</atom:updated>
            <content:encoded><![CDATA[<h3>Hyperlocal Devblog #0 — Intro</h3><p>Hi Everyone! I’m Kunal, an indie game developer and designer.</p><p>Welcome to my first ever dev blog! Hoping it’s the first of many 🙈</p><h4>A bit of History</h4><p>I have worked on this project on and off for about a year now, mostly turning away from it whenever the design did not feel right or the simulation seemed unnecessarily complex. And here we are again, this revival of the project and the devblog comes with some sense of understanding the concept better, a lot of encouragement, and validations.</p><h4>The Big Announcement</h4><p>I would like to introduce you to <strong>Hyperlocal</strong>.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*nP7BXL8R16w4EZky8yHoHA.png" /><figcaption>Colours and Font will most definitely change!</figcaption></figure><blockquote><em>A management simulation game about delivering groceries as quickly as possible. Run an app-based delivery platform, make difficult choices, navigate tricky situations, and more.</em></blockquote><h4>Current Status</h4><ol><li>The design document has made more progress than any of its previous iterations, enough to surpass the scope of a playable prototype. I highly recommend Freeform for distraction free mind mapping.</li><li>I started developing the project recently using the Unity game engine. All controllers, basic simulation systems and some custom modules (secret sauce) are in place for the simulation to start running. Almost there!</li><li>After insufferable amounts of struggle, the art direction was finally settled. And it won’t change for sure, I promise! 🤞🏽</li></ol><figure><img alt="" src="https://cdn-images-1.medium.com/max/480/1*MUDlJLNZqxoaVlzGx9X6hg.gif" /></figure><p>Keeping this one short, still learning to write like this.</p><h4>Next up</h4><ol><li>Filling in some key details in the design document</li><li>Getting the simulation up and running</li><li>Gearing up to share more about the project in the next blog post!</li></ol><p>Stay tuned!</p><p>Thanks for reading!<br>- Kunal</p><p><em>If you found this interesting, please consider supporting the development of this project on Patreon: </em><a href="http://patreon.com/littleinteractions"><strong><em>Become a Patron Today!</em></strong></a></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=90ee06311aaf" width="1" height="1" alt="">]]></content:encoded>
        </item>
    </channel>
</rss>