Vixen
c7401864
csharp
public sealed class UtilitySetView

A utility set, open for editing: a table of actions, a table of considerations, and a curve.

Read the guide page for this →

Remarks

doc 37 § Part 5's utility editor, and the shape is the argument. A utility set has no edges: drawing it on a canvas would be a canvas whose wires all run from a column of inputs to a column of actions and carry nothing. So it is a two-pane table — actions on the left with their scores as bars, the selected action's considerations on the right — and under it the selected consideration's response curve.

⚠ The current input is marked on the curve, and that detail is the whole tool. "Why is this scoring 0.2" is answered by seeing where on the curve the agent is sitting, and it has to be answerable while the game is not running — so the readings are a table an author types into and the panel does the arithmetic the runtime would. In play mode the same marker follows the selected agent.

⚠ The score bars are the compensated score, not the raw product. A panel that showed the product would show an action getting worse every time somebody added an axis to tune it, which is exactly the confusion the geometric mean exists to remove.

Fields and properties (10)

  • protected override string TagName

    The element name this type answers to when a caller does not choose one.

  • protected override bool AcceptsFocus

    Whether the focus can rest on this kind of control at all.

  • public UiElement Actions

    The actions, with their scores as bars.

  • public UiElement Considerations

    The selected action's considerations.

  • public UiElement Readings

    What each input is reading, which is what the scores are computed from.

  • public CurveEditor Curve

    The selected consideration's response curve.

  • public UiElement Diagnostics

    What the last compile said.

  • public Button Build

    The button that compiles the set.

  • public UtilityActionContent? Selected

    The action that is selected, or null.

  • public UtilityConsiderationContent? SelectedConsideration

    The consideration that is selected, or null.

Methods (10)

  • protected override void OnCreated()

    Builds whatever this element is made of, once, as it joins a document.

  • public void Show(UtilitySetDocument value)

    Shows a document.

  • public void Select(UtilityActionContent? value, UtilityConsiderationContent? axis = null)

    Selects an action, and the consideration inside it.

  • public void Reading(string name, float value)

    Says what an input is reading, which is what the preview scores from.

  • public float ReadingOf(string name)

    What one input is reading.

  • public void Follow(AgentDebugModel? value)

    Follows a running agent, so the bars and the readings are its own.

  • public float? LiveScore(string name)

    What a named action is scoring on the followed agent, if one is being followed.

  • public UtilitySet? Compile()

    Compiles the set and lists what it said.

  • public void Refresh()

    Rebuilds every panel from the document.

  • public static int Cells(float score)

    How many of the bar's twenty cells a score fills.

Used by (3)

  • LiveUtilityTestsVixen.Editor.AssetEditors.Tests
  • UtilitySetEditorFactoryVixen.Editor.AssetEditors
  • UtilitySetViewTestsVixen.Editor.AssetEditors.Tests