James Liu

Unreal Engine plugin prototype

Input Recorder & Ghost Replay

A C++ runtime plugin that records Enhanced Input and actor transforms frame by frame, then replays an interpolated ghost with controllable timing.

Input Recorder and Ghost Replay plugin icon
Focus

Replay systems & developer tooling

Tools & methods

Unreal Engine 5 · C++ · Enhanced Input · Blueprint API

Project

Unreal Engine plugin prototype

One runtime subsystem records input and world state together.

One GameInstanceSubsystem samples Enhanced Input and actor transforms together into a frame-based clip.

Runtime captureTwo kinds of state. One recording.
Enhanced InputAction valuesBoolean · 1D · 2D · 3D
Tracked ActorsWorld transformsWeak actor references
TimingFrame deltaRecorded sample duration
EACH TICK
ClipOne frame recordTiming + input + world state
Implementation details

A GameInstanceSubsystem owns the recording lifecycle and samples on the core ticker. Each frame stores delta time, tracked actor transforms, and Enhanced Input values for Boolean, 1D, 2D, and 3D actions.

Weak actor references keep the recorder from extending object lifetimes, while a clip object provides a compact boundary for frame data, duration, map identity, and future event tags.

Ghost motion remains smooth even when the source is frame-based.

A playback component finds adjacent samples and blends their transforms to move a ghost smoothly.

Interpolated playbackRecorded frames → a smooth ghost
  1. ControlsAdvance timePlay · pause · speed · loop
  2. ClipFind two samplesBefore / after the playhead
  3. InterpolationBlend transformsClamp the blend factor to 0–1
  4. OutputMove the ghostApply the blended transform
Technical details & source excerpt

A reusable ActorComponent binds to a clip and exposes play, pause, stop, looping, playback speed, and start-time controls. During playback it advances a playhead, finds the surrounding samples, and blends transforms before applying them to the ghost actor.

  • Transform interpolation prevents visible frame stepping
  • Loop and speed controls support testing and replay variation
  • Blueprint-callable APIs keep the C++ system accessible to designers
Frame interpolationIRGRGhostComponent.cpp · C++
const FIRGRActorFrame* Prev = PrevActors.FindByPredicate(
    [this](const FIRGRActorFrame& Frame) {
        return Frame.ActorPath == ActorTrack;
    }
);

if (Prev)
{
    const float Alpha =
        (Time - Acc) / Clip->Frames[i].DeltaTime;
    FTransform Blended;
    Blended.Blend(
        Prev->Transform,
        Cur->Transform,
        FMath::Clamp(Alpha, 0.f, 1.f)
    );
    OutXform = Blended;
}

Playback finds the two samples around the current playhead and blends their transforms, so recorded frame data produces a smooth ghost trajectory.

The prototype proves capture and replay before persistence.

The prototype includes runtime / editor modules and Blueprint APIs. File save and load are still stubs; durable serialization is the next milestone.

Implementation details

The repository separates runtime and editor modules and includes a Blueprint function library plus a generated circular test clip. File save and load are deliberately still stubs, so the next milestone is durable clip serialization rather than a claim of finished production tooling.

Next projectCoffeeTime