Proving Ground1.0.0 · Exaweft

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

MemberWhat 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
TuningThe TuningRegistry: every tuned value and action
PresetsThe PresetLibrary: named sets of values
PanelThe TuningPanel (F1)
DiagnosticsPanelThe DiagnosticsPanel (F2) and the run comparison
DiagnosticsThe DiagnosticsSession: counters, timers, events, performance and the log
RunsThe RunRecorder: run records
IsEnabledFalse in release builds (unless PROVING_GROUND_PLAYTEST), or everywhere with PROVING_GROUND_OFF
IsPointerOverPanelsTrue while the pointer is over either panel or the comparison
FreeCursorWhileOpenFrees a locked or hidden cursor while a panel is open. Off by default
Version, ProductName, Publisher, PlaytestDefine, OffDefineConstants

Attributes

AttributeUse
[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):

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().

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().