Map Generator Settings Guide (WIP)

We’re working to make the map generator more usable for people, but in the meantime here’s a rough guide to the parameters in the generator and what they do!

Perlin Generator Configs

These values can be found in the Generator Configs

  • NoiseScale - The primary factor to shrink/grow the sampled X,Y coordinates in Perlin Noise. A larger value will shrink the sampled X and Y coordinates.
  • PerlinAmplitude - Determines how high the floating points will be multiplied by. A higher value will mean greater amplitude.
  • PerlinFrequency - Affects how where to sample the perlin noise. A greater value means that the noiseScale will scale up and the sampled X,Y values will be smaller.
  • LODs - the number of sampled perlin iterations. If you increase the level of detail, you will achieve a higher elevation. THis value should never be 0.

Map Generator

This is just a reference on how the generator works for more insight.

The following steps are done in the MapGenerator class

  • Filter
    • Filtering means that we grab all palettes/stamps and stash them into a TileSet class.
    • The TileSet class mainly parses stmaps and palettes by name and ignores case (it is a simple for loop)
  • Voronoi Generator
    • Generates the regions (unchanged from how it was originally started)
  • QuadTree Generation
    • Splits the map into quadrants and selects quadrants which are generally opposite of each other to select
      starting points.
  • Initial Land Mass Generation (see line 424 as of the time of this documentation)
    • Annotates each region as a Land/Water region based on a recursive cellular automata rule
    • Starts from the players and recursively checks neighbors to determine if the accompanying region is Land/Water
    • This is affected by the Land Frequency and Divisor parameters. Each recursive step along unvisited neighbors divides the Land Frequency by the Divisor. (This can be changed to multiply between 0 and 1.0)
  • Force Connected Players Step
    • If the GeneratorConfig.ForceConnectedPlayers is enabled, then we perform a basic “raycast/brehasen line algo” check
      to ensure that there are connected regions of land between players.
  • Resource Placement
    • Recursively walks the voronoi graph (BFS) between players and drops resource tiles randomly in Land regions
    • The # of resource tiles can be configured through GeneratorConfig.MinNumberOfResources and MaxNumberOfResources.
  • Perlin Palette Pass
    • Generates perlin noise on the entire area of the map with the same dimensions
    • First iterates along all defined palettes
      • Palettes must have a defined Threshold Limit in the LocationData.
      • Palettes are ordered in increasing order
      • The “perlin bands” are defined by taking the previous Palette’s Threshold Limit and the current palette’s
        Threshold Limit. This defines the range of space that the palettes can occupy.
    • Each tile, randomly pick a tile from the palette and apply it to the map
  • Cellular Automata Pass (currently disabled)
    • Reads the CellularAutomata Palette from the TileSet class
    • Based on the cellular automata’s binary value, takes the tile from the cellular automata tile set and attempts to
      break large spans of the same terrain.
  • HeapMap Step
    • Generates a heat map of the map generated so far.
    • Iterates through each stamp and calculates a percent chace that the stamp will be placed onto the map
    • Queries the heat map and selects a random tile that matches that stamp’s most occuring base terrain
      • Checks the borders of the random tile and determines if the border’s base tile occurence >= the most frequent
        tile in stamp * locationData.PercentBaseTerrainMatch.
    • If the number of stamps generated is less than the minimum defined by the user, there is an additional pass to
      stamp randomly onto the map as long as the random tile’s base terrain matches the current stamp.
      • There is a threshold in the number of attempts this last pass can do. This is currently defined to 10 in
        the loop (see line 710).
    • Stamps can be rotated randomly (between 0 - 3) as long as locationData.AllowStampRotation is true.
      • Rotations are clockwise and currently allocate and generate garbage due to array matrix copying.