Hot answers tagged

44 votes

How can I reduce the performance impact of rendering trees?

There are couple of things you can do to increase drawing performance. You said they were pretty far away. You could use LOD to decrease the vertex count of those trees, and thus decreasing time ...
user avatar
  • 3,182
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,679
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,610
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
13 votes
Accepted

How to efficiently render a large terrain mesh?

Basic chunking is a good way to start. You can move to more sophisticated data structures like octrees later, if you need. For now, simply divide your terrain into chunks of given dimensions when ...
user avatar
  • 5,581
13 votes
Accepted

How can I reduce the performance impact of rendering trees?

Ok, so the problem was simply that I wasn't using pre-computed realtime GI. I check that on a little while ago but it didn't have an immediate effect so I left it and forgot about it, and the lighting ...
user avatar
  • 2,729
11 votes

How does one generate mountains out of a Fourier transform?

One simple way is to use something like the midpoint displacement algorithm. It can be used to generate terrain, lightning, clouds, and other things as well. (It's a bit old, but easy to understand.) ...
user avatar
  • 2,592
6 votes
Accepted

Triangles go missing as Z changes

so, to rework from comments: this is Z-fighting. The math is very well explained here: http://chaosinmotion.com/blog/?p=555, and the ways to solve it here: https://www.opengl.org/wiki/...
user avatar
  • 211
6 votes
Accepted

Difference between terrain and plane

You need Terrain as it allows you to add vegetation (Trees & Details), make adjustments to the relief like rise land to form mountains and also it gives you ability to paint textures on it. A ...
user avatar
  • 1,217
6 votes
Accepted

Why can't I patch my procedural terrain together?

Before Diamond-Square begins, you'll have to make sure the outermost boundaries (and the maximum number of potential midpoints generated therein) are set equal on either side of the map (in x and y). ...
user avatar
  • 29.1k
6 votes

Making Cave system in Unity 5

I have little experience using Unity directly, but I've been a level designer for years and a much easier approach rather than worrying about cutting holes into your terrain is to simply build up a C ...
user avatar
6 votes
Accepted

Is there an existing algorithm to find suitable locations to place a town on a heightmap?

Here's one (relatively exhaustive) method you can try: Take your terrain heighmap (left) Mask the areas that are too steep to build on (orange, center) Propagate a distance field from the too-steep ...
user avatar
  • 114k
6 votes
Accepted

Does anyone know what terrain generation algorithm is used here?

In addition to what Pikalek said, it's also known as the Midpoint Displacement algorithm (because you perturb the midpoints of each edge) or Diamond-Square algorithm when working with a square instead ...
user avatar
  • 2,592
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 ...
user avatar
5 votes
Accepted

How do I serialise a mesh to a text file?

I think the obj file format is what you need. OBJ is pretty commonly used in 3D graphics, and it's a text file. You will need to walk through your mesh properties and write your own file. Then you'll ...
user avatar
  • 2,614
5 votes

How can I generate random maps that feel like Age of Empires II random maps?

I create random map scripts for Age of Empires 2. My most recent one is for the HD version. If you're looking to understand how to create maps for Age of Empires 2, there is this excellent guide to ...
user avatar
5 votes
Accepted

Unity3D: Efficiently loading chunks in an infinite voxel engine

Non sequitur, your question does not entirely make sense. You cannot store infinite chunks. You can only ever store the subset that is currently of interest, i.e. those around the player(s). So how ...
user avatar
  • 29.1k
5 votes
Accepted

TopDown Island Generation

I suggest this aproach. Let fs(x,y) be your simplex noise function. Let's introduce a second function : ...
user avatar
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 ...
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 ...
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 ...
user avatar
  • 3,679
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 ...
user avatar
  • 14.6k
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 ...
user avatar
  • 41
4 votes

anisotropic fog of war

The shape is irregular because of the obstacles. If you shoot a ray in every direction (360 cicle around unit), you determine if you hit an obstacle, and if yes, at what distance. If the ray does ...
user avatar
  • 870
4 votes
Accepted

How to get more gentle (cloud like) noise?

The noise function is returning a single "frequency" of noise. The effect on the right (B) is by adding together noise of multiple frequencies, in a "red noise" or "fractal brownian noise" pattern. ...
user avatar
  • 5,886
4 votes

Getting one-point-collision object to conform to uneven terrain while keeping constant distance covered

So what you want is like this? As Stephan says, you have the right idea, just repeat it until you're all out of movement. ...
user avatar
  • 383
4 votes

Procedurally generate rivers for 2-d heightmap terrain

The naive approach of just checking all adjacent squares for one of lower elevation, then moving there gets stuck very easily in small holes/valleys. That happens all the time in real life; they're ...
user avatar
  • 14.6k
4 votes
Accepted

Generate a 2d mesh terain out of triangles (low details)

Try this: Generate random points Compute delaunay triangulation of those points Use those delaunay triangles as your mesh By restricting the domain and distribution of the random points, you can ...
user avatar
4 votes
Accepted

Terrain for MMORPG

Your problem lies in the fact that its almost impossible to load an entire 20x20 km map fully into memory. You mentioned LOD (I will talk about it later), but for now let's ignore it. Consider a game ...
user avatar
  • 363

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