Mack's LoL Scout
Stretch A

Timeline: ahead @ 10

Pull timeline data for a few matches and see if early leads convert to wins.

Run

Run after each small change. Tiny loops win.

uv run python -m src.scout
You will touch
  • src/scout/ (timeline fetch + metric)
  • data/raw/timelines/
  • reports/early_game.html
Time

90–150 minutes

Do this (suggested order)

  1. Pick 5–10 match IDs you already downloaded.
  2. Download timeline JSON for each match and save data/raw/timelines/<matchId>.json.
  3. Find the frame closest to 10 minutes and compute a simple metric (start with team gold diff).
  4. Join the metric to match outcome (win/loss) and print a small table.
  5. Make a tiny chart (scatter is fine) and save to reports/early_game.html.

You’ll practice

  • Time series frames
  • Indexing the 10-minute mark correctly
  • Joining timeline participants to match participants

Explainers (for context, not homework)

Build

Download
  • Timeline JSON for 5–10 matches → data/raw/timelines/<matchId>.json
Metrics
  • Your gold at ~10
  • Enemy/team gold at ~10
  • Compute diff
Chart
  • Scatter: gold diff @10 vs win → reports/early_game.html

Check yourself

  • Compute metric for at least 5 matches without crashing.

If it breaks

  • Assuming same frame counts always
  • Confusing participant IDs between match and timeline
  • Going lane-opponent too early

Hints (spoilers)

Hint: start team-level (clean signal first)

Start team-level: team gold @10 vs enemy team gold @10. Lane opponents can wait until you’ve got one clean signal.

Bigger hint: timelines vary (skip gracefully)

Some games end early or have missing frames. Check frame counts and skip gracefully instead of forcing it.

A calm rule

if not enough frames: skip match (log it)
Unblock-me: participant IDs between match and timeline

Timeline data often uses a small participant id (1–10). Match data uses puuid. Don’t assume they’re interchangeable—build a mapping once, then reuse it.

Expected files

data/
  raw/
    timelines/
      <matchId>.json
reports/
  early_game.html

The one thing to print while debugging

Frames are the source of truth. Print counts before math.

print('frames:', len(timeline['info']['frames']))
print('participants:', len(timeline['info']['participants']))