Football strategy

From aws-samples/sample-ai-possibilities · View interactive version

Football strategy is an AI agent skill from the GitHub repository aws-samples/sample-ai-possibilities. Activate when discussing strategy, tactics, or agent behavior design

How to use this skill

Skill file

Football Strategies & Tactics

Strategies and tactical concepts for programming smarter football agents. Each strategy includes agent-behavior mappings that translate directly to code decisions.

Offensive Strategies

Possession Play

Goal: Keep the ball, tire out opponents, wait for the perfect opening.

| Aspect | Detail |

|--------|--------|

| Style | Many short passes, patient build-up |

| Tempo | Slow, controlled |

| Risk | Low — fewer turnovers |

| Best When | Leading, or opponent presses aggressively |

Agent-Behavior Mapping:

if no_safe_forward_pass:
    pass_backward_or_sideways()
else:
    short_pass_to_best_positioned_teammate()

Counter-Attack

Goal: Defend deep, win the ball, then attack quickly with speed.

| Aspect | Detail |

|--------|--------|

| Style | Direct, fast transitions from defense to attack |

| Tempo | Slow in defense, explosive in attack |

| Risk | Medium — relies on speed and timing |

| Best When | Opponent dominates possession, you have fast forwards |

Agent-Behavior Mapping:

if just_won_ball:
    long_pass_to_forward_in_space()
    forwards.sprint_toward_goal()

High Press

Goal: Pressure opponents immediately, win the ball in their half.

| Aspect | Detail |

|--------|--------|

| Style | Aggressive, high defensive line |

| Tempo | Fast, intense |

| Risk | High — leaves space behind if beaten |

| Best When | Losing, need to force turnovers, high team stamina |

Agent-Behavior Mapping:

if opponent_has_ball and ball_in_opponent_half:
    nearest_player.sprint_to_ball_carrier()
    teammates.cut_passing_lanes()

Wing Play

Goal: Attack down the flanks, cross into the box.

| Aspect | Detail |

|--------|--------|

| Style | Wide positioning, crosses into penalty area |

| Tempo | Medium to fast |

| Risk | Medium — crosses can be intercepted |

| Best When | You have strong headers, opponent is narrow |

Agent-Behavior Mapping:

if wide_player_has_ball and in_crossing_zone:
    cross_to_penalty_box()
    central_players.run_into_box()

Defensive Strategies

Zonal Defense

Goal: Each player defends a specific area, maintain team shape.

| Aspect | Detail |

|--------|--------|

| Style | Area-based, structured |

| Weakness | Gaps between zones if spacing is poor |

| Best When | Default defensive setup, balanced approach |

Agent-Behavior Mapping:

if ball_in_my_zone:
    move_toward_ball()
    if opponent_has_ball_in_zone:
        tackle()
else:
    hold_zone_position()

Man-to-Man Marking

Goal: Each defender tracks a specific opponent closely.

| Aspect | Detail |

|--------|--------|

| Style | Player-based, tight coverage |

| Weakness | Can be pulled out of position by decoy runs |

| Best When | Opponent has a star player to neutralize |

Agent-Behavior Mapping:

if assigned_opponent_has_ball:
    tackle()
elif assigned_opponent_moving:
    mark(assigned_opponent_id)
    match_opponent_speed()

Compact Defense

Goal: Keep all players close together, deny space.

| Aspect | Detail |

|--------|--------|

| Style | Tight formation, narrow shape |

| Weakness | Vulnerable to wide play and crosses |

| Best When | Protecting a lead, opponent plays through the middle |

Agent-Behavior Mapping:

if ball_on_left_side:
    shift_formation_left()
    maintain_tight_spacing()
elif ball_on_right_side:
    shift_formation_right()
    maintain_tight_spacing()

Offside Trap

Goal: Catch attackers offside by moving defenders forward together.

| Aspect | Detail |

|--------|--------|

| Style | Synchronized defensive line movement |

| Weakness | Devastating if mistimed — attacker is through on goal |

| Risk | Very high — requires perfect coordination |

| Best When | Opponent relies on through balls, your defenders are fast |

Agent-Behavior Mapping:

if opponent_preparing_through_pass:
    all_defenders.run_forward_together()
    if trap_failed:
        nearest_defender.sprint_back()

Tactical Programming Concepts

Ball Possession Decisions

Your agent must decide what to do with the ball every tick. Use this decision tree:

| Situation | Recommended Action | Reasoning |

|-----------|-------------------|-----------|

| Close to goal, clear shot | SHOOT | Best scoring opportunity |

| Under pressure, teammate open | SHORT_PASS | Relieve pressure, keep possession |

| Teammate making a run behind defense | THROUGH_PASS | Exploit space, create chance |

| Wide position, teammates in box | CROSS | Deliver ball to scoring zone |

| No good options, safe area | DRIBBLE | Buy time, wait for movement |

| Need to switch play quickly | LONG_PASS | Change point of attack |

Priority order: Shoot → Through Pass → Short Pass → Cross → Dribble → Long Pass

Movement Without the Ball

What your agent does without the ball is just as important as what it does with it.

Making Runs:

Creating Space:

Supporting the Ball Carrier:

Team Coordination Patterns

Passing Triangles:

Overlapping Runs:

Switching Play:

Game-State Awareness

Adapt strategy based on the current match situation:

| Game State | Strategy Adjustment |

|------------|-------------------|

| Winning by 2+ goals | Possession play, conserve stamina, waste time |

| Winning by 1 goal | Balanced, protect lead but stay dangerous |

| Drawing | Look for opportunities, balanced risk |

| Losing by 1 goal | Push higher, take more shots, increase tempo |

| Losing by 2+ goals | High press, maximum aggression, all-out attack |

| Last 30 seconds, winning | All players defend, clear the ball |

| Last 30 seconds, losing | Everyone forward, goalkeeper too if desperate |

if score_difference >= 2:
    strategy = "possession_conserve"
elif score_difference == 1:
    strategy = "balanced_protect"
elif score_difference == 0:
    strategy = "balanced_opportunistic"
elif score_difference == -1:
    strategy = "aggressive_push"
else:
    strategy = "all_out_attack"

Stamina Management

Stamina is a finite resource. Poor management means your players slow down in critical moments.

Sprint Wisely:

Rotation:

Positioning Over Running:

| Stamina Level | Recommended Behavior |

|---------------|---------------------|

| 80-100% | Full intensity, sprint when needed |

| 50-79% | Moderate, prefer RUN over SPRINT |

| 30-49% | Conservative, mostly WALK and RUN |

| Below 30% | Minimal movement, hold position, WALK only |

Combining Strategies

Effective agents don't use a single strategy — they adapt. Consider a hybrid approach:

  1. Start with possession play to control the game and read the opponent
  2. Switch to counter-attack if the opponent presses high
  3. Use high press when losing and stamina is still high
  4. Fall back to compact defense when protecting a lead with low stamina
  5. Deploy offside trap selectively against through-ball-heavy opponents

The best agents read the game state every tick and adjust their strategy dynamically.

References

Use this skill with your AI agent: Open on Skill Issue to copy, download, or add to your library. Works with Claude, ChatGPT, Gemini, Cursor, Windsurf and more.