Path Labels
Path Labels and Spawn Conditions
The PathLabels (called Labels in short) are used to mark/tag certain parts of a Path (ex: turns) and then conditionally spawn components or PathTemplates in such marked areas. They can be used to mark all kinds of things - ex: sharp turn, downhill, slippery road, wet road, forest region, dirty, bridge, tunnel, cliff, speed limit.
Labels can be placed procedurally or manually. ProceduralLabels are blueprints with the IsFulfilled
function you
overwrite to provide your custom condition. Within that function, you can access information about the currently
processed Path and spline point. Based on that data, the function decides whether a Label should be placed there.
Procedural Labels can also be modified/painted by hand. For example, a Procedural Label "Barrier" can be extended manually to make the barrier longer. Or a barrier may be added in a certain area, independently of the procedural logic.
Labels that have no procedural logic are called ManualLabels. Such Labels don't overwrite the IsFulfilled
function.
They need to be painted manually on each Path.
The video below shows the process of creating a simple ProceduralLabel that detects sharp turns.
To see the Label in action, assign it to a component in a Path's PathTemplate and lastly update the Path.
For a Label to show in UI, it needs to be used as a SpawnCondition by the selected Path. It means that at least one of the components from the Path's PathTemplate needs to use that Label in its SpawnCondition.
Nesting Path Labels
ProceduralLabels have the capability to utilize other Labels, both manual or procedural. To nest a Label, follow these steps:
- Open the
IsFulfilled
function. - Call the
IsLabelFulfilled
and choose the desired Label to be used.
Other examples of available functions to access other Label: IsLabelStarting
, IsLabelEnding
, IsLabelNearby
...
When nesting Labels, it is important to be cautious of circular dependencies. If it occurs, a compilation error will be displayed and the Label will be ignored in the Path generation.
Inheritance of Labels
Another way to utilize other Labels is to derive from them. To do that, follow these steps:
- Right-click the Label you want derive from.
- Select Create Child Blueprint Class
- Or right-click the content browser to open the context menu.
- Go to Errant Paths, select the Path Label, and choose the class to derive from.
Manual Label edition
Labels can be manually edited in the Label Painting tool. To interact with a Label, follow these actions:
- Select a Label in the UI or in the viewport.
- Paint the Label by holding Left Mouse Button (LMB).
- Press Left-Ctrl + LMB to remove the Label at the cursor position.
- Press Left-Shift + LMB to restore the Label at the cursor position."
During the generation of a Path, we make efforts to preserve any manual edits made by the user.
Ignoring short Labels
Some Labels are meaningful only when their associated feature spans a certain minimum length. For example:
- "Steep Incline" Label shouldn't trigger for every small pothole or bump on the road. Instead, it should apply when the road consistently maintains a steep incline over a stretch of at least 100 meters.
- "Guardrail" Label applied to a single meter of road is typically unnecessary. Additionally, short, disconnected sections of guardrail are often undesirable.
To address such scenarios, Labels have "Ignore Label Sections Shorter Than" property. Sections shorter than this threshold are automatically ignored, ensuring Labels represent features in a more practical and cohesive way.
Debugging Labels
When working on a Label, it is often useful to display some debug values to the screen. It can be done via the
Print Debug
function.
Debug information will be displayed at the every processed point.