# anukul1712/mlfootball_env architecture

> Architecture diagram of the GitHub repository anukul1712/mlfootball_env, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-10-04). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/anukul1712/mlfootball_env
- Repository: https://github.com/anukul1712/mlfootball_env

## Overview

This is a self-contained AI soccer participant development kit: participants create or train a bot, run it in the game environment, inspect matches, then validate and package a submission. The graph includes the game engine, policy choices, training, and local match/viewer workflow, plus submission checks. Relationships for sampled core modules are supported by excerpts or the SOURCE INDEX; broader workflow links are documented in the README. Unsampled implementation details are not inferred.

Main entry points: [`participants/train_bot.py`](https://github.com/anukul1712/mlfootball_env/blob/main/participants/train_bot.py) (Training Runner), [`participants/soccer_env/match_runner.py`](https://github.com/anukul1712/mlfootball_env/blob/main/participants/soccer_env/match_runner.py) (Match Runner), [`participants/live_viewer.py`](https://github.com/anukul1712/mlfootball_env/blob/main/participants/live_viewer.py) (Live Viewer), [`participants/soccer_env/engine.py`](https://github.com/anukul1712/mlfootball_env/blob/main/participants/soccer_env/engine.py) (Soccer Engine)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_game["Game Environment"]
  node_game_config["Game Rules<br/>[config.py]"]
  node_engine["Soccer Engine<br/>[engine.py]"]
end

subgraph group_policies["Bot Policies"]
  node_starter_bot["Starter Bot<br/>[bots.py]"]
  node_reference_policy["Readable Opponent<br/>[policy.py]"]
  node_organizer_policy["Organizer RL Bot<br/>[policy.py]"]
  node_team_bot["Team Policy<br/>[policy.py]"]
end

subgraph group_training["Training"]
  node_reinforcement["RL Algorithms<br/>[reinforcement.py]"]
  node_trainer["Training Runner<br/>[train_bot.py]"]
end

subgraph group_matches["Matches And Viewing"]
  node_match_runner["Match Runner<br/>[match_runner.py]"]
  node_live_viewer["Live Viewer<br/>[live_viewer.py]"]
  node_replay_viewer["Replay Viewer<br/>[replay_viewer.py]"]
  node_viewer_server["Viewer Server<br/>[web_viewer.py]"]
  node_viewer_ui["Browser Viewer<br/>[viewer.js]"]
end

subgraph group_submission["Submission"]
  node_validator["Process Validator"]
  node_static_checker["Archive Checker"]
  node_packager["ZIP Packager"]
end

node_participant(("Participant"))

node_participant -->|"trains bot"| node_trainer
node_participant -->|"watches match"| node_live_viewer
node_participant -->|"validates submission"| node_validator
node_participant -->|"packages bot"| node_packager
node_game_config -->|"configures"| node_engine
node_trainer -->|"runs episodes"| node_engine
node_trainer -->|"trains policy"| node_reinforcement
node_trainer -->|"uses opponent"| node_organizer_policy
node_trainer -->|"uses opponent"| node_reference_policy
node_trainer -->|"selects opponents"| node_starter_bot
node_organizer_policy -->|"delegates to"| node_reinforcement
node_live_viewer -->|"runs match"| node_match_runner
node_live_viewer -->|"starts viewer"| node_viewer_server
node_replay_viewer -->|"opens replay"| node_viewer_server
node_match_runner -->|"steps game"| node_engine
node_match_runner -->|"loads rules"| node_game_config
node_validator -->|"runs matches"| node_match_runner
node_packager -->|"checked by"| node_static_checker
node_participant -->|"edits policy"| node_team_bot

click node_game_config "https://github.com/anukul1712/mlfootball_env/blob/main/participants/soccer_env/config.py"
click node_engine "https://github.com/anukul1712/mlfootball_env/blob/main/participants/soccer_env/engine.py"
click node_starter_bot "https://github.com/anukul1712/mlfootball_env/blob/main/participants/soccer_env/bots.py"
click node_reference_policy "https://github.com/anukul1712/mlfootball_env/blob/main/participants/reference_bot/policy.py"
click node_organizer_policy "https://github.com/anukul1712/mlfootball_env/blob/main/participants/organizer_rl_bot/policy.py"
click node_team_bot "https://github.com/anukul1712/mlfootball_env/blob/main/participants/submission_kit/team_bot/policy.py"
click node_reinforcement "https://github.com/anukul1712/mlfootball_env/blob/main/participants/soccer_env/reinforcement.py"
click node_trainer "https://github.com/anukul1712/mlfootball_env/blob/main/participants/train_bot.py"
click node_match_runner "https://github.com/anukul1712/mlfootball_env/blob/main/participants/soccer_env/match_runner.py"
click node_live_viewer "https://github.com/anukul1712/mlfootball_env/blob/main/participants/live_viewer.py"
click node_replay_viewer "https://github.com/anukul1712/mlfootball_env/blob/main/participants/replay_viewer.py"
click node_viewer_server "https://github.com/anukul1712/mlfootball_env/blob/main/participants/soccer_env/web_viewer.py"
click node_viewer_ui "https://github.com/anukul1712/mlfootball_env/blob/main/participants/viewer/viewer.js"
click node_validator "https://github.com/anukul1712/mlfootball_env/blob/main/participants/validate_submission.py"
click node_static_checker "https://github.com/anukul1712/mlfootball_env/blob/main/participants/submission_checker.py"
click node_packager "https://github.com/anukul1712/mlfootball_env/blob/main/participants/package_submission.py"

classDef toneNeutral fill:#f8fafc,stroke:#334155,stroke-width:1.5px,color:#0f172a
classDef toneBlue fill:#dbeafe,stroke:#2563eb,stroke-width:1.5px,color:#172554
classDef toneAmber fill:#fef3c7,stroke:#d97706,stroke-width:1.5px,color:#78350f
classDef toneMint fill:#dcfce7,stroke:#16a34a,stroke-width:1.5px,color:#14532d
classDef toneRose fill:#ffe4e6,stroke:#e11d48,stroke-width:1.5px,color:#881337
classDef toneIndigo fill:#e0e7ff,stroke:#4f46e5,stroke-width:1.5px,color:#312e81
classDef toneTeal fill:#ccfbf1,stroke:#0f766e,stroke-width:1.5px,color:#134e4a
class node_game_config,node_engine toneBlue
class node_starter_bot,node_reference_policy,node_organizer_policy,node_team_bot toneAmber
class node_reinforcement,node_trainer toneMint
class node_match_runner,node_live_viewer,node_replay_viewer,node_viewer_server,node_viewer_ui toneRose
class node_validator,node_static_checker,node_packager,node_participant toneIndigo
```

## Components

### Game Environment

- [Game Rules](https://github.com/anukul1712/mlfootball_env/blob/main/participants/soccer_env/config.py): `participants/soccer_env/config.py`
- [Soccer Engine](https://github.com/anukul1712/mlfootball_env/blob/main/participants/soccer_env/engine.py): `participants/soccer_env/engine.py`

### Bot Policies

- [Starter Bot](https://github.com/anukul1712/mlfootball_env/blob/main/participants/soccer_env/bots.py): `participants/soccer_env/bots.py`
- [Readable Opponent](https://github.com/anukul1712/mlfootball_env/blob/main/participants/reference_bot/policy.py): `participants/reference_bot/policy.py`
- [Organizer RL Bot](https://github.com/anukul1712/mlfootball_env/blob/main/participants/organizer_rl_bot/policy.py): `participants/organizer_rl_bot/policy.py`
- [Team Policy](https://github.com/anukul1712/mlfootball_env/blob/main/participants/submission_kit/team_bot/policy.py): `participants/submission_kit/team_bot/policy.py`

### Training

- [RL Algorithms](https://github.com/anukul1712/mlfootball_env/blob/main/participants/soccer_env/reinforcement.py): `participants/soccer_env/reinforcement.py`
- [Training Runner](https://github.com/anukul1712/mlfootball_env/blob/main/participants/train_bot.py): `participants/train_bot.py`

### Matches And Viewing

- [Match Runner](https://github.com/anukul1712/mlfootball_env/blob/main/participants/soccer_env/match_runner.py): `participants/soccer_env/match_runner.py`
- [Live Viewer](https://github.com/anukul1712/mlfootball_env/blob/main/participants/live_viewer.py): `participants/live_viewer.py`
- [Replay Viewer](https://github.com/anukul1712/mlfootball_env/blob/main/participants/replay_viewer.py): `participants/replay_viewer.py`
- [Viewer Server](https://github.com/anukul1712/mlfootball_env/blob/main/participants/soccer_env/web_viewer.py): `participants/soccer_env/web_viewer.py`
- [Browser Viewer](https://github.com/anukul1712/mlfootball_env/blob/main/participants/viewer/viewer.js): `participants/viewer/viewer.js`

### Submission

- [Process Validator](https://github.com/anukul1712/mlfootball_env/blob/main/participants/validate_submission.py): `participants/validate_submission.py`
- [Archive Checker](https://github.com/anukul1712/mlfootball_env/blob/main/participants/submission_checker.py): `participants/submission_checker.py`
- [ZIP Packager](https://github.com/anukul1712/mlfootball_env/blob/main/participants/package_submission.py): `participants/package_submission.py`

### Other components

- **Participant**

## Connections

- Participant → Training Runner: trains bot (evidence: `README.md`)
- Participant → Live Viewer: watches match (evidence: `README.md`)
- Participant → Process Validator: validates submission (evidence: `README.md`)
- Participant → ZIP Packager: packages bot (evidence: `README.md`)
- Game Rules → Soccer Engine: configures (evidence: `participants/soccer_env/engine.py`)
- Training Runner → Soccer Engine: runs episodes (evidence: `participants/train_bot.py`)
- Training Runner → RL Algorithms: trains policy (evidence: `participants/train_bot.py`)
- Training Runner → Organizer RL Bot: uses opponent (evidence: `participants/train_bot.py`)
- Training Runner → Readable Opponent: uses opponent (evidence: `participants/train_bot.py`)
- Training Runner → Starter Bot: selects opponents (evidence: `participants/train_bot.py`)
- Organizer RL Bot → RL Algorithms: delegates to (evidence: `participants/organizer_rl_bot/policy.py`)
- Live Viewer → Match Runner: runs match (evidence: `participants/live_viewer.py`)
- Live Viewer → Viewer Server: starts viewer (evidence: `participants/live_viewer.py`)
- Replay Viewer → Viewer Server: opens replay (evidence: `participants/replay_viewer.py`)
- Match Runner → Soccer Engine: steps game (evidence: `participants/soccer_env/match_runner.py`)
- Match Runner → Game Rules: loads rules (evidence: `participants/soccer_env/match_runner.py`)
- Process Validator → Match Runner: runs matches (evidence: `participants/validate_submission.py`)
- ZIP Packager → Archive Checker: checked by (evidence: `README.md`)
- Participant → Team Policy: edits policy (evidence: `README.md`)
