Vizzy Authoring Guide

The .vizzy.cs format is a C#-style domain-specific language used by VizzyCode to describe Juno Vizzy programs. It is designed for conversion, not for normal C# compilation in user projects. authoring vizzy dsl

Authoring target

For new scripts, the target is code -> XML recognized by Juno. For imported scripts, the target can also include strict XML -> code -> XML fidelity.

What Is The vizzy.cs DSL

.vizzy.cs looks like C#, but it can include VizzyCode-specific constructs:

ConstructExamplePurpose
Program initVz.Init("Mission")Program name and setup.
Event blocksusing (new OnStart()) { }Top-level Vizzy events.
Vizzy callsVz.Display("Hello", 3);High-level instruction syntax.
Variable comments// var altitude = 0;Declares Vizzy variables.
Preservation anchors// VZEL ...Imported XML fidelity.
Raw XMLVz.RawXmlEval(@"<EvaluateExpression ... />")Exact fragment preservation.
Layout hints// VZPOS x=1200 y=-300Top-level block position metadata.

Not ordinary C#

Do not judge .vizzy.cs by whether it compiles as a normal application file. Judge it by whether VizzyCode exports valid Juno XML.

Safe Authoring Subset

PatternSafe form
Program setupVz.Init("Program Name");
Start eventusing (new OnStart()) { ... }
End eventusing (new OnEnd()) { ... }
Message eventusing (new OnReceiveMessage("name")) { ... }
DisplayVz.Display("Text", 3);
Flight logVz.FlightLog("Text", true);
Wait untilusing (new WaitUntil(condition)) { }
Craft inputVz.SetInput(CraftInput.Throttle, 1);
Variables// var name = 0; plus assignments in code
Layout// VZPOS x=N y=N before top-level authored blocks
Vz.Init("Demo");
 
// VZPOS x=0 y=0
using (new OnStart())
{
    Vz.Display("Ready", 3);
    Vz.SetInput(CraftInput.Throttle, 1);
}
 
Console.WriteLine(Vz.context.currentProgram.Serialize().ToString());

Event Handler Syntax

Code formJuno event
OnStart() or Vz.OnStart()FlightStart
OnEnd() or Vz.OnEnd()FlightEnd
OnReceiveMessage("name")ReceiveMessage
OnDocked()Docked
OnChangeSoi()ChangeSoi
OnPartCollision("part")PartCollision
OnPartExplode("part")PartExplode
On("eventName")Custom event name

Unsafe Or Sensitive Patterns

PatternWhy it is sensitiveSafer approach
Removing VZEL from imported regionsChanges preserved XML into authored XML.Rewrite only the intended region.
Deleting .vizzy.meta.jsonHides exact import metadata from export.Keep sidecar with imported files.
New top-level blocks without VZPOSCan fail validation due missing pos.Add layout hints.
Replacing RawXml* with cleaner code blindlyLogical equivalence may not preserve XML shape.Decode/inspect and verify export.
Inventing custom block headerscallFormat, format, name, and pos are required.Copy shapes from working examples.
Large global rewritesMixed missions need local reasoning.Fix one region at a time.

Mixed mission caution

A file can contain preserved imported regions and handwritten authoring regions at the same time. Use Repair Rules For AI before asking an AI to modify it.

Example Files

FileTypeDescription
Altair Alphard Vizzy.vizzy.csImported clean viewReal imported Vizzy program with matching sidecar.
Altair Basic Function.vizzy.csImported clean viewSmaller imported function-style example.
MFD Default.vizzy.csImported clean viewMFD-related behavior and UI blocks.
T.T. Mission Program.vizzy.csMission-scale imported fileComplex and fidelity-sensitive.
Universal Vizzy Mission 2.vizzy.csImported mission exampleUniversal mission logic with sidecar.
Authoring checklist
  • Start from a known-good pattern.
  • Use normal authoring syntax first.
  • Add VZPOS for new top-level blocks.
  • Use RawXml* only when exact XML shape matters.
  • Export with Export.
  • Validate with 04 - Export Validation.

Related notes: 02 - Conversion Engine (VizzyXmlConverter), 04 - Export Validation, 05 - Raw Preservation, 11 - Vizzy Blocks Reference, 12 - Project Examples, 13 - Recommended Workflows.