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)
| Member | Use |
|---|---|
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. |
Paused | While 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. |
TesterLabel | A label saved with each session, such as "Sam". Set by -footfallTester "Sam" on the command line. Applies from the next session. |
OutputFolder | Where session files go. Defaults to Application.persistentDataPath/Footfall/Sessions. Applies from the next session. |
MaxPositionSamples, MaxEvents | Caps per session, 100,000 samples and 20,000 events by default. Later records are dropped and the file notes the cap. |
IsEnabled | True 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, CurrentSessionPath | Whether a session file is open, and its path. |
LastSessionPath | The file of the last session that ended. |
SessionTime | Seconds of game time since the open session started. |
TesterArgument, DefaultMaxPositionSamples, DefaultMaxEvents | Constants: "-footfallTester", 100,000 and 20,000. |
HeatmapRecorder (component)
Records where its GameObject goes, as one track per session. Add Component > Exaweft > Footfall > Heatmap Recorder.
| Member | Use |
|---|---|
SampleInterval | Seconds of game time between samples. Default 0.5; at least MinSampleInterval (0.05). |
TrackName | The 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.
| Type | Use |
|---|---|
SessionFile | Read(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. |
SessionData | One session: Header, Tracks, Positions, Events, Duration, and how it ended (EndReason, EndedCleanly, PositionsCapped, EventsCapped, Truncated, SkippedLines). |
SessionHeader | Scene and scene path, build, Unity version, platform, tester label, start time, session ID and format version. |
SessionTrack | One recorder's track: Id, Name, SampleInterval. |
PositionSample | Track, Time and Position. |
SessionEvent | Name, Time, Position and Tags; GetTag(key) returns a tag's value, or null. |
The user guide's section 11 describes the file format itself.