← Back to the workshop How and why I built it

Flag Football Simulator

A play-by-play simulator of my 7v7 rec flag football league that finds the best defense, rusher, and lineup against the kind of team we're playing.

LiveTypeScript · React · Web Worker · S3 · CloudFront · CDK7v7 rec rules
Flag Football Simulator's play viewer: a Cover 2 defense with its zone landmarks against a gunslinger offense, mid-play, with each route drawn
Cover 2 against a gunslinger, 3.3 seconds in. Dashed circles are each zone's landmark; the bold route is the QB's first read.Watch a play →

The itch

I play linebacker in a 7v7 rec flag football league. Every week our defense has the same arguments: man or zone, who rushes, who plays safety, and what to do about the team whose QB only throws to one guy. I wanted answers that came from more than a hunch, so I built a simulator of our league and let it play thousands of snaps.

Our league's rules

What it does

Opponents come as types I recognize from the league: the Gunslinger who throws deep early, the Dink and Dunk team, Hero Ball (forcing it to one star), the Scrambler, and the Scared QB who holds it forever.

How it works

Each play is simulated ten times a second. Every player has six ratings (speed, agility, hands, catch height, man, and zone) that turn into how fast they run, how sharply they cut, how quickly they react, and how high they can catch, at a rec-league pace rather than a track meet's (friends who tried it said the receivers were too fast). Receivers run real routes from sampled formations. Man defenders trail a step behind, so separation shows up at the breaks. Zone defenders read the QB's eyes, and safeties follow the rule we actually play by: never let anyone get behind you.

The QB is modeled on what I see at our games: he either throws a planned quick pass in the first half second, or uses the count and waits for someone to come open. Catches, interceptions, missed flag pulls, and yards after the catch all come out of the same physics.

  1. Opponent typehow their QB reads and throws
  2. Every setup5 defenses × 7 rushers × 2 rush styles
  3. Swap spotswho plays safety, who covers their star
  4. Fresh plays800 snaps each to rank the finalists
  5. Call cardbest setup and what to watch for
The search runs in your browser, in about 10 seconds. Every setup sees the same sampled plays, so the comparisons are fair.
A call card against a gunslinger: Cover 2 with Quick rushing on contain, the lineup, stats, routes to watch for, and every defense ranked
Against a gunslinger it says Cover 2, with our shiftiest player rushing on contain, and to watch for shallow crosses.Try another opponent →

Players are built from types rather than real ratings, so the call cards answer "what should a team like ours run," not "what should we run against Thursday's opponent." Even so, it has already moved a few arguments: our two-high defense holds up best against most teams, and a bracket on their star mostly just gets the ball thrown to whoever is left open.

What's next

Run a matchup

Pick an opponent type and watch a play, or find the best setup.

Open Flag Football Simulator →