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;
$begingroup$
I've got a procedurally generated map using Voronoi cells, with a defined sea level and a believable height map.

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
$endgroup$
add a comment |
$begingroup$
I've got a procedurally generated map using Voronoi cells, with a defined sea level and a believable height map.

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
$endgroup$
add a comment |
$begingroup$
I've got a procedurally generated map using Voronoi cells, with a defined sea level and a believable height map.

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
$endgroup$
I've got a procedurally generated map using Voronoi cells, with a defined sea level and a believable height map.

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
procedural-generation maps graphics-programming simulations
edited 4 hours ago
Olin Kirkland
asked 8 hours ago
Olin KirklandOlin Kirkland
506
506
add a comment |
add a comment |
2 Answers
2
active
oldest
votes
$begingroup$
Here's a rough idea using image processing transformations to isolate the features of interest:
- 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. ;)

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.

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

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:

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.
$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
add a comment |
$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.
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$
add a comment |
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
);
);
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
var $window = $(window),
onScroll = function(e)
var $elem = $('.new-login-left'),
docViewTop = $window.scrollTop(),
docViewBottom = docViewTop + $window.height(),
elemTop = $elem.offset().top,
elemBottom = elemTop + $elem.height();
if ((docViewTop elemBottom))
StackExchange.using('gps', function() StackExchange.gps.track('embedded_signup_form.view', location: 'question_page' ); );
$window.unbind('scroll', onScroll);
;
$window.on('scroll', onScroll);
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
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
$begingroup$
Here's a rough idea using image processing transformations to isolate the features of interest:
- 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. ;)

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.

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

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:

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.
$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
add a comment |
$begingroup$
Here's a rough idea using image processing transformations to isolate the features of interest:
- 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. ;)

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.

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

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:

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.
$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
add a comment |
$begingroup$
Here's a rough idea using image processing transformations to isolate the features of interest:
- 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. ;)

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.

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

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:

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.
$endgroup$
Here's a rough idea using image processing transformations to isolate the features of interest:
- 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. ;)

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.

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

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:

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.
edited 1 hour ago
answered 3 hours ago
DMGregory♦DMGregory
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
add a comment |
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
add a comment |
$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.
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$
add a comment |
$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.
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$
add a comment |
$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.
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.
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.
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.
add a comment |
add a comment |
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.
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
var $window = $(window),
onScroll = function(e)
var $elem = $('.new-login-left'),
docViewTop = $window.scrollTop(),
docViewBottom = docViewTop + $window.height(),
elemTop = $elem.offset().top,
elemBottom = elemTop + $elem.height();
if ((docViewTop elemBottom))
StackExchange.using('gps', function() StackExchange.gps.track('embedded_signup_form.view', location: 'question_page' ); );
$window.unbind('scroll', onScroll);
;
$window.on('scroll', onScroll);
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
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
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
var $window = $(window),
onScroll = function(e)
var $elem = $('.new-login-left'),
docViewTop = $window.scrollTop(),
docViewBottom = docViewTop + $window.height(),
elemTop = $elem.offset().top,
elemBottom = elemTop + $elem.height();
if ((docViewTop elemBottom))
StackExchange.using('gps', function() StackExchange.gps.track('embedded_signup_form.view', location: 'question_page' ); );
$window.unbind('scroll', onScroll);
;
$window.on('scroll', onScroll);
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
var $window = $(window),
onScroll = function(e)
var $elem = $('.new-login-left'),
docViewTop = $window.scrollTop(),
docViewBottom = docViewTop + $window.height(),
elemTop = $elem.offset().top,
elemBottom = elemTop + $elem.height();
if ((docViewTop elemBottom))
StackExchange.using('gps', function() StackExchange.gps.track('embedded_signup_form.view', location: 'question_page' ); );
$window.unbind('scroll', onScroll);
;
$window.on('scroll', onScroll);
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
var $window = $(window),
onScroll = function(e)
var $elem = $('.new-login-left'),
docViewTop = $window.scrollTop(),
docViewBottom = docViewTop + $window.height(),
elemTop = $elem.offset().top,
elemBottom = elemTop + $elem.height();
if ((docViewTop elemBottom))
StackExchange.using('gps', function() StackExchange.gps.track('embedded_signup_form.view', location: 'question_page' ); );
$window.unbind('scroll', onScroll);
;
$window.on('scroll', onScroll);
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
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