Skip to content
Ben edited this page Jul 17, 2019 · 22 revisions

Hexamap Wiki

What

Hexamap is an asset for Unity. It is providing fast, extensible, procedural world generation for hexagonal-tile-based projects.
Trailer video : https://www.youtube.com/watch?v=whXKXgCyMxo
Overview video : https://www.youtube.com/watch?v=FdU40Vt69Zw

Where

The package is available on the Unity Asset Store.
TODO: Add link when the package is published.

How

Demo

  • Grab the package from the Unity Asset Store
  • Open the Assets/Hexamap/_DEMO/_DEMO_SCENE_ scene
  • Play
  • Open the Hexamap settings object of the demo scene (Assets/Hexamap/_DEMO/HexamapSettings) to customize
    • You probably don't want to make changes to anything related to prefabs here for now if you are just discovering the asset
    • But you can play with biome's sizes, distributions of landforms, map's seed, tiles' padding...

Core Model (Assets/Hexamap/Core/)

  • Top level object : Map
  • A Map has many Biome
  • A Biome has many Landform
  • A Landform has many Tile
  • A Map has many MetaLandform
  • Everything above (except Tile) is a Section

Landforms

A landform is at least one tile representing something interesting on the map (a city, a chain of mountains, a lake, a farm...). A landform belong to a biome but at the map level, adjacent landforms are grouped inside metalandforms.

At the core level there is actually 4 types of landforms, they define how the landform will be handled internally by the biome :

  • Distribution : landform will take X percent of space allocated to the biome
  • Quantity : there will be X tile of this landform
  • Adaptable : this landform can take whichever space it needs
  • Filler : this landform will fill every space available

You should not work directly with these classes unless you are creating your own templates. Please see the section about this topic below.

Unity integration

Settings

  • A : Display section
  • B : Biomes settings
  • C : Prefabs picking section
  • 1 : The shape of the map. This field is populated by reflection, it is looking for classes with the attribute MapShapeName
  • 2 : Seed (0 = random). Used by the RNG
  • 3 : The space between a tile and its neighbours (1 = the size of a tile)
  • 4 : Settings to customize the border of the map
  • 5 : Number of biomes for this map
  • 6 : Name of the biome
  • 7 : The biome's expected size. It will always at least be this size, it can be more depending of the shape and RNG
  • 8 : Distribution/Quantity/Missing (depends of the type of the landform) is the amount of this landform expected in the biome. Distribution is a percentage (0-100) and Quantity is the precise amount. Some type of landforms do not have this field because they will fill the whole space left (plains) or take as much as they want (roads)
  • 9 : Order of generation of the landform, the less the earlier it will be created
  • 10 : Picking method of the prefab. This field if populated by reflection, looking for classes with the attribute "PickingMethodName". It defines how the prefab for this landform will be chose
  • 11 : Rotate method of the prefab. Can be 0, 60, 120, 180, 240, 300 or random. It defines the rotation of the prefab on its local Y axis
  • 12 : Size of the list of prefabs below available for this landform