Virtually Season 2020 – Notes & Thoughts


To simulate the AFL season in real-time, as if matches were really being played.

How It Works:

  • Each week, any model author can post simulated results for the round’s games. Your data would show results like “Round 2 Collingwood 76 Richmond 54”, where the numbers aren’t the most likely outcome for that game, but rather a single sim randomly chosen from your distribution. (E.g. if you have Collingwood winning 60% of the time in your sims, you are 60% likely to randomly select a sim in which the Pies are victorious, but there’s a 40% chance you select a Richmond victory.)
  • At game time, Squiggle randomly selects one of the available models to be the host, and updates in real-time with a match page & score worm as if the match were really happening.
  • The final score is that supplied by the host model.
  • If model authors supply event data for score worms, Squiggle will use that; otherwise it will use its own algorithm to generate a score worm to match the final scores.
  • If event data includes scorers, they will be used; otherwise Squiggle will generate scorers using probability data supplied by Stattraction.
  • Squiggle will update the ladder based on these results

ScoreWorm data format

If you are supplying scoreworm data, it must be JSON like this:

[{ "event_type": "period_start", "period_seconds": 0 }, {"event_type": "behind", "team": "home", "period_seconds": 139 }, {"event_type": "goal", "team": "away", "period_seconds": 213 }, 
{ "event_type": "period_end", "period_seconds": 1727 } ]

That is:

  • It is an array of objects (events).
  • Events must be chronologically ordered.
  • Each event object must have:
    • event_type (string)
    • period_seconds (number: seconds elapsed since the start of this quarter)
  • Valid values for event_type are: period_start, period_end, goal, behind.
  • For goal and behind events:
    • The event must also include team (string), which must be either home or away.
    • The event may optionally include scorer (string), which should be the name of the player who created this score, e.g. “Shiels, Liam” or “Rushed”.

If your data makes sense, then:

  • The very first event should be period_start and the very last event should be period_end
  • There should be 4 period_start events and 4 period_end events in total – and, except for the first and last one, they should occur in pairs, with a period_end being immediately followed by a period_start
  • Each period_start event should have period_seconds set to 0.
  • Goals and behinds shouldn’t occur implausibly close together in time