UMRIDemoSubsystem¶
Game instance subsystem that manages demo recording, playback, and replay enumeration.
Syntax¶
Remarks¶
Adapted from the driving simulator so that any project can use this functionality without replacing its own game instance class. Attach to any UGameInstance by including the plugin. Provides Blueprint-callable wrappers for all core replay operations, a demo-rendering pipeline for offline frame capture, and OBS integration stubs. UCLASS
Inheritance Hierarchy¶
UGameInstanceSubsystem → UMRIDemoSubsystem
Methods¶
| Method | Signature | Description | Blueprint |
|---|---|---|---|
| BP_OnFindReplaysComplete | void UMRIDemoSubsystem::BP_OnFindReplaysComplete(const TArray< FReplayInfo > &AllReplays) |
Blueprint event fired when replay enumeration completes. | yes |
| CaptureFrames | bool UMRIDemoSubsystem::CaptureFrames() const |
Returns whether the spectator controller should capture frames during playback. | |
| Deinitialize | void UMRIDemoSubsystem::Deinitialize() override |
Called by Unreal when the subsystem is destroyed. | |
| DeleteReplay | void UMRIDemoSubsystem::DeleteReplay(const FString &ReplayName) |
Deletes an existing replay from disk. | yes |
| DemoRenderFrames | void UMRIDemoSubsystem::DemoRenderFrames(const FString &demoName, int fps) |
Plays back a demo and renders each frame to disk using a spectator controller. | yes |
| FindReplays | void UMRIDemoSubsystem::FindReplays() |
Asynchronously enumerates all available demo files. | yes |
| GetCaptureFPS | int UMRIDemoSubsystem::GetCaptureFPS() const |
Returns the target frame rate for demo rendering. | |
| GetCaptureFolder | FString * UMRIDemoSubsystem::GetCaptureFolder() const |
Returns folder path where captured frames are saved. | |
| GetDemoName | FString * UMRIDemoSubsystem::GetDemoName() const |
Returns the filename of the demo currently being rendered. | |
| GetDemoState | int UMRIDemoSubsystem::GetDemoState() const |
Returns the current demo recording status code. | |
| GetDemosList | const TArray< FString > & UMRIDemoSubsystem::GetDemosList() |
Returns the list of all known demo filenames. | yes |
| GetExperimentType | EExperimentType UMRIDemoSubsystem::GetExperimentType() const |
Returns the current experiment type loaded from settings. | |
| GetIsDemoRenderedList | const TArray< bool > & UMRIDemoSubsystem::GetIsDemoRenderedList() |
Returns a bool array indicating which demos have already been rendered. | yes |
| GetPlayerPawn | APawn * UMRIDemoSubsystem::GetPlayerPawn() |
Returns the player pawn, using tag-based lookup or name-based lookup as appropriate. | |
| GetPlayerPawnByName | APawn * UMRIDemoSubsystem::GetPlayerPawnByName() |
Finds the player pawn by searching for an actor whose name matches the stored player pawn name. | |
| GetPlayerPawnByTag | APawn * UMRIDemoSubsystem::GetPlayerPawnByTag() |
Finds the player pawn by searching for an actor tagged with MRIPlayerTag. | |
| Initialize | void UMRIDemoSubsystem::Initialize(FSubsystemCollectionBase &Collection) override |
Called by Unreal when the subsystem is created. | |
| IsAutoRender | bool UMRIDemoSubsystem::IsAutoRender() const |
Whether we should automatically render all demos. | |
| IsPlayingReplay | bool UMRIDemoSubsystem::IsPlayingReplay() |
Returns whether a replay is currently being played back. | |
| IsRecordingReplay | bool UMRIDemoSubsystem::IsRecordingReplay() |
Returns whether a replay is currently being recorded. | yes |
| PlayReplay | void UMRIDemoSubsystem::PlayReplay(const FString &replayName) |
Plays the demo with the given name. | |
| PlayReplayFromBP | void UMRIDemoSubsystem::PlayReplayFromBP(FString ReplayName) |
Blueprint-callable wrapper to begin playing back a demo. | yes |
| ReadSettings | void UMRIDemoSubsystem::ReadSettings(UMRISettings *settings) |
Reads relevant settings from the settings object. | |
| RenameReplay | void UMRIDemoSubsystem::RenameReplay(const FString &ReplayName, const FString &NewFriendlyReplayName) |
Renames an existing replay. | yes |
| RequestOBSRecording | int UMRIDemoSubsystem::RequestOBSRecording(bool startStop) |
Requests OBS to start or stop recording. | |
| SetCaptureFolder | void UMRIDemoSubsystem::SetCaptureFolder(const FString &folder) |
Sets the folder where rendered frames will be saved. | |
| StartRecordingReplay | void UMRIDemoSubsystem::StartRecordingReplay(const FString &name, const FString &friendlyName) |
Begins recording a new demo. | |
| StartRecordingReplayFromBP | void UMRIDemoSubsystem::StartRecordingReplayFromBP(FString ReplayName, FString FriendlyName) |
Blueprint-callable wrapper to begin recording a demo. | yes |
| StopRecordingReplay | void UMRIDemoSubsystem::StopRecordingReplay() |
Stops the currently active demo recording. | |
| StopRecordingReplayFromBP | void UMRIDemoSubsystem::StopRecordingReplayFromBP() |
Blueprint-callable wrapper to stop the currently active demo recording. | yes |
Properties¶
| Property | Type | Description | Blueprint |
|---|---|---|---|
| demoStartTime | FDateTime |
Timestamp recording when the current demo recording started. | |
| replayToRender | FString |
Name of the next replay to render when auto-rendering is enabled. | yes |