Editor tools¶
6 types in this area.
On this page
MapExperienceExamples · MapExperienceStudioWindow · MapStudioCommandResult · MapStudioSession · MapStudioSnapshot · Piece
MapExperienceExamples¶
:material-star: Start here
Waybranch.Editor.Experience · Editor/Experience/MapExperienceExamples.cs
Editor helpers that create reproducible Waybranch example scenes from authoring presets.
Methods
public static IReadOnlyList<MapExperiencePreset> Create(string folder)-
Creates four editable presentation presets and their authoring assets in a new folder; an existing folder is rejected. -
folder— A new project-relative folder below Assets. - Returns — Illustrated Expedition, Neon Network, Tabletop Journey and World Trail presets, in that order. public static void CreateFromMenu()-
Creates an independent set of examples beneath Assets and selects the first.
public static MapExperienceHost CreateScene(MapExperiencePreset preset, Scene destination = default(Scene), bool includeDemoControls = false)-
Adds a configured, playable map without replacing the active scene. -
preset— Preset whose authoring and backend configure the new map. -destination— Scene that receives the generated example objects. -includeDemoControls— Whether to add the optional demo input controls. - Returns — The newly created experience host.
MapExperienceStudioWindow¶
:material-star: Start here
Waybranch.Editor.Experience · Editor/Experience/MapExperienceStudioWindow.cs
Edits a detached preset while rendering and simulating an isolated map.
Remarks
A kept window of the common editor guide (6.2): its layout does not change. It carries the guide's names (ll-header, ll-topbar, ll-body, ll-inspector and ll-status on its own containers), readable tabs with the "selected" class, "?" and F1, the fixed vocabulary (Apply, Discard, Reload source), the state phrases, an empty state with one button, and the three preset options of OWN-P13 (routes on the ground, hidden locked routes, presentation art) with live preview.
Properties
public MapExperienceSnapshot PreviewSnapshot-
Current isolated simulation state.
public MapExperiencePreset WorkingPreset-
Temporary authoring copy, independent of the source asset and active game.
Methods
public void ApplyPreset()-
Persists only authoring settings with Undo support.
public void CreateGUI()-
Builds a fixed toolbar, task tabs and a renderer-backed preview.
public override void DiscardChanges()-
Explicitly discards temporary settings without saving simulation state.
public void EditPreset(MapExperiencePreset value)-
Opens an asset as a temporary, editable presentation. -
value— Preset or value applied to this configuration. public static void Open()-
Opens the live configuration window without changing the active scene.
public void RefreshPreview()-
Refreshes presentation from the working copy without restarting simulation.
public override void SaveChanges()-
Uses Unity's standard unsaved-window flow when the Studio closes.
MapStudioCommandResult¶
:material-star: Start here
Waybranch.Editor.MapStudio · Editor/MapStudio/MapStudioModels.cs
What one Map Studio command did: whether it was accepted, the snapshot to display afterwards,
and the error that explains a rejection. A session returns its current snapshot either way, so
a rejected command still hands back the state to keep showing rather than nothing. Rejection
does not always mean nothing moved -- a generation that fails keeps the previous graph but
still records the attempt in the seed history -- so drive the UI from
Snapshot rather than from Succeeded alone.
Constructors
public MapStudioCommandResult(bool succeeded, MapStudioSnapshot snapshot, MapDiagnostic diagnostic)-
Records the outcome of one command. -
succeeded— Whether the command was accepted. -snapshot— Session state that the editor should display after the command. -diagnostic— First error explaining rejection, or null for an accepted command.
Properties
public MapDiagnostic Diagnostic-
The first error behind a rejection, and null whenever
Succeededis true. public MapStudioSnapshot Snapshot-
The session's snapshot as it stands after the command, whether or not the command was accepted.
public bool Succeeded-
Whether the command was accepted. It is not a statement about whether anything changed: a generation that fails is a rejection that still leaves a new attempt in the seed history, and a command asked to do what is already the case is an acceptance that changes nothing.
MapStudioSession¶
:material-star: Start here
Waybranch.Editor.MapStudio · Editor/MapStudio/MapStudioSession.cs
The editing model behind the Map Studio window: it holds one MapStudioSnapshot at
a time and turns each authoring gesture -- regenerate, move, retype, pin, connect, undo -- into
the next one. No command throws when an edit is refused; each returns a
MapStudioCommandResult carrying both the snapshot to keep displaying and the
diagnostic that explains the refusal, so a window can render either outcome the same way.
A session is pinned to the one MapRuleSnapshot it was built around and never
swaps it, so recompiled rules mean a new session. What a command will accept depends on
MapStudioSnapshot.Mode: Procedural refuses graph edits outright, Hybrid turns an
edit into an override and re-runs the generator, which may itself reject it, and Manual
rebuilds the graph straight from the edited nodes and edges.
Constructors
public MapStudioSession(MapRuleSnapshot rules)-
Starts an empty preview over the given rules, driven by the shipped
LayeredMapGeneratorand carrying no node types. Nothing is generated yet, soMapStudioSnapshot.Graphstays null untilRegenerateor a Manual edit produces one. Without node types nothing resolves a type ID back to its definition, which suits a headless or test session rather than one behind a window. -rules— Compiled rule snapshot that governs every graph generated by the session. public MapStudioSession(MapRuleSnapshot rules, IEnumerable<CompiledMapNodeType> nodeTypes)-
Starts an empty preview over the given rules and node types, driven by the shipped
LayeredMapGenerator. This is the usual way to open a session that is not backed by a blueprint asset; useLoadwhen it is. -rules— Compiled rule snapshot that governs every graph generated by the session. -nodeTypes— Node-type definitions copied for resolving graph type IDs in the preview. public MapStudioSession(MapRuleSnapshot rules, IMapGenerator generator)-
Starts an empty preview driven by your own generator instead of the shipped one, carrying no node types. Every command that produces a generated graph goes through this instance, including the Hybrid edits, which re-run generation to honour the override they just added. -
rules— Compiled rule snapshot that governs every graph generated by the session. -generator— Generator instance invoked for regeneration and Hybrid-mode edits. public MapStudioSession(MapRuleSnapshot rules, IMapGenerator generator, IEnumerable<CompiledMapNodeType> nodeTypes)-
Starts an empty preview with every input stated. The node types are copied, so the caller may reuse or mutate the sequence afterwards, and the session keeps that one set -- as it keeps the one rule snapshot -- for its whole lifetime. -
rules— Compiled rule snapshot that governs every graph generated by the session. -generator— Generator instance invoked for regeneration and Hybrid-mode edits. -nodeTypes— Node-type definitions copied for resolving graph type IDs in the preview.
Properties
public bool CanRedo-
Whether an undone edit is still there to reapply. Committing any new edit clears the redo history, so an undone edit is recoverable only until the next change.
public bool CanUndo-
Whether there is a committed preview edit to step back to. Only edits enter the history:
Validate,FocusDiagnostic, andMarkSavedrewriteCurrentin place and leave this untouched. public MapStudioSnapshot Current-
The preview as it stands. Every command replaces it with a new snapshot rather than editing this one, so a reference you keep goes stale instead of changing underneath you -- read it again, or take it from the command result, after each call.
Fields
public const int MaximumSeedHistory-
Maximum number of recent generation attempts retained in the preview history.
Methods
public MapStudioCommandResult AddManualNode(StableId id, StableId typeId, MapNodeSlot slot, NormalizedMapPosition position, MapNodePayload payload)-
Adds a fully specified node to the Manual-mode graph and refreshes validation. -
id— Unique, non-empty identity for the new graph node. -typeId— Non-empty node-type identity assigned to the new node. -slot— Unoccupied layer and index where the node will be inserted. -position— Normalized map-space coordinates for the new node. -payload— Canonical payload stored on the new node. - Returns — Failure outside Manual mode, or for an empty ID, an out-of-range or occupied slot, a duplicate node ID, a position outside bounds, or an invalid payload. public MapStudioCommandResult Connect(StableId sourceId, StableId targetId, string edgeIdText)-
Joins two nodes with a forward edge between adjacent layers. Manual mode adds the edge to the graph outright. Hybrid instead records it as a required edge override and pins both endpoints' identities first, so the override has stable slots to name, then regenerates -- which is what lets the connection survive later regenerations, and also what lets the generator refuse it. -
sourceId— Identity of the node at the edge's earlier layer. -targetId— Identity of the node at the immediately following layer. -edgeIdText— Text representation of the unique stable identity assigned to the edge. - Returns — Failure in Procedural mode, for an unknown or locked endpoint, for endpoints that are not on adjacent layers, for a connection or edge ID that already exists, for text that is not a valid stable ID, or when a Hybrid regeneration rejects the edge. public MapStudioCommandResult Disconnect(StableId edgeId)-
Removes an edge directly in Manual mode or releases its requirement in Hybrid mode. -
edgeId— Identity of the graph edge to remove or unrequire. - Returns — Failure in Procedural mode, for an unknown edge, for a locked endpoint, or when regenerating without the edge fails. public MapStudioCommandResult FocusDiagnostic(int index)-
Points the preview's highlight at one diagnostic from the current report, gathering what the message is about: its rule IDs, its node IDs, its slots, and the nodes that currently occupy those slots. Resolving slots to nodes here is what lets a diagnostic raised against a slot rather than an identity still light something up on screen. Only the highlight moves. The graph, overrides, and report are untouched, so this is neither an undoable edit nor a reason to save. -
index— Zero-based index into the current snapshot's validation diagnostics. - Returns — Failure when the index falls outside that list; success otherwise. public static MapStudioSession Load(MapBlueprintCompilation compilation, string sourceToken, IEnumerable<CompiledMapNodeType> nodeTypes = null)-
Opens a session on an already compiled blueprint, adopting its mode, seed, graph, overrides, search budgets, locks, and validation report as the first snapshot. The preview starts clean rather than dirty, and its seed history starts empty: whatever the blueprint was generated from is not replayable history until this session generates something itself. The session drives the shipped
LayeredMapGenerator; construct one directly to supply your own. -compilation— Compiled blueprint whose graph, rules, overrides, and validation report seed the first snapshot. -sourceToken— Opaque token for the blueprint asset's stored state, carried so a later save can tell that the asset has moved on. -nodeTypes— Node-type definitions copied for resolving graph type IDs in the preview. - Returns — A session whose first snapshot is the blueprint exactly as compiled, undo history empty. public void MarkSaved(long sourceRevision, string sourceToken)-
Records that the preview has been written to a blueprint asset: it clears the dirty flag and adopts the revision and token that save produced, which is what a later save compares against to tell whether the asset has been changed by something else in the meantime. It writes nothing itself -- call it after the save has succeeded. The current snapshot is rewritten in place rather than committed, so saving is not an undoable step. The snapshots already on the undo stack keep the save state they were built with, which means stepping back past a save shows the preview as dirty again. -
sourceRevision— Blueprint revision returned by the successful save operation. -sourceToken— Opaque token for that asset's stored state as of the save. Null is kept as an empty token. public MapStudioCommandResult MoveNode(StableId nodeId, NormalizedMapPosition position)-
Moves a node to a new normalized position and pins the position, so a later regeneration cannot put it back. In Hybrid mode the pin is handed to the generator and the map is rebuilt around it, which can fail and leave the preview as it was; in Manual mode the graph is rebuilt directly from the edited nodes. -
nodeId— Identity of the graph node whose position will be pinned. -position— Normalized map-space coordinates to assign to the node. - Returns — Failure in Procedural mode, for an unknown or locked node, for a position outside those bounds, or when a Hybrid regeneration rejects the pin. public MapStudioCommandResult Redo()-
Reapplies the most recently undone edit and returns the snapshot being left to the undo stack. Committing any new edit clears the redo stack, so an undone edit survives only until the next change is made. - Returns — Failure when there is nothing to redo; success carrying the reinstated snapshot otherwise.
public MapStudioCommandResult Regenerate(uint seed, CancellationToken cancellationToken)-
Runs the generator for one seed and commits the outcome as the new preview. Manual mode ignores
seedand generates against zero, because a manual graph is authored rather than seeded. A failed attempt is still committed. The previous graph, seed, and locks are kept, but the attempt is recorded inMapStudioSnapshot.SeedHistoryand the failure's diagnostics become the snapshot's report -- so a rejected command here has still changed what the window should draw. Holding the old seed next to the old graph is deliberate: it keeps the pair consistent so the preview still round-trips when it is saved. A cancelled attempt is the exception and commits nothing at all. -seed— Explicit unsigned deterministic seed; equal inputs and seed produce equal canonical output. -cancellationToken— Cancels the attempt. Cancellation leaves the preview exactly as it was and is reported as a diagnostic, not thrown. - Returns — Success with the new graph, or failure carrying the first diagnostic explaining why generation produced none. public MapStudioCommandResult RemoveManualNode(StableId id)-
Removes an unlocked node and all incident edges from the Manual-mode graph. -
id— Identity of the Manual graph node to remove. - Returns — Failure outside Manual mode, for a locked node, or for a node that is not in the graph. public MapStudioCommandResult ReplayHistory(int index, CancellationToken cancellationToken)-
Regenerates from the seed of one entry in
MapStudioSnapshot.SeedHistory, which is how a map that has since been generated over is brought back. It replays the seed and not the stored result: the graph is produced afresh from the rules and overrides in force now, so it can differ from the fingerprint that entry recorded. A replay that lands somewhere different is pushed onto the history as a new attempt, because that divergence is the thing worth seeing. A replay that reproduces the entry exactly is not, because the history already holds that row and adding an identical one reads as the window duplicating rather than as history. -index— Zero-based index into the current snapshot's seed history, which is ordered newest first. -cancellationToken— Cancels the attempt, exactly as forRegenerate. - Returns — The outcome of the regeneration, or failure when the index falls outside the history. public MapStudioCommandResult SetMode(MapGenerationMode mode)-
Switches the preview between Procedural, Hybrid, and Manual, converting whatever is already there rather than starting over. Asking for the mode already in force is accepted and leaves the preview alone. The conversions are not symmetric, so this is not a setting you can flick back and forth without loss. Procedural discards the graph and every override, because it is only allowed to hold none. Hybrid pins each existing node's identity and nothing else -- type, position, and payload go back to the generator -- and then regenerates, which can refuse the conversion and leave the preview untouched. Manual pins every field of every node, turns each edge into a required override, and forces the seed to zero. -
mode— Target authoring mode: Procedural, Hybrid, or Manual. - Returns — Failure when the value is none of the three supported modes, or when a Hybrid conversion cannot be generated; success otherwise. public MapStudioCommandResult SetNodeLocked(StableId nodeId, bool locked)-
Locks or unlocks a node against further editing. A lock is editor bookkeeping and nothing more: it makes the session refuse to move, retype, repayload, or remove that node and to touch any edge that ends on it, but it creates no override and changes nothing about what the generator may produce. That is also why regenerating quietly drops the locks whose nodes are not in the new graph. -
nodeId— Identity of the graph node whose editor lock state will change. -locked— True to lock the node, false to release it. - Returns — Failure only when there is no graph or the node is unknown. Setting the state the node already has is accepted and still counts as a preview edit. public MapStudioCommandResult SetNodePayload(StableId nodeId, MapNodePayload payload)-
Replaces a node's payload and pins it. Unlike the type, the payload is checked before anything is committed: it must be non-null, must carry a payload ID once it has any properties at all, and every property must have a non-empty key, a canonical value, and no duplicate of that key elsewhere in the payload. -
nodeId— Identity of the graph node whose payload will be pinned. -payload— Replacement payload, including its canonical property values. - Returns — Failure in Procedural mode, for an unknown or locked node, for a payload that fails those checks, or when a Hybrid regeneration rejects the pin. public MapStudioCommandResult SetNodeType(StableId nodeId, StableId typeId)-
Retypes a node and pins the type. The type ID is only checked for being non-empty here; whether the rules actually allow that type in that slot is settled afterwards, by the Hybrid regeneration or by the validation report a Manual edit produces, so a bad type comes back as a rejected command or an invalid preview rather than as an argument error. -
nodeId— Identity of the graph node whose type will be pinned. -typeId— Non-empty node-type identity to assign. - Returns — Failure in Procedural mode, for an unknown or locked node, for an empty type ID, or when a Hybrid regeneration rejects the pin. public MapStudioCommandResult SetPinnedFields(StableId nodeId, PinnedNodeFields fields)-
Replaces the set Pinned Fields settings used by future operations; existing immutable graphs and saves are not rewritten. -
nodeId— Identity of the node whose Hybrid pin mask will change. -fields— Combination of node fields the generator must preserve; Manual mode requires all fields. - Returns — Failure in Procedural mode, for an unknown node, for flags outsidePinnedNodeFields.All, for anything short of every field in Manual mode, or when a Hybrid regeneration rejects the pins. public MapStudioCommandResult Undo()-
Steps back to the snapshot from before the last committed edit, and puts the one being left within reach of
Redo. It restores an earlier snapshot whole -- graph, overrides, locks, seed history, and save state alike -- rather than reversing one field, soMapStudioSnapshot.ChangeOrdinalgoes back down with it. Only edits are on the stack. Validating, focusing a diagnostic, and recording a save replace the preview without entering the history, so none of them can be undone. A failed regeneration, on the other hand, does commit and therefore is undoable. - Returns — Failure when there is nothing to undo; success carrying the restored snapshot otherwise. public MapStudioCommandResult UnpinNode(StableId nodeId)-
Drops a node's pin entirely -- identity included, not just its fields -- and regenerates. The generator is then free to fill that slot however the rules allow, so the node that comes back need not be the one that was there and need not carry the same ID. It is refused while any edge override still names the node's slot, because such an override would otherwise be left pointing at a slot nothing pins any more. Disconnect or reroute those edges first. -
nodeId— Identity of the pinned Hybrid node to release back to generation. - Returns — Failure outside Hybrid mode, for an unknown node, while an edge override still references the node's slot, or when regenerating without the pin fails. public MapStudioCommandResult Validate()-
Re-runs whole-graph validation against the rules, mode, and overrides in force now and stores the report on the preview. With no graph yet it reports that one must be generated or authored first, rather than passing on an empty map. Nothing about the graph changes, so this is not an undoable edit and does not mark the preview dirty. It does clear any highlight left by
FocusDiagnostic, since the diagnostic that highlight pointed at may no longer be the one at that index. - Returns — Success when the report holds no error -- warnings alone still pass -- otherwise failure carrying the first diagnostic.
MapStudioSnapshot¶
:material-star: Start here
Waybranch.Editor.MapStudio · Editor/MapStudio/MapStudioModels.cs
Immutable picture of one Map Studio preview: the compiled rules the preview is pinned to, the
generation mode and seed, the graph as it currently stands, the overrides and search budget
behind it, the locked nodes, the latest validation report, and the editor bookkeeping -- seed
history, change ordinal, and save state. Every session command produces a new instance instead
of mutating one, so a snapshot you are holding stays readable, and stays stale, once the next
command runs. Graph is null until something has been generated or authored, so
read it defensively.
Constructors
public MapStudioSnapshot(MapRuleSnapshot rules, IEnumerable<CompiledMapNodeType> nodeTypes, MapGenerationMode mode, uint seed, MapGraph graph, MapGenerationOverrides overrides, MapGenerationSearchOptions searchOptions, IEnumerable<StableId> lockedNodeIds, ValidationReport validation, MapStudioFocus focus, MapGenerationStatistics generationStatistics, IEnumerable<MapStudioSeedHistoryEntry> seedHistory, long changeOrdinal, long sourceRevision, string sourceToken, bool isDirty)-
Freezes a complete Map Studio preview state for display, undo, redo, or persistence. -
rules— Compiled rules against which the preview graph and overrides are interpreted. -nodeTypes— Node-type definitions copied and sorted by stable identity. -mode— Authoring mode that determines whether edits are generated, overridden, or direct. -seed— Explicit unsigned deterministic seed; equal inputs and seed produce equal canonical output. -graph— Graph currently displayed by the preview, or null before generation or authoring. -overrides— Pinned nodes and edge requirements used for Hybrid or Manual reconstruction. -searchOptions— Per-phase generation trial budgets associated with the preview. -lockedNodeIds— Nodes the session refuses to edit or remove, in any order. -validation— Latest graph validation diagnostics; null selects an empty report. -focus— Diagnostic targets the editor should highlight; null selects no focus. -generationStatistics— Search counters from the most recent generation attempt. -seedHistory— Recent generation attempts, newest first. -changeOrdinal— Count of preview edits committed so far. -sourceRevision— Authoring revision of the blueprint asset this preview came from or was last saved to; zero when there is none. -sourceToken— Opaque token for that blueprint's stored state; empty when the preview is not backed by an asset. -isDirty— Whether the preview holds edits that have not been written to a blueprint asset.
Properties
public long ChangeOrdinal-
How many preview edits had been committed when this snapshot was built: each committed command raises it by one over the snapshot it was based on. Undo and redo move between snapshots that already exist, so this is not a session-wide clock and can go back down.
public MapStudioFocus Focus-
The rule IDs, node IDs, and slots the window should highlight, never null; empty unless a diagnostic was focused.
public MapGenerationStatistics GenerationStatistics-
Search counters from the most recent generation attempt, never null. Edits that do not run the generator carry the previous attempt's counters forward unchanged.
public MapGraph Graph-
The graph this preview is showing, or null before anything has been generated or authored.
public MapStudioGraphStatistics GraphStatistics-
Node, edge, branch, merge, and reachability counts measured from
Graphwhen this snapshot was built. public bool IsDirty-
Whether the preview holds edits not yet written to a blueprint asset. Once set it stays set until the session is told the preview was saved.
public IReadOnlyList<StableId> LockedNodeIds-
The nodes the session refuses to move, retype, or remove until they are unlocked, sorted and de-duplicated. Regeneration drops any lock whose node is gone from the new graph.
public MapGenerationMode Mode-
How much of the preview the generator is allowed to invent, and therefore which commands the session will accept: Procedural refuses graph edits outright, Hybrid turns an edit into an override and re-runs the generator, and Manual rebuilds the graph straight from the edited nodes and edges. A session can be switched between modes, and the switch rewrites the overrides and may drop the graph, so read the mode from the snapshot rather than remembering what it was.
public IReadOnlyList<CompiledMapNodeType> NodeTypes-
The compiled node types, sorted by type ID rather than left in the order supplied.
public MapGenerationOverrides Overrides-
The pinned nodes and required or forbidden edges the current graph was built under, never null. In Hybrid mode an edit is recorded here rather than written onto the graph, which is what lets the same seed be regenerated and still land the edited nodes where they were put. Manual mode instead rebuilds the graph from the edited rows and re-derives these overrides from it, pinning every field of every node and turning every edge into a required override. Empty in Procedural mode, where no edit is allowed to survive.
public MapRuleSnapshot Rules-
The compiled rules every command in this preview is measured against. A session is created around one ruleset and never replaces it, so recompiling changed rules means a new session.
public MapGenerationSearchOptions SearchOptions-
The per-phase trial budgets the generator may spend on this preview, never null. A search that exhausts them is a failed generation that leaves the previous graph on screen and records the attempt in
SeedHistory, so a seed that will not generate is sometimes a budget question rather than an unsatisfiable ruleset. public uint Seed-
The seed behind
Graph. Always zero in Manual mode, where nothing is seeded. public IReadOnlyList<MapStudioSeedHistoryEntry> SeedHistory-
The recent generation attempts, newest first, failures included. The session caps how many it keeps, so this is a window on recent history rather than the whole session.
public long SourceRevision-
The authoring revision of the blueprint asset this preview came from or was last saved to; zero when it is backed by no asset.
public string SourceToken-
Opaque token for the stored state of that blueprint asset when the preview was loaded or last saved, never null. Empty when there is no backing asset.
public ValidationReport Validation-
The diagnostics from the most recent validation or generation pass, never null.
Methods
public bool TryGetNodeType(StableId typeId, out CompiledMapNodeType type)-
Resolves a node type ID against the compiled types this snapshot carries -- the same set a node on
Graphrefers to by ID. -typeId— Stable identity to find in the snapshot's sorted node-type definitions. -type— Receives the matching compiled definition, or null when no definition matches. - Returns — True when a node type with that ID is present.
Piece¶
Waybranch.Editor.Experience · Editor/Experience/MapExperienceTabletopKit.cs
One row binds a node type of the Ruins example to its piece, its FBX object, its accent colour and its icon file.
Properties
public string IconPath-
—
public string PrefabPath-
—
Fields
public string TypeId, Name, FbxObject-
—