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 ...
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 ...
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 ...
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 ...
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 ...
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 ...
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 ...
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/...
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 ...
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 ...
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. ...
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 ...
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 ...
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.
...
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 \...
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 ...
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 ...
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.
...
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 ...
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 (...
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 ...
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 &...
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 ...
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, ...
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 ...
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 ...
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 ...
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 ...
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. ...
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 ...
Only top scored, non community-wiki answers of a minimum length are eligible
Related Tags
terrain × 449unity × 128
procedural-generation × 99
terrain-rendering × 55
perlin-noise × 38
c# × 37
opengl × 37
heightmap × 37
2d × 34
3d × 31
voxels × 28
algorithm × 27
textures × 24
c++ × 22
shaders × 18
xna × 17
collision-detection × 17
optimization × 17
procedural × 15
mesh × 14
java × 12
3d-meshes × 12
maps × 10
level-of-detail × 10
physics × 9