Proving Ground API overview
Everything is in the Exaweft.Proving namespace. This page lists the public API by job; each type and member has XML documentation with the details, shown by your IDE. The user guide (index.md) explains how the parts fit together.
Entry point: ProvingGround
| Member | What it does |
|---|---|
Register(object owner), Register(object owner, string scope) | Adds an object's [Tune] fields and [DebugAction] methods. Returns the number of values found (0 when off). A scope gives the object values of its own |
Unregister(object owner) | Removes it; its values are remembered for the next object of its type this session |
Tuning | The TuningRegistry: every tuned value and action |
Presets | The PresetLibrary: named sets of values |
Panel | The TuningPanel (F1) |
DiagnosticsPanel | The DiagnosticsPanel (F2) and the run comparison |
Diagnostics | The DiagnosticsSession: counters, timers, events, performance and the log |
Runs | The RunRecorder: run records |
IsEnabled | False in release builds (unless PROVING_GROUND_PLAYTEST), or everywhere with PROVING_GROUND_OFF |
IsPointerOverPanels | True while the pointer is over either panel or the comparison |
FreeCursorWhileOpen | Frees a locked or hidden cursor while a panel is open. Off by default |
Version, ProductName, Publisher, PlaytestDefine, OffDefine | Constants |
Attributes
| Attribute | Use |
|---|---|
[Tune(group, min, max, step, hint, label)], [Tune(group, hint, label)] | On a float, int, bool or enum field (or [field: Tune] on an auto-property), or on a field holding a struct or class with tuned fields inside |
[DebugAction(group, label, hint)] | On a method with no parameters: a button in the F1 panel |
Tuning: TuningRegistry and TunedValue
TuningRegistry: Values, Actions, Find(key), FindAction(key), ResetAll(), ResetGroup(group), IsRegistered(owner), RegisteredCount, and the events ValueChanged (a value changed through Proving Ground) and RegistrationChanged. DefaultGroup is "General".
TunedValue, one per tuned field (per scope):
- Identity:
Key(such asMyGame.Player.speed),Group,Scope,Label,Hint,Kind(TuneKind.Float,Int,Bool,Enum),FieldType. - Range:
HasRange,Min,Max,Step,Options(an enum's names). - Value:
Value(as a double; setting it clamps and snaps, and applies to every registered object),BoolValue,ValueText,TrySetText(text),Default,DefaultText,IsDefault,Reset(),Clamp(v),Snap(v). - Targets:
IsActive,TargetCount.
DebugAction: Key, Group, Scope, Label, Hint, IsActive, TargetCount, Invoke() (returns how many objects it ran on).
Presets: PresetLibrary
Save(name, out message), Load(name, out message), Delete(name, out message), Exists(name), List(), IsValidName(name), PathFor(name), Directory, CurrentName, and the limits MaxNameLength (64) and MaxFileBytes. Each call returns false with a message when it doesn't succeed, and changes nothing.
Panels: TuningPanel (F1) and DiagnosticsPanel (F2)
Both: Open(), Close(), Toggle(), IsOpen, OpenChanged, ToggleKey (KeyCode.None turns the hotkey off), IsPointerOverPanel, Placement, DefaultPlacement and ForgetPlacement().
TuningPanelalso hasTitle,Scale(MinScaletoMaxScale, shared by both panels),IsTyping(any Proving Ground text box has the keyboard) andReleaseKeyboard(). Its placement is aPanelPlacement:Left,RightorFloating.DiagnosticsPanel's placement is aDiagnosticsPlacement:OppositeTuning(the default),LeftorRight. It also has the run comparison:OpenComparison(),OpenComparison(selectLatestBatch)(opens it with the latest batch selected),CloseComparison(),IsComparisonOpen,ComparisonChangedandComparisonTextSize.
A placement set from code or chosen with a panel's buttons is remembered in PlayerPrefs and wins over DefaultPlacement, which isn't saved.
Diagnostics: Diag and DiagnosticsSession
Diag is the short form for game code: Event(message), Count(name, amount = 1), Timer(name) (returns a DiagTimer to dispose, usually with using) and MarkAutomated(bool).
DiagnosticsSession (ProvingGround.Diagnostics): Counters (DiagCounter: Name, Value), Timers (DiagTimerStats: Name, Count, Total, Mean, Min, Max, Last), RecentEvents (DiagEvent: Time, Message), FindCounter, FindTimer, EventCount, Performance, Summary(), CopySummary(), OpenLogFolder(out message), LogDirectory, LogFilePrefix, LogFolder, LogFile, LogStatus, Kind (DiagnosticsSessionKind.Playtest or Automated), Id, StartedUtc, Elapsed.
PerformanceMonitor (Diagnostics.Performance): CurrentFps, AverageFps, MeanFrameMs, P95FrameMs, MaxFrameMs, Frames, memory (ManagedHeapBytes, allocated bytes at start, last and peak), Collections, pauses (Pauses, PausedSeconds, LongestPauseSeconds) and Summary().
Runs: RunRecorder, RunRecord and RunComparison
RunRecorder (ProvingGround.Runs): Start(label, preset) (false if it couldn't start, such as a preset that didn't load), End(outcome) (returns the saved record), BeginBatch(name), EndBatch(), LoadAll() (newest first), IsRunning, CurrentId, CurrentLabel, Elapsed, Batch, LastRun, LastMessage, AutoStartOnSceneLoad, Directory, Folder.
RunRecord, one saved run: Id, Label, Batch, Preset, PresetModified, StartedBy, Outcome, StartedUtc, Duration, SettingsAtStart, SettingsAtEnd, SettingAtStart(key), Changes, Counters, CounterValue(name), Timers, Events, Performance, and the build identity (Build, UnityVersion, Platform, Scene, Kind, SessionId). Its entries are RunSetting, RunChange, RunCount, RunTiming, RunEvent and RunPerformance. FormatVersion is the JSON format's version.
RunComparison.Compare(records): Groups (one RunGroup per label: Label, Runs, Presets, Batches), Outcomes and Settings (rows of RunComparisonRow: Name, Cells, Stats with each group's Mean, Min, Max and Runs), RunCount, SameSettings, and ToText().