Map altitude
In the Simple or Expert Inspector, open Map altitude, enable Enable Map
Altitude, set Altitude Min Height and Altitude Max Height, then
generate again. The feature is off by default and works in Procedural and
Image modes. Turning it off and regenerating restores the previous relief.
The minimum and maximum are additive offsets in map units, before the
generator transform's scale. Existing mountains, plateaus, seabed depth and
the 0.02 path recess remain on top of this field, so they may exceed these
bounds. Equal bounds produce a uniform vertical offset; negative heights
are supported.
Automatic height map
Leave Altitude Height Map empty. Broad, seeded noise hills are generated
and normalized between the minimum and maximum. Altitude Noise Scale
controls their frequency in cell units; lower values produce broader hills.
Start with 0–8 units and 0.035. Keep Use Random Seed disabled and Seed
unchanged for repeatable geometry. Changing altitude does not consume Unity's
random stream or change strategic feature placement. Automatic altitude does
not impose symmetry on the hills.
Custom height map
Assign a grayscale Texture2D to Altitude Height Map. This is a separate
texture from Source Map Image and does not change terrain classification.
In the texture importer, enable Read/Write, disable sRGB (Color
Texture), choose Compression: None, and Apply. Keep sufficient Max Size
to retain the source detail. An unreadable texture stops generation with an
actionable validation error.
Black is the minimum, white is the maximum, and intermediate grayscale
values interpolate between them. Custom values are not auto-normalized:
a uniform gray image gives a uniform intermediate offset. The entire image
fits the square terrain footprint regardless of its aspect ratio. Sampling
is bilinear, independent of the texture filter/wrap mode. By default the
bottom-left pixel maps to minimum local X/Z; Altitude Height Map Origin Top
Left flips the vertical axis. Samples outside the map clamp to its edge,
including shoreline overlaps and cliff skirts.
Geometry and runtime data
When altitude is enabled, MeshGround/MapSides closes the outer terrain down
to a common base. Its rock faces follow the final perimeter, including path
recesses, coastal floor extensions and the lower edges of existing mountain
walls. Mountain Material is used first, then Env Material or Grass Material.
The side mesh has a matching collider and embedded geometry for saved scenes.
Disabling altitude and regenerating removes these additional faces.
Controlled terrain example with an automatic height map, a river and a
mountain touching the map border:
| Before |
Closed sides |
 |
 |
Each freshly generated terrain and water vertex receives the adjusted vertical
offset at its final X/Z position, after contour and path smoothing. Mesh
indices, shared vertices, UV seams and shader facet markers are retained.
Normals and bounds are rebuilt and colliders are recooked from the displaced
mesh. Embedded mesh data captures the final geometry, without applying the
offset again when the scene reloads.
Grass is placed by MapPropsGenerator on the final displaced terrain colliders,
using the same large-then-small passes and shared prefab meshes. Its placement
probes follow the terrain bounds and slightly embed accepted footprints to avoid
floating roots. See Grass prefabs.
Other props, resources and cliff prefab instances follow the field at their pivot
and keep their original shape and orientation. Very steep custom relief can
therefore leave large rigid props partially embedded or overhanging. River
bridges connect the raised endpoint heights with their rigid deck. The
aerial navigation mesh, when Enable Aerial Generation is enabled, follows the final ground and water with Aerial Clearance world units of clearance (3 by default). This output is disabled by default. Mountain peaks and rock
feet do not lift the flight surface: it continues through the massif at the
underlying regional altitude. The rock's own collider remains a physical obstacle
where it protrudes above the plane. The mesh and its collider retain this
intersection when embedded geometry reloads. A separate game navigation bake
must include protruding rock as obstacles. The altitude phase does not deform
source prefab or texture assets.
result.Grid.AltitudeHeightMap is a generation snapshot. Its
Sample(terrainX, terrainZ) method accepts X/Z in the local space of
result.MapRoot.Find("MeshGround/Terrain"), including Cell Size. The field
can be sampled without retaining a readable texture after generation. This
snapshot includes the water constraints below. MapAltitudeHeightMap.Create
returns the raw recipe field; use the result grid's snapshot to match the
generated geometry around water.
GridCell.Height and MountainHeight include the cell-center altitude;
GridCell.AltitudeOffset records that offset. ClampCellHeight preserves
the global altitude while clamping the underlying local feature height.
Player spawn positions and saved generation recipes include the new relief.
Water levels and banks
Water constraints apply automatically when both altitude and water are enabled,
with automatic or custom height maps. Lakes, seas and closed pools use one
horizontal level per connected water surface. Disconnected basins can have
different levels. Their level uses the mean height-map offset over that basin.
In the River layout, channels reaching separate map-boundary mouths use the
lowest mean mouth as their outlet. The surface follows a common distance-to-outlet
profile, so branches join continuously and water can descend toward that outlet.
The grade is capped at 8 percent. Closed pools without through-flow stay level.
This removes the height map's repeated uphill/downhill waves from the water.
The seabed receives the same correction, retaining its local depth/noise. Banks
follow the water over the visible shoreline and three further cells, then blend
back into the height map over four cells. This keeps the water attached to its
banks. Bridge decks use the adjusted landing heights; water collision and optional minimap
meshes retain their final levels when embedded geometry reloads. The source
height-map texture is unchanged. Relief far from water keeps its original field.
Controlled custom height-map examples, identical recipes and cameras:
| Water |
Before |
Corrected altitude |
| Lake |
 |
 |
| River |
 |
 |
Strong custom height-map differences can still produce steep banks within the
transition band.
This stage retains the strategic flags and layout score. It does not yet
recompute walkability/buildability from slope, level base footprints, simulate
time-dependent fluid flow or create waterfalls, terrain holes or elevated land bridges. Bake or
update your game's navigation from the generated colliders as appropriate.