This adds several methods, an enum and a class to deal improve the corridor generations.
The new "algorithm" works as follows:
The existing corridors from the breadth first search algorithm are carved as normal.
Each corridor tile is examined one by one. The type of corridor is determined.
Each corridor type has its own extension method, allowing for greater fine tuning.
In each extension method, the number of extensions in a single direction is generated from an exponential distribution. This distribution was chosen because it has a high probability density near the lower values and can be fine tuned with a single parameter.
An extension is saved in a hash set of extension as a 2d integer vector.
An iterator is created from the hash set and each extension vector is checked if it is a valid location to place a new corridor tile in the maze.
As you can see this is quite a simple way to create some noisy patterns into the cave generation. There are four parameters that can be used to fine tune the corridor creation found in the CorridorExponentialExtension utility class.
MINIMUM_EXTENSION: the minimum amount of extension that should be given to each direction of a corridor tile
MAXIMUM_EXTENSION: the maximum amount of extension that should be given to each direction of a corridor tile
LAMBDA: the parameter of the exponential distribution, a higher lambda mean a higher concentrations of values near zero, a lower lambda means a more spread out distribution.
EXTRA_CORNER_EXTENSION: how much more each corridor corner should be extended, this is to prevent small and tiny corners, giving a much larger feel to the corners of corridors.
There are no additional PMD, CheckStyle nor Findbugs errors in this PR and almost all lines are tested bar a single branch in a method and a private constructor.
This closes #485, closes #477, closes #478 and closes #479. This PR also closes #480 because this feature was deemed to create to much lag after implementation.
Here are the more cave like corridors.
This adds several methods, an enum and a class to deal improve the corridor generations. The new "algorithm" works as follows:
As you can see this is quite a simple way to create some noisy patterns into the cave generation. There are four parameters that can be used to fine tune the corridor creation found in the CorridorExponentialExtension utility class.
There are no additional PMD, CheckStyle nor Findbugs errors in this PR and almost all lines are tested bar a single branch in a method and a private constructor.
This closes #485, closes #477, closes #478 and closes #479. This PR also closes #480 because this feature was deemed to create to much lag after implementation.