Skip to content

AMRISubjectState

Replicated player state holding all per-frame data needed for experiment logging and replay.

Syntax

class AMRISubjectState : public APlayerState

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 AMRISubjectController via friend declaration to enforce that state mutations always go through the controller's logic. UCLASS

Inheritance Hierarchy

APlayerStateAMRISubjectState

Methods

Method Signature Description Blueprint
AMRISubjectState AMRISubjectState::AMRISubjectState() Initializes all replicated fields to their default values.
CopyProperties void AMRISubjectState::CopyProperties(APlayerState *playerState) override Copies replicated properties from another player state.
GetDisplayedPromptType EDisplayedPromptType AMRISubjectState::GetDisplayedPromptType() const Returns the type of on-screen prompt currently being displayed. yes
GetFrameNumber int64 AMRISubjectState::GetFrameNumber() const Returns the current simulation frame number. yes
GetGameTimeStamp int32 AMRISubjectState::GetGameTimeStamp() const Returns the in-game timestamp for the current frame in milliseconds. yes
GetLifetimeReplicatedProps void AMRISubjectState::GetLifetimeReplicatedProps(TArray< FLifetimeProperty > &OutLifetimeProps) const override Registers which properties are replicated.
GetLocation FVector AMRISubjectState::GetLocation() const Returns the subject's current world-space location. yes
GetOrientation FVector AMRISubjectState::GetOrientation() const Returns the subject's current forward orientation vector. yes
GetPlatformTimeStamp int32 AMRISubjectState::GetPlatformTimeStamp() const Returns the platform timestamp for the current frame (milliseconds since epoch). yes
GetPoints int AMRISubjectState::GetPoints() const Returns the subject's accumulated score for this run. yes
GetSecondsToStartOfRun float AMRISubjectState::GetSecondsToStartOfRun() const Returns elapsed seconds between demo start and the first TTL of this run. yes
GetSimulationStepInSeconds float AMRISubjectState::GetSimulationStepInSeconds() const Returns the duration of the last simulation step in seconds. yes
GetSubjectTransform const FTransform & AMRISubjectState::GetSubjectTransform() const Returns the subject's current world transform (position + rotation + scale). yes
GetTotalTTLs int AMRISubjectState::GetTotalTTLs() const Returns the total number of TTLs received since the start of the experiment. yes
Reset void AMRISubjectState::Reset() override Resets the player state to its initial values.
ResetExperimentState void AMRISubjectState::ResetExperimentState() Resets only the experiment-specific state (not base PlayerState fields).
SetDisplayedPromptType void AMRISubjectState::SetDisplayedPromptType(EDisplayedPromptType type) Sets the type of prompt recorded as currently displayed.
SetPoints void AMRISubjectState::SetPoints(int newPoints) Sets the subject's accumulated points.
isTTL bool AMRISubjectState::isTTL() const Returns whether a The TTL is currently pressed. yes