The Map
We're working on a small map (32x32 to 128x128 hex). The map will be used in a game similar to BattleTech or Full Metal Planet, meaning only a few level high (5 level for FMP for example). I may eventually change this ( a settler game ? or a Capitalism look-alike ?), but this is my current goal.
The generation process I'll present in this set of blogs are working either on a standard heightmap, or on an hexagonal space (mainly in case we need the neighbours of a cell : we can take the 6 neighbours in hex space and map it to square space).
The general method
We first create a heightmap using a combination of methods and operators.Then we create an HexMap based on this heightmap, using it to get the height of each cell. Last, we use several filters to generate / calculate some others data, such as the discrete elevation.
We will present each time the general process and then an hexmap based on it.
So, on to the first method...
Landslide generation
This generation process is based on the idea of having a landslide, pushing one part of the map up and the rest being lowered.
Linear Landslide
Here the map is separated in two along a line going from one border to the other. One side of the line is lowered, while the other one is heightened. Performing this several time should lead to an interesting map.
The idea comes from this site.
The first version perform for each pass a landslide along either an horizontal line or a vertical one (one then the others). This give terrain that are good, but there are artefacts : the fault lines are visible. Having a great number of passes tend to limit the artefacts, but the last lines are still visible. Discretizing to a low range of values reduce the artefacts, and performing a smoothing operation also help.
Circular Landslide
The same thing can be done with a circle instead of a line : inside a random circle (random in position and radius), add or remove a small amount.
Results from execution with the same number of pass as the previous one (1,2, 3 and 4 for the first line and 64, 640, 1024 and 4096 for the second one) are below : while 64 circles still shows some artefacts, this is less vsible at 640, and nearly invisible at 1024 and higher...
No comments:
Post a Comment