Expose generated selector choices in replay payloads

This commit is contained in:
axiomlogicnexus 2026-05-01 23:35:49 +02:00
parent fd09e17459
commit 1aec54d0e4
3 changed files with 30 additions and 1 deletions

View file

@ -1601,6 +1601,7 @@ FHyperTwistTrainingSessionSummary UHyperTwistTrainingLibrary::DeriveTrainingSess
FHyperTwistReplayEvent UHyperTwistTrainingLibrary::MakeTrainingAttemptReplayEvent(
const FHyperTwistTrainingSession& Session,
const FHyperTwistTrainingAttempt& Attempt,
const FHyperTwistTrainingImportedRuntimeSelectionState& ImportedRuntimeSelectionState,
int32 TimeMs
)
{
@ -1625,6 +1626,12 @@ FHyperTwistReplayEvent UHyperTwistTrainingLibrary::MakeTrainingAttemptReplayEven
Payload.Mistakes = Attempt.Mistakes;
Payload.ReplayId = Attempt.ReplayId;
Payload.CompletedAtUtc = Attempt.CompletedAtUtc;
if (ImportedRuntimeSelectionState.IsStructurallyValid())
{
Payload.ImportedRuntimeSurfaceId = ImportedRuntimeSelectionState.SurfaceId;
Payload.ImportedRuntimeSurfaceKind = ImportedRuntimeSelectionState.SurfaceKind;
Payload.ImportedRuntimeSelectorChoices = ImportedRuntimeSelectionState.SelectorChoices;
}
ReplayEvent.EventId = Attempt.AttemptId.IsEmpty()
? TEXT("training_attempt")
@ -1643,6 +1650,7 @@ FHyperTwistReplayPacket UHyperTwistTrainingLibrary::AppendTrainingAttemptToRepla
const FHyperTwistReplayPacket& ReplayPacket,
const FHyperTwistTrainingSession& Session,
const FHyperTwistTrainingAttempt& Attempt,
const FHyperTwistTrainingImportedRuntimeSelectionState& ImportedRuntimeSelectionState,
int32 TimeMs
)
{
@ -1689,7 +1697,12 @@ FHyperTwistReplayPacket UHyperTwistTrainingLibrary::AppendTrainingAttemptToRepla
UpdatedReplayPacket = UHyperTwistReplayLibrary::AppendReplayEvent(UpdatedReplayPacket, PhaseCompleteEvent);
}
const FHyperTwistReplayEvent ReplayEvent = MakeTrainingAttemptReplayEvent(Session, Attempt, TimeMs);
const FHyperTwistReplayEvent ReplayEvent = MakeTrainingAttemptReplayEvent(
Session,
Attempt,
ImportedRuntimeSelectionState,
TimeMs
);
if (!ReplayEvent.IsStructurallyValid())
{
return UpdatedReplayPacket;
@ -1704,6 +1717,7 @@ FHyperTwistTrainingAttemptResolution UHyperTwistTrainingLibrary::ResolveTraining
const FHyperTwistTrainingCase& TrainingCase,
const TArray<FHyperTwistProgressionMemory>& Memories,
const FHyperTwistTrainingAttempt& Attempt,
const FHyperTwistTrainingImportedRuntimeSelectionState& ImportedRuntimeSelectionState,
int32 TimeMs
)
{
@ -1739,6 +1753,7 @@ FHyperTwistTrainingAttemptResolution UHyperTwistTrainingLibrary::ResolveTraining
Resolution.ReplayEvent = MakeTrainingAttemptReplayEvent(
Session,
NormalizedAttempt,
ImportedRuntimeSelectionState,
TimeMs > 0 ? TimeMs : HyperTwistTrainingLibraryInternal::GetObservedAttemptTimeMs(NormalizedAttempt)
);
@ -1811,6 +1826,7 @@ FHyperTwistTrainingRunStepResult UHyperTwistTrainingLibrary::ResolveTrainingRunA
*TrainingCase,
RunState.Memories,
NormalizedAttempt,
RunState.ImportedRuntimeSelectionState,
ObservedAttemptTimeMs
);
if (!StepResult.AttemptResolution.IsStructurallyValid())
@ -1825,6 +1841,7 @@ FHyperTwistTrainingRunStepResult UHyperTwistTrainingLibrary::ResolveTrainingRunA
RunState.ReplayPacket,
RunState.Session,
NormalizedAttempt,
RunState.ImportedRuntimeSelectionState,
ObservedAttemptTimeMs
);
if (StepResult.UpdatedRunState.ReplayPacket.Events.Num() > 0)

View file

@ -120,6 +120,7 @@ public:
static FHyperTwistReplayEvent MakeTrainingAttemptReplayEvent(
const FHyperTwistTrainingSession& Session,
const FHyperTwistTrainingAttempt& Attempt,
const FHyperTwistTrainingImportedRuntimeSelectionState& ImportedRuntimeSelectionState,
int32 TimeMs
);
@ -128,6 +129,7 @@ public:
const FHyperTwistReplayPacket& ReplayPacket,
const FHyperTwistTrainingSession& Session,
const FHyperTwistTrainingAttempt& Attempt,
const FHyperTwistTrainingImportedRuntimeSelectionState& ImportedRuntimeSelectionState,
int32 TimeMs
);
@ -138,6 +140,7 @@ public:
const FHyperTwistTrainingCase& TrainingCase,
const TArray<FHyperTwistProgressionMemory>& Memories,
const FHyperTwistTrainingAttempt& Attempt,
const FHyperTwistTrainingImportedRuntimeSelectionState& ImportedRuntimeSelectionState,
int32 TimeMs
);

View file

@ -885,6 +885,15 @@ struct FHyperTwistTrainingAttemptReplayPayload
UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "HyperTwist")
FString CompletedAtUtc;
UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "HyperTwist")
FString ImportedRuntimeSurfaceId;
UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "HyperTwist")
FString ImportedRuntimeSurfaceKind;
UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "HyperTwist")
TArray<FHyperTwistTrainingImportedRuntimeSelectorChoice> ImportedRuntimeSelectorChoices;
};
USTRUCT(BlueprintType)