Under the Hood — How the Logic Works
How the formation, auto-assign scoring, fatigue detection, traffic light, and validation logic work under the hood.
Written By Squad Rotate Admin
Last updated About 1 month ago
Under the Hood – How the Logic Works
Formation rules
SquadRotate's formation is configurable from the Team Info tab. The default is 1-3-1-2 (GK / DEF / MID / STR) for 7v7. You can change it to match your league's format, for example, 1-3-2-2 for 8v8 or 1-3-2-3 for 9v9. The validation rules and auto-assign algorithm both read your configured formation at runtime.
Any roster size above your team size will have players rotating through the bench each shift, the algorithm accounts for this automatically.
Auto-assign scoring formula
When you tap Auto-Assign, the algorithm scores every possible player-to-position assignment and picks the combination that minimizes the total cost across all shifts. The key factors in that score:
Position preference match – large bonus if the player listed this position as a preference. Players always go where they want first when possible.
Power balance – each shift's average power rating is compared to the team average. Assignments that keep all shifts near the mean are preferred over ones that pile strong players into one shift.
Bench equity – players who have already sat the bench more times this game are deprioritized for bench assignments, so bench time spreads evenly.
GK rotation – among players with GK as a preference, goalkeeper duty rotates so no one player is stuck in goal every shift.
Note: Auto-assign produces a good starting point, not a perfect solution. You know your kids better than any algorithm does. Use manual adjustments freely after the initial auto-assign.
Fatigue detection logic
The fatigue warning system scans every player's shift sequence and looks for consecutive pairs where both roles are attacking (Striker or Midfield). It flags the second shift in the consecutive pair:
- STR → STR – flagged
- MID → MID – flagged
- STR → MID or MID → STR – flagged
- STR → DEF → STR – not flagged (DEF breaks the chain)
- STR → Bench → STR – not flagged (Bench breaks the chain)
Three consecutive attacking shifts produce two warnings (shifts 2 and 3 in the sequence).
Traffic light scoring
The quality dot on each shift header is based on the sum of power ratings for field players (non-bench) in that shift, compared to the ideal average across all shifts:
- Within ~10% of average → green
- 10–25% off → yellow
- More than 25% off → red
Validation thresholds
Shift validation fires as soon as one or more players have been assigned a non-bench role. It checks exact counts against your configured formation and generates a specific corrective message for each violation (e.g. wrong goalkeeper count, too many strikers, wrong total field count).