Skip to content

Authoring assets

32 types in this area.

CompiledMapNodeType

:material-star: Start here

public sealed class CompiledMapNodeType

Waybranch.Authoring · Runtime/Authoring/MapNodeTypeAsset.cs

One node type after compilation: an immutable bundle of its parsed StableId, its fallback display strings, the prefabs, icon, and per-state colors a view draws it with, and its default payload. This, rather than the MapNodeTypeAsset it came from, is what presenters, view factories, and the traversal controller are handed, so a custom view reads a node's appearance from here and never needs to reach back to an asset.

A MapAuthoringCompiler only produces one when the asset compiled with no diagnostics at all, so an instance obtained that way is already validated: its IDs parse and its colors have finite channels.

Constructors

public CompiledMapNodeType(StableId id, string displayLabel, MapNodePayload defaultPayload)

Creates a compiled node type with built-in fallback colors and no custom presentation assets. - id — Parsed identity used by graphs, rules, and persisted progression. - displayLabel — Fallback player-facing label shown when localization supplies no value. - defaultPayload — Payload supplied to consumers when a node has no per-node override.

public CompiledMapNodeType( StableId id, string displayLabel, string localizationKey, string tooltip, Sprite icon, GameObject canvasPrefab, GameObject worldPrefab, Color hiddenColor, Color lockedColor, Color availableColor, Color currentColor, Color visitedColor, Color completedColor, string rendererKey, string enterAudioCueId, string completeAudioCueId, MapNodePayload defaultPayload)

The full constructor freezes every validated presentation reference, state color, cue ID, and default payload. - localizationKey — Adapter lookup key for the label; the tooltip uses the same key with .tooltip appended. - tooltip — Fallback tooltip used when the localized lookup yields nothing. - rendererKey — Optional pooling and styling discriminator; see MapNodeTypeAsset.RendererKey. - defaultPayload — Payload describing what the type means to your game; it is not applied to generated nodes. - id — Parsed identity used by graphs, rules, and persisted progression. - displayLabel — Fallback player-facing label shown when localization supplies no value. - icon — Optional sprite drawn inside built-in node views. - canvasPrefab — Optional prefab instantiated by the built-in canvas node factory. - worldPrefab — Optional prefab instantiated by the built-in world-space node factory. - hiddenColor — Tint used before the node has been discovered. - lockedColor — Tint used after discovery when the node cannot yet be entered. - availableColor — Tint used for a node that is a valid next traversal target. - currentColor — Tint used for the player's current, incomplete node. - visitedColor — Tint used for a previously entered but incomplete node. - completedColor — Tint used after completion data has been recorded for the node. - enterAudioCueId — Optional audio-cue key emitted when traversal enters this node type. - completeAudioCueId — Optional audio-cue key emitted when this node type is completed.

Properties

public Color AvailableColor

Color for a node the player may enter next. A node unlocked by hand reads as available too, so it is indistinguishable from one made reachable by normal progression.

public GameObject CanvasPrefab

Canvas view prefab, or null to let the built-in factory build a plain canvas node.

public string CompleteAudioCueId

Cue played on completion, on the same terms as EnterAudioCueId.

public Color CompletedColor

Color for a node whose completion result is in the progression. Completion is tested first of all six states, so this wins over current, available, and visited alike.

public Color CurrentColor

Color for the node the player is standing on. Completion is tested before position, so a current node that already has a result recorded draws in CompletedColor.

public MapNodePayload DefaultPayload

What a node of this type means to your game, as tagged content. Never null. Generation does not copy it into the nodes it produces -- a generated node's own payload is empty unless a pinned override supplied one -- so resolve a node's contents through its type, not through the node.

public string DisplayLabel

The authored label, not a localized one. A presenter resolves LocalizationKey first and only falls back to this, so reading it directly bypasses localization.

public string EnterAudioCueId

Cue the traversal controller passes to your audio adapter on entering a node of this type. Empty, or text that is not a valid stable ID, plays nothing.

public Color HiddenColor

Color for an undiscovered node, and the fallback for any visual state a view does not recognise. Fog scales the alpha of whichever of these six colors was selected.

public Sprite Icon

Sprite the built-in views draw for the node, or null. A styled node insets it inside the node shape; an unstyled one uses it as the node's own sprite and falls back to a generated rounded sprite when there is none.

public StableId Id

The parsed identity that rules, graphs, and saves address this type by. It comes from the asset's authored ID text rather than from its file name, so moving or renaming the asset leaves every weight, quota, forced slot, and adjacency ban still pointing at this type.

public string LocalizationKey

Lookup key for the label. The tooltip is resolved under the same key with .tooltip appended; an empty key suppresses both lookups.

public Color LockedColor

Color for a node the player has discovered but cannot reach from where they stand.

public string RendererKey

Optional discriminator that keeps views of this type out of another type's pool; see MapNodeTypeAsset.RendererKey.

public string Tooltip

The authored tooltip, used when the localized .tooltip lookup yields nothing.

public Color VisitedColor

Color for a node reached earlier with no completion recorded against it. It is the last of the reachable states to be tested, so a visited node that is also current or available takes those colors instead.

public GameObject WorldPrefab

World-space view prefab, or null to let the built-in factory build a plain world node.


CompiledMapTheme

:material-star: Start here

public sealed class CompiledMapTheme

Waybranch.Authoring · Runtime/Authoring/RuntimeCompilation.cs

One map theme after compilation: the spacing a map is laid out with, the colors and edge geometry it is drawn with, the zoom range a view may offer, and how long a state change takes to play. It is presentation only and takes no part in generation, so swapping a theme restyles a map without changing which map it is.

A theme that came from MapAuthoringCompiler.CompileTheme(MapThemeAsset) has already been range-checked against MapThemeLimits, and out-of-range authoring is reported as a diagnostic rather than clamped, so a presenter can use these numbers as they stand.

Constructors

public CompiledMapTheme( StableId id, MapLayoutOrientation orientation, int layerSpacing, int nodeSpacing, Color backgroundColor, Color edgeColor, MapEdgeGeometryKind edgeGeometry, int bezierSegments, int bezierControlOffset, float minimumZoom, float maximumZoom, float stateTransitionSeconds)

Freezes validated layout, geometry, color, zoom, and transition settings for runtime presentation. - layerSpacing — Distance between successive layers, in presentation units. - nodeSpacing — Distance between neighbouring nodes inside one layer, in presentation units. - bezierSegments — Line segments per curved edge; ignored unless edgeGeometry is Bezier. - bezierControlOffset — Curve control-point offset in normalized fixed point, 10,000 units per 1.0. - stateTransitionSeconds — How long a node or edge state change plays for; zero asks for an instant change, which the built-in views honour. - id — Parsed identity of the source theme asset. - orientation — Axis along which map layers advance during layout. - backgroundColor — Fallback backdrop color carried for presentation adapters. - edgeColor — Fallback route color used when no style preset supplies one. - edgeGeometry — Straight, stepped polyline, or sampled cubic route shape. - minimumZoom — Smallest permitted viewport zoom after compilation. - maximumZoom — Largest permitted viewport zoom after compilation.

public CompiledMapTheme( StableId id, MapLayoutOrientation orientation, int layerSpacing, int nodeSpacing, Color backgroundColor, Color edgeColor, MapEdgeGeometryKind edgeGeometry, int bezierSegments, int bezierControlOffset, float minimumZoom, float maximumZoom, float stateTransitionSeconds, float laneJitter)

Freezes validated settings like the other constructor, together with the lane jitter of a lane map. - layerSpacing — Distance between successive layers, in presentation units. - nodeSpacing — Distance between neighbouring nodes inside one layer, in presentation units. - bezierSegments — Line segments per curved edge; ignored unless edgeGeometry is Bezier. - bezierControlOffset — Curve control-point offset in normalized fixed point, 10,000 units per 1.0. - stateTransitionSeconds — How long a node or edge state change plays for; zero asks for an instant change, which the built-in views honour. - id — Parsed identity of the source theme asset. - orientation — Axis along which map layers advance during layout. - backgroundColor — Fallback backdrop color carried for presentation adapters. - edgeColor — Fallback route color used when no style preset supplies one. - edgeGeometry — Straight, stepped polyline, or sampled cubic route shape. - minimumZoom — Smallest permitted viewport zoom after compilation. - maximumZoom — Largest permitted viewport zoom after compilation. - laneJitter — How far a lane map's nodes are drawn off their grid, from 0 to 1; ignored by layered maps.

Properties

public Color BackgroundColor

The authored backdrop colour, carried for a custom view or backdrop to read. Unlike EdgeColor no built-in view consumes it -- the shipped presentation paints its backdrop from the style preset's backdrop and palette tokens -- so changing this alone changes nothing that is drawn. Compilation only checks that its channels are finite, never that they sit in 0..1, so an HDR value reaches a reader exactly as authored.

public int BezierControlOffset

How far a curved edge's control points sit off the straight line, in normalized fixed point at 10,000 units per 1.0. Zero draws a Bezier edge as a straight one.

public int BezierSegments

Line segments per curved edge, from 2 to 64. It only matters when EdgeGeometry is Bezier, where more segments buy smoothness with vertices.

public Color EdgeColor

The colour edges are drawn in when no presentation style is installed on the presenter. A style replaces it outright rather than tinting against it, so this is the fallback look and not a base colour a style modulates.

public MapEdgeGeometryKind EdgeGeometry

The shape edges are sampled into: a straight line, a right-angled polyline that steps across at the halfway point, or a cubic Bezier. Only Bezier reads BezierSegments and BezierControlOffset, but the compiler range-checks both whichever kind is chosen.

public StableId Id

Identity of the theme asset this was compiled from, carried so a presenter or a diagnostic can say which theme is in force and so two themes can be told apart. Layout and drawing read the other fields; nothing keys off this one.

public float LaneJitter

How far the built-in presenters and MapExperienceHost draw each node of a lane map off its lane and floor, from 0 (the lane grid exactly) to 1, through LaneMapLayoutStrategy; already range-checked when the theme came from the compiler. Ignored for layered maps. A theme built with the constructor without it uses LaneMapLayoutStrategy.DefaultJitter.

public int LayerSpacing

Distance between successive layers, in presentation units. Together with the number of layers it sets the map's extent along the orientation axis, and a spacing large enough to push that extent past MapThemeLimits.MaximumContentExtent makes deriving presentation metrics throw rather than report a diagnostic.

public float MaximumZoom

Furthest zoom a view may offer, capped at MapThemeLimits.MaximumZoom so no theme can ask for an unbounded one.

public float MinimumZoom

Closest zoom a view may offer. It is positive and never above MaximumZoom, so the pair is always a usable range.

public int NodeSpacing

Distance between neighbouring nodes inside one layer, in presentation units. It sets the extent across the layers from the busiest layer's node count, under the same ceiling as LayerSpacing, and the built-in views also derive their node size from it.

public MapLayoutOrientation Orientation

Which way layers advance, and therefore which screen axis carries progress. It affects layout only: the same graph read vertically and horizontally is the same map.

public float StateTransitionSeconds

How long a node or edge state change plays for, from 0 to MapThemeLimits.MaximumTransitionSeconds. The presenter passes it to whichever transition path is installed on every state change, and the built-in views treat zero as an instant change rather than a one-frame animation.


MapAuthoringCompiler

:material-star: Start here

public sealed class MapAuthoringCompiler

Waybranch.Authoring · Runtime/Authoring/MapAuthoringCompiler.cs

Turns authoring assets into the immutable compiled types the runtime works with: node types, themes, rule snapshots, and blueprints.

Every entry point returns a compilation result instead of throwing, so an editor tool can list everything wrong with an asset in one pass rather than fixing faults one at a time. Compilation follows asset references: a blueprint compiles its rules, and rules compile every node type they reach, with all of those diagnostics folded into the report you get back. The compiler holds no state between calls and never writes to the assets it reads.

Methods

public MapBlueprintCompilation CompileBlueprint(MapBlueprintAsset asset)

Compiles persisted blueprint rows, generation pins, search budgets, and referenced rules into a regeneration request. - asset — Blueprint asset to compile; null produces an empty failed compilation result. - Returns — The compiled blueprint and its diagnostics; check MapBlueprintCompilation.Succeeded before reading the rules.

public MapNodeTypeCompilation CompileNodeType(MapNodeTypeAsset asset)

Parses a node type's identity, payload, presentation references, colors, and optional cue IDs into a runtime value. - asset — Node-type asset to validate; null produces an asset-missing diagnostic. - Returns — The compiled type and its diagnostics; check MapNodeTypeCompilation.Succeeded before reading the value.

public MapRulesCompilation CompileRules(MapRulesAsset asset)

One traversal of the authored rules and referenced node types yields a validated deterministic generation snapshot. - asset — Rules asset to traverse; null produces an asset-missing diagnostic and no snapshot. - Returns — The snapshot, the node types it referenced, and the diagnostics. The snapshot is discarded when any diagnostic is an error.

public MapThemeCompilation CompileTheme(MapThemeAsset asset)

Checks a theme's layout, geometry, zoom, transition, and color bounds before freezing them for presentation. - asset — Theme asset to validate; null produces an asset-missing diagnostic. - Returns — The compiled theme and its diagnostics; check MapThemeCompilation.Succeeded before reading the value.


MapBlueprintAsset

:material-star: Start here

public sealed class MapBlueprintAsset : ScriptableObject

Waybranch.Authoring · Runtime/Authoring/MapBlueprintAsset.cs

The saved form of one map: the rules it came from, the mode and seed it was generated with, the complete node and edge rows the editor persisted, the budgets a regeneration is allowed, and optional cached fingerprints tying all of that together. Compiling it with MapAuthoringCompiler.CompileBlueprint(MapBlueprintAsset) turns the rows into the authored graph and, separately, hands back the rules, mode, seed, overrides, and budgets a generator needs to reproduce that map at runtime, so the asset is both a stored map and a recipe for one.

Nothing here is settable from code beyond ConfigureForNewAsset. Map Studio edits the asset through Unity serialization instead, which is what keeps AuthoringRevision and the fingerprints in step with the rows they describe.

Properties

public long AuthoringRevision

Editor revision, incremented on every applied edit so a stale in-memory preview cannot overwrite a newer asset. It takes no part in the generation key, so bumping it cannot change the map.

public int BlueprintFormatVersion

Serialization format of the persisted rows. Only 1 is supported; any other value fails compilation outright rather than being read on a best-effort basis.

public IReadOnlyList<BlueprintEdgeOverrideAuthoring> EdgeOverrides

Edges required or forbidden between adjacent slots. These rows are read in MapGenerationMode.Procedural and MapGenerationMode.Hybrid only: a MapGenerationMode.Manual blueprint ignores them and derives one required override per row of Edges instead.

public IReadOnlyList<BlueprintEdgeAuthoring> Edges

Every persisted edge, keyed by IDs that are unique across the whole map rather than per layer.

public string GenerationKey

Cached generation identity -- generator version, mode, rules, overrides, and seed combined -- or empty; checked the same way as RulesFingerprint.

public string GraphFingerprint

Cached fingerprint of the graph the rows build, or empty; checked the same way as RulesFingerprint, and only when the rows do build a graph.

public int MaximumCountStates

Authored value of MapGenerationSearchOptions.MaximumCountStates.

public int MaximumTopologyTrials

Authored value of MapGenerationSearchOptions.MaximumTopologyTrials.

public int MaximumTypeTrials

Authored value of MapGenerationSearchOptions.MaximumTypeTrials.

public MapGenerationMode Mode

How much of this map the generator is allowed to invent when it is rebuilt: everything in MapGenerationMode.Procedural, nothing in MapGenerationMode.Manual, and whatever the pins leave free in MapGenerationMode.Hybrid. It decides which of the other fields are read at all -- Manual requires a zero Seed and ignores EdgeOverrides, deriving its overrides from the stored rows instead.

public IReadOnlyList<BlueprintNodeAuthoring> Nodes

Every persisted node, as a complete graph rather than a patch: a blueprint that carries rows at all must carry all of them. Each row may pin its identity and, independently, its type, position, or payload, and those pins become the node overrides handed to a generator.

public string OverridesFingerprint

Cached fingerprint of the node and edge overrides, or empty; checked the same way as RulesFingerprint.

public MapRulesAsset Rules

The rules this blueprint was generated against, and the rules it is recompiled against. Compilation requires one, and every rule diagnostic it produces is reported as the blueprint's own.

public string RulesFingerprint

Cached fingerprint of the compiled rules, or empty. When present it must equal what compilation computes, so an edited rules asset is reported as a mismatch instead of quietly changing the map.

public uint Seed

Generation seed. MapGenerationMode.Manual requires zero, because a manual map draws nothing at random; a non-zero seed in that mode is a compile error rather than an ignored field.

Fields

public const int CurrentBlueprintFormatVersion

The blueprint serialization format this build writes and reads. Compilation refuses any other value with bw.authoring.blueprint-version-unsupported.

Methods

public void ConfigureForNewAsset(MapRulesAsset rulesAsset, MapGenerationMode generationMode, uint generationSeed)

Replaces the configure For New Asset settings used by future operations; existing immutable graphs and saves are not rewritten. - rulesAsset — Rules to compile against; required, and may not be null at compile time. - generationSeed — Seed to generate with; must be zero for MapGenerationMode.Manual. - generationMode — Procedural, manual, or hybrid policy used when this new blueprint is built.


MapBlueprintCompilation

:material-star: Start here

public sealed class MapBlueprintCompilation

Waybranch.Authoring · Runtime/Authoring/AuthoringCompilation.cs

The result of compiling one MapBlueprintAsset: everything a generation request needs -- rules, mode, seed, overrides, and search budgets -- plus the graph the blueprint authored, when it authored one. A successful compilation does not imply a graph, because Succeeded is decided by Rules and the report alone.

Constructors

public MapBlueprintCompilation( MapRuleSnapshot rules, MapGraph graph, MapGenerationMode mode, uint seed, MapGenerationOverrides overrides, MapGenerationSearchOptions searchOptions, IEnumerable<StableId> lockedNodeIds, long authoringRevision, ValidationReport validation)

Pairs the compiled blueprint parts with the report that describes them. A null overrides or searchOptions is replaced by its empty or default value, and the locked IDs are copied and sorted, so the caller's collection is neither retained nor reordered. - rules — Compiled rules used to validate or regenerate the blueprint, or null after rule failure. - graph — Persisted authored graph, or null when the blueprint contains no complete graph. - mode — How much of the map the blueprint left to the generator. - seed — Explicit unsigned deterministic seed; equal inputs and seed produce equal canonical output. - overrides — Pinned node fields and required or forbidden edges that generation must honor. - searchOptions — Per-phase generation work budgets; null selects the documented defaults. - lockedNodeIds — Nodes the blueprint marked as locked against editing. May be null. - authoringRevision — Editor revision used to detect stale blueprint writes; it does not affect generation identity. - validation — Combined blueprint, graph, rule, and referenced node-type diagnostics.

Properties

public long AuthoringRevision

The blueprint's editor revision, carried through so stale-write protection can compare it against the asset before saving. It is not part of the generation key, so bumping it does not change the map.

public MapGraph Graph

The graph the blueprint authored, or null when it authored no nodes and no edges. It is also null when the rules failed to compile or the graph could not be built at all; a non-null graph says nothing on its own about Succeeded.

public IReadOnlyList<StableId> LockedNodeIds

Nodes the blueprint marked as locked, sorted by ID. A lock only stops Map Studio from editing that node: it creates no override and has no effect on what a generator produces.

public MapGenerationMode Mode

How much of the map the blueprint left to the generator. An authored value that names no known mode is reported as an error and compiled as MapGenerationMode.Procedural, so this always names a real mode -- even on a compilation that failed.

public MapGenerationOverrides Overrides

The node pins and edge overrides a generator must honour; never null, because a blueprint that authored none compiles to MapGenerationOverrides.Empty. A manual blueprint pins every field of every node it drew and marks every edge required, so its overrides describe the whole map on their own.

public MapRuleSnapshot Rules

Null when the blueprint's rules failed to compile.

public MapGenerationSearchOptions SearchOptions

The per-phase work caps one generation attempt may spend; never null, because a blueprint that authored none compiles to MapGenerationSearchOptions.Default. Budgets that are not positive are reported as an error rather than quietly raised.

public uint Seed

The authored seed, passed through unchanged. It is folded into the generation key alongside the mode, the rules, and the overrides, so two blueprints differing only here describe two unrelated maps. A manual blueprint is required to use zero, since it invents nothing.

public bool Succeeded

True only when rules compiled and no diagnostic is an error; a null Graph does not make it false.

public ValidationReport Validation

The blueprint's own diagnostics plus those of the rules and node types it referenced and, when a graph was built, the full MapValidator report for that graph against these rules and overrides -- so a blueprint whose drawn map no longer satisfies its own rules is caught here rather than at generation time.


MapConstraintAsset

:material-puzzle: Extension point — implement this yourself to change behaviour

public abstract class MapConstraintAsset : ScriptableObject

Waybranch.Authoring · Runtime/Authoring/MapConstraintAsset.cs

The ScriptableObject base for a generation rule of your own: subclass it, author whatever fields the rule needs in the Inspector, and hand back an IMapConstraint that judges a map while it is being built. Assets of this kind are listed on a MapRulesAsset and compiled into the rule snapshot beside the built-in quota, forced-type, and adjacency families, which is how a rule those families cannot express still prunes bad maps inside the generator's search rather than after it.

This asset is only the authored front end. The object it compiles to runs deep inside a backtracking search and has to meet the purity and determinism requirements set out on IMapConstraint, so keep the Unity-facing work here and out of the compiled rule.

Methods

public abstract IMapConstraint CompileConstraint()

Subclasses translate their Unity-authored fields into the deterministic rule evaluated during generation. - Returns — The compiled rule. Returning null fails the whole ruleset with a diagnostic rather than dropping this one constraint, and an exception thrown here is caught and reported the same way, so neither can leave a map generated under a rule that never ran.


MapDefaultFont

public sealed class MapDefaultFont : ScriptableObject

Waybranch.Authoring · Runtime/Authoring/MapDefaultFont.cs

The font the built-in views set their text in when nothing names one: the names on a map when neither the experience preset nor the style names a font, the demo HUD of the experience maps after them, and the Setup Wizard's starter panel. It is Nunito Regular, which ships with the package under the SIL Open Font License (Samples/Experience/Fonts/Nunito, with the license text beside it; see Third-Party Notices) together with its font data, so the names look the same on every machine. Unity's built-in font, the default before, takes its glyphs from a font of the operating system (Arial on Windows, Liberation Sans on Linux), so the same map looked different from one machine to the next.

One asset of this type, in a Resources folder of the core (Waybranch/Waybranch Default Font), names the font file; a build therefore carries that one font, about 130 KB, whether a map uses it or not. A font set on the preset or on the style still wins everywhere, so a style of your own that names a font is unchanged; that is also the way to use another font for every map, since the asset belongs to the package and an update replaces it. If the font file is removed from the project (with the examples' fonts, for instance), the views fall back to Unity's built-in font as before.

Methods

public static Font Resolve()

The font to draw with when nothing names one: Nunito Regular from the package, or Unity's built-in runtime font when that file is not in the project. - Returns — The packaged default font when present; otherwise Unity's built-in legacy runtime font.


MapEdgeGeometryKind

:material-star: Start here

public enum MapEdgeGeometryKind

Waybranch.Authoring · Runtime/Authoring/MapThemeAsset.cs

How a route between two nodes is shaped when the built-in views sample it. Straight is the single segment from source to target. Polyline runs along the flow axis to the halfway point, steps across to the target's other coordinate, then continues, giving right-angled routes. Bezier is a cubic curve whose control points are pushed along the flow axis by the theme's control offset and which is sampled into the theme's segment count.

Only Bezier reads those two Bezier fields, but the compiler range-checks them whichever kind you pick.

Value Meaning
Straight —
Polyline —
Bezier —

MapExperienceArt

public sealed class MapExperienceArt : ScriptableObject

Waybranch.Authoring · Runtime/Authoring/MapExperienceArt.cs

Pictures a flat presentation draws instead of its generated shapes: a backdrop (Canvas and UI Toolkit) with a frame and ornaments (Canvas), layered scenery (World2D), and one medallion per node made of a fill and a ring the style tints by state, a halo and a traveller for the current node, and a plate under captions. Every part is optional; a preset without art draws exactly what it drew before.

Properties

public Sprite Backdrop

Picture that covers the whole screen behind the map, scaled until both sides are filled and centred.

public Sprite CurrentMarker

Flag planted on the current node.

public bool DottedLockedRoutes

Whether routes the traveller cannot use are drawn as a dotted line instead of a solid one.

public Sprite Frame

Nine-slice picture drawn along the edge of the screen.

public float FrameScale

How many times smaller the frame's border is drawn than its pixels suggest.

public Color HaloColor

Colour of the halo.

public bool HasNodeArt

True when the art replaces the generated node surface.

public Sprite LabelPlate

Nine-slice plate drawn under a caption.

public IReadOnlyList<MapExperienceArtLayer> Layers

Scenery layers, farthest first.

public Sprite NodeFill

Filled medallion, tinted with the node's state colour.

public Sprite NodeHalo

Ring drawn around the current node.

public Sprite NodeRing

Outline of the medallion, tinted with the ring colour of the node's state.

public IReadOnlyList<MapExperienceArtOrnament> Ornaments

Pictures attached to points of the screen.

public Color PlateColor

Colour of the caption plate.

public MapExperienceArtPlateStates PlateStates

The node states whose caption is drawn on a plate.

public Sprite Traveller

Traveller standing on the current node.

Methods

public bool PlateFor(bool current, bool available, bool visited)

Whether a caption in a state is drawn on a plate. - current — The node is the current one. - available — The traveller can enter the node. - visited — The node has been visited or completed. - Returns — True when the plate states include the state.

public Color RingColor(bool current, bool available, bool visited)

The ring colour of a node in a state. - current — The node is the current one. - available — The traveller can enter the node. - visited — The node has been visited or completed. - Returns — The colour the ring sprite is tinted with.


MapExperienceArtLayer

public sealed class MapExperienceArtLayer

Waybranch.Authoring · Runtime/Authoring/MapExperienceArt.cs

A wide picture behind a world map that always covers the screen width, optionally drifting a little when the map is panned.

Constructors

public MapExperienceArtLayer(Sprite sprite, float bottom, bool coverScreen, float drift, Color tint)

Creates a scenery layer from a sprite and how it is scaled, placed and drifted against the screen. - sprite — Picture to draw; its width should be about ten percent more than the screen it covers. - bottom — Height of the picture's lower edge as a fraction of the screen height, 0 at the bottom of the screen. - coverScreen — True scales the picture until it covers the whole screen; false scales it to the screen width and keeps its proportions. - drift — Fraction of the map's panning the layer follows; 0 keeps it still. - tint — Colour multiplied into the picture.

public MapExperienceArtLayer()

Creates a layer with no sprite, resting on the bottom of the screen and not drifting, for Unity serialization.

Properties

public float Bottom

Height of the picture's lower edge as a fraction of the screen height.

public bool CoverScreen

Whether the picture is scaled to cover the whole screen.

public float Drift

Fraction of the map's panning the layer follows.

public Sprite Sprite

Picture to draw.

public Color Tint

Colour multiplied into the picture.


MapExperienceArtOrnament

public sealed class MapExperienceArtOrnament

Waybranch.Authoring · Runtime/Authoring/MapExperienceArt.cs

A picture placed against the screen behind a map, such as a compass rose in a corner.

Constructors

public MapExperienceArtOrnament(Sprite sprite, Vector2 anchor, Vector2 pivot, Vector2 offset, float height)

Creates an ornament from a sprite and where it sits against the screen; sizes are in reference pixels of a 1080 pixel high screen. - sprite — Picture to draw. - anchor — Point of the screen the ornament is attached to, 0 to 1 from the bottom left. - pivot — Point of the picture that sits on the anchor, 0 to 1 from the bottom left. - offset — Distance from the anchor in reference pixels of a 1080 pixel high screen; positive moves right and up. - height — Height of the picture in reference pixels of a 1080 pixel high screen.

public MapExperienceArtOrnament()

Creates an ornament with no sprite, a top right anchor and a height of 128 reference pixels, for Unity serialization.

Properties

public Vector2 Anchor

Point of the screen the ornament is attached to, 0 to 1 from the bottom left.

public float Height

Height of the picture in reference pixels of a 1080 pixel high screen.

public Vector2 Offset

Distance from the anchor in reference pixels of a 1080 pixel high screen.

public Vector2 Pivot

Point of the picture that sits on the anchor, 0 to 1 from the bottom left.

public Sprite Sprite

Picture to draw.


MapExperienceArtPlateStates

public enum MapExperienceArtPlateStates

Waybranch.Authoring · Runtime/Authoring/MapExperienceArt.cs

The node states whose caption is drawn on a plate.

Value Meaning
None No caption has a plate.
Current The caption of the current node.
Available The captions of nodes the traveller can enter.
Locked The captions of nodes the traveller cannot enter yet.
Visited The captions of nodes already visited.

MapExperienceAssetMapping

:material-star: Start here

public sealed class MapExperienceAssetMapping

Waybranch.Authoring · Runtime/Authoring/MapExperiencePreset.cs

Maps authored node types to optional presentation assets without coupling Core to Unity objects.

Properties

public string IconKey

Optional renderer-specific icon key for the mapped type.

public string NodeTypeId

Stable node-type identifier matched by this mapping.

public GameObject Prefab

Optional prefab used by world presentations.

public Sprite Sprite

Optional sprite used by 2D or Canvas presentations.

public bool TintPrefabWithState

Whether the World3D renderer may tint this authored prefab with node state.


MapExperienceBackend

:material-star: Start here

public enum MapExperienceBackend

Waybranch.Authoring · Runtime/Authoring/MapExperiencePreset.cs

Presentation backend selected by a map experience preset.

Value Meaning
Canvas Canvas/uGUI presentation.
World2D World-space 2D presentation.
World3D World-space 3D presentation.
UIToolkit UI Toolkit presentation when supported by the Unity version.

MapExperienceInteractionOptions

:material-star: Start here

public struct MapExperienceInteractionOptions

Waybranch.Authoring · Runtime/Authoring/MapExperiencePreset.cs

Inspector-editable interaction settings shared by all presentation backends.

Properties

public bool ConfirmOnSelection

Whether selecting a node immediately confirms it.

public static MapExperienceInteractionOptions Default

Returns the default interaction policy for a new preset.

public bool PanZoom

Whether viewport pan and zoom gestures are enabled.

public bool ReducedMotion

Whether renderers should reduce transition motion.


MapExperienceNodePlacement

:material-star: Start here

public sealed class MapExperienceNodePlacement

Waybranch.Authoring · Runtime/Authoring/MapExperiencePreset.cs

Optional presentation offset that never changes the graph or its stable IDs.

Properties

public float Elevation

Optional world-space elevation used by 3D presentations.

public string NodeId

Stable node identifier receiving this presentation offset.

public Vector2 Offset

Normalized visual offset applied without changing graph coordinates.


MapExperiencePreset

:material-star: Start here

public sealed class MapExperiencePreset : ScriptableObject

Waybranch.Authoring · Runtime/Authoring/MapExperiencePreset.cs

Authoring configuration for a runtime map experience. It selects a renderer, style and progression policy while leaving the compiled graph and save identity untouched.

Properties

public Color AccentColor

Accent color supplied to renderers and sample controls.

public bool AllowRepeatCompletion

Whether completed content may run again in revisitable sessions.

public MapExperienceArt Art

Optional pictures a flat presentation draws in place of its generated shapes; null keeps the generated look.

public IReadOnlyList<MapExperienceAssetMapping> AssetMappings

Detached copies of node-type asset mappings.

public MapExperienceBackend Backend

Presentation backend used by this preset.

public MapBlueprintAsset Blueprint

Blueprint that supplies the map graph or generation request.

public VisualTreeAsset DocumentTemplate

Optional UI Toolkit document template.

public MapExperienceInteractionOptions Interaction

Input and viewport behavior shared by presentations.

public Font LabelFont

Optional font supplied to labels.

public IReadOnlyList<MapExperienceNodePlacement> NodePlacements

Detached copies of presentation-only node placements.

public VisualTreeAsset NodeTemplate

Optional UI Toolkit node template.

public MapExperienceProgressionPolicy ProgressionPolicy

Progression policy used to create a new session.

public MapExperienceRouteAppearance RouteAppearance

Optional detached route geometry and curvature override.

public MapStylePreset Style

Optional authored style shared by compatible renderers.

public StyleSheet StyleSheet

Optional UI Toolkit stylesheet.

public MapThemeAsset Theme

Theme supplying node rules and map content metadata.

public MapExperienceVisualPreset VisualPreset

Ready-made visual look selected for the presentation.

Methods

public MapExperienceRuntimeOptions CreateRuntimeOptions()

Creates a detached value object suitable for temporary Play Mode overrides. - Returns — The immutable runtime options compiled from this authoring preset.


MapExperienceProgressionPolicy

:material-star: Start here

public enum MapExperienceProgressionPolicy

Waybranch.Authoring · Runtime/Authoring/MapExperiencePreset.cs

Progression policy selected by an experience. Existing forward maps remain the default.

Value Meaning
Forward Use the existing one-way map session behavior.
Revisitable Allow policy-controlled movement back through discovered links.

MapExperienceRouteAppearance

:material-star: Start here

public struct MapExperienceRouteAppearance

Waybranch.Authoring · Runtime/Authoring/MapExperiencePreset.cs

Optional route appearance override carried by an experience preset.

Constructors

public MapExperienceRouteAppearance(bool overrideTheme, MapEdgeGeometryKind geometry, float curveStrength)

Creates a route appearance override; invalid geometry and strength are sanitized by its getters. - overrideTheme — Whether to use this route appearance instead of the theme geometry. - geometry — Requested route geometry. - curveStrength — Requested normalized Bezier curvature strength.

public MapExperienceRouteAppearance(bool overrideTheme, MapEdgeGeometryKind geometry, float curveStrength, bool groundRibbon, bool hideLockedRoutes)

Creates a route appearance override that also selects ground ribbons and locked-route hiding. - overrideTheme — Whether to use this route appearance instead of the theme geometry. - geometry — Requested route geometry. - curveStrength — Requested normalized Bezier curvature strength. - groundRibbon — Whether the World3D presentation draws routes as flat strips on the ground. - hideLockedRoutes — Whether the World3D presentation omits routes that are locked.

Properties

public float CurveStrength

Normalized curvature strength, sanitized to the inclusive unit interval.

public static MapExperienceRouteAppearance Default

Default disabled route override using Bezier geometry and half strength.

public MapEdgeGeometryKind Geometry

Route geometry to use when OverrideTheme is enabled.

public bool GroundRibbon

Whether the World3D presentation draws each route as a flat strip lying on the ground. Off by default.

public bool HideLockedRoutes

Whether the World3D presentation omits routes that are locked until they are revealed. Off by default.

public bool OverrideTheme

Whether this preset supplies route geometry and curvature.


MapExperienceRuntimeOptions

:material-star: Start here

public sealed class MapExperienceRuntimeOptions

Waybranch.Authoring · Runtime/Authoring/MapExperiencePreset.cs

Detached experience settings used by a host while a preset remains unchanged.

Constructors

public MapExperienceRuntimeOptions(MapExperienceBackend backend, MapExperienceVisualPreset visualPreset, MapExperienceInteractionOptions interaction, MapExperienceProgressionPolicy policy, bool allowRepeatCompletion, Color accentColor, Font labelFont, IReadOnlyList<MapExperienceAssetMapping> assetMappings, IReadOnlyList<MapExperienceNodePlacement> nodePlacements = null, MapStylePreset style = null, VisualTreeAsset documentTemplate = null, VisualTreeAsset nodeTemplate = null, StyleSheet styleSheet = null)

Creates immutable runtime options from backend, visual, interaction, progression, asset, layout, and UI template settings. - backend — Presentation backend to select. - visualPreset — Ready-made visual look. - interaction — Shared input and viewport behavior. - policy — Progression policy for the session. - allowRepeatCompletion — Whether revisitable content may repeat. - accentColor — Accent color for presentation elements. - labelFont — Optional label font. - assetMappings — Node-type asset mappings to copy. - nodePlacements — Presentation-only placements to copy. - style — Optional authored style. - documentTemplate — Optional UI Toolkit document template. - nodeTemplate — Optional UI Toolkit node template. - styleSheet — Optional UI Toolkit stylesheet.

public MapExperienceRuntimeOptions(MapExperienceBackend backend, MapExperienceVisualPreset visualPreset, MapExperienceInteractionOptions interaction, MapExperienceProgressionPolicy policy, bool allowRepeatCompletion, Color accentColor, Font labelFont, IReadOnlyList<MapExperienceAssetMapping> assetMappings, IReadOnlyList<MapExperienceNodePlacement> nodePlacements, MapStylePreset style, VisualTreeAsset documentTemplate, VisualTreeAsset nodeTemplate, StyleSheet styleSheet, MapExperienceRouteAppearance routeAppearance)

Copies authoring values into immutable runtime options, including route appearance settings and caller-owned asset references. - backend — Presentation backend to select. - visualPreset — Ready-made visual look. - interaction — Shared input and viewport behavior. - policy — Progression policy for the session. - allowRepeatCompletion — Whether revisitable content may repeat. - accentColor — Accent color for presentation elements. - labelFont — Optional label font. - assetMappings — Node-type asset mappings to copy. - nodePlacements — Presentation-only placements to copy. - style — Optional authored style. - documentTemplate — Optional UI Toolkit document template. - nodeTemplate — Optional UI Toolkit node template. - styleSheet — Optional UI Toolkit stylesheet. - routeAppearance — Route geometry and curvature override.

public MapExperienceRuntimeOptions(MapExperienceBackend backend, MapExperienceVisualPreset visualPreset, MapExperienceInteractionOptions interaction, MapExperienceProgressionPolicy policy, bool allowRepeatCompletion, Color accentColor, Font labelFont, IReadOnlyList<MapExperienceAssetMapping> assetMappings, IReadOnlyList<MapExperienceNodePlacement> nodePlacements, MapStylePreset style, VisualTreeAsset documentTemplate, VisualTreeAsset nodeTemplate, StyleSheet styleSheet, MapExperienceRouteAppearance routeAppearance, MapExperienceArt art)

Copies authoring values into immutable runtime options, including route appearance and optional node and scene art. - backend — Presentation backend to select. - visualPreset — Ready-made visual look. - interaction — Shared input and viewport behavior. - policy — Progression policy for the session. - allowRepeatCompletion — Whether revisitable content may repeat. - accentColor — Accent color for presentation elements. - labelFont — Optional label font. - assetMappings — Node-type asset mappings to copy. - nodePlacements — Presentation-only placements to copy. - style — Optional authored style. - documentTemplate — Optional UI Toolkit document template. - nodeTemplate — Optional UI Toolkit node template. - styleSheet — Optional UI Toolkit stylesheet. - routeAppearance — Route geometry and curvature override. - art — Optional pictures drawn in place of generated shapes.

Properties

public Color AccentColor

Accent color for renderer-owned UI.

public bool AllowRepeatCompletion

Whether revisitable content may repeat.

public MapExperienceArt Art

Optional pictures a flat presentation draws in place of its generated shapes.

public IReadOnlyList<MapExperienceAssetMapping> AssetMappings

Immutable copies of mapped assets.

public MapExperienceBackend Backend

Selected presentation backend.

public CompiledMapStyle CompiledStyle

Immutable compiled style for renderer consumption.

public VisualTreeAsset DocumentTemplate

Optional UI Toolkit document template.

public MapExperienceInteractionOptions Interaction

Detached interaction settings.

public Font LabelFont

Optional label font.

public IReadOnlyList<MapExperienceNodePlacement> NodePlacements

Immutable copies of presentation placements.

public VisualTreeAsset NodeTemplate

Optional UI Toolkit node template.

public MapExperienceProgressionPolicy ProgressionPolicy

Active session progression policy.

public MapExperienceRouteAppearance RouteAppearance

Route geometry and curvature override.

public MapStylePreset Style

Optional authored style carried with the detached runtime options.

public StyleSheet StyleSheet

Optional UI Toolkit stylesheet.

public MapExperienceVisualPreset VisualPreset

Selected ready-made visual look.


MapExperienceVisualPreset

:material-star: Start here

public enum MapExperienceVisualPreset

Waybranch.Authoring · Runtime/Authoring/MapExperiencePreset.cs

Small set of ready-to-style starting looks for a new experience.

Value Meaning
Slate Neutral slate starting appearance.
Parchment Illustrated parchment starting appearance.
Neon Bright science-fiction starting appearance.

MapFlowDirection

:material-star: Start here

public enum MapFlowDirection

Waybranch.Authoring · Runtime/Authoring/MapStyleTokens.cs

Where the map's progress runs on the screen.

The default, AlongThemeAxis, follows the theme: the map's progress runs along the axis the theme lays its layers on, so a horizontal theme lies left to right and a vertical theme runs upward. The other four values each name a direction on the screen and turn the map that way whatever the theme's axis: a horizontal theme under BottomToTop is drawn standing up, its layout transposed (a quarter turn and a mirror). The direction is applied when normalized positions are converted for display. It is presentation-only, so turning a map cannot change the generated graph, a save, or a fingerprint -- a saved run reopened after a direction change is still the same run, drawn another way round.

Value Meaning
AlongThemeAxis Progress runs along the theme's own axis: rightward for a horizontal theme, upward for a vertical one.
BottomToTop Progress runs upward on the screen, whatever the theme's axis.
TopToBottom Progress runs downward on the screen, as in a descent, whatever the theme's axis.
LeftToRight Progress runs rightward on the screen, whatever the theme's axis.
RightToLeft Progress runs leftward on the screen, for right-to-left reading orders, whatever the theme's axis.

MapLayoutOrientation

:material-star: Start here

public enum MapLayoutOrientation

Waybranch.Authoring · Runtime/Authoring/MapThemeAsset.cs

Which axis a map's layers advance along once it is laid out. Vertical runs the layers along Y and spreads each layer's nodes along X; Horizontal swaps the two. The same graph is laid out either way, so this is a presentation choice and never changes node identity or reachability.

Waybranch.Core declares an enum of the same name and the same values for its own layout and geometry code; this is the authored form that a MapThemeAsset stores.

Value Meaning
Vertical —
Horizontal —

MapNodeTypeAsset

:material-star: Start here

public sealed class MapNodeTypeAsset : ScriptableObject

Waybranch.Authoring · Runtime/Authoring/MapNodeTypeAsset.cs

One kind of node a map may contain: its stable identity, the label and tooltip shown for it, the prefabs, icon, and per-state colors the built-in views draw it with, and the default payload that says what the kind means to your game. Rules name node types by the stable ID authored here, so that ID -- never the asset's file name -- is what weights, quotas, forced slots, and adjacency bans are written against, and renaming or moving the asset changes nothing.

A type only exists for a map if the rules reach it: the default type, the weight table, the zone lists, the quotas, the forced nodes, and the adjacency rules are the only routes by which an asset gets compiled and becomes placeable. Everything below the identity is presentation and integration, and none of it takes part in generation or in a map's identity.

Properties

public Color AvailableColor

Color for a node the player may enter next. Being unlocked by hand counts as available too, so a node opened outside normal progression reads the same as one reached by route.

public GameObject CanvasPrefab

Prefab the built-in canvas factory instantiates per node. When null the factory builds a plain canvas node instead; when the prefab carries no IMapNodeView component the factory adds the built-in one.

public string CompleteAudioCueId

Cue passed to your audio adapter when a node of this type is completed, on the same terms as EnterAudioCueId.

public Color CompletedColor

Color for a node whose completion result is in the progression. Completion is tested first of all six states, so this wins over current, available, and visited alike.

public Color CurrentColor

Color for the node the player is standing on. Completion is tested before position, so a current node that already has a result recorded draws in CompletedColor.

public string DefaultPayloadId

Optional identity of the payload that describes what a node of this type means to your game. It is content you read off the compiled type: generation never copies it into the nodes it produces, so it cannot change a map. Required as soon as DefaultProperties holds anything.

public IReadOnlyList<MapPropertyAuthoring> DefaultProperties

Tagged values carried alongside DefaultPayloadId. Keys must be unique and each value must be canonical for its kind; compilation sorts them by key.

public string DisplayLabel

Label used when LocalizationKey is empty or your localization adapter has no entry for it. It is a fallback, not a default that a translation is layered over.

public string EnterAudioCueId

Cue passed to your audio adapter when a session enters a node of this type. Empty, or text that is not a valid stable ID, simply plays nothing.

public Color HiddenColor

Color for a node the player has not discovered yet, and the color the built-in views fall back to for any visual state they do not recognise. Fog is applied afterwards and independently: it scales the alpha of whichever of these six colors the state selected.

public Sprite Icon

Sprite the built-in views show for the node. A styled node insets it inside the node shape; an unstyled one uses it as the node's own sprite, and falls back to a generated rounded sprite when this is null.

public string LocalizationKey

Key handed to your localization adapter for the label. The tooltip is looked up under the same key with .tooltip appended, so one key covers both strings; leaving this empty suppresses the lookup entirely and uses the authored fallbacks.

public Color LockedColor

Color for a node the player has discovered but cannot reach from where they stand.

public string RendererKey

Optional discriminator that separates views of this type from otherwise identical ones. It is part of the built-in factories' pool key, so changing it stops a pooled view from being reused and forces a fresh instance.

public string StableIdText

The authored identity as raw text, before it is parsed. Compilation turns it into the StableId that rules and graphs use, and rejects the asset outright if the text is not a valid stable ID or if a different asset already compiled under the same one.

public string Tooltip

Tooltip text used when the localized .tooltip lookup yields nothing.

public Color VisitedColor

Color for a node reached earlier with no completion recorded against it. It is the last of the reachable states to be tested, so a visited node that is also current or available takes those colors instead.

public GameObject WorldPrefab

Prefab the built-in world-space factory instantiates per node, with the same null and missing-component handling as CanvasPrefab.

Methods

public void Configure( string id, string label, string payloadId, IEnumerable<MapPropertyAuthoring> properties)

Replaces the configure settings used by future operations; existing immutable graphs and saves are not rewritten. - id — Stable ID text; a value that does not parse fails compilation rather than this call. - label — Fallback display label. - payloadId — Default payload ID; pass an empty string for no payload. - properties — Default payload properties, copied into a new list. Null is stored as an empty list.


MapNodeTypeCompilation

:material-star: Start here

public sealed class MapNodeTypeCompilation

Waybranch.Authoring · Runtime/Authoring/AuthoringCompilation.cs

The result of compiling one MapNodeTypeAsset: the immutable node type on success, and in every case the diagnostics the compiler gathered. Bad authoring is reported here rather than thrown, so check Succeeded before reading Value.

Constructors

public MapNodeTypeCompilation(CompiledMapNodeType value, ValidationReport validation)

Pairs a compiled node type with the report that describes it. - value — Compiled node type, or null when authoring could not produce one. - validation — Complete diagnostics collected while compiling the node-type asset.

Properties

public bool Succeeded

True only when a value was produced and no diagnostic is an error; warnings alone still succeed.

public ValidationReport Validation

Everything the compiler had to say about this asset. Read it even on success: a warning does not stop Succeeded being true.

public CompiledMapNodeType Value

Null when compilation failed.


MapPropertyAuthoring

:material-star: Start here

public sealed class MapPropertyAuthoring

Waybranch.Authoring · Runtime/Authoring/MapPropertyAuthoring.cs

One authored row of a tagged property: its key, which kind of value it holds, and three value fields to hold it -- a numeric one shared by the boolean, integer, and fixed-point kinds, plus one for text and one for a stable ID.

This is the Unity-serializable counterpart of MapPropertyValue, which the authoring compiler turns each row into. Only the field Kind selects may carry data: a row that leaves data in one of the others compiles to a value that is not canonical, and is reported and dropped rather than quietly corrected. The fields are private and serialized while the properties are read-only, so a row is edited in the inspector rather than in code; the getters substitute an empty string for the nulls that deserialization can leave behind. The inspector shows only the field Kind names, so a row authored there cannot carry the leftover data that makes it non-canonical.

Constructors

public MapPropertyAuthoring()

Creates an empty string-valued property row for inspector authoring.

public MapPropertyAuthoring( string key, MapPropertyKind kind, long numericValue, string stringValue, string stableIdValue)

One tagged-property row retains all serialized value slots; compilation enforces that only the selected kind is populated. - key — Lowercase stable key under which the payload property is stored. - kind — Which of the three value parameters is the meaningful one. - numericValue — Raw boolean, integer, or fixed-point storage selected by kind. - stringValue — Text storage used only when kind is MapPropertyKind.String. - stableIdValue — Stable-ID text used only when kind is MapPropertyKind.StableId.

Properties

public string Key

The key this property is stored under. Never null. Compiling the row requires it to parse as a lowercase stable ID and to be unique among the keys of its payload.

public MapPropertyKind Kind

Which of NumericValue, StringValue, and StableIdValue holds this row's value. The other two must be left at their defaults for the row to compile.

public long NumericValue

The value for the boolean, integer, and fixed-point kinds: 1 or 0 for a boolean, the number itself for an integer, and the number already multiplied by MapPropertyValue.FixedPointScale for fixed point. Zero for the other kinds, since nothing here scales or converts on your behalf.

public string StableIdValue

The value for MapPropertyKind.StableId, and empty for every other kind. Never null. It is held as text here and parsed into a stable ID when the row is compiled, so an unusable reference is reported as a diagnostic rather than lost.

public string StringValue

The value for MapPropertyKind.String, and empty for every other kind. Never null.


MapRulesAsset

:material-star: Start here

public sealed class MapRulesAsset : ScriptableObject

Waybranch.Authoring · Runtime/Authoring/MapRulesAsset.cs

The inspector-authored ruleset every Waybranch map is generated from: how many nodes each layer may hold, which node types may appear and how often they are chosen, the zones that narrow those choices over a range of layers, the quota, forced-node, and adjacency rules a finished map has to satisfy, and the branch, merge, and crossing limits its edges must respect. Nothing here is enforced while you edit. The asset is compiled by MapAuthoringCompiler.CompileRules into an immutable MapRuleSnapshot, and that is where contradictions are reported -- a ruleset that fails to compile yields no snapshot at all, so generation never runs on half-valid rules. The snapshot's fingerprint is folded into the generation key, which is why editing a rules asset replaces the maps its seeds produce rather than refining them.

Properties

public string ConnectionRuleId

Identity carried by the compiled connection rules, never null. It has to parse as a stable ID or compilation reports the ruleset as invalid.

public EdgeCrossingPolicy CrossingPolicy

Whether edges between two layers may cross one another. Forbidding crossings is enforced with a deterministic monotone check over the topology rather than by measuring drawn positions, so the guarantee survives whatever theme, orientation, or custom layout the map is eventually drawn with -- and it constrains which edge sets exist at all, not merely how they are rendered.

public IReadOnlyList<MapConstraintAsset> CustomConstraints

Extra constraint assets compiled alongside the built-in rules. Each one is asked for its constraint at compile time, and a constraint that compiles to null or throws fails the whole ruleset rather than being skipped.

public MapNodeTypeAsset DefaultNodeType

The fallback node type. It is required -- compilation fails without it -- and it always joins the compiled type set even when no weight, zone, or rule mentions it.

public IReadOnlyList<ForbiddenAdjacencyAuthoring> ForbiddenAdjacencies

Pairs of node types that may not end up at the two ends of an edge, each either directional or symmetric. The generator applies them on both sides of the problem -- it prunes types that would break a ban while assigning them, and never adds an optional edge whose endpoints match one -- so a ban can leave a chosen topology with no legal type assignment at all rather than merely thinning its connections.

public IReadOnlyList<ForcedNodeAuthoring> ForcedNodes

Node types pinned to an exact layer and ordinal. Layers are filled contiguously from ordinal zero, so forcing ordinal n obliges that layer to hold at least n + 1 nodes: a forced node can raise a layer's effective size above its authored minimum and rule out layer sizes that would otherwise have been legal.

public int GeneratorVersion

The generator algorithm version paired with SchemaVersion. It is part of the generation key, so changing it changes every map these rules produce.

public int LaneCount

Lane maps only: lanes across the hidden grid, from 2 to 15; every layer maximum has to fit in it. Ignored by layered rules.

public string LaneRuleId

Lane maps only: identity of the compiled lane rules, never null. It has to parse as a stable ID when the shape is Lanes.

public IReadOnlyList<LayerRangeAuthoring> Layers

One row per layer, in layer order: the position in this list is the layer index the row describes.

public int MaximumIncoming

Merge cap: the most edges one node may receive from the layer below. It still has to leave room for a backbone that connects every layer.

public int MaximumOutgoing

Branch cap: the most edges one node may send to the layer above. It still has to leave room for a backbone that connects every layer.

public int MinimumSplitLength

Lane maps only: fewest floors between two paths parting and meeting again; 0 is off, otherwise 3 to 16. Ignored by layered rules.

public IReadOnlyList<NodeTypeWeightAuthoring> NodeTypeWeights

The node types the generator may reach for, and how often it reaches for each. This list is also the type domain: a type with no row here cannot be placed at all and cannot be named by a zone, quota, forced-node, or adjacency rule, so adding a type to the project is not enough on its own. Weights are proportional rather than ranked -- a weight of 3 is tried three times as often as a weight of 1 -- and compilation requires each to be between 1 and 1,000,000, so the zero the inspector will accept is reported as an error rather than read as "never choose this type".

public int OptionalEdgeChance

The chance out of 10,000 -- not out of 100 -- that each candidate optional edge is added, applied only after the mandatory backbone exists.

public int PathCount

Lane maps only: paths walked over the grid, from 1 to 32; a walked floor keeps at most this many nodes. Ignored by layered rules.

public IReadOnlyList<QuotaAuthoring> Quotas

Inclusive minimum and maximum counts for one node type, over the whole map or over a single zone. The generator treats each as a hard constraint rather than a preference, so a quota it cannot satisfy makes generation backtrack and finally fail with a diagnostic instead of returning a map that breaks the bound.

public int SchemaVersion

The rules schema version this asset was authored against; copied straight into the compiled snapshot.

public MapShape Shape

How these rules build their maps: MapShape.Lanes when the asset declares the lane schema and generator (version three), otherwise MapShape.Layered. Every rules asset made before lane maps, and every new one until its shape is changed, is layered. Change it with ConfigureShape or the Map Shape field of the inspector; doing so replaces every map these rules produce.

public IReadOnlyList<ZoneAuthoring> Zones

Layer ranges that narrow what may appear inside them, through permitted and forbidden type lists and weight overrides that replace NodeTypeWeights for those layers. Ranges may not overlap, and a layer no zone covers falls back to the map-wide weights. A zone override may be zero, unlike a map-wide weight, which is how a type is kept out of one stretch of the map while staying available elsewhere.

Methods

public void Configure( MapNodeTypeAsset defaultType, IEnumerable<LayerRangeAuthoring> layerRows, IEnumerable<NodeTypeWeightAuthoring> weights)

Overwrites the core of this ruleset in place -- default node type, layer rows, and node type weights -- and stamps the schema and generator versions this build authors. It is the code path behind generated starter assets, samples, and tests: the lists are replaced wholesale, zones, quotas, forced nodes, adjacencies, connection limits, and custom constraints are left exactly as they were, nothing is validated here, and the asset is neither marked dirty nor saved, so an editor caller still has to do that. - defaultType — Required fallback node type included in every compiled ruleset. - layerRows — One row per layer, in layer order; null clears the layers. - weights — Positive relative selection weight; zero or negative values are rejected by validation.

public void ConfigureAdvanced( MapNodeTypeAsset defaultType, IEnumerable<LayerRangeAuthoring> layerRows, IEnumerable<NodeTypeWeightAuthoring> weights, IEnumerable<ZoneAuthoring> zoneRows, IEnumerable<QuotaAuthoring> quotaRows, IEnumerable<ForcedNodeAuthoring> forcedRows, IEnumerable<ForbiddenAdjacencyAuthoring> adjacencyRows, string connectionId, int maxOutgoing, int maxIncoming, int optionalChance, EdgeCrossingPolicy edgeCrossingPolicy, IEnumerable<MapConstraintAsset> constraints)

Overwrites every rule on this asset: everything Configure covers plus zones, quotas, forced nodes, forbidden adjacencies, the connection limits, and the custom constraints. Any sequence passed as null becomes an empty list, so unlike Configure -- which leaves the zone, quota, and connection settings untouched -- this resets every category and leaves nothing behind from an earlier configuration. It validates nothing -- contradictory rules surface when the asset is compiled -- and does not mark the asset dirty or save it. - defaultType — Required fallback node type included in every compiled ruleset. - layerRows — One row per layer, in layer order. - weights — Positive relative selection weight; zero or negative values are rejected by validation. - zoneRows — Layer ranges with their permitted types, forbidden types, and local weight overrides. - quotaRows — Minimum and maximum counts for a node type, optionally scoped to one zone. - forcedRows — Node types required at an exact layer and ordinal slot. - adjacencyRows — Node type pairs that may not end up adjacent. - connectionId — Stable ID for the compiled connection rules. - maxOutgoing — Branch cap: the most edges one node may send to the layer above. - maxIncoming — Merge cap: the most edges one node may receive from the layer below. - optionalChance — Chance out of 10,000 that each candidate optional edge is added. - edgeCrossingPolicy — Whether edge crossings are forbidden or allowed. - constraints — Custom constraint assets to compile alongside the built-in rules.

public void ConfigureShape( MapShape shape, int lanes = MapLaneRules.DefaultLaneCount, int paths = MapLaneRules.DefaultPathCount, int splitLength = MapLaneRules.DefaultMinimumSplitLength)

Sets how these rules build their maps, for building a ruleset from code: MapShape.Lanes stamps the lane schema and generator (version three) and writes the lane values; MapShape.Layered stamps version two and keeps the lane values, which layered rules ignore. Call it after Configure or ConfigureAdvanced, which stamp the layered versions. Ranges are not checked here (the compiler reports them); no undo step is registered and the asset is not marked dirty. Changing the shape replaces every map these rules produce, and a blueprint that stores a preview of them has to be saved again. - shape — Layered or Lanes. - lanes — Lanes across the grid, from 2 to 15; used by Lanes only. - paths — Paths walked over the grid, from 1 to 32; used by Lanes only. - splitLength — Fewest floors between two paths parting and meeting again: 0 (off) or 3 to 16; used by Lanes only.


MapRulesCompilation

:material-star: Start here

public sealed class MapRulesCompilation

Waybranch.Authoring · Runtime/Authoring/AuthoringCompilation.cs

The result of compiling one MapRulesAsset: the rule snapshot a generator can be handed, every node type those rules referenced, and the diagnostics the compiler gathered. Value is null when compilation failed, while NodeTypes still lists whatever compiled cleanly, so a failed compilation is still worth reporting to an author.

Constructors

public MapRulesCompilation(MapRuleSnapshot value, IEnumerable<CompiledMapNodeType> nodeTypes, ValidationReport validation)

Pairs a rule snapshot with the node types it referenced and the report that describes both. The node types are copied and sorted by ID, so the caller's collection is neither retained nor reordered, and a null collection is stored as an empty one. - value — Validated rule snapshot, or null when any rule failed compilation. - nodeTypes — Every node type the rules referenced. Null is treated as an empty set. - validation — Combined rule and referenced node-type diagnostics.

Properties

public IReadOnlyList<CompiledMapNodeType> NodeTypes

Every node type the rules reached -- the default type, the weights, the zone lists, the quotas, the forced nodes, and the forbidden adjacencies -- compiled once each and ordered by ID rather than by where they were authored.

public bool Succeeded

True only when a snapshot was produced and no diagnostic is an error; warnings alone still succeed.

public ValidationReport Validation

The rules' own diagnostics together with those of every node type they referenced, so a fault in a shared node-type asset surfaces here rather than only where that asset lives.

public MapRuleSnapshot Value

The snapshot a generator can be handed, or null when compilation failed. The compiler discards a snapshot whose report holds any error rather than returning a half-built one, so a non-null value here is always one that passed rule validation.


MapShape

public enum MapShape

Waybranch.Authoring · Runtime/Authoring/MapRulesAsset.cs

How a ruleset builds its maps. The value is the rule schema and generator version the asset declares, so it is read from and written to MapRulesAsset.SchemaVersion and MapRulesAsset.GeneratorVersion, which every rules asset already stores.

Value Meaning
Layered —
Lanes —

MapThemeAsset

:material-star: Start here

public sealed class MapThemeAsset : ScriptableObject

Waybranch.Authoring · Runtime/Authoring/MapThemeAsset.cs

The authored asset that decides how a generated map is laid out and drawn: layer and node spacing, which axis the layers run along, how edges are shaped, the two colours the built-in views paint the backdrop and the routes with, the zoom range the view allows, and how long a node state change is given.

Create one from Assets > Create > Waybranch > Map Theme, then compile it with MapAuthoringCompiler.CompileTheme; the compiled theme is what the runtime, the presenters, and the input controller actually read. Authored values are validated rather than clamped, so a value outside the range noted on its property fails compilation with a diagnostic instead of being quietly corrected.

None of it takes part in generation. Spacing, orientation and the lane jitter place the laid-out map without touching the graph the generator produced, so a theme can be edited or swapped without invalidating a map or a save. Purely cosmetic styling - palette, node shapes, per-state emphasis - lives in MapStylePreset instead.

Properties

public Color BackgroundColor

Backdrop colour carried onto the compiled theme. Unlike the numeric fields it has no range, but every channel must be a finite number: a NaN or infinite channel fails compilation. A MapStylePreset carries its own backdrop tokens, so a project that assigns one is painted from the style rather than from here.

public int BezierControlOffset

How far along the flow axis a Bezier edge's control points are pushed away from its endpoints, in normalized map units where 10000 is the full span of the map, not in presentation units. Must be between 0 and 10000; 0 collapses the curve onto the straight line between the two nodes. Ignored unless EdgeGeometry is Bezier.

public int BezierSegments

How many line segments a Bezier edge is sampled into; higher is smoother and costlier. Must be between 2 and 64. Ignored unless EdgeGeometry is Bezier.

public Color EdgeColor

One flat colour for every route, whatever its state. The built-in presenters fall back to it only when no MapStylePreset is assigned; with a style in place a route is coloured by its traversal role instead, so this value stops being read. Every channel must be finite or compilation fails.

public MapEdgeGeometryKind EdgeGeometry

How a route between two nodes is shaped when the built-in views sample it. Only MapEdgeGeometryKind.Bezier reads BezierSegments and BezierControlOffset, but both are range-checked whichever kind is chosen, so an out-of-range Bezier field fails compilation even on a straight-edged theme.

public float LaneJitter

How far the built-in presenters and MapExperienceHost draw each node of a lane map (a graph of generator version three) off its lane and floor, from 0 (the lane grid exactly) to 1 (up to 22% of a spacing), through Waybranch.Core.LaneMapLayoutStrategy. The default is 0.6. It has no effect on a layered map, so existing themes draw what they always drew. Presentation only: it never changes a graph, an id or a save. A value outside 0 to 1, or not a finite number, fails compilation.

public int LayerSpacing

Distance between two successive layers, in presentation units. Must be between 1 and MapThemeLimits.MaximumSpacing.

public float MaximumZoom

The highest zoom level the view allows, so the furthest it may zoom in. Must be at least MinimumZoom and no more than MapThemeLimits.MaximumZoom. Together the two bound every zoom the input controller applies.

public float MinimumZoom

The lowest zoom level the view allows, so the furthest it may zoom out. Must be greater than 0 and no greater than MaximumZoom.

public int NodeSpacing

Distance between two adjacent nodes inside one layer, in the same units as LayerSpacing. Must be between 1 and MapThemeLimits.MaximumSpacing, and it also drives the size the built-in views draw a node at.

public MapLayoutOrientation Orientation

Which axis the layers advance along, and so which way round the map is laid out. It sizes and orients the presentation only, so changing it redraws an existing map rather than invalidating the graph or any save taken from it.

public string StableIdText

The theme's authored identity, which survives renaming the asset. Empty rather than null when nothing was authored, and an empty or malformed ID fails compilation.

public float StateTransitionSeconds

The duration handed to a node or edge transition view each time that node or edge changes state. Must be between 0 and MapThemeLimits.MaximumTransitionSeconds; how a view spends it is the view's own business.

Methods

public void ConfigureLaneJitter(float jitter)

Writes LaneJitter, for building a theme from code, on the same terms as ConfigureRuntime: nothing is validated or clamped here (a value outside 0 to 1 is reported by MapAuthoringCompiler.CompileTheme), no undo step is registered, and the asset is not marked dirty. - jitter — Sets LaneJitter, from 0 to 1.

public void ConfigureRuntime( string id, MapLayoutOrientation layoutOrientation, int authoredLayerSpacing, int authoredNodeSpacing, MapEdgeGeometryKind geometry, int segments, int controlOffset, float minZoom, float maxZoom, float transitionSeconds)

Writes this theme's identity, layout, edge, zoom, and transition fields in one call, for building a theme from code instead of the Inspector - a starter or sample asset, a test fixture, or an instance made with ScriptableObject.CreateInstance. BackgroundColor and EdgeColor are not among them and keep whatever they already held, which on a freshly created instance is their authored default. Nothing is validated or clamped here: the values are stored exactly as given, and a value out of range is reported later, by MapAuthoringCompiler.CompileTheme. The call assigns the serialized fields directly, so it registers no undo step and does not mark the asset dirty; an editor caller that wants the change on disk must save the asset itself. - id — Stable theme identity copied into the compiled presentation contract. - authoredLayerSpacing — Sets LayerSpacing. - authoredNodeSpacing — Sets NodeSpacing. - segments — Sets BezierSegments. - controlOffset — Sets BezierControlOffset, in normalized map units. - transitionSeconds — Sets StateTransitionSeconds. - layoutOrientation — Axis along which successive map layers advance. - geometry — Shape used when built-in views sample routes between nodes. - minZoom — Smallest allowed viewport zoom, representing the furthest zoom-out. - maxZoom — Largest allowed viewport zoom, representing the furthest zoom-in.


MapThemeCompilation

:material-star: Start here

public sealed class MapThemeCompilation

Waybranch.Authoring · Runtime/Authoring/RuntimeCompilation.cs

The result of compiling one MapThemeAsset: the immutable theme on success, and in every case the diagnostics the compiler gathered. Bad authoring is reported here rather than thrown, so check Succeeded before reading Value.

Constructors

public MapThemeCompilation(CompiledMapTheme value, ValidationReport validation)

Pairs a compiled theme with the report that describes it. Pass null for value to record a failure. - value — Compiled theme, or null when spacing, geometry, zoom, color, identity, or transition validation failed. - validation — Complete diagnostics collected while compiling the theme asset.

Properties

public bool Succeeded

True only when a theme was produced and no diagnostic is an error; warnings alone still succeed.

public ValidationReport Validation

Everything the compiler found while reading the asset, errors and warnings alike, in the sorted order a ValidationReport keeps. It is the only channel bad theme authoring is reported through -- compilation does not throw -- and MapAuthoringCompiler.CompileTheme(MapThemeAsset) only builds a theme when this report came back completely empty, so in practice anything listed here means no theme was produced.

public CompiledMapTheme Value

Null when compilation failed.


MapThemeLimits

:material-star: Start here

public static class MapThemeLimits

Waybranch.Authoring · Runtime/Authoring/AuthoringCompilation.cs

The ceilings a map theme is compiled against. A MapThemeAsset that exceeds one of these is rejected with a diagnostic rather than clamped, so an authoring UI of your own should enforce them on its own fields instead of discovering them at compile time.

Fields

public const long MaximumContentExtent

Ceiling on the laid-out extent of a map, in the same units as the spacing above and measured separately along and across the layers. Unlike the other limits this one is not a theme field: it is checked when presentation metrics are derived from a graph and a theme together, and a graph too large for its spacing throws instead of reporting a diagnostic.

public const int MaximumSpacing

Ceiling on both the layer spacing and the node spacing of a theme; the floor for each is 1.

public const float MaximumTransitionSeconds

Longest node or edge state transition a compiled theme may request, in seconds.

public const float MaximumZoom

Highest zoom multiplier a compiled theme may expose to a viewport.