Skip to main content
42 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 ...
Bram's user avatar
  • 3,744
29 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 ...
Pikalek's user avatar
  • 13.4k
6 votes

How do I store destructible terrain that characters can walk on?

Storage of destructible terrain For the terrain I would recommend looking at the quadtree data structure. It provides an efficient way to store destructible terrain. For an excellent, in-depth ...
Jelle van Campen's user avatar
5 votes

Terrain not rendering underneath

This is due to Back-Face Culling. You'll have to create a shader and set "Cull Off" in the SubShader section: See Unity Documentation on shaders. Be warned that the normals will be inverted on the ...
Stephane Hockenhull's user avatar
5 votes
Accepted

How can I generate terrain like SimCity 3000 does?

Sim city uses a an XY grid, and the heights are discrete. In addition to this, the slopes seem to be limited to one "step" up or down. So just handle all possible cases for a grid-cell. Each cell ...
Bram's user avatar
  • 3,744
5 votes

Scan for water in 2D procedural terrain locale

This is a maximum subarray problem in disguise! It's a popular interview question. Instead of finding subarray sums, we're finding terrain that can hold water, and instead of finding the biggest ...
congusbongus's user avatar
  • 14.9k
5 votes

Procedurally generated terrain that has some caves

You'll probably want to do a 2nd pass and carve caves after doing the regular quick height-map generation pass. Find a steep slope in the low-frequency height map layer (if you use multiple ...
Stephane Hockenhull's user avatar
5 votes

Procedurally generate regions on island

MineCraft does this nicely, and its world generation algorithm has been analyzed and documented thoroughly. There are various descriptions of the algorithm, one of them here: https://github.com/...
Guntram Blohm's user avatar
5 votes

Procedurally generate regions on island

A typical algorithm used, for example, by Azgaar (source code). Is roughly like this: split your landmass into smaller areas, e.g. through delauny triangulation or voronoi cells. determine (randomly ...
Tom's user avatar
  • 1,323
4 votes

How can I make caves with Unity's terrain creator?

Starting from Unity 2019.3, you can properly cut holes in terrain surface (see https://blogs.unity3d.com/2019/08/27/unity-2019-3-beta-is-now-available/#attachment_82836) However, this won't create the ...
Casto's user avatar
  • 141
4 votes

Unity: Create large Terrain with accurate raycast detection?

(1) Notes on terrain systems Outdoor scenes are always a challenge to render and interact with, given viewing distance and subsequent complexity involved. This is just a reality of outdoor terrain. ...
Engineer's user avatar
  • 30.4k
4 votes

Generate cave like Terrain in 2D

You could generate, analyse and discard random noise fields. Just generate thousands of them, and keep the ones that have a fully enclosing wall on the outside. For generation, I would use Simplex ...
Bram's user avatar
  • 3,744
4 votes
Accepted

Diamond Square Algorithm - How to fix horrible diamond shaped artefacts and spikes?

The main issue is your code for DiamondStep is the same as for SquareStep. As a result, it is populating the uninitialized target point using other uninitialized points. It should be using points in a ...
stewbasic's user avatar
  • 170
3 votes

Generate cave like Terrain in 2D

I think you will get similar results if you do it like this. Start with some points in a circle around your cave area. Jitter the points by moving each one randomly from it's starting position. ...
Jay's user avatar
  • 822
3 votes

How to blend biomes with procedural terrain

While this is an old question, I feel like I have something useful to contribute. The world generator I'm currently building uses two functions for each biome \$i\$: The classical heightmap-function \...
LukeG's user avatar
  • 1,557
3 votes

How to place grass on custom terrain mesh

This is an old topic, but it's still valid. There are a couple of ways you can handle grass outside of Unity's Terrain System. The simplest way is to create your own planar mesh and apply a shader ...
user3345048's user avatar
3 votes
Accepted

Effective & Efficient Way to Simulate a Desert

Notes: I know this is about Egypt, but I will not make this specific to Egypt... because people coming here may find this question and its answers useful for other desert simulations. I am trying to ...
Theraot's user avatar
  • 28.2k
3 votes

How to avoid the cutoff of a Sprite when overlapping in a terrain?

You can force the sprite to render always on top by disabling the depth testing in the sprite's material. ...
Jay's user avatar
  • 822
3 votes

Midpoint displacement generating unsatisfactory terrain

The magnitude of your random displacement is not changing appropriately. For your initial points, you're using a random value between 0 and 10. But for the subdivisions you're only using a random ...
user1118321's user avatar
  • 2,642
3 votes

Procedurally generate regions on island

If you are interested in doing this in vectorial format rather than raster-based approaches, I have written a blog post a while ago about pretty much exactly this. The idea is you start with a mesh (...
Wouter Lievens's user avatar
3 votes

Procedurally generate regions on island

What a fun question :) This approach is kinda based on Vornoi cells but the distance metric isn't quite Euclidian (I used the power of 1.5 instead of 2.0) and has some randomness built into it. It may ...
NikoNyrh's user avatar
  • 131
3 votes

Procedurally generate regions on island

It just so happens that I found a VERY easy solution to this problem. I use a Flood-Fill technique as follows. First I create a number of random seed locations on the map. Then I use Flood-Fill to &...
Tarzan's user avatar
  • 31
3 votes
Accepted

How to make many perlin noise function match

Do not assign a biome per chunk. Instead, compute your biome as a function of position. There are a few popular ways to do this... Compute the low-frequency levels of your height map first (the ...
DMGregory's user avatar
  • 141k
3 votes
Accepted

Convert a dot product scalar for a triangle's slope, into a translation ratio?

I don't understand your setup. However, 0.707106 looks familiar to me. It is approximately this: $$\frac{1}{\sqrt{2}}$$ And you say that is a 45º slope, right? So, ...
Theraot's user avatar
  • 28.2k
2 votes
Accepted

Determining and Re-Considering Trapped Targets when Path-finding

Break your graph up into connected components (See also). (Image source) This will have a high initial cost, but recomputation is cheap: when a wall is added, check if it disjointed a connected ...
BlueRaja - Danny Pflughoeft's user avatar
2 votes
Accepted

Procedurally generated terrain that has some caves

A blog post at the accidental noise library addresses exactly this issue. It offers the solution of perturbing the xy values, and of a single-pass implicit solution that creates caves that narrow as ...
Bram's user avatar
  • 3,744
2 votes

Handmade Terrain vs. Terrain Engine in Unity?

Polybrush - Polybrush is a free tool, that allows unique terrain sculpting. It may have a feature to blend between terrains. Or you can use this as a main terrain solution. There are many ways to ...
Candid Moon _Max_'s user avatar
2 votes

Diamond square texture: too-diamond-ish?

While this is an old question, it still ranks on google and the marked answer does not explain the artefacts seen in the output. I have just implemented this algorithm (for fun) in c# using linqpad ...
kas's user avatar
  • 21
2 votes
Accepted

Diamond square texture: too-diamond-ish?

Your code cites the Wikipedia article, which in turn has a section called "Artifacts and Extensions" that observes a potential problem: The diamond-square algorithm was analyzed by Gavin S. P. ...
Pikalek's user avatar
  • 13.4k
2 votes
Accepted

How to add prefabs to the terrain and still retain scripts, colliders, etc.?

There’s no way to do it directly because they are no longer GameObjects for performance reasons. However, if you add them as tree objects on the terrain, you can write a script that runs on awake ...
Ed Marty's user avatar
  • 5,259

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