Home
  • Manual
  • Node Index
  • API
  • Changelog
Show / Hide Table of Contents
  • Tutorials
    • Creating your first map generator
      • 1. Creating your first map graph
      • 2. Running a graph at runtime
      • 3. Adding more nodes
      • 4. Object placement
    • Basic map types
      • • Cave-like maps
      • • Room-based maps
      • • Sample-based maps
      • • Combining map types
    • More Tutorials
      • • Using prefabs instead of tilemaps
      • • Changing tile/prefab/tilemap set probabilities (weighted random)
      • • Linking a named color set to tilesets/prefab sets
      • • Organizing nodes into groups
      • • Adding notes & comments
      • • Running a graph within a graph (Sub graphs)
      • • Tilemap Sets
      • • Optimization tips
      • • Static seed (daily challenges)
      • • Running a graph asynchronously/multi-threaded
      • • Object pooling
      • • Tips for rule tiles
      • • Saving and loading maps
    • Tutorials for coders
      • • Running graphs from scripts
      • • Output parameters
      • • Creating your own nodes
      • • Creating your own node views
      • • Adding a constant node type
  • Sample Project
  • Troubleshooting
  • Support

Tilemap sets

Sometimes you want your maps to contain certain predefined parts. If you're generating gameobjects from prefabs, you can create your own prefabs for this. For tilemaps Map Graph has Tilemap Sets. For example, the "Village" example in the sample project uses this system.

Village example

The surroundings are all randomly generated, but the buildings are designed beforehand and are randomly placed inside of the world.

To achieve this, you can create a tilemap set. You can do so using the create menu, under "Map Graph/Tilemap Set".

The tilemap set is very similar to the tileset and prefab set. Types can be added to it and you can add one or more tilemaps to those types.

Tilemap set inspector

You can add any prefab, that contains a tilemap component, to a tilemap set. However, to make this process a bit easier, you can create new tilemap prefabs using the "Map Graph/Tilemap Prefab" option in the create menu. This will create a new prefab with all the components you'd normally need to assign it to a tilemap set and easily edit it in the prefab editor.

Once you've created the assets you need, your graph can use them to place the predefined tilemaps with the Randomly Stamp Tilemaps node.

Hexagonal tilemaps

If you're using this in combination with hexagonal tilemaps, you might want to use the "Lock Shape" option on the Map Graph Tilemap Prefab component of your prefabs or your tilemaps might not always come out looking the way you'd expect. The reason for this is described in this forum post: https://forum.unity.com/threads/released-map-graph-node-based-random-map-generation.944568/#post-6681352

In This Article
Back to top Generated by DocFX