Home
  • Manual
  • Node Index
  • API
  • Changelog
Search Results for

    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
        • • Generating prefabs
        • • Tile/prefab/tilemap set weights
        • • Syncing named color sets
        • • Groups
        • • Notes & comments
        • • Sub graphs
        • • Tilemap Sets
        • • Optimization tips
        • • Static seed (daily challenges)
        • • Running a graph asynchronously or multi-threaded
        • • Object pooling
        • • Tips for rule tiles
        • • Saving and loading maps
      • Tutorials for coders
        • • Running graphs from scripts
        • • Output parameters
        • • Custom nodes
        • • Custom node views
        • • Adding a constant node type
        • • Custom styling for the graph editor
        • • Dependencies for custom nodes
    • Sample Project
    • Troubleshooting
    • Support

    Changing tile/prefab/tilemap set probabilities (weighted random)

    If you want to change the probability of a tile/prefab/tilemap entry being chosen, you can set different weights for each type entry in a set.

    For example, here's a tileset with 3 different tiles, each with a different weight: Example

    Increasing the weight will increase the likelihood of the entry being used. So in this example, the Grass 1 tile is most likely to be used whenever a Ground tile is requested, followed by Grass 2 and Dirt 2.

    In order to use the weights, you need select the set in the project window and explicitly enable it for each type, as needed, by ticking the "Weights" checkbox. This enables the weight fields.

    This is not enabled by default, because it's a bit more expensive to calculate, slightly impacting performance.

    In This Article
    Back to top Generated by DocFX