Changes between Version 3 and Version 4 of Heightmap_Library


Ignore:
Timestamp:
May 18, 2016, 11:37:10 AM (8 years ago)
Author:
FeXoR
Comment:

--

Legend:

Unmodified
Added
Removed
Modified
  • Heightmap_Library

    v3 v4  
    1414== General heightmap functionality ==
    1515The file [source:ps/trunk/binaries/data/mods/public/maps/random/heightmap/heightmap.js heightmap.js] contains the fundamental tools to work with heightmaps.
     16
     17 * `getMinAndMaxHeight` Takes a heightmap and returns an object with properties `min` and `max`, the minimum and maximum height value present in a heightmap.
     18 * `rescaleHeightmap` Rescales a heightmap's height values linear to have minimum and maximum as given by the arguments. `ToDo`: Add a height to be unchanged (e.g. the water height to preserve the costline) and rescale above/below that value seperately. Logarithmic/exponential scaling would also be nice with the base as parameter.
     19 * `getStartLocationsByHeightmap` Searches a heightmap for a given number of points within a given height range and distance to the map border and tries to maximize the distance between the points returning them in a list.
     20 * `distributeEntitiesByHeight` Places entities/actors randomly chosen from a given list in a specific height range while avoiding given points (e.g. start locations) and the map border by the given distance.
     21 * `setRandomHeightmap` Sets a given heightmap to entirely random values. This is mainly meant for using erosion/smoothing on it later to get a realistic over all map shape (or test stability of erosion/smoothing functions)
     22 * `setBaseTerrainDiamondSquare` A method to set a heightmap to a realistic shape within the given height range limits (they might not be reached though). The `initialHeightmap` defines the global shape. The smoothness parameter can be chosen between 0 (uniform in roughness on all scales so quite rough even at small scales) and 1 (roughness decreases with smaller scales exponentially so quite smooth on small scales).
     23 * `globalSmoothHeightmap` Smoothes the heightmap depending on the adjacent tiles height. The `strength`value should be chosen between 0 (no effect at all) and 1 (quite strong smoothing). To get an even stronger smoothing effect apply it multiple times (rather than increasing the strength above 1). This can be seen as a very simple erosion function (e.g. erosion by decay and gravity). To get directional effects an assymetrical smoothMap can be used (e.g. to simulate wind/sun driven erosion).
     24 * `rectangularSmoothToHeight` Pushes the center of a rectangular region towards a target height while preserving the original height and shape at the edges.
     25
     26== Erosion ==
     27WIP. It's planned to put (more complex) erosion functionality (like water driven erosion) in a separate file.
     28
     29== Painting terrain by height and inclination ==
     30WIP. A fully automated method to paint the whole map realistically will go here. It is planned to make use of the biome system (the current biome functions are not sufficient though).
     31
     32== Local heightmap manimulation and window functions ==
     33WIP. All global heightmap functionalities can be used locally by manipulating a partial heightmap and fuse that manipulated part back into the original heightmap with appropriate windows functions (that fullfill the boundary conditions).