Class HeightMapFactory

java.lang.Object
squidpony.squidgrid.mapping.HeightMapFactory

public class HeightMapFactory
extends Object
Tools to create maps. Not commonly used outside of code that needs height maps.
Author:
Eben Howard - http://squidpony.com - howard@squidpony.com
See Also:
WorldMapGenerator is a much-more-detailed kind of map generator.
  • Constructor Details

  • Method Details

    • heightMap

      public static double[][] heightMap​(int width, int height, double offset)
      Returns a randomly generated map of doubles that smoothly change nearby. Commonly referred to as a Height Map. Uses FastNoise to generate coherent heights. The offset parameter is converted to an int seed via NumberTools.doubleToMixedIntBits(double), so it can be any double, even an infinite one, and will still be treated as a valid seed.
      Parameters:
      width - in cells
      height - in cells
      offset - a double that changes the sampling process; the range doesn't matter
      Returns:
      the created map as a 2D double array
    • heightMapSeeded

      public static float[][] heightMapSeeded​(int width, int height, int seed)
      Returns a randomly generated map of floats. Commonly referred to as a Height Map. Uses FastNoise (producing FBM Simplex noise) to generate coherent heights. Unlike heightMap(int, int, double), this doesn't drop off heights at the east and west edges of the map. As such, it may be more suitable for local maps than world maps, since it is unlikely to tile east-west.
      Parameters:
      width - in cells
      height - in cells
      seed - an int that significantly changes the generation process
      Returns:
      the created map as a 2D float array