Skip to content

File Format

unicbm edited this page Jul 8, 2026 · 3 revisions

File Format

This page is a summary. The repository docs/FORMAT.md is the source of truth.

Version Summary

  • Magic: CSDTRREC
  • Current writer format: .dtr v7
  • Runtime reader support: v3 through v7
  • Current manifest ABI: 17
  • Current BotController native ABI: 16
  • Current DemoTracer companion API: 5

What .dtr Stores

.dtr is the native replay file consumed by DemoTracer's CounterStrikeSharp plugin and the BotController runtime.

It stores demo-derived route replay evidence such as:

  • Movement snapshots.
  • View angles.
  • Firing/input state.
  • Weapon state.
  • Projectile events.
  • High-fidelity metadata.
  • Subtick records.
  • Optional command-frame data.

v7 Section Model

.dtr v7 uses a section container. Known sections include:

  • Movement snapshot chain.
  • Tick metadata.
  • Subtick moves.
  • Projectile events.
  • High-fidelity metadata JSON.
  • Command frames.
  • Movement extra data.

Readers should skip unknown v7 section IDs by stored payload length when the format contract allows it.

Legacy Compatibility

The runtime reader supports v3 through v7:

  • v3 files do not contain projectile metadata.
  • v4 introduced projectile metadata.
  • v5 added play_start_tick_index and bounded freeze-time replay context.
  • v6 added high-fidelity metadata JSON.
  • v7 added the section container and optional command-frame/movement-extra sections.

Parser Checklist

  1. Validate magic and supported version.
  2. Read header counts and string fields.
  3. For v7, parse known sections and skip unknown sections safely.
  4. For legacy versions, parse the compressed body according to the version contract.
  5. Require mandatory movement, tick metadata, and subtick data.
  6. Parse metadata JSON by declared byte length.
  7. Verify subtick totals and replay bounds.

Release Compatibility

Use a matching server bundle for current .dtr output. If dtr_runtime or dtr_doctor reports an ABI mismatch, install the full matching server bundle and restart the server.

Clone this wiki locally