Generator Settings
A TesseraGenerator has a great deal of options on it. Most of them are described more fully on specific pages, but here is a reference.
Grid Shape
Depending on what sort of tiles you use, Tessera will automatically change the shape of the generator. But each shape has similar settings.
The grid is composed out of a number of cells. During generation, each cell will be filled with a single Tessera tile.
Center
Where the center of the generator should be, in space local to the generator's GameObject
Size
The number of cells the grid extends for in each direction.
Cell Size
The size of each individual cell in the grid. This should match the Cell Size setting on each tile - if not, the tiles will be resized to fit.
The full size of the grid is the size of the grid multiplied by the cell size.
Skybox
A special constraint configured directly on the generator. It lets you quickly constraint what tiles are allowed on the boundary of the grid. See Skybox for details.
Surface Mesh
Set this to use a custom grid shape derived from a Unity Mesh. There are details on the Surfaces Tutorial.
Generation
Seed
Fixes the random values used during generation. This gives repeatable behaviour from generation to generation. The default value of 0 is not fixed, and means it uses the built in Unity random source.
Retries
As generation can fail in some circumstances, this setting allows the generator to retry from scratch. See Errors and Contradictions for details.
Generally speaking, this setting is not useful if backtracking is set.
Backtrack
Changes the algorithm so that instead of failing, it undoes the most recent change and resumes from there. This makes the generator much more likely to succeed, but can mean that it gets stuck and hangs indefinitely instead. See the Quality page for some discussion of this.
Step Limit
This is a compromise between retrying and backtracking. When set and backtracking is on, the algorithm will try backtrack for a given number of steps, and then fail (and retry). One "step" is roughly speaking, trying to place a single tile.
The default of -1 means no step limit.
Algorithm
Controls some core details of the algorithm. Feel free to experiment. In theory, some of these are faster, but less reliable than the default algorithm, but I've never seen much difference.
Record Undo
If you use the buttons to run the generator in the editor, then it will record the changes to the scene so that they can be undone with Ctrl+Z. This can be slow, you are recommended to disable it if you are having performance problems.
Failure Mode
By default, if generation fails and all the retries have been exhausted, then the generator stops and logs an error message. This setting forces the generator to dump a partially completed generation for diagnostic purposes.
See Errors and Contradictions for details.
Model
The "model" is how Tessera decides what tiles can be safely placed next to each other.
Model Type
Adjacent Paint
This is the default model, and most of the docs assume that you have this set. Each tile is painted as shown in the getting started tutorial. To compute if two rotated tiles can be placed adjacently, the faces of each tile are compared. If the paint patterns match, either exactly, or according the rules set up in the palette, then they can be placed together.
Overlapping Model
In the Overlapping Model, you need to supply one or more samples. The sample is split up into small patches, and the model ensures that the outputted result is entirely composed out of overlapping copies of those patches.
Adjacent Model
The Adjacent Model Type works the same as overlapping model, only the samples are analysed for pairwise adjacencies between tiles instead of small patches.
Mesh Edges
In the Mesh Edges Model Type, each tile is analysed based on the Mesh attached to the game object. Two tiles can be placed adjacently if their meshes would form a continuous surface.
Samples
Samples is a list of Unity game objects (they may be prefabs). This setting is only used for Overalapping and Adjacent Model Types. The children of the sample are assumed each correspond to tiles in the generator (matched by name)
Mesh Edges Tolerance
This is only used with the Mesh Edges Model Type. It controls the degree to which mesh vertices snap to each other.
Tiles
The list of tiles configures what tiles the generator can place in each cell. The tile objects themselves have a number of configuration options.
You can use several types of tiles: Cube, Square, Hex, Triangle. You cannot mix and match tile types.
Each tile has a Weight variable. This controls how likely the tile is to be selected. A tile with a weight of 10 is twice as likely to be selected as a tile of weight 5.
A weight of 0 means that the tile will never be randomly chosen. But it can still be generated, if it's the only legal choice for a given cell.
Buttons
The generator can be run straight in the editor with these buttons. If you want to run the generator at runtime, use the API, the Bolt Unit or the included Generate On Start
script.
Clear
Deletes all child objects of the generator. If a generator output is set, then that will be cleared instead.
Generate / Regenerate
Runs the generator, and instantiates the tiles in the scene. Prefab tiles will be created as prefab links. If a generator output is set, then will be used to instantiate the tiles instead.
Clone Sample
Only available for Model Types Overlapping and Adjacent. This instructs the generator to copy the sample exactly, with no generation. This is useful to determine that your sample is being correctly processed.