Irregular Grids
Wildtile supports both regular square-based grids and irregular grids.
Irregular grids are curvy grids, such the one in Townscaper.
Irregular grids use the same tilesets as square based grids - you can change a GridPlacer
's grid between a VoxelGrid
and an IrregularVoxelGrid
freely. You do not need to change the tileset.
Using an Irregular Grid in Wildtile
Wildtile includes a sample scene with two irregular grids. After importing Wildtile into your project, use your Project window's search bar to find the "Wildtile Sample" scene.
Once open, find the irregular landscape in the scene.
If you want to create your own irregular grid, follow the steps below.
Setup
This tutorial assumes you have followed the getting started tutorial and have a square based grid with a tileset set up.
Creating an IrregularVoxelGrid Asset
Right click in your project window and select Create
→Wildtile
→Irregular Voxel Grid
to create an asset.
The new asset will be completely empty, it will not have any map data or voxel contents. Click on the asset to show it in the inspector window.
The inspector window contains controls for populating the map under the Generate Grid
foldout. Expand the foldout to edit the creation settings before clicking Generate Grid
.
Option | Description |
---|---|
Voxels per Border | How many voxels to place along each border. The total number of voxels in the grid will be less than 6 × voxels per border. |
Relax Strength | Wildtile generates an angular grid first, then smooths it into the curved grid by running an algorithm multiple times. This setting controls how much each iteration of the smoothing algorithm affects the grid. A large value means that it will take fewer iterations to reach the smoothed grid. A small value makes the algorithm more stable - if your generated grid is a spiky mess then reduce this value and regenerate. |
Relax Iterations | How many iterations of the smoothing algorithm should be run. A higher value will make the grid smoother, and a lower value will take less time to run. |
For this example, set the Height
to 5 and the Voxels per Border
to 3.
Warning
Populating a voxel grid with a new map will delete any voxel data that was stored previously. You can use undo to restore the object if you click Generate Grid
by accident.
Note
The parameters for setting up the grid are not saved. If you select another object then reselect the irregular grid asset then the set up parameters will reset.
Using the IrregularVoxelGrid Asset
Once you have generated the voxel grid asset you can use it in a GridPlacer
component.
Select the GridPlacer
object in your scene that has the square grid.
In the properties inspector set the Voxel Grid
field to your newly created grid asset.
You are now set up to use the irregular grids. Select the voxel editing tool (keyboard U
by default) to edit the grid, click on the blue grid to add voxels, then deselect the tool (keyboard W
by default) to make Wildtile build a mesh for you.