Skip to content

KernelAPI reference

Class RunOptions

Namespace: MicroEngine.Core
Assembly: MicroEngine.dll
Guide: Game lifecycle and time

Options shared by every launcher: scripted input, captures and run limits.

C#
public sealed record RunOptions : IEquatable<RunOptions>

Inheritance

object ← RunOptions

Implements

IEquatable<RunOptions>

Constructors

RunOptions()

C#
public RunOptions()

Properties

CaptureDirectory

Directory where script “capture” commands write PNGs.

C#
public string CaptureDirectory { get; init; }

Property Value

string

FirstFrame

Called once, right after the first frame is presented (the start screen, or the game’s first frame), from the loop’s thread. Phone hosts use it to keep the system’s launch screen up until the game has something to show.

C#
public Action? FirstFrame { get; init; }

Property Value

Action?

Graphics

The graphics options the run started with, after the launcher’s overrides (Screen starts from them); null uses Graphics.

C#
public GraphicsSettings? Graphics { get; init; }

Property Value

GraphicsSettings?

MaxUpdates

Stops after this many updates (0 = unlimited).

C#
public long MaxUpdates { get; init; }

Property Value

long

Mute

Sets the sound effect and music volumes to 0 after Load.

C#
public bool Mute { get; init; }

Property Value

bool

PaceToDisplay

Whether real-time runs count elapsed time in refresh periods of the display that paces them (IDisplayPacing), which removes the stutter of an irregular wake-up (true by default). False takes every frame’s time as measured (the launcher’s –pacing measured), for comparisons.

C#
public bool PaceToDisplay { get; init; }

Property Value

bool

Profiler

Measures every frame and the phases of the start (the launcher’s –profile), or null to measure nothing.

C#
public FrameProfiler? Profiler { get; init; }

Property Value

FrameProfiler?

Script

Scripted input to play, or null for none.

C#
public InputScript? Script { get; init; }

Property Value

InputScript?

Seed

Seed for Random (1 by default).

C#
public int Seed { get; init; }

Property Value

int

StartScreen

Whether the game’s start screen (StartScreen) is drawn while it loads, for runs whose time mode (TimeMode) is not deterministic and games whose identity keeps it on (true by default).

C#
public bool StartScreen { get; init; }

Property Value

bool

StateTrace

Receives the simulation state hash after every fixed step (ComputeStateHash), with each section’s hash when Sections is true; null (the default) hashes nothing. Two deterministic runs of the same build, script and seed record the same trace; FirstDivergence names the first update and section where two differ.

C#
public StateTrace? StateTrace { get; init; }

Property Value

StateTrace?

TimeMode

How the loop advances time (the launcher’s –time): RealTime with the wall clock, or Deterministic, one fixed step per frame. It wins over the game’s Configure; null (the default) keeps the game’s choice, else the composition’s RunPreset (the headless platform’s: deterministic), else real time. Nothing a platform does depends on the mode: it belongs to the loop only.

C#
public TimeMode? TimeMode { get; init; }

Property Value

TimeMode?

Methods

<Clone>$()

C#
public RunOptions <Clone>$()

Returns

RunOptions

Equals(object?)

C#
public override bool Equals(object? obj)

Parameters

obj object?

Returns

bool

Equals(RunOptions?)

C#
public bool Equals(RunOptions? other)

Parameters

other RunOptions?

Returns

bool

GetHashCode()

C#
public override int GetHashCode()

Returns

int

ToString()

C#
public override string ToString()

Returns

string

Operators

operator ==(RunOptions?, RunOptions?)

C#
public static bool operator ==(RunOptions? left, RunOptions? right)

Parameters

left RunOptions?

right RunOptions?

Returns

bool

operator !=(RunOptions?, RunOptions?)

C#
public static bool operator !=(RunOptions? left, RunOptions? right)

Parameters

left RunOptions?

right RunOptions?

Returns

bool