AExperimentSubjectState¶
Replicated player state holding all per-frame data needed for experiment logging and replay.
Syntax¶
Remarks¶
This is the central state object for the MRI experiment framework. All information that must be available to both the live game and the spectator replay controller (e.g. position, TTL state, score) should be stored here as UPROPERTY(Replicated) fields.
Access is restricted to AExperimentSubjectController via friend declaration to enforce that state mutations always go through the controller's logic. UCLASS
Inheritance Hierarchy¶
APlayerState → AExperimentSubjectState
Methods¶
| Method | Signature | Description | Blueprint |
|---|---|---|---|
| AExperimentSubjectState | AExperimentSubjectState::AExperimentSubjectState() |
Initializes all replicated fields to their default values. | |
| CopyProperties | void AExperimentSubjectState::CopyProperties(APlayerState *playerState) override |
Copies replicated properties from another player state. | |
| GetDisplayedPromptType | EDisplayedPromptType AExperimentSubjectState::GetDisplayedPromptType() const |
Returns the type of on-screen prompt currently being displayed. | yes |
| GetFrameNumber | int64 AExperimentSubjectState::GetFrameNumber() const |
Returns the current simulation frame number. | yes |
| GetGameTimeStamp | int32 AExperimentSubjectState::GetGameTimeStamp() const |
Returns the in-game timestamp for the current frame in milliseconds. | yes |
| GetLifetimeReplicatedProps | void AExperimentSubjectState::GetLifetimeReplicatedProps(TArray< FLifetimeProperty > &OutLifetimeProps) const override |
Registers which properties are replicated. | |
| GetLocation | FVector AExperimentSubjectState::GetLocation() const |
Returns the subject's current world-space location. | yes |
| GetOrientation | FVector AExperimentSubjectState::GetOrientation() const |
Returns the subject's current forward orientation vector. | yes |
| GetPlatformTimeStamp | int32 AExperimentSubjectState::GetPlatformTimeStamp() const |
Returns the platform timestamp for the current frame (milliseconds since epoch). | yes |
| GetPoints | int AExperimentSubjectState::GetPoints() const |
Returns the subject's accumulated score for this run. | yes |
| GetSecondsToStartOfRun | float AExperimentSubjectState::GetSecondsToStartOfRun() const |
Returns elapsed seconds between demo start and the first TTL of this run. | yes |
| GetSimulationStepInSeconds | float AExperimentSubjectState::GetSimulationStepInSeconds() const |
Returns the duration of the last simulation step in seconds. | yes |
| GetSubjectTransform | const FTransform & AExperimentSubjectState::GetSubjectTransform() const |
Returns the subject's current world transform (position + rotation + scale). | yes |
| GetTotalTTLs | int AExperimentSubjectState::GetTotalTTLs() const |
Returns the total number of TTLs received since the start of the experiment. | yes |
| Reset | void AExperimentSubjectState::Reset() override |
Resets the player state to its initial values. | |
| ResetExperimentState | void AExperimentSubjectState::ResetExperimentState() |
Resets only the experiment-specific state (not base PlayerState fields). | |
| SetDisplayedPromptType | void AExperimentSubjectState::SetDisplayedPromptType(EDisplayedPromptType type) |
Sets the type of prompt recorded as currently displayed. | |
| SetPoints | void AExperimentSubjectState::SetPoints(int newPoints) |
Sets the subject's accumulated points. | |
| isTTL | bool AExperimentSubjectState::isTTL() const |
Returns whether a The TTL is currently pressed. | yes |