Help us measure site usage?

With your permission, we use self-hosted analytics to understand page usage. It is optional and does not affect the Service. Learn more.

C++advancedcliAI generated

Game Replay Analyzer

Build a C++ tool that reads game replay files (recordings of every event in a match, such as movements, shots, kills and objectives) and turns them into a timeline and statistics: each player's kills, deaths, accuracy and damage, the match's key moments, and a heatmap image showing where on the map players spent their time. You'll define a replay format (or use a public dataset from a game that publishes one), parse it with Boost.JSON, check it for inconsistencies, compute the statistics efficiently even for very long matches, and draw the heatmap with OpenCV. You'll learn parsing and validating event data, designing data structures for timelines, aggregating statistics, image generation with OpenCV, and testing with realistic data.

Estimate
~14h
Steps
7
Completed by
0
Proposed by
codeseed.app

CMake · Boost · OpenCV

Project roadmap

  1. 01

    Define the replay format

    ~2h

    Write FORMAT.md for a JSON Lines replay: a header (match id, map name and size, players and teams) and events with a time in milliseconds and a type (spawn, move with x and y, shot, hit with damage, kill, objective and match end). Write a generator that creates realistic replays of any length with a seed, so you have test data. Set up a CMake project with Boost and OpenCV. Done when: FORMAT.md is written, and the generator creates sample replays.

  2. 02

    Parse and validate replays

    ~2.5h

    Parse the header and events with Boost.JSON, reading line by line so large files don't need to fit in memory. Validate: times never go backwards, players exist, positions are on the map, and a dead player doesn't act before respawning. Report problems with line numbers, and decide which ones stop the analysis and which are only warnings. Done when: a valid replay parses, and a damaged one reports its problems.

  3. 03

    Build the timeline

    ~2h

    Store events in a timeline structure with fast lookup by time and player, and track each player's state as events are applied (alive or dead, position and health). Detect key moments, such as a player getting several kills within 10 seconds, or a team losing most of its players in a short time. Done when: the tool prints the key moments of a sample match with their times.

  4. 04

    Compute player and match statistics

    ~2h

    For each player, compute kills, deaths, assists (damage to a player killed by someone else within a few seconds), accuracy (hits divided by shots), damage done and taken, and time alive; for the match, the score over time and each team's totals. Print them as aligned tables and write them as JSON with --json. Done when: the statistics for a small hand-written replay match the numbers calculated by hand.

  5. 05

    Draw heatmaps with OpenCV

    ~2h

    Accumulate player positions over time into a grid covering the map, blur it with GaussianBlur, normalize it, color it with applyColorMap, and save it as a PNG, optionally per team or per player, and for kills only. Done when: the heatmap images clearly show where players spent their time.

  6. 06

    Handle large and damaged files

    ~1.5h

    Measure memory and time on a very long generated replay and improve anything slow (for example storing positions compactly). Let the analysis continue past warnings, report skipped events, and use Boost.Program_options for the command line (input, output folder, which heatmaps and output format). Done when: a long replay is analyzed within reasonable time and memory, noted in README.md.

  7. 07

    Test it

    ~2h

    Write tests with small hand-written replays covering each validation rule, assists within and outside the time window, accuracy with no shots, key moment detection, and consistency checks (total kills equal total deaths). Done when: all tests pass.

Ready to build this?

Get a GitHub repo and start building. Your AI reviewer checks each step as you go.

~14h · 7 steps

Tech stack

CMakeBoostOpenCV