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

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

How can I prevent hyper evolved versions of regular creatures from wiping out their cousins?

LWC SFDX source push error TypeError: LWC1009: decl.moveTo is not a function

What is the word for reserving something for yourself before others do?

Why can't we play rap on piano?

Doing something right before you need it - expression for this?

What would happen to a modern skyscraper if it rains micro blackholes?

Paid for article while in US on F-1 visa?

"You are your self first supporter", a more proper way to say it

Why is Minecraft giving an OpenGL error?

How does quantile regression compare to logistic regression with the variable split at the quantile?

Client team has low performances and low technical skills: we always fix their work and now they stop collaborate with us. How to solve?

Did Shadowfax go to Valinor?

Horror movie about a virus at the prom; beginning and end are stylized as a cartoon

Why is 150k or 200k jobs considered good when there's 300k+ births a month?

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

How does one intimidate enemies without having the capacity for violence?

How much of data wrangling is a data scientist's job?

How to determine what difficulty is right for the game?

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

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

High voltage LED indicator 40-1000 VDC without additional power supply

LaTeX: Why are digits allowed in environments, but forbidden in commands?

A case of the sniffles



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;








23












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







  • 2




    $begingroup$
    I recommend a baysian classifier.
    $endgroup$
    – Acccumulation
    10 hours ago

















23












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







  • 2




    $begingroup$
    I recommend a baysian classifier.
    $endgroup$
    – Acccumulation
    10 hours ago













23












23








23


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$




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 15 hours ago







Olin Kirkland

















asked 19 hours ago









Olin KirklandOlin Kirkland

1258




1258







  • 2




    $begingroup$
    I recommend a baysian classifier.
    $endgroup$
    – Acccumulation
    10 hours ago












  • 2




    $begingroup$
    I recommend a baysian classifier.
    $endgroup$
    – Acccumulation
    10 hours ago







2




2




$begingroup$
I recommend a baysian classifier.
$endgroup$
– Acccumulation
10 hours ago




$begingroup$
I recommend a baysian classifier.
$endgroup$
– Acccumulation
10 hours ago










3 Answers
3






active

oldest

votes


















36












$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




  2. 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




  3. 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$








  • 7




    $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
    12 hours ago






  • 5




    $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
    11 hours ago


















9












$begingroup$

The way Dragons Abound identifies bays is to walk along the coastline and find two spots on the coastline where the straight-line distance between the spots is less than the distance along the coastline between the spots. This is the sinuosity of the coastline between the two spots. By selecting a sinuosity limit and limits for the straight-line distance between the spots you can identify narrow deep bays, wide shallow bays, etc.



In this picture, the red and purple dots show the two candidate points and the green line is the coastline between the points. The sinuosity is the ratio of those two lengths:



Example of a Bay



Alternatively, you can select two points on the coast and create a polygon by connecting the two points and the coastline between the two points (i.e., connect the green line above from red dot to purple dot). Measure the area of this polygon. A bay will have a larger area than a non-bay.



In my experience, a combination of these two measures was best for reliably identifying what people see as bays.



Note that this will also detect points. To find only bays, you need to check that the "inside" of the bay contains water and not land. A quick and easy way to do this is to check the midpoint of the line between the two points to see if it is water. (This can be fooled but is generally sufficient.)



A related problem is to identify the "mouth" of the bay -- i.e., the best choice for the two points that mark the opening to the bay. Typically you'll have a bunch of candidates for the "mouth". In the example map above, you could put the mouth of that bay further in or further out. Generally speaking it probably doesn't matter too much, but one heuristic that works reasonably well is to minimize the straight-line distance across the mouth.



I haven't done straits yet, but my intuition is to check points along the coastline to find the closest point on any other coastline; if that is under some set limit it is a strait.






share|improve this answer








New contributor




Dr. Pain 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$

    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$








    • 2




      $begingroup$
      When a strait leads to a bay, then these two together might be labeled as a fjord.
      $endgroup$
      – Philipp
      10 hours ago











    • $begingroup$
      If the cells are small relative to the size of a bay/strait, then you might need to propagate this to look at cells beyond the immediately adjacent neighbours.
      $endgroup$
      – DMGregory
      9 hours ago










    • $begingroup$
      Yes, scaling is a bit of an issue, and will impact how you define things and declare 'cells'. Consider a map of Canada, and compare the following: Hudson Bay, James Bay, Gulf of St Lawrence, and Bay of Fundy. How do you reliably apply these rules to get the desired related names? - Is there a "straight" between Newfoundland and Nova Scotia?
      $endgroup$
      – TheLuckless
      8 hours ago











    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

























    3 Answers
    3






    active

    oldest

    votes








    3 Answers
    3






    active

    oldest

    votes









    active

    oldest

    votes






    active

    oldest

    votes









    36












    $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




    2. 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




    3. 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$








    • 7




      $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
      12 hours ago






    • 5




      $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
      11 hours ago















    36












    $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




    2. 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




    3. 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$








    • 7




      $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
      12 hours ago






    • 5




      $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
      11 hours ago













    36












    36








    36





    $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




    2. 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




    3. 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




    2. 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




    3. 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 8 hours ago









    Alexandre Vaillancourt

    12.8k114149




    12.8k114149










    answered 14 hours ago









    DMGregoryDMGregory

    64.4k15115179




    64.4k15115179







    • 7




      $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
      12 hours ago






    • 5




      $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
      11 hours ago












    • 7




      $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
      12 hours ago






    • 5




      $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
      11 hours ago







    7




    7




    $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
    12 hours 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
    12 hours ago




    5




    5




    $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
    11 hours 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
    11 hours ago













    9












    $begingroup$

    The way Dragons Abound identifies bays is to walk along the coastline and find two spots on the coastline where the straight-line distance between the spots is less than the distance along the coastline between the spots. This is the sinuosity of the coastline between the two spots. By selecting a sinuosity limit and limits for the straight-line distance between the spots you can identify narrow deep bays, wide shallow bays, etc.



    In this picture, the red and purple dots show the two candidate points and the green line is the coastline between the points. The sinuosity is the ratio of those two lengths:



    Example of a Bay



    Alternatively, you can select two points on the coast and create a polygon by connecting the two points and the coastline between the two points (i.e., connect the green line above from red dot to purple dot). Measure the area of this polygon. A bay will have a larger area than a non-bay.



    In my experience, a combination of these two measures was best for reliably identifying what people see as bays.



    Note that this will also detect points. To find only bays, you need to check that the "inside" of the bay contains water and not land. A quick and easy way to do this is to check the midpoint of the line between the two points to see if it is water. (This can be fooled but is generally sufficient.)



    A related problem is to identify the "mouth" of the bay -- i.e., the best choice for the two points that mark the opening to the bay. Typically you'll have a bunch of candidates for the "mouth". In the example map above, you could put the mouth of that bay further in or further out. Generally speaking it probably doesn't matter too much, but one heuristic that works reasonably well is to minimize the straight-line distance across the mouth.



    I haven't done straits yet, but my intuition is to check points along the coastline to find the closest point on any other coastline; if that is under some set limit it is a strait.






    share|improve this answer








    New contributor




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






    $endgroup$

















      9












      $begingroup$

      The way Dragons Abound identifies bays is to walk along the coastline and find two spots on the coastline where the straight-line distance between the spots is less than the distance along the coastline between the spots. This is the sinuosity of the coastline between the two spots. By selecting a sinuosity limit and limits for the straight-line distance between the spots you can identify narrow deep bays, wide shallow bays, etc.



      In this picture, the red and purple dots show the two candidate points and the green line is the coastline between the points. The sinuosity is the ratio of those two lengths:



      Example of a Bay



      Alternatively, you can select two points on the coast and create a polygon by connecting the two points and the coastline between the two points (i.e., connect the green line above from red dot to purple dot). Measure the area of this polygon. A bay will have a larger area than a non-bay.



      In my experience, a combination of these two measures was best for reliably identifying what people see as bays.



      Note that this will also detect points. To find only bays, you need to check that the "inside" of the bay contains water and not land. A quick and easy way to do this is to check the midpoint of the line between the two points to see if it is water. (This can be fooled but is generally sufficient.)



      A related problem is to identify the "mouth" of the bay -- i.e., the best choice for the two points that mark the opening to the bay. Typically you'll have a bunch of candidates for the "mouth". In the example map above, you could put the mouth of that bay further in or further out. Generally speaking it probably doesn't matter too much, but one heuristic that works reasonably well is to minimize the straight-line distance across the mouth.



      I haven't done straits yet, but my intuition is to check points along the coastline to find the closest point on any other coastline; if that is under some set limit it is a strait.






      share|improve this answer








      New contributor




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






      $endgroup$















        9












        9








        9





        $begingroup$

        The way Dragons Abound identifies bays is to walk along the coastline and find two spots on the coastline where the straight-line distance between the spots is less than the distance along the coastline between the spots. This is the sinuosity of the coastline between the two spots. By selecting a sinuosity limit and limits for the straight-line distance between the spots you can identify narrow deep bays, wide shallow bays, etc.



        In this picture, the red and purple dots show the two candidate points and the green line is the coastline between the points. The sinuosity is the ratio of those two lengths:



        Example of a Bay



        Alternatively, you can select two points on the coast and create a polygon by connecting the two points and the coastline between the two points (i.e., connect the green line above from red dot to purple dot). Measure the area of this polygon. A bay will have a larger area than a non-bay.



        In my experience, a combination of these two measures was best for reliably identifying what people see as bays.



        Note that this will also detect points. To find only bays, you need to check that the "inside" of the bay contains water and not land. A quick and easy way to do this is to check the midpoint of the line between the two points to see if it is water. (This can be fooled but is generally sufficient.)



        A related problem is to identify the "mouth" of the bay -- i.e., the best choice for the two points that mark the opening to the bay. Typically you'll have a bunch of candidates for the "mouth". In the example map above, you could put the mouth of that bay further in or further out. Generally speaking it probably doesn't matter too much, but one heuristic that works reasonably well is to minimize the straight-line distance across the mouth.



        I haven't done straits yet, but my intuition is to check points along the coastline to find the closest point on any other coastline; if that is under some set limit it is a strait.






        share|improve this answer








        New contributor




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






        $endgroup$



        The way Dragons Abound identifies bays is to walk along the coastline and find two spots on the coastline where the straight-line distance between the spots is less than the distance along the coastline between the spots. This is the sinuosity of the coastline between the two spots. By selecting a sinuosity limit and limits for the straight-line distance between the spots you can identify narrow deep bays, wide shallow bays, etc.



        In this picture, the red and purple dots show the two candidate points and the green line is the coastline between the points. The sinuosity is the ratio of those two lengths:



        Example of a Bay



        Alternatively, you can select two points on the coast and create a polygon by connecting the two points and the coastline between the two points (i.e., connect the green line above from red dot to purple dot). Measure the area of this polygon. A bay will have a larger area than a non-bay.



        In my experience, a combination of these two measures was best for reliably identifying what people see as bays.



        Note that this will also detect points. To find only bays, you need to check that the "inside" of the bay contains water and not land. A quick and easy way to do this is to check the midpoint of the line between the two points to see if it is water. (This can be fooled but is generally sufficient.)



        A related problem is to identify the "mouth" of the bay -- i.e., the best choice for the two points that mark the opening to the bay. Typically you'll have a bunch of candidates for the "mouth". In the example map above, you could put the mouth of that bay further in or further out. Generally speaking it probably doesn't matter too much, but one heuristic that works reasonably well is to minimize the straight-line distance across the mouth.



        I haven't done straits yet, but my intuition is to check points along the coastline to find the closest point on any other coastline; if that is under some set limit it is a strait.







        share|improve this answer








        New contributor




        Dr. Pain 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




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









        answered 8 hours ago









        Dr. PainDr. Pain

        1912




        1912




        New contributor




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





        New contributor





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






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





















            4












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








            • 2




              $begingroup$
              When a strait leads to a bay, then these two together might be labeled as a fjord.
              $endgroup$
              – Philipp
              10 hours ago











            • $begingroup$
              If the cells are small relative to the size of a bay/strait, then you might need to propagate this to look at cells beyond the immediately adjacent neighbours.
              $endgroup$
              – DMGregory
              9 hours ago










            • $begingroup$
              Yes, scaling is a bit of an issue, and will impact how you define things and declare 'cells'. Consider a map of Canada, and compare the following: Hudson Bay, James Bay, Gulf of St Lawrence, and Bay of Fundy. How do you reliably apply these rules to get the desired related names? - Is there a "straight" between Newfoundland and Nova Scotia?
              $endgroup$
              – TheLuckless
              8 hours ago















            4












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








            • 2




              $begingroup$
              When a strait leads to a bay, then these two together might be labeled as a fjord.
              $endgroup$
              – Philipp
              10 hours ago











            • $begingroup$
              If the cells are small relative to the size of a bay/strait, then you might need to propagate this to look at cells beyond the immediately adjacent neighbours.
              $endgroup$
              – DMGregory
              9 hours ago










            • $begingroup$
              Yes, scaling is a bit of an issue, and will impact how you define things and declare 'cells'. Consider a map of Canada, and compare the following: Hudson Bay, James Bay, Gulf of St Lawrence, and Bay of Fundy. How do you reliably apply these rules to get the desired related names? - Is there a "straight" between Newfoundland and Nova Scotia?
              $endgroup$
              – TheLuckless
              8 hours ago













            4












            4








            4





            $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 11 hours 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 11 hours ago









            AutolykosAutolykos

            1412




            1412




            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.







            • 2




              $begingroup$
              When a strait leads to a bay, then these two together might be labeled as a fjord.
              $endgroup$
              – Philipp
              10 hours ago











            • $begingroup$
              If the cells are small relative to the size of a bay/strait, then you might need to propagate this to look at cells beyond the immediately adjacent neighbours.
              $endgroup$
              – DMGregory
              9 hours ago










            • $begingroup$
              Yes, scaling is a bit of an issue, and will impact how you define things and declare 'cells'. Consider a map of Canada, and compare the following: Hudson Bay, James Bay, Gulf of St Lawrence, and Bay of Fundy. How do you reliably apply these rules to get the desired related names? - Is there a "straight" between Newfoundland and Nova Scotia?
              $endgroup$
              – TheLuckless
              8 hours ago












            • 2




              $begingroup$
              When a strait leads to a bay, then these two together might be labeled as a fjord.
              $endgroup$
              – Philipp
              10 hours ago











            • $begingroup$
              If the cells are small relative to the size of a bay/strait, then you might need to propagate this to look at cells beyond the immediately adjacent neighbours.
              $endgroup$
              – DMGregory
              9 hours ago










            • $begingroup$
              Yes, scaling is a bit of an issue, and will impact how you define things and declare 'cells'. Consider a map of Canada, and compare the following: Hudson Bay, James Bay, Gulf of St Lawrence, and Bay of Fundy. How do you reliably apply these rules to get the desired related names? - Is there a "straight" between Newfoundland and Nova Scotia?
              $endgroup$
              – TheLuckless
              8 hours ago







            2




            2




            $begingroup$
            When a strait leads to a bay, then these two together might be labeled as a fjord.
            $endgroup$
            – Philipp
            10 hours ago





            $begingroup$
            When a strait leads to a bay, then these two together might be labeled as a fjord.
            $endgroup$
            – Philipp
            10 hours ago













            $begingroup$
            If the cells are small relative to the size of a bay/strait, then you might need to propagate this to look at cells beyond the immediately adjacent neighbours.
            $endgroup$
            – DMGregory
            9 hours ago




            $begingroup$
            If the cells are small relative to the size of a bay/strait, then you might need to propagate this to look at cells beyond the immediately adjacent neighbours.
            $endgroup$
            – DMGregory
            9 hours ago












            $begingroup$
            Yes, scaling is a bit of an issue, and will impact how you define things and declare 'cells'. Consider a map of Canada, and compare the following: Hudson Bay, James Bay, Gulf of St Lawrence, and Bay of Fundy. How do you reliably apply these rules to get the desired related names? - Is there a "straight" between Newfoundland and Nova Scotia?
            $endgroup$
            – TheLuckless
            8 hours ago




            $begingroup$
            Yes, scaling is a bit of an issue, and will impact how you define things and declare 'cells'. Consider a map of Canada, and compare the following: Hudson Bay, James Bay, Gulf of St Lawrence, and Bay of Fundy. How do you reliably apply these rules to get the desired related names? - Is there a "straight" between Newfoundland and Nova Scotia?
            $endgroup$
            – TheLuckless
            8 hours ago

















            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

            Reverse int within the 32-bit signed integer range: [−2^31, 2^31 − 1]Combining two 32-bit integers into one 64-bit integerDetermine if an int is within rangeLossy packing 32 bit integer to 16 bitComputing the square root of a 64-bit integerKeeping integer addition within boundsSafe multiplication of two 64-bit signed integersLeetcode 10: Regular Expression MatchingSigned integer-to-ascii x86_64 assembler macroReverse the digits of an Integer“Add two numbers given in reverse order from a linked list”

            Category:Fedor von Bock Media in category "Fedor von Bock"Navigation menuUpload mediaISNI: 0000 0000 5511 3417VIAF ID: 24712551GND ID: 119294796Library of Congress authority ID: n96068363BnF ID: 12534305fSUDOC authorities ID: 034604189Open Library ID: OL338253ANKCR AUT ID: jn19990000869National Library of Israel ID: 000514068National Thesaurus for Author Names ID: 341574317ReasonatorScholiaStatistics

            Kiel Indholdsfortegnelse Historie | Transport og færgeforbindelser | Sejlsport og anden sport | Kultur | Kendte personer fra Kiel | Noter | Litteratur | Eksterne henvisninger | Navigationsmenuwww.kiel.de54°19′31″N 10°8′26″Ø / 54.32528°N 10.14056°Ø / 54.32528; 10.14056Oberbürgermeister Dr. Ulf Kämpferwww.statistik-nord.deDen danske Stats StatistikKiels hjemmesiderrrWorldCat312794080n790547494030481-4