Unity Package

Zones

Please note that this feature requires a separate activation from the COALA team. Contact us at support@thoughtfish.de for more information.

Overview

Zones are groups of cells that are connected by their context and their proximity. They are uniquely identifiable.

For example, while a single cell might only contain the information that it has the context park, there is no information in the cell as to whether its neighboring cells are part of the same park. This information, however, would be useful if for example you wanted to attach specific data, like a leaderboard, to a specific park. With COALA you can quickly check which park a single cell belongs to.

Borders

To differentiate a zone from its surroundings you can place a border along the edges of the zone. To do this you have to first enable mesh creation for zones in the System Config asset.

Next, you need to create a Zone Render Config asset. This asset needs to be added under Zones in the CoalaConfig MonoBehaviour in your scene

In the Zone Render Config asset you can specify which prefabs to use as zone borders, the pattern in which you want them to spawn, and whether they should be aligned with the terrain.

Prefab Guidelines

To ensure that zone borders work correctly, certain guidelines need to be followed when creating a border prefab.

  • Overall, the prefab should be 1 unit wide on the X axis. The scale will later be automatically set to fit the cell size

  • The border prefab should have its origin on its left corner. To make the borders fit seamlessly there should be an offset on the X axis that is equivalent to half the object's size on the Z axis. This way the objects should perfectly fit without clipping no matter their orientation

Borders on slopes

Depending on the border style you are going for in your project it might be useful to deform the border meshes to fit the terrain. To do this, check the Align Border With Terrain property in the Zone Render Config asset.

Unaligned to terrain


Aligned to terrain