Procedurally generate regions on islandHuge procedurally generated 'wilderness' worldsProcedurally generated terrain map. Blend Transitions between terrain typesHow can I identify feature regions in a procedurally generated world?Correct way to “randomly” generate flowing terrainMethod for procedurally creating spawn pointsHow do I procedurally generate level like in Dino Run, or Tiny Wings?Using L-Systems to procedurally generate citieshow to 'Scale up' my procedurally generated island/continent without losing its uniqueness?Procedurally generate rivers for 2-d heightmap terrainProcedurally generating non tile based top down 2d game worlds

What happens if a caster is surprised while casting a spell with a long casting time?

Why doesn't SpaceX land boosters in Africa?

Do electrons really perform instantaneous quantum leaps?

How soon after takeoff can you recline your airplane seat?

What is the lowest possible AC?

Why will we fail creating a self sustaining off world colony?

iMac 2019: Can I mix the old modules with the new ones when upgrading RAM?

How is it possible for tall trees to pull water to heights more than 10m?

Could you fall off a planet if it was being accelerated by engines?

Identifying positions of the last TRUEs in a sequence of TRUEs and FALSEs

Why are symbols not written in words?

What verb goes with "coup"?

Where to connect the fuse and why?

"I am [the / an] owner of a bookstore"?

ATMEGA328P-U vs ATMEGA328-PU

Having to constantly redo everything because I don't know how to do it

How can this fractal shape perfectly cover a certain platonic solid?

Is it advisable to inform the CEO about his brother accessing his office?

Basic calculations in PGF/TikZ for loop

What would you need merely the term "collection" for pitches, but not "scale"?

Odd PCB Layout for Voltage Regulator

What does that Pokemon Trainer mean by saying I am a SHELLOS?

How to track mail undetectably?

How does mmorpg store data?



Procedurally generate regions on island


Huge procedurally generated 'wilderness' worldsProcedurally generated terrain map. Blend Transitions between terrain typesHow can I identify feature regions in a procedurally generated world?Correct way to “randomly” generate flowing terrainMethod for procedurally creating spawn pointsHow do I procedurally generate level like in Dino Run, or Tiny Wings?Using L-Systems to procedurally generate citieshow to 'Scale up' my procedurally generated island/continent without losing its uniqueness?Procedurally generate rivers for 2-d heightmap terrainProcedurally generating non tile based top down 2d game worlds













27












$begingroup$


I currently have islands that look like this:



island



And I want to procedurally subdivide it into regions, like this:



island with regions



What algorithm does what I'm looking for? Do you have suggestions on how to create coherent regions like in the bottom picture. Your help is appreciated.










share|improve this question









$endgroup$











  • $begingroup$
    How did you get that island image in the first place? Did you generate it, and if so, how did you achieve it?
    $endgroup$
    – Alexandre Vaillancourt
    Jun 23 at 2:30










  • $begingroup$
    I got it from a online map generator.
    $endgroup$
    – domisum
    Jun 23 at 6:23










  • $begingroup$
    Sorry for the delay in updating my answer - took longer to get home than originally planned. I added some illustrations & links.
    $endgroup$
    – Pikalek
    Jun 24 at 15:37










  • $begingroup$
    If you got this from an online generator, you should look at Azgaar's Fantasy Map Generator. It has regions and names, with customizeable parameters, and WB.SE says hello. It's a github, so you may be able to check their code.
    $endgroup$
    – Anoplexian
    Jun 25 at 15:40
















27












$begingroup$


I currently have islands that look like this:



island



And I want to procedurally subdivide it into regions, like this:



island with regions



What algorithm does what I'm looking for? Do you have suggestions on how to create coherent regions like in the bottom picture. Your help is appreciated.










share|improve this question









$endgroup$











  • $begingroup$
    How did you get that island image in the first place? Did you generate it, and if so, how did you achieve it?
    $endgroup$
    – Alexandre Vaillancourt
    Jun 23 at 2:30










  • $begingroup$
    I got it from a online map generator.
    $endgroup$
    – domisum
    Jun 23 at 6:23










  • $begingroup$
    Sorry for the delay in updating my answer - took longer to get home than originally planned. I added some illustrations & links.
    $endgroup$
    – Pikalek
    Jun 24 at 15:37










  • $begingroup$
    If you got this from an online generator, you should look at Azgaar's Fantasy Map Generator. It has regions and names, with customizeable parameters, and WB.SE says hello. It's a github, so you may be able to check their code.
    $endgroup$
    – Anoplexian
    Jun 25 at 15:40














27












27








27


18



$begingroup$


I currently have islands that look like this:



island



And I want to procedurally subdivide it into regions, like this:



island with regions



What algorithm does what I'm looking for? Do you have suggestions on how to create coherent regions like in the bottom picture. Your help is appreciated.










share|improve this question









$endgroup$




I currently have islands that look like this:



island



And I want to procedurally subdivide it into regions, like this:



island with regions



What algorithm does what I'm looking for? Do you have suggestions on how to create coherent regions like in the bottom picture. Your help is appreciated.







procedural-generation terrain






share|improve this question













share|improve this question











share|improve this question




share|improve this question










asked Jun 22 at 20:39









domisumdomisum

1362 silver badges4 bronze badges




1362 silver badges4 bronze badges











  • $begingroup$
    How did you get that island image in the first place? Did you generate it, and if so, how did you achieve it?
    $endgroup$
    – Alexandre Vaillancourt
    Jun 23 at 2:30










  • $begingroup$
    I got it from a online map generator.
    $endgroup$
    – domisum
    Jun 23 at 6:23










  • $begingroup$
    Sorry for the delay in updating my answer - took longer to get home than originally planned. I added some illustrations & links.
    $endgroup$
    – Pikalek
    Jun 24 at 15:37










  • $begingroup$
    If you got this from an online generator, you should look at Azgaar's Fantasy Map Generator. It has regions and names, with customizeable parameters, and WB.SE says hello. It's a github, so you may be able to check their code.
    $endgroup$
    – Anoplexian
    Jun 25 at 15:40

















  • $begingroup$
    How did you get that island image in the first place? Did you generate it, and if so, how did you achieve it?
    $endgroup$
    – Alexandre Vaillancourt
    Jun 23 at 2:30










  • $begingroup$
    I got it from a online map generator.
    $endgroup$
    – domisum
    Jun 23 at 6:23










  • $begingroup$
    Sorry for the delay in updating my answer - took longer to get home than originally planned. I added some illustrations & links.
    $endgroup$
    – Pikalek
    Jun 24 at 15:37










  • $begingroup$
    If you got this from an online generator, you should look at Azgaar's Fantasy Map Generator. It has regions and names, with customizeable parameters, and WB.SE says hello. It's a github, so you may be able to check their code.
    $endgroup$
    – Anoplexian
    Jun 25 at 15:40
















$begingroup$
How did you get that island image in the first place? Did you generate it, and if so, how did you achieve it?
$endgroup$
– Alexandre Vaillancourt
Jun 23 at 2:30




$begingroup$
How did you get that island image in the first place? Did you generate it, and if so, how did you achieve it?
$endgroup$
– Alexandre Vaillancourt
Jun 23 at 2:30












$begingroup$
I got it from a online map generator.
$endgroup$
– domisum
Jun 23 at 6:23




$begingroup$
I got it from a online map generator.
$endgroup$
– domisum
Jun 23 at 6:23












$begingroup$
Sorry for the delay in updating my answer - took longer to get home than originally planned. I added some illustrations & links.
$endgroup$
– Pikalek
Jun 24 at 15:37




$begingroup$
Sorry for the delay in updating my answer - took longer to get home than originally planned. I added some illustrations & links.
$endgroup$
– Pikalek
Jun 24 at 15:37












$begingroup$
If you got this from an online generator, you should look at Azgaar's Fantasy Map Generator. It has regions and names, with customizeable parameters, and WB.SE says hello. It's a github, so you may be able to check their code.
$endgroup$
– Anoplexian
Jun 25 at 15:40





$begingroup$
If you got this from an online generator, you should look at Azgaar's Fantasy Map Generator. It has regions and names, with customizeable parameters, and WB.SE says hello. It's a github, so you may be able to check their code.
$endgroup$
– Anoplexian
Jun 25 at 15:40











6 Answers
6






active

oldest

votes


















38












$begingroup$

In the real world, those provincial borders will often be following geological features like rivers.



So maybe a good approach would be to model the geology of the island and have the borders fall out of this?



Red Blob Games has some good articles on this subject, with nice looking results.



His approach seems to involve using Voronoi tessellation, and define the rivers as the boundaries between the cells.



Check out the other articles on his site, he has done a lot of writing on the subject of map generation.



island






share|improve this answer









$endgroup$








  • 3




    $begingroup$
    Note that in real world, political or administrative divisions also sometimes have arbitrary divisions, usually straight lines (e.g. along latitud/longitud lines, lines between mountain peaks, etc.).
    $endgroup$
    – Pablo H
    Jun 24 at 12:02






  • 2




    $begingroup$
    @PabloH Good point, although straight borders seem to be post-mediaval colonial era phenomenon. But since we don't know the setting of OPs problem, it might be relevant
    $endgroup$
    – Sentry
    Jun 24 at 14:31


















27












$begingroup$

I would solve this problem with two passes of Voronoi diagrams:



First Pass: Region Partitioning



The first pass would use a somewhat sparse distribution of points (i.e. the distance between the points should be relatively large) in order to roughly divide the island into regions (see the note below regarding point generation). Next generate a Voronoi diagram based on these points. This will divide the island into polygonal regions around each point as shown below:



enter image description here



Second Pass: Border Randomization



Now that the island has been divided into regions, then next step is to 'rough up' the boundaries between them. To do so, generate a new layer of points using a more compact distribution of points (i.e. the distance between points should be small) and again use these points to create another Voronoi diagram. Next for each smaller region, assign it to a larger region by checking its 'seed' point. This will result in a more jagged boundaries between the larger subdivisions. Here's a close up of what it looks like with both Voronoi diagrams in place:



enter image description here



And here's that same area showing only the final boundaries:



enter image description here



Comments on Point Generation



Regarding point generation, I like using a Poisson disc distribution in order to get a relatively nice & even distribution of points. The other common option is to get a similarly even distribution is to use Lloyd's algorithm on a set of 'regular' random points. LLoyd's is easier to code, but can take some trial & error to determine how many passes are required to give the desired result.



One potential problem with this approach is that the first pass partitioning may generate some very small regions. If you don't want them in your final result, I would simply merge them with a random adjacent region.



Final Notes



The illustrations I provided happen to be raster images, but this technique also works with polygonal / vector representations as well.






share|improve this answer











$endgroup$








  • 1




    $begingroup$
    For procedural floor plans this is what I do, do a Voronoi diagram from points inside the region (the island), construct a grid (it doesn't have to be rectangular, for your case a deformed grid) that encloses the same region, then compute the boolean intersections of the grid and the Voronoi, calculate the areas and assign to a data tree (list of list, jagged array, etc... whatever data structure you prefer) according to the 0.6 percentage of the smallest grid cell, you'll get some missing cells, but you can compare your culled grid with the original to find and reassign to your tree.
    $endgroup$
    – Felipe Gutierrez
    Jun 24 at 3:37











  • $begingroup$
    You added images! This is exactly what I am doing for a different purpose
    $endgroup$
    – Felipe Gutierrez
    Jun 26 at 3:39


















4












$begingroup$

MineCraft does this nicely, and its world generation algorithm has been analyzed and documented thoroughly.



There are various descriptions of the algorithm, one of them here: https://github.com/UnknownShadow200/ClassiCube/wiki/Minecraft-Classic-map-generation-algorithm



The core of the algorithm is a Perlin noise generator. This controls elevation directly (more or less, as the subsequent step to carve out caves can change the surface as well), as well as biome generation. Something like the biome generator is probably what you want to use to create your areas.



(An old version of it) is documented, basically it works by using two different Perlin Noise generators, one for "temperature", one for "precipitation", then choosing the biome from those two. The variables themselves (temperature and precipitation) aren't really used in the game later; for example, deserts have no rain, but the game determines this from the "desert" property, not from the original precipitation value.



There are various online tools to generate a biome map from a random seed, one of them is mineatlas.com. I guess that, internally, they use a java server which uses the internal classes of MineCraft itself; I don't know if any of their source code is available directly.






share|improve this answer








New contributor



Guntram Blohm is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.





$endgroup$




















    4












    $begingroup$

    A typical algorithm used, for example, by Azgaar (source code). Is roughly like this:



    1. split your landmass into smaller areas, e.g. through delauny triangulation or voronoi cells.

    2. determine (randomly or otherwise) "starting" locations for your cultures, realms, religions or whatever else you want to simulate.

    3. determine (randomly or otherwise) a "growth factor" for each of them. The more difference in growth factors you have, the less uniform your final map.

    4. Now iterate over your realms (etc) and, depending on growth factor, make them spread into surrounding, empty tiles until the entire map is filled.

    5. You probably want to end with straightening out borders a bit, by switching cells that have only one neighbour in their own colour and are otherwise surrounded by a different one to that colour.





    share|improve this answer









    $endgroup$




















      3












      $begingroup$

      If you are interested in doing this in vectorial format rather than raster-based approaches, I have written a blog post a while ago about pretty much exactly this.



      http://blog.particracy.com/worlds-and-their-geography/



      The idea is you start with a mesh (Voronoi based usually) and grow the regions concentrically from randomly seeded points that are sufficiently spaced apart.






      share|improve this answer









      $endgroup$




















        0












        $begingroup$

        What a fun question :) This approach is kinda based on Vornoi cells but the distance metric isn't quite Euclidian (I used the power of 1.5 instead of 2.0) and has some randomness built into it. It may jump over the water which isn't ideal.



        Nearby regions can be merged together to get more interesting shapes, here I kind of used the N nearest neighbors to determine this.



        If you are interested I can go into more details and share the Python code.



        map 1map 2






        share|improve this answer










        New contributor



        NikoNyrh is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
        Check out our Code of Conduct.





        $endgroup$















          Your Answer






          StackExchange.ifUsing("editor", function ()
          StackExchange.using("externalEditor", function ()
          StackExchange.using("snippets", function ()
          StackExchange.snippets.init();
          );
          );
          , "code-snippets");

          StackExchange.ready(function()
          var channelOptions =
          tags: "".split(" "),
          id: "53"
          ;
          initTagRenderer("".split(" "), "".split(" "), channelOptions);

          StackExchange.using("externalEditor", function()
          // Have to fire editor after snippets, if snippets enabled
          if (StackExchange.settings.snippets.snippetsEnabled)
          StackExchange.using("snippets", function()
          createEditor();
          );

          else
          createEditor();

          );

          function createEditor()
          StackExchange.prepareEditor(
          heartbeatType: 'answer',
          autoActivateHeartbeat: false,
          convertImagesToLinks: false,
          noModals: true,
          showLowRepImageUploadWarning: true,
          reputationToPostImages: null,
          bindNavPrevention: true,
          postfix: "",
          imageUploader:
          brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
          contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
          allowUrls: true
          ,
          onDemand: true,
          discardSelector: ".discard-answer"
          ,immediatelyShowMarkdownHelp:true
          );



          );













          draft saved

          draft discarded


















          StackExchange.ready(
          function ()
          StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fgamedev.stackexchange.com%2fquestions%2f173105%2fprocedurally-generate-regions-on-island%23new-answer', 'question_page');

          );

          Post as a guest















          Required, but never shown

























          6 Answers
          6






          active

          oldest

          votes








          6 Answers
          6






          active

          oldest

          votes









          active

          oldest

          votes






          active

          oldest

          votes









          38












          $begingroup$

          In the real world, those provincial borders will often be following geological features like rivers.



          So maybe a good approach would be to model the geology of the island and have the borders fall out of this?



          Red Blob Games has some good articles on this subject, with nice looking results.



          His approach seems to involve using Voronoi tessellation, and define the rivers as the boundaries between the cells.



          Check out the other articles on his site, he has done a lot of writing on the subject of map generation.



          island






          share|improve this answer









          $endgroup$








          • 3




            $begingroup$
            Note that in real world, political or administrative divisions also sometimes have arbitrary divisions, usually straight lines (e.g. along latitud/longitud lines, lines between mountain peaks, etc.).
            $endgroup$
            – Pablo H
            Jun 24 at 12:02






          • 2




            $begingroup$
            @PabloH Good point, although straight borders seem to be post-mediaval colonial era phenomenon. But since we don't know the setting of OPs problem, it might be relevant
            $endgroup$
            – Sentry
            Jun 24 at 14:31















          38












          $begingroup$

          In the real world, those provincial borders will often be following geological features like rivers.



          So maybe a good approach would be to model the geology of the island and have the borders fall out of this?



          Red Blob Games has some good articles on this subject, with nice looking results.



          His approach seems to involve using Voronoi tessellation, and define the rivers as the boundaries between the cells.



          Check out the other articles on his site, he has done a lot of writing on the subject of map generation.



          island






          share|improve this answer









          $endgroup$








          • 3




            $begingroup$
            Note that in real world, political or administrative divisions also sometimes have arbitrary divisions, usually straight lines (e.g. along latitud/longitud lines, lines between mountain peaks, etc.).
            $endgroup$
            – Pablo H
            Jun 24 at 12:02






          • 2




            $begingroup$
            @PabloH Good point, although straight borders seem to be post-mediaval colonial era phenomenon. But since we don't know the setting of OPs problem, it might be relevant
            $endgroup$
            – Sentry
            Jun 24 at 14:31













          38












          38








          38





          $begingroup$

          In the real world, those provincial borders will often be following geological features like rivers.



          So maybe a good approach would be to model the geology of the island and have the borders fall out of this?



          Red Blob Games has some good articles on this subject, with nice looking results.



          His approach seems to involve using Voronoi tessellation, and define the rivers as the boundaries between the cells.



          Check out the other articles on his site, he has done a lot of writing on the subject of map generation.



          island






          share|improve this answer









          $endgroup$



          In the real world, those provincial borders will often be following geological features like rivers.



          So maybe a good approach would be to model the geology of the island and have the borders fall out of this?



          Red Blob Games has some good articles on this subject, with nice looking results.



          His approach seems to involve using Voronoi tessellation, and define the rivers as the boundaries between the cells.



          Check out the other articles on his site, he has done a lot of writing on the subject of map generation.



          island







          share|improve this answer












          share|improve this answer



          share|improve this answer










          answered Jun 22 at 22:53









          BramBram

          2,83511 silver badges16 bronze badges




          2,83511 silver badges16 bronze badges







          • 3




            $begingroup$
            Note that in real world, political or administrative divisions also sometimes have arbitrary divisions, usually straight lines (e.g. along latitud/longitud lines, lines between mountain peaks, etc.).
            $endgroup$
            – Pablo H
            Jun 24 at 12:02






          • 2




            $begingroup$
            @PabloH Good point, although straight borders seem to be post-mediaval colonial era phenomenon. But since we don't know the setting of OPs problem, it might be relevant
            $endgroup$
            – Sentry
            Jun 24 at 14:31












          • 3




            $begingroup$
            Note that in real world, political or administrative divisions also sometimes have arbitrary divisions, usually straight lines (e.g. along latitud/longitud lines, lines between mountain peaks, etc.).
            $endgroup$
            – Pablo H
            Jun 24 at 12:02






          • 2




            $begingroup$
            @PabloH Good point, although straight borders seem to be post-mediaval colonial era phenomenon. But since we don't know the setting of OPs problem, it might be relevant
            $endgroup$
            – Sentry
            Jun 24 at 14:31







          3




          3




          $begingroup$
          Note that in real world, political or administrative divisions also sometimes have arbitrary divisions, usually straight lines (e.g. along latitud/longitud lines, lines between mountain peaks, etc.).
          $endgroup$
          – Pablo H
          Jun 24 at 12:02




          $begingroup$
          Note that in real world, political or administrative divisions also sometimes have arbitrary divisions, usually straight lines (e.g. along latitud/longitud lines, lines between mountain peaks, etc.).
          $endgroup$
          – Pablo H
          Jun 24 at 12:02




          2




          2




          $begingroup$
          @PabloH Good point, although straight borders seem to be post-mediaval colonial era phenomenon. But since we don't know the setting of OPs problem, it might be relevant
          $endgroup$
          – Sentry
          Jun 24 at 14:31




          $begingroup$
          @PabloH Good point, although straight borders seem to be post-mediaval colonial era phenomenon. But since we don't know the setting of OPs problem, it might be relevant
          $endgroup$
          – Sentry
          Jun 24 at 14:31











          27












          $begingroup$

          I would solve this problem with two passes of Voronoi diagrams:



          First Pass: Region Partitioning



          The first pass would use a somewhat sparse distribution of points (i.e. the distance between the points should be relatively large) in order to roughly divide the island into regions (see the note below regarding point generation). Next generate a Voronoi diagram based on these points. This will divide the island into polygonal regions around each point as shown below:



          enter image description here



          Second Pass: Border Randomization



          Now that the island has been divided into regions, then next step is to 'rough up' the boundaries between them. To do so, generate a new layer of points using a more compact distribution of points (i.e. the distance between points should be small) and again use these points to create another Voronoi diagram. Next for each smaller region, assign it to a larger region by checking its 'seed' point. This will result in a more jagged boundaries between the larger subdivisions. Here's a close up of what it looks like with both Voronoi diagrams in place:



          enter image description here



          And here's that same area showing only the final boundaries:



          enter image description here



          Comments on Point Generation



          Regarding point generation, I like using a Poisson disc distribution in order to get a relatively nice & even distribution of points. The other common option is to get a similarly even distribution is to use Lloyd's algorithm on a set of 'regular' random points. LLoyd's is easier to code, but can take some trial & error to determine how many passes are required to give the desired result.



          One potential problem with this approach is that the first pass partitioning may generate some very small regions. If you don't want them in your final result, I would simply merge them with a random adjacent region.



          Final Notes



          The illustrations I provided happen to be raster images, but this technique also works with polygonal / vector representations as well.






          share|improve this answer











          $endgroup$








          • 1




            $begingroup$
            For procedural floor plans this is what I do, do a Voronoi diagram from points inside the region (the island), construct a grid (it doesn't have to be rectangular, for your case a deformed grid) that encloses the same region, then compute the boolean intersections of the grid and the Voronoi, calculate the areas and assign to a data tree (list of list, jagged array, etc... whatever data structure you prefer) according to the 0.6 percentage of the smallest grid cell, you'll get some missing cells, but you can compare your culled grid with the original to find and reassign to your tree.
            $endgroup$
            – Felipe Gutierrez
            Jun 24 at 3:37











          • $begingroup$
            You added images! This is exactly what I am doing for a different purpose
            $endgroup$
            – Felipe Gutierrez
            Jun 26 at 3:39















          27












          $begingroup$

          I would solve this problem with two passes of Voronoi diagrams:



          First Pass: Region Partitioning



          The first pass would use a somewhat sparse distribution of points (i.e. the distance between the points should be relatively large) in order to roughly divide the island into regions (see the note below regarding point generation). Next generate a Voronoi diagram based on these points. This will divide the island into polygonal regions around each point as shown below:



          enter image description here



          Second Pass: Border Randomization



          Now that the island has been divided into regions, then next step is to 'rough up' the boundaries between them. To do so, generate a new layer of points using a more compact distribution of points (i.e. the distance between points should be small) and again use these points to create another Voronoi diagram. Next for each smaller region, assign it to a larger region by checking its 'seed' point. This will result in a more jagged boundaries between the larger subdivisions. Here's a close up of what it looks like with both Voronoi diagrams in place:



          enter image description here



          And here's that same area showing only the final boundaries:



          enter image description here



          Comments on Point Generation



          Regarding point generation, I like using a Poisson disc distribution in order to get a relatively nice & even distribution of points. The other common option is to get a similarly even distribution is to use Lloyd's algorithm on a set of 'regular' random points. LLoyd's is easier to code, but can take some trial & error to determine how many passes are required to give the desired result.



          One potential problem with this approach is that the first pass partitioning may generate some very small regions. If you don't want them in your final result, I would simply merge them with a random adjacent region.



          Final Notes



          The illustrations I provided happen to be raster images, but this technique also works with polygonal / vector representations as well.






          share|improve this answer











          $endgroup$








          • 1




            $begingroup$
            For procedural floor plans this is what I do, do a Voronoi diagram from points inside the region (the island), construct a grid (it doesn't have to be rectangular, for your case a deformed grid) that encloses the same region, then compute the boolean intersections of the grid and the Voronoi, calculate the areas and assign to a data tree (list of list, jagged array, etc... whatever data structure you prefer) according to the 0.6 percentage of the smallest grid cell, you'll get some missing cells, but you can compare your culled grid with the original to find and reassign to your tree.
            $endgroup$
            – Felipe Gutierrez
            Jun 24 at 3:37











          • $begingroup$
            You added images! This is exactly what I am doing for a different purpose
            $endgroup$
            – Felipe Gutierrez
            Jun 26 at 3:39













          27












          27








          27





          $begingroup$

          I would solve this problem with two passes of Voronoi diagrams:



          First Pass: Region Partitioning



          The first pass would use a somewhat sparse distribution of points (i.e. the distance between the points should be relatively large) in order to roughly divide the island into regions (see the note below regarding point generation). Next generate a Voronoi diagram based on these points. This will divide the island into polygonal regions around each point as shown below:



          enter image description here



          Second Pass: Border Randomization



          Now that the island has been divided into regions, then next step is to 'rough up' the boundaries between them. To do so, generate a new layer of points using a more compact distribution of points (i.e. the distance between points should be small) and again use these points to create another Voronoi diagram. Next for each smaller region, assign it to a larger region by checking its 'seed' point. This will result in a more jagged boundaries between the larger subdivisions. Here's a close up of what it looks like with both Voronoi diagrams in place:



          enter image description here



          And here's that same area showing only the final boundaries:



          enter image description here



          Comments on Point Generation



          Regarding point generation, I like using a Poisson disc distribution in order to get a relatively nice & even distribution of points. The other common option is to get a similarly even distribution is to use Lloyd's algorithm on a set of 'regular' random points. LLoyd's is easier to code, but can take some trial & error to determine how many passes are required to give the desired result.



          One potential problem with this approach is that the first pass partitioning may generate some very small regions. If you don't want them in your final result, I would simply merge them with a random adjacent region.



          Final Notes



          The illustrations I provided happen to be raster images, but this technique also works with polygonal / vector representations as well.






          share|improve this answer











          $endgroup$



          I would solve this problem with two passes of Voronoi diagrams:



          First Pass: Region Partitioning



          The first pass would use a somewhat sparse distribution of points (i.e. the distance between the points should be relatively large) in order to roughly divide the island into regions (see the note below regarding point generation). Next generate a Voronoi diagram based on these points. This will divide the island into polygonal regions around each point as shown below:



          enter image description here



          Second Pass: Border Randomization



          Now that the island has been divided into regions, then next step is to 'rough up' the boundaries between them. To do so, generate a new layer of points using a more compact distribution of points (i.e. the distance between points should be small) and again use these points to create another Voronoi diagram. Next for each smaller region, assign it to a larger region by checking its 'seed' point. This will result in a more jagged boundaries between the larger subdivisions. Here's a close up of what it looks like with both Voronoi diagrams in place:



          enter image description here



          And here's that same area showing only the final boundaries:



          enter image description here



          Comments on Point Generation



          Regarding point generation, I like using a Poisson disc distribution in order to get a relatively nice & even distribution of points. The other common option is to get a similarly even distribution is to use Lloyd's algorithm on a set of 'regular' random points. LLoyd's is easier to code, but can take some trial & error to determine how many passes are required to give the desired result.



          One potential problem with this approach is that the first pass partitioning may generate some very small regions. If you don't want them in your final result, I would simply merge them with a random adjacent region.



          Final Notes



          The illustrations I provided happen to be raster images, but this technique also works with polygonal / vector representations as well.







          share|improve this answer














          share|improve this answer



          share|improve this answer








          edited Jun 24 at 15:34

























          answered Jun 22 at 22:59









          PikalekPikalek

          7,0131 gold badge24 silver badges38 bronze badges




          7,0131 gold badge24 silver badges38 bronze badges







          • 1




            $begingroup$
            For procedural floor plans this is what I do, do a Voronoi diagram from points inside the region (the island), construct a grid (it doesn't have to be rectangular, for your case a deformed grid) that encloses the same region, then compute the boolean intersections of the grid and the Voronoi, calculate the areas and assign to a data tree (list of list, jagged array, etc... whatever data structure you prefer) according to the 0.6 percentage of the smallest grid cell, you'll get some missing cells, but you can compare your culled grid with the original to find and reassign to your tree.
            $endgroup$
            – Felipe Gutierrez
            Jun 24 at 3:37











          • $begingroup$
            You added images! This is exactly what I am doing for a different purpose
            $endgroup$
            – Felipe Gutierrez
            Jun 26 at 3:39












          • 1




            $begingroup$
            For procedural floor plans this is what I do, do a Voronoi diagram from points inside the region (the island), construct a grid (it doesn't have to be rectangular, for your case a deformed grid) that encloses the same region, then compute the boolean intersections of the grid and the Voronoi, calculate the areas and assign to a data tree (list of list, jagged array, etc... whatever data structure you prefer) according to the 0.6 percentage of the smallest grid cell, you'll get some missing cells, but you can compare your culled grid with the original to find and reassign to your tree.
            $endgroup$
            – Felipe Gutierrez
            Jun 24 at 3:37











          • $begingroup$
            You added images! This is exactly what I am doing for a different purpose
            $endgroup$
            – Felipe Gutierrez
            Jun 26 at 3:39







          1




          1




          $begingroup$
          For procedural floor plans this is what I do, do a Voronoi diagram from points inside the region (the island), construct a grid (it doesn't have to be rectangular, for your case a deformed grid) that encloses the same region, then compute the boolean intersections of the grid and the Voronoi, calculate the areas and assign to a data tree (list of list, jagged array, etc... whatever data structure you prefer) according to the 0.6 percentage of the smallest grid cell, you'll get some missing cells, but you can compare your culled grid with the original to find and reassign to your tree.
          $endgroup$
          – Felipe Gutierrez
          Jun 24 at 3:37





          $begingroup$
          For procedural floor plans this is what I do, do a Voronoi diagram from points inside the region (the island), construct a grid (it doesn't have to be rectangular, for your case a deformed grid) that encloses the same region, then compute the boolean intersections of the grid and the Voronoi, calculate the areas and assign to a data tree (list of list, jagged array, etc... whatever data structure you prefer) according to the 0.6 percentage of the smallest grid cell, you'll get some missing cells, but you can compare your culled grid with the original to find and reassign to your tree.
          $endgroup$
          – Felipe Gutierrez
          Jun 24 at 3:37













          $begingroup$
          You added images! This is exactly what I am doing for a different purpose
          $endgroup$
          – Felipe Gutierrez
          Jun 26 at 3:39




          $begingroup$
          You added images! This is exactly what I am doing for a different purpose
          $endgroup$
          – Felipe Gutierrez
          Jun 26 at 3:39











          4












          $begingroup$

          MineCraft does this nicely, and its world generation algorithm has been analyzed and documented thoroughly.



          There are various descriptions of the algorithm, one of them here: https://github.com/UnknownShadow200/ClassiCube/wiki/Minecraft-Classic-map-generation-algorithm



          The core of the algorithm is a Perlin noise generator. This controls elevation directly (more or less, as the subsequent step to carve out caves can change the surface as well), as well as biome generation. Something like the biome generator is probably what you want to use to create your areas.



          (An old version of it) is documented, basically it works by using two different Perlin Noise generators, one for "temperature", one for "precipitation", then choosing the biome from those two. The variables themselves (temperature and precipitation) aren't really used in the game later; for example, deserts have no rain, but the game determines this from the "desert" property, not from the original precipitation value.



          There are various online tools to generate a biome map from a random seed, one of them is mineatlas.com. I guess that, internally, they use a java server which uses the internal classes of MineCraft itself; I don't know if any of their source code is available directly.






          share|improve this answer








          New contributor



          Guntram Blohm is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
          Check out our Code of Conduct.





          $endgroup$

















            4












            $begingroup$

            MineCraft does this nicely, and its world generation algorithm has been analyzed and documented thoroughly.



            There are various descriptions of the algorithm, one of them here: https://github.com/UnknownShadow200/ClassiCube/wiki/Minecraft-Classic-map-generation-algorithm



            The core of the algorithm is a Perlin noise generator. This controls elevation directly (more or less, as the subsequent step to carve out caves can change the surface as well), as well as biome generation. Something like the biome generator is probably what you want to use to create your areas.



            (An old version of it) is documented, basically it works by using two different Perlin Noise generators, one for "temperature", one for "precipitation", then choosing the biome from those two. The variables themselves (temperature and precipitation) aren't really used in the game later; for example, deserts have no rain, but the game determines this from the "desert" property, not from the original precipitation value.



            There are various online tools to generate a biome map from a random seed, one of them is mineatlas.com. I guess that, internally, they use a java server which uses the internal classes of MineCraft itself; I don't know if any of their source code is available directly.






            share|improve this answer








            New contributor



            Guntram Blohm is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
            Check out our Code of Conduct.





            $endgroup$















              4












              4








              4





              $begingroup$

              MineCraft does this nicely, and its world generation algorithm has been analyzed and documented thoroughly.



              There are various descriptions of the algorithm, one of them here: https://github.com/UnknownShadow200/ClassiCube/wiki/Minecraft-Classic-map-generation-algorithm



              The core of the algorithm is a Perlin noise generator. This controls elevation directly (more or less, as the subsequent step to carve out caves can change the surface as well), as well as biome generation. Something like the biome generator is probably what you want to use to create your areas.



              (An old version of it) is documented, basically it works by using two different Perlin Noise generators, one for "temperature", one for "precipitation", then choosing the biome from those two. The variables themselves (temperature and precipitation) aren't really used in the game later; for example, deserts have no rain, but the game determines this from the "desert" property, not from the original precipitation value.



              There are various online tools to generate a biome map from a random seed, one of them is mineatlas.com. I guess that, internally, they use a java server which uses the internal classes of MineCraft itself; I don't know if any of their source code is available directly.






              share|improve this answer








              New contributor



              Guntram Blohm is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
              Check out our Code of Conduct.





              $endgroup$



              MineCraft does this nicely, and its world generation algorithm has been analyzed and documented thoroughly.



              There are various descriptions of the algorithm, one of them here: https://github.com/UnknownShadow200/ClassiCube/wiki/Minecraft-Classic-map-generation-algorithm



              The core of the algorithm is a Perlin noise generator. This controls elevation directly (more or less, as the subsequent step to carve out caves can change the surface as well), as well as biome generation. Something like the biome generator is probably what you want to use to create your areas.



              (An old version of it) is documented, basically it works by using two different Perlin Noise generators, one for "temperature", one for "precipitation", then choosing the biome from those two. The variables themselves (temperature and precipitation) aren't really used in the game later; for example, deserts have no rain, but the game determines this from the "desert" property, not from the original precipitation value.



              There are various online tools to generate a biome map from a random seed, one of them is mineatlas.com. I guess that, internally, they use a java server which uses the internal classes of MineCraft itself; I don't know if any of their source code is available directly.







              share|improve this answer








              New contributor



              Guntram Blohm is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
              Check out our Code of Conduct.








              share|improve this answer



              share|improve this answer






              New contributor



              Guntram Blohm is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
              Check out our Code of Conduct.








              answered Jun 24 at 13:11









              Guntram BlohmGuntram Blohm

              1412 bronze badges




              1412 bronze badges




              New contributor



              Guntram Blohm is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
              Check out our Code of Conduct.




              New contributor




              Guntram Blohm is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
              Check out our Code of Conduct.























                  4












                  $begingroup$

                  A typical algorithm used, for example, by Azgaar (source code). Is roughly like this:



                  1. split your landmass into smaller areas, e.g. through delauny triangulation or voronoi cells.

                  2. determine (randomly or otherwise) "starting" locations for your cultures, realms, religions or whatever else you want to simulate.

                  3. determine (randomly or otherwise) a "growth factor" for each of them. The more difference in growth factors you have, the less uniform your final map.

                  4. Now iterate over your realms (etc) and, depending on growth factor, make them spread into surrounding, empty tiles until the entire map is filled.

                  5. You probably want to end with straightening out borders a bit, by switching cells that have only one neighbour in their own colour and are otherwise surrounded by a different one to that colour.





                  share|improve this answer









                  $endgroup$

















                    4












                    $begingroup$

                    A typical algorithm used, for example, by Azgaar (source code). Is roughly like this:



                    1. split your landmass into smaller areas, e.g. through delauny triangulation or voronoi cells.

                    2. determine (randomly or otherwise) "starting" locations for your cultures, realms, religions or whatever else you want to simulate.

                    3. determine (randomly or otherwise) a "growth factor" for each of them. The more difference in growth factors you have, the less uniform your final map.

                    4. Now iterate over your realms (etc) and, depending on growth factor, make them spread into surrounding, empty tiles until the entire map is filled.

                    5. You probably want to end with straightening out borders a bit, by switching cells that have only one neighbour in their own colour and are otherwise surrounded by a different one to that colour.





                    share|improve this answer









                    $endgroup$















                      4












                      4








                      4





                      $begingroup$

                      A typical algorithm used, for example, by Azgaar (source code). Is roughly like this:



                      1. split your landmass into smaller areas, e.g. through delauny triangulation or voronoi cells.

                      2. determine (randomly or otherwise) "starting" locations for your cultures, realms, religions or whatever else you want to simulate.

                      3. determine (randomly or otherwise) a "growth factor" for each of them. The more difference in growth factors you have, the less uniform your final map.

                      4. Now iterate over your realms (etc) and, depending on growth factor, make them spread into surrounding, empty tiles until the entire map is filled.

                      5. You probably want to end with straightening out borders a bit, by switching cells that have only one neighbour in their own colour and are otherwise surrounded by a different one to that colour.





                      share|improve this answer









                      $endgroup$



                      A typical algorithm used, for example, by Azgaar (source code). Is roughly like this:



                      1. split your landmass into smaller areas, e.g. through delauny triangulation or voronoi cells.

                      2. determine (randomly or otherwise) "starting" locations for your cultures, realms, religions or whatever else you want to simulate.

                      3. determine (randomly or otherwise) a "growth factor" for each of them. The more difference in growth factors you have, the less uniform your final map.

                      4. Now iterate over your realms (etc) and, depending on growth factor, make them spread into surrounding, empty tiles until the entire map is filled.

                      5. You probably want to end with straightening out borders a bit, by switching cells that have only one neighbour in their own colour and are otherwise surrounded by a different one to that colour.






                      share|improve this answer












                      share|improve this answer



                      share|improve this answer










                      answered Jun 25 at 11:27









                      TomTom

                      8903 silver badges10 bronze badges




                      8903 silver badges10 bronze badges





















                          3












                          $begingroup$

                          If you are interested in doing this in vectorial format rather than raster-based approaches, I have written a blog post a while ago about pretty much exactly this.



                          http://blog.particracy.com/worlds-and-their-geography/



                          The idea is you start with a mesh (Voronoi based usually) and grow the regions concentrically from randomly seeded points that are sufficiently spaced apart.






                          share|improve this answer









                          $endgroup$

















                            3












                            $begingroup$

                            If you are interested in doing this in vectorial format rather than raster-based approaches, I have written a blog post a while ago about pretty much exactly this.



                            http://blog.particracy.com/worlds-and-their-geography/



                            The idea is you start with a mesh (Voronoi based usually) and grow the regions concentrically from randomly seeded points that are sufficiently spaced apart.






                            share|improve this answer









                            $endgroup$















                              3












                              3








                              3





                              $begingroup$

                              If you are interested in doing this in vectorial format rather than raster-based approaches, I have written a blog post a while ago about pretty much exactly this.



                              http://blog.particracy.com/worlds-and-their-geography/



                              The idea is you start with a mesh (Voronoi based usually) and grow the regions concentrically from randomly seeded points that are sufficiently spaced apart.






                              share|improve this answer









                              $endgroup$



                              If you are interested in doing this in vectorial format rather than raster-based approaches, I have written a blog post a while ago about pretty much exactly this.



                              http://blog.particracy.com/worlds-and-their-geography/



                              The idea is you start with a mesh (Voronoi based usually) and grow the regions concentrically from randomly seeded points that are sufficiently spaced apart.







                              share|improve this answer












                              share|improve this answer



                              share|improve this answer










                              answered Jun 23 at 21:34









                              Wouter LievensWouter Lievens

                              2661 silver badge3 bronze badges




                              2661 silver badge3 bronze badges





















                                  0












                                  $begingroup$

                                  What a fun question :) This approach is kinda based on Vornoi cells but the distance metric isn't quite Euclidian (I used the power of 1.5 instead of 2.0) and has some randomness built into it. It may jump over the water which isn't ideal.



                                  Nearby regions can be merged together to get more interesting shapes, here I kind of used the N nearest neighbors to determine this.



                                  If you are interested I can go into more details and share the Python code.



                                  map 1map 2






                                  share|improve this answer










                                  New contributor



                                  NikoNyrh is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
                                  Check out our Code of Conduct.





                                  $endgroup$

















                                    0












                                    $begingroup$

                                    What a fun question :) This approach is kinda based on Vornoi cells but the distance metric isn't quite Euclidian (I used the power of 1.5 instead of 2.0) and has some randomness built into it. It may jump over the water which isn't ideal.



                                    Nearby regions can be merged together to get more interesting shapes, here I kind of used the N nearest neighbors to determine this.



                                    If you are interested I can go into more details and share the Python code.



                                    map 1map 2






                                    share|improve this answer










                                    New contributor



                                    NikoNyrh is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
                                    Check out our Code of Conduct.





                                    $endgroup$















                                      0












                                      0








                                      0





                                      $begingroup$

                                      What a fun question :) This approach is kinda based on Vornoi cells but the distance metric isn't quite Euclidian (I used the power of 1.5 instead of 2.0) and has some randomness built into it. It may jump over the water which isn't ideal.



                                      Nearby regions can be merged together to get more interesting shapes, here I kind of used the N nearest neighbors to determine this.



                                      If you are interested I can go into more details and share the Python code.



                                      map 1map 2






                                      share|improve this answer










                                      New contributor



                                      NikoNyrh is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
                                      Check out our Code of Conduct.





                                      $endgroup$



                                      What a fun question :) This approach is kinda based on Vornoi cells but the distance metric isn't quite Euclidian (I used the power of 1.5 instead of 2.0) and has some randomness built into it. It may jump over the water which isn't ideal.



                                      Nearby regions can be merged together to get more interesting shapes, here I kind of used the N nearest neighbors to determine this.



                                      If you are interested I can go into more details and share the Python code.



                                      map 1map 2







                                      share|improve this answer










                                      New contributor



                                      NikoNyrh is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
                                      Check out our Code of Conduct.








                                      share|improve this answer



                                      share|improve this answer








                                      edited Jun 26 at 18:56





















                                      New contributor



                                      NikoNyrh is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
                                      Check out our Code of Conduct.








                                      answered Jun 26 at 18:34









                                      NikoNyrhNikoNyrh

                                      1012 bronze badges




                                      1012 bronze badges




                                      New contributor



                                      NikoNyrh is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
                                      Check out our Code of Conduct.




                                      New contributor




                                      NikoNyrh is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
                                      Check out our Code of Conduct.





























                                          draft saved

                                          draft discarded
















































                                          Thanks for contributing an answer to Game Development Stack Exchange!


                                          • Please be sure to answer the question. Provide details and share your research!

                                          But avoid


                                          • Asking for help, clarification, or responding to other answers.

                                          • Making statements based on opinion; back them up with references or personal experience.

                                          Use MathJax to format equations. MathJax reference.


                                          To learn more, see our tips on writing great answers.




                                          draft saved


                                          draft discarded














                                          StackExchange.ready(
                                          function ()
                                          StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fgamedev.stackexchange.com%2fquestions%2f173105%2fprocedurally-generate-regions-on-island%23new-answer', 'question_page');

                                          );

                                          Post as a guest















                                          Required, but never shown





















































                                          Required, but never shown














                                          Required, but never shown












                                          Required, but never shown







                                          Required, but never shown

































                                          Required, but never shown














                                          Required, but never shown












                                          Required, but never shown







                                          Required, but never shown







                                          Popular posts from this blog

                                          Grendel Contents Story Scholarship Depictions Notes References Navigation menu10.1093/notesj/gjn112Berserkeree

                                          Area configuration aggregation error after install Porto themeMagento 2.1 CE Installed but front/backend not loading/workingCSS not loading on page within Magento 2 pageCannot install module in Magento 2no commands defined in the “setup” namespace. in Magento2Magento 2: Static files are present but shows 404Why do i have to always run the commands to clean cache in Magento 2.1.8?Failure reason: 'Unable to unserialize value.'Error 500 after magento migrationIn production mode the site does not loadMagento 2 : Error 500 after installing

                                          Middle Expansion Olielle Resaix Definition: Uttering songs of triumph shouting with joy triumphant exulting Sejunction Journal 붙다 달 고급 품목 외출 The stretch trades the screeching tin. Definition: The act of speaking with a drawl a drawl Cough Sand Definition: An uproar a quarrel a noisy outbreak Shake Iron Publicize Horse House Baby 사과 Resaix Flaggy Jelly Temporary Unequaled Puppet A drop in the bucket Shrew 성격 회원 성질 미팅 The burn frames the tacky quality. Materialistic The smoke reduces the way. Yammoe Nondescript Cheek 얼굴 배 약하다 날리다 타다 The illegal country shows the iron. Help Rule Drearien Smoke Teaching Meaty Wasp Abraham Lincoln Jaws 진심 수리하다 Size Cork Idea Convert Think Lark John Lennon 거울 청소 군 추천하다 아이스크림