Footfall1.0.0 · Exaweft

Footfall API overview

Everything is in the Exaweft.Footfall namespace, in the runtime assembly Exaweft.Footfall.Runtime. Every public type and member has XML documentation, so your IDE shows the details as you type. The Editor windows and the Scene View panel have no public API.

Recording

Heatmaps (static class)

MemberUse
Record(string eventName, Vector3 position)Records an event, such as a death, at a world position.
Record(string eventName, Vector3 position, string tagKey, string tagValue)The same, with one tag, such as ("enemy", "bat").
Record(string eventName, Vector3 position, params HeatmapTag[] tags)The same, with any number of tags. Tuples convert: Record("death", pos, ("enemy", "bat"), ("wave", "3")).
EndSession()Ends the open session and closes its file. The next record starts a new one.
Flush()Saves the open session's buffered records now. Footfall also does this every two seconds.
PausedWhile true, nothing is recorded and no session starts; an open session continues when it is set back to false. False at the start of every run.
TesterLabelA label saved with each session, such as "Sam". Set by -footfallTester "Sam" on the command line. Applies from the next session.
OutputFolderWhere session files go. Defaults to Application.persistentDataPath/Footfall/Sessions. Applies from the next session.
MaxPositionSamples, MaxEventsCaps per session, 100,000 samples and 20,000 events by default. Later records are dropped and the file notes the cap.
IsEnabledTrue when recording runs: in the Editor and development builds, and in release builds only with "Record in release builds" ticked. When false, every call does nothing (its arguments are still evaluated; wrap costly ones in if (Heatmaps.IsEnabled)).
IsRecording, CurrentSessionPathWhether a session file is open, and its path.
LastSessionPathThe file of the last session that ended.
SessionTimeSeconds of game time since the open session started.
TesterArgument, DefaultMaxPositionSamples, DefaultMaxEventsConstants: "-footfallTester", 100,000 and 20,000.

HeatmapRecorder (component)

Records where its GameObject goes, as one track per session. Add Component > Exaweft > Footfall > Heatmap Recorder.

MemberUse
SampleIntervalSeconds of game time between samples. Default 0.5; at least MinSampleInterval (0.05).
TrackNameThe track's name, such as "Player". Empty uses the GameObject's name. Applies from the next session.

HeatmapTag (struct)

A key and value pair, such as enemy = bat. Built with new HeatmapTag("enemy", "bat") or converted from a tuple, ("enemy", "bat"). To record tags without allocating, keep a HeatmapTag[] and pass it to Record.

Reading session files

For your own tools: these read the files Footfall writes.

TypeUse
SessionFileRead(path) reads a session file; Parse(text) reads its text. Both return SessionData, and throw SessionFormatException for a file that isn't a Footfall session or uses a newer format. A file a game is still writing can be read as it stands. Extension is ".footfall"; FormatVersion is the newest format this version reads.
SessionDataOne session: Header, Tracks, Positions, Events, Duration, and how it ended (EndReason, EndedCleanly, PositionsCapped, EventsCapped, Truncated, SkippedLines).
SessionHeaderScene and scene path, build, Unity version, platform, tester label, start time, session ID and format version.
SessionTrackOne recorder's track: Id, Name, SampleInterval.
PositionSampleTrack, Time and Position.
SessionEventName, Time, Position and Tags; GetTag(key) returns a tag's value, or null.

The user guide's section 11 describes the file format itself.