How can bays and straits be determined in a procedurally generated map?Huge procedurally generated 'wilderness' worldsProcedurally generated terrain map. Blend Transitions between terrain typesHow can I identify feature regions in a procedurally generated world?Algorithms for rainfall + river creation in procedurally generated terrainLegality, implementation, and viability of using the BSP map format in a procedurally generated XNA game?How can I generate random maps that feel like Age of Empires II random maps?Procedurally Generated Top View 2D RPG Map GenerationHow to display procedurally created rooms as a schematic map?Procedurally generated paths with intersectionsProcedurally-generated 2D curved roads on map

Which country benefited the most from vetos?

How can an equation having ColorDistance function be solved?

What's the point of deactivating Num Lock on login screens?

I'm flying to France today and my passport expires in less than 2 months

What does it mean to describe someone as a butt steak?

Is it unprofessional to ask if a job posting on GlassDoor is real?

Paid for article while in US on F1 visa?

Replacing matching entries in one column of a file by another column from a different file

Why doesn't H₄O²⁺ exist?

Is "remove commented out code" correct English?

Is it possible to run Internet Explorer on OS X El Capitan?

Filter any system log file by date or date range

Opposition of Newton's law

Can a monk's single staff be considered dual wielded, as per the Dual Wielder feat?

Why are electrically insulating heatsinks so rare? Is it just cost?

Took a trip to a parallel universe, need help deciphering

Linear Path Optimization with Two Dependent Variables

Does Otiluke's Resilient Sphere beat Magic Circle?

Reorder a Master List Based on a Reordered Subset

Fully-Firstable Anagram Sets

Revoked SSL certificate

What is a clear way to write a bar that has an extra beat?

Is it legal for company to use my work email to pretend I still work there?

What exploit are these user agents trying to use?



How can bays and straits be determined in a procedurally generated map?


Huge procedurally generated 'wilderness' worldsProcedurally generated terrain map. Blend Transitions between terrain typesHow can I identify feature regions in a procedurally generated world?Algorithms for rainfall + river creation in procedurally generated terrainLegality, implementation, and viability of using the BSP map format in a procedurally generated XNA game?How can I generate random maps that feel like Age of Empires II random maps?Procedurally Generated Top View 2D RPG Map GenerationHow to display procedurally created rooms as a schematic map?Procedurally generated paths with intersectionsProcedurally-generated 2D curved roads on map






.everyoneloves__top-leaderboard:empty,.everyoneloves__mid-leaderboard:empty,.everyoneloves__bot-mid-leaderboard:empty margin-bottom:0;








8












$begingroup$


I've got a procedurally generated map using Voronoi cells, with a defined sea level and a believable height map.



Current



So far, I've been successful in labelling certain geographic features: land, ocean, lakes, rivers, estuaries, confluences, mountains, and biomes. Biomes include tundra, boreal forest, grassland, and temperate forest. There are also a couple other biomes there but for my purposes they aren't important right now.



I'd like to label bays, and straits next, but I'm at a loss on how to do this properly. A bay is a recessed, coastal body of water that directly connects to the ocean.



A strait is a naturally formed, narrow waterway that connects two parts of the ocean. Basically, where two pieces of land almost touch and there's ocean on both sides. Also called a "channel".



For determining features, I can loop through any feature by type like this:



for each (var feature:Object in geography.getFeaturesByType(Geography.LAND))
// loop through lands
for each (var cell:Cell in feature.cells)
// loop through cells
for each (var neighbor:Cell in cell.neighbors)
// loop through a cell's neighbors
trace(neighbor.hasFeatureType(Geography.LAND));









share|improve this question











$endgroup$


















    8












    $begingroup$


    I've got a procedurally generated map using Voronoi cells, with a defined sea level and a believable height map.



    Current



    So far, I've been successful in labelling certain geographic features: land, ocean, lakes, rivers, estuaries, confluences, mountains, and biomes. Biomes include tundra, boreal forest, grassland, and temperate forest. There are also a couple other biomes there but for my purposes they aren't important right now.



    I'd like to label bays, and straits next, but I'm at a loss on how to do this properly. A bay is a recessed, coastal body of water that directly connects to the ocean.



    A strait is a naturally formed, narrow waterway that connects two parts of the ocean. Basically, where two pieces of land almost touch and there's ocean on both sides. Also called a "channel".



    For determining features, I can loop through any feature by type like this:



    for each (var feature:Object in geography.getFeaturesByType(Geography.LAND))
    // loop through lands
    for each (var cell:Cell in feature.cells)
    // loop through cells
    for each (var neighbor:Cell in cell.neighbors)
    // loop through a cell's neighbors
    trace(neighbor.hasFeatureType(Geography.LAND));









    share|improve this question











    $endgroup$














      8












      8








      8


      4



      $begingroup$


      I've got a procedurally generated map using Voronoi cells, with a defined sea level and a believable height map.



      Current



      So far, I've been successful in labelling certain geographic features: land, ocean, lakes, rivers, estuaries, confluences, mountains, and biomes. Biomes include tundra, boreal forest, grassland, and temperate forest. There are also a couple other biomes there but for my purposes they aren't important right now.



      I'd like to label bays, and straits next, but I'm at a loss on how to do this properly. A bay is a recessed, coastal body of water that directly connects to the ocean.



      A strait is a naturally formed, narrow waterway that connects two parts of the ocean. Basically, where two pieces of land almost touch and there's ocean on both sides. Also called a "channel".



      For determining features, I can loop through any feature by type like this:



      for each (var feature:Object in geography.getFeaturesByType(Geography.LAND))
      // loop through lands
      for each (var cell:Cell in feature.cells)
      // loop through cells
      for each (var neighbor:Cell in cell.neighbors)
      // loop through a cell's neighbors
      trace(neighbor.hasFeatureType(Geography.LAND));









      share|improve this question











      $endgroup$




      I've got a procedurally generated map using Voronoi cells, with a defined sea level and a believable height map.



      Current



      So far, I've been successful in labelling certain geographic features: land, ocean, lakes, rivers, estuaries, confluences, mountains, and biomes. Biomes include tundra, boreal forest, grassland, and temperate forest. There are also a couple other biomes there but for my purposes they aren't important right now.



      I'd like to label bays, and straits next, but I'm at a loss on how to do this properly. A bay is a recessed, coastal body of water that directly connects to the ocean.



      A strait is a naturally formed, narrow waterway that connects two parts of the ocean. Basically, where two pieces of land almost touch and there's ocean on both sides. Also called a "channel".



      For determining features, I can loop through any feature by type like this:



      for each (var feature:Object in geography.getFeaturesByType(Geography.LAND))
      // loop through lands
      for each (var cell:Cell in feature.cells)
      // loop through cells
      for each (var neighbor:Cell in cell.neighbors)
      // loop through a cell's neighbors
      trace(neighbor.hasFeatureType(Geography.LAND));






      procedural-generation maps graphics-programming simulations






      share|improve this question















      share|improve this question













      share|improve this question




      share|improve this question








      edited 4 hours ago







      Olin Kirkland

















      asked 8 hours ago









      Olin KirklandOlin Kirkland

      506




      506




















          2 Answers
          2






          active

          oldest

          votes


















          20












          $begingroup$

          Here's a rough idea using image processing transformations to isolate the features of interest:



          1. Apply a flood fill from an ocean cell to make a mask of all ocean cells. Depending on how your rivers are set up, you might need an extra elevation or clearance criterion to keep the ocean mask from flowing inland. ;)

          Ocean Mask




          1. Apply a local smoothing to the edge of this mask, keeping the connectedness/topology the same, but smoothing out small noisy coastline features that can be distracting. This lets us focus on big bays over tiny inlets. You can use the width of your filter kernal / number of iterations to finely control the scale of features you preserve.



            Here I applied a median filter a few times. Cellular automata are another popular way to erode smooth shapes from a noisy input.



          Smoothed Coastline



          1. Turn the mask into a distance field, where each cell stores its distance from the smoothed coastline.

          Distance Field



          Now we see some promising feature highlights. In a signed distance field, both bays and straits show up as sharp ridges, with distance falling off to the sides. We can use an edge detection filter to pop out these ridges:



          Ridges Highlighted



          You can then distinguish between bays and straits by following the ridge to determine its connectivity. A bay is a ridge that runs toward the coast, getting shallower and shallower (in distance from land) until it ends in a point. A strait is a ridge that connects a high-distance region to another high-distance region, going through a lower-distance region along the way.



          Or, another way is to assign each island an ID (connected component search), then when you're making your distance field, propagate "closest island ID" alongside the distance frontier. A bay or inlet is then a ridge in water adjacent to the same landmass on both sides, while a channel is a ridge that separates water adjacent to two different landmasses.



          You can set minimum & maximum distance-to-shore or length-of-ridge constraints to control which features to label, if you need to exclude excessively narrow/wide straits for instance.






          share|improve this answer











          $endgroup$








          • 3




            $begingroup$
            This looks really cool, and could probably be sped up considerably by directly using the cell structure to apply the various steps rather than the graphical representation!
            $endgroup$
            – Quentin
            1 hour ago






          • 2




            $begingroup$
            The second approach (assigning each distinct landmass an ID and distinguishing based on whether it's the same landmass on both sides of the body of water) seems like the easiest thing to do..
            $endgroup$
            – Monty Harder
            24 mins ago


















          0












          $begingroup$

          Basically, you need to think about what you mean, precisely, by a bay or strait, and why you want to differentiate them (is it for AI calculations, or to label landmarks, or something else?). Play around with a few definitions to find the one that looks best to you. Then, formulate conditions to check on your Voronoi cells. A few suggestions:



          Bay



          • Any ocean cell that only connects to a single other ocean cell

          • OR: Any ocean cell that connects to more land than ocean cells, with all ocean cells next to each other

          • OR: Same as above, but with a criterion based on border length (e.g. twice as much land as water border)

          Strait



          • Any ocean cell that connects to exactly two ocean cells which are not next to each other

          • OR: Any ocean cell that connects to two land cells that don't belong to the same landmass (you need to find out which land cells are connected first, and assign IDs to each landmass)

          • OR: March around the border, and count land/water and water/land transitions. You need at least two of each.

          • Depending on your method and what you want to do with the categories, you might want to eliminate straits that only lead to a bay, or label them as bay instead.





          share|improve this answer










          New contributor




          Autolykos 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 ()
            return StackExchange.using("mathjaxEditing", function ()
            StackExchange.MarkdownEditor.creationCallbacks.add(function (editor, postfix)
            StackExchange.mathjaxEditing.prepareWmdForMathJax(editor, postfix, [["\$", "\$"]]);
            );
            );
            , "mathjax-editing");

            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%2f169723%2fhow-can-bays-and-straits-be-determined-in-a-procedurally-generated-map%23new-answer', 'question_page');

            );

            Post as a guest















            Required, but never shown

























            2 Answers
            2






            active

            oldest

            votes








            2 Answers
            2






            active

            oldest

            votes









            active

            oldest

            votes






            active

            oldest

            votes









            20












            $begingroup$

            Here's a rough idea using image processing transformations to isolate the features of interest:



            1. Apply a flood fill from an ocean cell to make a mask of all ocean cells. Depending on how your rivers are set up, you might need an extra elevation or clearance criterion to keep the ocean mask from flowing inland. ;)

            Ocean Mask




            1. Apply a local smoothing to the edge of this mask, keeping the connectedness/topology the same, but smoothing out small noisy coastline features that can be distracting. This lets us focus on big bays over tiny inlets. You can use the width of your filter kernal / number of iterations to finely control the scale of features you preserve.



              Here I applied a median filter a few times. Cellular automata are another popular way to erode smooth shapes from a noisy input.



            Smoothed Coastline



            1. Turn the mask into a distance field, where each cell stores its distance from the smoothed coastline.

            Distance Field



            Now we see some promising feature highlights. In a signed distance field, both bays and straits show up as sharp ridges, with distance falling off to the sides. We can use an edge detection filter to pop out these ridges:



            Ridges Highlighted



            You can then distinguish between bays and straits by following the ridge to determine its connectivity. A bay is a ridge that runs toward the coast, getting shallower and shallower (in distance from land) until it ends in a point. A strait is a ridge that connects a high-distance region to another high-distance region, going through a lower-distance region along the way.



            Or, another way is to assign each island an ID (connected component search), then when you're making your distance field, propagate "closest island ID" alongside the distance frontier. A bay or inlet is then a ridge in water adjacent to the same landmass on both sides, while a channel is a ridge that separates water adjacent to two different landmasses.



            You can set minimum & maximum distance-to-shore or length-of-ridge constraints to control which features to label, if you need to exclude excessively narrow/wide straits for instance.






            share|improve this answer











            $endgroup$








            • 3




              $begingroup$
              This looks really cool, and could probably be sped up considerably by directly using the cell structure to apply the various steps rather than the graphical representation!
              $endgroup$
              – Quentin
              1 hour ago






            • 2




              $begingroup$
              The second approach (assigning each distinct landmass an ID and distinguishing based on whether it's the same landmass on both sides of the body of water) seems like the easiest thing to do..
              $endgroup$
              – Monty Harder
              24 mins ago















            20












            $begingroup$

            Here's a rough idea using image processing transformations to isolate the features of interest:



            1. Apply a flood fill from an ocean cell to make a mask of all ocean cells. Depending on how your rivers are set up, you might need an extra elevation or clearance criterion to keep the ocean mask from flowing inland. ;)

            Ocean Mask




            1. Apply a local smoothing to the edge of this mask, keeping the connectedness/topology the same, but smoothing out small noisy coastline features that can be distracting. This lets us focus on big bays over tiny inlets. You can use the width of your filter kernal / number of iterations to finely control the scale of features you preserve.



              Here I applied a median filter a few times. Cellular automata are another popular way to erode smooth shapes from a noisy input.



            Smoothed Coastline



            1. Turn the mask into a distance field, where each cell stores its distance from the smoothed coastline.

            Distance Field



            Now we see some promising feature highlights. In a signed distance field, both bays and straits show up as sharp ridges, with distance falling off to the sides. We can use an edge detection filter to pop out these ridges:



            Ridges Highlighted



            You can then distinguish between bays and straits by following the ridge to determine its connectivity. A bay is a ridge that runs toward the coast, getting shallower and shallower (in distance from land) until it ends in a point. A strait is a ridge that connects a high-distance region to another high-distance region, going through a lower-distance region along the way.



            Or, another way is to assign each island an ID (connected component search), then when you're making your distance field, propagate "closest island ID" alongside the distance frontier. A bay or inlet is then a ridge in water adjacent to the same landmass on both sides, while a channel is a ridge that separates water adjacent to two different landmasses.



            You can set minimum & maximum distance-to-shore or length-of-ridge constraints to control which features to label, if you need to exclude excessively narrow/wide straits for instance.






            share|improve this answer











            $endgroup$








            • 3




              $begingroup$
              This looks really cool, and could probably be sped up considerably by directly using the cell structure to apply the various steps rather than the graphical representation!
              $endgroup$
              – Quentin
              1 hour ago






            • 2




              $begingroup$
              The second approach (assigning each distinct landmass an ID and distinguishing based on whether it's the same landmass on both sides of the body of water) seems like the easiest thing to do..
              $endgroup$
              – Monty Harder
              24 mins ago













            20












            20








            20





            $begingroup$

            Here's a rough idea using image processing transformations to isolate the features of interest:



            1. Apply a flood fill from an ocean cell to make a mask of all ocean cells. Depending on how your rivers are set up, you might need an extra elevation or clearance criterion to keep the ocean mask from flowing inland. ;)

            Ocean Mask




            1. Apply a local smoothing to the edge of this mask, keeping the connectedness/topology the same, but smoothing out small noisy coastline features that can be distracting. This lets us focus on big bays over tiny inlets. You can use the width of your filter kernal / number of iterations to finely control the scale of features you preserve.



              Here I applied a median filter a few times. Cellular automata are another popular way to erode smooth shapes from a noisy input.



            Smoothed Coastline



            1. Turn the mask into a distance field, where each cell stores its distance from the smoothed coastline.

            Distance Field



            Now we see some promising feature highlights. In a signed distance field, both bays and straits show up as sharp ridges, with distance falling off to the sides. We can use an edge detection filter to pop out these ridges:



            Ridges Highlighted



            You can then distinguish between bays and straits by following the ridge to determine its connectivity. A bay is a ridge that runs toward the coast, getting shallower and shallower (in distance from land) until it ends in a point. A strait is a ridge that connects a high-distance region to another high-distance region, going through a lower-distance region along the way.



            Or, another way is to assign each island an ID (connected component search), then when you're making your distance field, propagate "closest island ID" alongside the distance frontier. A bay or inlet is then a ridge in water adjacent to the same landmass on both sides, while a channel is a ridge that separates water adjacent to two different landmasses.



            You can set minimum & maximum distance-to-shore or length-of-ridge constraints to control which features to label, if you need to exclude excessively narrow/wide straits for instance.






            share|improve this answer











            $endgroup$



            Here's a rough idea using image processing transformations to isolate the features of interest:



            1. Apply a flood fill from an ocean cell to make a mask of all ocean cells. Depending on how your rivers are set up, you might need an extra elevation or clearance criterion to keep the ocean mask from flowing inland. ;)

            Ocean Mask




            1. Apply a local smoothing to the edge of this mask, keeping the connectedness/topology the same, but smoothing out small noisy coastline features that can be distracting. This lets us focus on big bays over tiny inlets. You can use the width of your filter kernal / number of iterations to finely control the scale of features you preserve.



              Here I applied a median filter a few times. Cellular automata are another popular way to erode smooth shapes from a noisy input.



            Smoothed Coastline



            1. Turn the mask into a distance field, where each cell stores its distance from the smoothed coastline.

            Distance Field



            Now we see some promising feature highlights. In a signed distance field, both bays and straits show up as sharp ridges, with distance falling off to the sides. We can use an edge detection filter to pop out these ridges:



            Ridges Highlighted



            You can then distinguish between bays and straits by following the ridge to determine its connectivity. A bay is a ridge that runs toward the coast, getting shallower and shallower (in distance from land) until it ends in a point. A strait is a ridge that connects a high-distance region to another high-distance region, going through a lower-distance region along the way.



            Or, another way is to assign each island an ID (connected component search), then when you're making your distance field, propagate "closest island ID" alongside the distance frontier. A bay or inlet is then a ridge in water adjacent to the same landmass on both sides, while a channel is a ridge that separates water adjacent to two different landmasses.



            You can set minimum & maximum distance-to-shore or length-of-ridge constraints to control which features to label, if you need to exclude excessively narrow/wide straits for instance.







            share|improve this answer














            share|improve this answer



            share|improve this answer








            edited 1 hour ago

























            answered 3 hours ago









            DMGregoryDMGregory

            64.4k15113179




            64.4k15113179







            • 3




              $begingroup$
              This looks really cool, and could probably be sped up considerably by directly using the cell structure to apply the various steps rather than the graphical representation!
              $endgroup$
              – Quentin
              1 hour ago






            • 2




              $begingroup$
              The second approach (assigning each distinct landmass an ID and distinguishing based on whether it's the same landmass on both sides of the body of water) seems like the easiest thing to do..
              $endgroup$
              – Monty Harder
              24 mins ago












            • 3




              $begingroup$
              This looks really cool, and could probably be sped up considerably by directly using the cell structure to apply the various steps rather than the graphical representation!
              $endgroup$
              – Quentin
              1 hour ago






            • 2




              $begingroup$
              The second approach (assigning each distinct landmass an ID and distinguishing based on whether it's the same landmass on both sides of the body of water) seems like the easiest thing to do..
              $endgroup$
              – Monty Harder
              24 mins ago







            3




            3




            $begingroup$
            This looks really cool, and could probably be sped up considerably by directly using the cell structure to apply the various steps rather than the graphical representation!
            $endgroup$
            – Quentin
            1 hour ago




            $begingroup$
            This looks really cool, and could probably be sped up considerably by directly using the cell structure to apply the various steps rather than the graphical representation!
            $endgroup$
            – Quentin
            1 hour ago




            2




            2




            $begingroup$
            The second approach (assigning each distinct landmass an ID and distinguishing based on whether it's the same landmass on both sides of the body of water) seems like the easiest thing to do..
            $endgroup$
            – Monty Harder
            24 mins ago




            $begingroup$
            The second approach (assigning each distinct landmass an ID and distinguishing based on whether it's the same landmass on both sides of the body of water) seems like the easiest thing to do..
            $endgroup$
            – Monty Harder
            24 mins ago













            0












            $begingroup$

            Basically, you need to think about what you mean, precisely, by a bay or strait, and why you want to differentiate them (is it for AI calculations, or to label landmarks, or something else?). Play around with a few definitions to find the one that looks best to you. Then, formulate conditions to check on your Voronoi cells. A few suggestions:



            Bay



            • Any ocean cell that only connects to a single other ocean cell

            • OR: Any ocean cell that connects to more land than ocean cells, with all ocean cells next to each other

            • OR: Same as above, but with a criterion based on border length (e.g. twice as much land as water border)

            Strait



            • Any ocean cell that connects to exactly two ocean cells which are not next to each other

            • OR: Any ocean cell that connects to two land cells that don't belong to the same landmass (you need to find out which land cells are connected first, and assign IDs to each landmass)

            • OR: March around the border, and count land/water and water/land transitions. You need at least two of each.

            • Depending on your method and what you want to do with the categories, you might want to eliminate straits that only lead to a bay, or label them as bay instead.





            share|improve this answer










            New contributor




            Autolykos 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$

              Basically, you need to think about what you mean, precisely, by a bay or strait, and why you want to differentiate them (is it for AI calculations, or to label landmarks, or something else?). Play around with a few definitions to find the one that looks best to you. Then, formulate conditions to check on your Voronoi cells. A few suggestions:



              Bay



              • Any ocean cell that only connects to a single other ocean cell

              • OR: Any ocean cell that connects to more land than ocean cells, with all ocean cells next to each other

              • OR: Same as above, but with a criterion based on border length (e.g. twice as much land as water border)

              Strait



              • Any ocean cell that connects to exactly two ocean cells which are not next to each other

              • OR: Any ocean cell that connects to two land cells that don't belong to the same landmass (you need to find out which land cells are connected first, and assign IDs to each landmass)

              • OR: March around the border, and count land/water and water/land transitions. You need at least two of each.

              • Depending on your method and what you want to do with the categories, you might want to eliminate straits that only lead to a bay, or label them as bay instead.





              share|improve this answer










              New contributor




              Autolykos 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$

                Basically, you need to think about what you mean, precisely, by a bay or strait, and why you want to differentiate them (is it for AI calculations, or to label landmarks, or something else?). Play around with a few definitions to find the one that looks best to you. Then, formulate conditions to check on your Voronoi cells. A few suggestions:



                Bay



                • Any ocean cell that only connects to a single other ocean cell

                • OR: Any ocean cell that connects to more land than ocean cells, with all ocean cells next to each other

                • OR: Same as above, but with a criterion based on border length (e.g. twice as much land as water border)

                Strait



                • Any ocean cell that connects to exactly two ocean cells which are not next to each other

                • OR: Any ocean cell that connects to two land cells that don't belong to the same landmass (you need to find out which land cells are connected first, and assign IDs to each landmass)

                • OR: March around the border, and count land/water and water/land transitions. You need at least two of each.

                • Depending on your method and what you want to do with the categories, you might want to eliminate straits that only lead to a bay, or label them as bay instead.





                share|improve this answer










                New contributor




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






                $endgroup$



                Basically, you need to think about what you mean, precisely, by a bay or strait, and why you want to differentiate them (is it for AI calculations, or to label landmarks, or something else?). Play around with a few definitions to find the one that looks best to you. Then, formulate conditions to check on your Voronoi cells. A few suggestions:



                Bay



                • Any ocean cell that only connects to a single other ocean cell

                • OR: Any ocean cell that connects to more land than ocean cells, with all ocean cells next to each other

                • OR: Same as above, but with a criterion based on border length (e.g. twice as much land as water border)

                Strait



                • Any ocean cell that connects to exactly two ocean cells which are not next to each other

                • OR: Any ocean cell that connects to two land cells that don't belong to the same landmass (you need to find out which land cells are connected first, and assign IDs to each landmass)

                • OR: March around the border, and count land/water and water/land transitions. You need at least two of each.

                • Depending on your method and what you want to do with the categories, you might want to eliminate straits that only lead to a bay, or label them as bay instead.






                share|improve this answer










                New contributor




                Autolykos 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 3 mins ago





















                New contributor




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









                answered 15 mins ago









                AutolykosAutolykos

                1011




                1011




                New contributor




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





                New contributor





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






                Autolykos 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%2f169723%2fhow-can-bays-and-straits-be-determined-in-a-procedurally-generated-map%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

                    acmart: Multiple authors: all with same affiliation, one author an additional affiliationHow to Write Names of Multiple Authors with Shared Affiliation in ACM 2017 Template?Multiple authors with different primary affiliation, but same additional affiliationSame affiliation for all authors without extra packagesIOS-Book-Article.cls: one author with multiple affiliationacmart: Shared Author AffiliationMultiple authors with different primary affiliation, but same additional affiliationAuthor affiliation with only 1 authorAdding Multiple Authors with Different Affiliation in LaTeX ArticleLaTeX: Multiple authors stays on same lineHow to Label Multiple Authors with Same DescriptionHow to make two authors use the same affiliationTwo authors with same affiliation on finished front page

                    inputenc: Unicode character … not set up for use with LaTeX The Next CEO of Stack OverflowEntering Unicode characters in LaTeXHow to solve the `Package inputenc Error: Unicode char not set up for use with LaTeX` problem?solve “Unicode char is not set up for use with LaTeX” without special handling of every new interesting UTF-8 characterPackage inputenc Error: Unicode character ² (U+B2)(inputenc) not set up for use with LaTeX. acroI2C[I²C]package inputenc error unicode char (u + 190) not set up for use with latexPackage inputenc Error: Unicode char u8:′ not set up for use with LaTeX. 3′inputenc Error: Unicode char u8: not set up for use with LaTeX with G-BriefPackage Inputenc Error: Unicode char u8: not set up for use with LaTeXPackage inputenc Error: Unicode char ́ (U+301)(inputenc) not set up for use with LaTeX. includePackage inputenc Error: Unicode char ̂ (U+302)(inputenc) not set up for use with LaTeX. … $widehatleft (OA,AA' right )$Package inputenc Error: Unicode char â„¡ (U+2121)(inputenc) not set up for use with LaTeX. printbibliography[heading=bibintoc]Package inputenc Error: Unicode char − (U+2212)(inputenc) not set up for use with LaTeXPackage inputenc Error: Unicode character α (U+3B1) not set up for use with LaTeXPackage inputenc Error: Unicode characterError: ! Package inputenc Error: Unicode char ⊘ (U+2298)(inputenc) not set up for use with LaTeX

                    Problem using RevTeX4-1 with “! Undefined control sequence. @bibitemShut”