Last call to make your voice heard! Our 2022 Developer Survey closes in less than a week. Take survey.
48 votes

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

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 ...
user avatar
  • 113k
39 votes

Procedurally generate regions on island

In the real world, those provincial borders will often be following geological features like rivers. So maybe a good approach would be to model the geology of the island and have the borders fall out ...
user avatar
  • 3,669
35 votes
Accepted

Algorithm for procedureral 2D map with connected paths

One of the best, and most used, algorithms I've seen out there is generating dungeons using Binary Space Partitioning. The best general explanation I've read is the one found in The Chronicles of ...
user avatar
  • 2,298
32 votes

Continents with Simplex noise

It looks like you're looking for "Turbulence", "Fractional Brownian Motion", or something similar. This is where we take multiple samples of the noise at different scales - like the different panes ...
user avatar
  • 113k
30 votes
Accepted

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

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 ...
user avatar
  • 416
27 votes
Accepted

Why is this Procedural Content Generation while that other isn't?

By way of analogy A circuit does not generate power. A light bulb does not generate power. A battery does not generate power. None of the things which use or store generated power, are power ...
user avatar
  • 29.1k
27 votes

Procedurally generate regions on island

I would solve this problem with two passes of Voronoi diagrams: First Pass: Region Partitioning The first pass would use a somewhat sparse distribution of points (i.e. the distance between the points ...
user avatar
  • 8,595
25 votes
Accepted

Generating tile map

What you could do is randomly generate a Voronoi map like this: Picking random center points (see the black dots) and randomly decide if they are grass or dirt. ...
user avatar
  • 10.5k
25 votes

Generating tile map

You could use perlin noise, which is normaly used for heightmap generation. Perlin noise in games Then you could use the heights as an adviser, how high the chance of grass/dirt occuring in one ...
user avatar
  • 465
23 votes

Matching a chunk of procedurally generated world to a chunk of other world

Use a slice of higher-order noise. If you used 2d noise for a height-map before, use 3D noise with the last coordinate fixed instead. Now you can slowly change the position in the last dimension to ...
user avatar
  • 5,571
23 votes
Accepted

How to generate a city street network?

A good place to start with procedural city generation is Parish and Müller's Procedural Modeling of Cities. Their paper presents an L-System in which rules concerning population density & road ...
user avatar
  • 8,595
23 votes
Accepted

How do Minecraft know where village's buildings are if the village is not generated yet?

Yes, it generates more chunks (or at least more of the village tree) than you think it does. This is what I call "area of interest" in my voxel code. There are two kinds of area of interest: Logical (...
user avatar
  • 29.1k
19 votes
Accepted

Using L-Systems to procedurally generate cities

L-Systems, from what I can tell*, are a set of grammar-like substitution rules that you can apply recursively to get interesting, "organic" results. Plants are where L-Systems are often used, as they ...
user avatar
  • 14.5k
19 votes
Accepted

What is the difference between “dynamic generation” and “procedural generation”?

"Procedural" means that some algorithm made the content. This is opposed to content being created manually by a human. "Dynamic" means that the content changes over time. This is opposed to "static" ...
user avatar
18 votes
Accepted

How to report bugs found on procedurally generated levels?

It can also be very useful when your map generation algorithm is deterministic and repeatable based on an initial seed value. So when you enter the same seed value, you get the same map. This might be ...
user avatar
  • 111k
16 votes

Procedurally generating a building of specific area

A simple way to build a procedural generator is: Randomly build things Run a function that checks whether the output is good If the output is not good, go to step 1 Even if it takes thousands of ...
user avatar
  • 14.5k
16 votes

Procedural generation of semi-correct planetary systems

Simplify to 2-body physics. N-body physics is in general chaotic and you cannot simulate them to a stable orbit. Single stars For systems with a single star, I'd ignore the N-body problem and just ...
user avatar
  • 8,954
16 votes
Accepted

How to Instantiate an array of Prefabs in a chequerboard pattern

In the decision on what tile prefab to choose, you can think of it this way: If (xCoord + yCoord) % 2 == 0, then select prefab1 If (xCoord + yCoord) % 2 != 0, then select prefab2 This ensures the ...
user avatar
15 votes
Accepted

How can I generate a (relatively) linear dungeon path?

Requirements You want multiple paths from A to B. You want to work in grid space, presumably this is tile space for your side-scroller. You don't want paths to cross, or it will spoil game ...
user avatar
  • 29.1k
15 votes
Accepted

How would I go about generating a star map?

A Poisson-Disk sampling distribution will allow you to select random points a minimum distance apart & Bridson's algorithm can efficiently solve the problem in O(n) - fast enough for real time ...
user avatar
  • 8,595
15 votes

How can I fix zig-zagging UV mapping artifacts on a generated mesh that tapers?

Typical UV mapping is what's called an affine transformation. That means the mapping of each triangle between 3D space and texture space can include rotation, translation, scaling/squash, and skew (ie....
user avatar
  • 113k
14 votes
Accepted

Name generation

Most name generators work via some variation of Markov Chain, which are fairly remarkable (remarkovle?) constructs that have many uses in games, as well as other domains. The basic approach does ...
user avatar
14 votes
Accepted

How do I generate random mountains in a sidescroller?

You want to mix different wave lengths with different levels of intensity. E.G. Have one long wave, that has a high intensity, and a short wave with low intensity. Now add the two(or more) waves ...
user avatar
  • 1,943
14 votes
Accepted

How to randomly generate biome with perlin noise?

There are three main steps here: Use some method to assign biomes to regions (this is the hard part, with multiple strategies I'll break down shortly) For each point in your mesh or tile/node in ...
user avatar
  • 113k
13 votes

How to load a spherical planet and its regions?

As you've already shown, there are a number of solutions to this problem, but none 100% ideal. Spheres are tricky. Cube-based One common route, used by Spore and quite likely other games (though it'...
user avatar
  • 113k
13 votes
Accepted

Procedural generation of semi-correct planetary systems

In order to create a plausible solar system, make sure every orbit is within the sphere of influence of the parent body, but not within the hill sphere or roche limit of another body. The sphere of ...
user avatar
  • 111k
12 votes
Accepted

Axis Aligned Spatial Division : Divide space into random rectangles?

The approach you outline is simple and useful, but suffers from terrible artifacts as shown. Avoid it. You need a parallel growth algorithm; for a single-threaded model, a round-robin approach follows:...
user avatar
  • 29.1k
12 votes
Accepted

Fast, simple procedural 2d island generation

One thing I've done in the past for island shapes is to use perlin noise minus a circular shape. It usually produces one big island and some little things off on the side. You can use flood fill or ...
user avatar
  • 5,856
12 votes

How do I programatically lay tiles with the Godot engine?

You can programmatically set a cell in the TileMap class by using the set_cell function. Note: if you're new to an engine & ...
user avatar
  • 8,595

Only top scored, non community-wiki answers of a minimum length are eligible