Two different traces
The reference session produces its own 512-entry effect log. The live trace bridge is a separate world subsystem for events observed in your actual game. It does not intercept GAS, calculate damage or automatically connect the reference session to a host.
Instrument a play
- Find the subsystem with
UDeckToolkitLiveTrace::Find(WorldContext); handle a null result. - Enable capture for the diagnostic session.
- Call BeginCard once to obtain a local PlayId.
- Pass that GUID through synchronous and delayed work belonging to the play.
- Call Record or RecordValue with your observed stage, detail and optional target.
// Includes: DeckToolkitLiveTrace.h
// CardObject, SourceActor and TargetActor are supplied by your host game.
if (UDeckToolkitLiveTrace* Trace = UDeckToolkitLiveTrace::Find(this))
{
const FGuid PlayId = Trace->BeginCard(CardObject, TEXT("Strike"), SourceActor, TargetActor);
Trace->Record(PlayId, TEXT("Queued"), TEXT("Host accepted the play"));
// After your own combat code applies the effect:
Trace->RecordValue(PlayId, TEXT("Health"), HealthBefore, HealthAfter,
TEXT("Observed enemy health"), TargetActor);
}This excerpt requires the host variables named in the comments. The bridge only records supplied values. Find, BeginCard, Record and RecordValue are native C++ functions; only GetEvents and Clear are exposed as Blueprint functions.
Enable capture and inspect
Open Tools > Live Card Trace, start PIE and enable capture. Select the correct world when multiple PIE/game worlds exist. In a development console, use:
DeckToolkit.Trace 1
DeckToolkit.ExportTrace
DeckToolkit.Trace 0Export writes JSON under Saved/DeckToolkit/LiveTrace-<guid>.json. Native code can use ExportJson(Filename) and check its boolean result. Do not rely on an interactive console being available in every Shipping configuration; integrate native controls if your product needs them.
Event fields
FDTLiveTraceEvent records PlayId, Sequence, TimeSeconds, Card, Source, Target, Stage and Detail. RecordValue additionally sets Before, After and bHasValues. GetRevision changes as history changes and can help avoid rebuilding an inspector unnecessarily.
Lifetime and limits
Capture defaults off. The subsystem does not tick, replicate or retain strong actor references. History is bounded to 2,048 events and 512 play metadata records. Disabled capture makes BeginCard return an invalid GUID and drops new records. Clear removes events and metadata; later events for cleared or evicted plays are discarded. Start a new play capture after clearing.
Use calls on the game thread. Only the open editor inspector polls. This is local observed history, not multiplayer telemetry or a replay system. Choose diagnostic labels appropriate for any JSON you intend to share.