Formations
A lineup stores its players by position index. Indexes 0 to 10 are the starting eleven and 0 is always the goalkeeper; 11 to 17 are the bench, which has no position. What the other starting indexes mean depends on the formation: index 4 is the left back in a 4-4-2 but a right midfielder in a 3-4-3.
For each formation, the files give the position of each starting index and where it sits on the pitch: x goes from 0 (left touchline) to 1 (right touchline), and y from 0 (the opponent's goal line) to 1 (your own goal line), as seen by the team attacking upwards.
All formations
| Formation | 0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 |
|---|---|---|---|---|---|---|---|---|---|---|---|
| 3-4-2-1 | GK | CB | CB | CB | RM | CM | CM | LM | CF | ST | CF |
| 3-4-3 | GK | CB | CB | CB | RM | CM | CM | LM | RW | ST | LW |
| 3-4-3_diamond | GK | CB | CB | CB | RM | CDM | LM | CAM | RW | ST | LW |
| 3-5-2 | GK | CB | CB | CB | RM | CM | CDM | CM | LM | ST | ST |
| 3-5-2_B | GK | CB | CB | CB | CDM | CDM | RM | CAM | LM | ST | ST |
| 4-1-2-1-2 | GK | RB | CB | CB | LB | RM | CDM | LM | ST | CAM | ST |
| 4-1-2-1-2_narrow | GK | RB | CB | CB | LB | CM | CDM | CM | ST | CAM | ST |
| 4-1-3-2 | GK | RB | CB | CB | LB | CDM | RM | CM | LM | ST | ST |
| 4-1-4-1 | GK | RB | CB | CB | LB | RM | CM | CDM | CM | LM | ST |
| 4-2-2-2 | GK | RB | CB | CB | LB | CAM | CDM | CDM | CAM | ST | ST |
| 4-2-3-1 | GK | RB | CB | CB | LB | CDM | CAM | CDM | RM | ST | LM |
| 4-2-4 | GK | RB | CB | CB | LB | CM | CM | RW | ST | ST | LW |
| 4-3-1-2 | GK | RB | CB | CB | LB | CM | CM | CM | ST | CAM | ST |
| 4-3-2-1 | GK | RB | CB | CB | LB | CM | CM | CM | CF | ST | CF |
| 4-3-3 | GK | RB | CB | CB | LB | CM | CM | CM | RW | ST | LW |
| 4-3-3_attack | GK | RB | CB | CB | LB | CM | CAM | CM | RW | ST | LW |
| 4-3-3_defend | GK | RB | CB | CB | LB | CM | CDM | CM | RW | ST | LW |
| 4-3-3_false9 | GK | RB | CB | CB | LB | CM | CDM | CM | RW | CF | LW |
| 4-4-1-1 | GK | RB | CB | CB | LB | RM | CM | CM | LM | CF | ST |
| 4-4-2 | GK | RB | CB | CB | LB | RM | CM | CM | LM | ST | ST |
| 4-4-2_B | GK | RB | CB | CB | LB | RM | CDM | CDM | LM | ST | ST |
| 5-2-3 | GK | RWB | CB | CB | CB | LWB | CM | CM | RW | ST | LW |
| 5-3-2 | GK | RWB | CB | CB | CB | LWB | RM | CM | LM | ST | ST |
| 5-4-1 | GK | RWB | CB | CB | CB | LWB | RM | CDM | LM | CAM | ST |
| 5-4-1_flat | GK | RWB | CB | CB | CB | LWB | RM | CM | CM | LM | ST |
formations.ts
// MFL formations: the position played by each lineup index.
// Indexes 0-10 are the starting eleven (0 = goalkeeper), 11-17 the bench (no position).
// x/y are pitch coordinates in [0, 1]: x = 0 left touchline, 1 right; y = 0 opponent goal line, 1 own goal line.
// Generated from mfl-lambdas TACTICS_FORMATIONS_POSITIONS_CONFIG by mfl-guide scripts/generate-formations.mjs.
export type FormationPosition = 'GK' | 'RB' | 'RWB' | 'CB' | 'LB' | 'LWB' | 'CDM' | 'CM' | 'RM' | 'LM' | 'CAM' | 'RW' | 'LW' | 'CF' | 'ST'
export type FormationName =
| '3-4-2-1'
| '3-4-3'
| '3-4-3_diamond'
| '3-5-2'
| '3-5-2_B'
| '4-1-2-1-2'
| '4-1-2-1-2_narrow'
| '4-1-3-2'
| '4-1-4-1'
| '4-2-2-2'
| '4-2-3-1'
| '4-2-4'
| '4-3-1-2'
| '4-3-2-1'
| '4-3-3'
| '4-3-3_attack'
| '4-3-3_defend'
| '4-3-3_false9'
| '4-4-1-1'
| '4-4-2'
| '4-4-2_B'
| '5-2-3'
| '5-3-2'
| '5-4-1'
| '5-4-1_flat'
export interface FormationSlot {
index: number
position: FormationPosition
x: number
y: number
}
export const STARTER_INDEXES = [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10] as const
export const BENCH_INDEXES = [11, 12, 13, 14, 15, 16, 17] as const
export const FORMATIONS: Record<FormationName, FormationSlot[]> = {
'3-4-2-1': [
{ index: 0, position: 'GK', x: 0.5, y: 1 },
{ index: 1, position: 'CB', x: 0.73, y: 0.82 },
{ index: 2, position: 'CB', x: 0.5, y: 0.82 },
{ index: 3, position: 'CB', x: 0.27, y: 0.82 },
{ index: 4, position: 'RM', x: 0.83, y: 0.58 },
{ index: 5, position: 'CM', x: 0.61, y: 0.58 },
{ index: 6, position: 'CM', x: 0.39, y: 0.58 },
{ index: 7, position: 'LM', x: 0.17, y: 0.58 },
{ index: 8, position: 'CF', x: 0.71, y: 0.36 },
{ index: 9, position: 'ST', x: 0.5, y: 0.29 },
{ index: 10, position: 'CF', x: 0.29, y: 0.36 },
],
'3-4-3': [
{ index: 0, position: 'GK', x: 0.5, y: 1 },
{ index: 1, position: 'CB', x: 0.73, y: 0.82 },
{ index: 2, position: 'CB', x: 0.5, y: 0.82 },
{ index: 3, position: 'CB', x: 0.27, y: 0.82 },
{ index: 4, position: 'RM', x: 0.83, y: 0.58 },
{ index: 5, position: 'CM', x: 0.61, y: 0.58 },
{ index: 6, position: 'CM', x: 0.39, y: 0.58 },
{ index: 7, position: 'LM', x: 0.17, y: 0.58 },
{ index: 8, position: 'RW', x: 0.78, y: 0.32 },
{ index: 9, position: 'ST', x: 0.5, y: 0.29 },
{ index: 10, position: 'LW', x: 0.22, y: 0.32 },
],
'3-4-3_diamond': [
{ index: 0, position: 'GK', x: 0.5, y: 1 },
{ index: 1, position: 'CB', x: 0.73, y: 0.82 },
{ index: 2, position: 'CB', x: 0.5, y: 0.82 },
{ index: 3, position: 'CB', x: 0.27, y: 0.82 },
{ index: 4, position: 'RM', x: 0.83, y: 0.54 },
{ index: 5, position: 'CDM', x: 0.5, y: 0.645 },
{ index: 6, position: 'LM', x: 0.17, y: 0.54 },
{ index: 7, position: 'CAM', x: 0.5, y: 0.45 },
{ index: 8, position: 'RW', x: 0.78, y: 0.31 },
{ index: 9, position: 'ST', x: 0.5, y: 0.28 },
{ index: 10, position: 'LW', x: 0.22, y: 0.31 },
],
'3-5-2': [
{ index: 0, position: 'GK', x: 0.5, y: 1 },
{ index: 1, position: 'CB', x: 0.75, y: 0.81 },
{ index: 2, position: 'CB', x: 0.5, y: 0.82 },
{ index: 3, position: 'CB', x: 0.25, y: 0.81 },
{ index: 4, position: 'RM', x: 0.82, y: 0.45 },
{ index: 5, position: 'CM', x: 0.7, y: 0.6 },
{ index: 6, position: 'CDM', x: 0.5, y: 0.64 },
{ index: 7, position: 'CM', x: 0.3, y: 0.6 },
{ index: 8, position: 'LM', x: 0.18, y: 0.45 },
{ index: 9, position: 'ST', x: 0.62, y: 0.29 },
{ index: 10, position: 'ST', x: 0.38, y: 0.29 },
],
'3-5-2_B': [
{ index: 0, position: 'GK', x: 0.5, y: 1 },
{ index: 1, position: 'CB', x: 0.75, y: 0.81 },
{ index: 2, position: 'CB', x: 0.5, y: 0.82 },
{ index: 3, position: 'CB', x: 0.25, y: 0.81 },
{ index: 4, position: 'CDM', x: 0.675, y: 0.62 },
{ index: 5, position: 'CDM', x: 0.325, y: 0.62 },
{ index: 6, position: 'RM', x: 0.85, y: 0.47 },
{ index: 7, position: 'CAM', x: 0.5, y: 0.44 },
{ index: 8, position: 'LM', x: 0.15, y: 0.47 },
{ index: 9, position: 'ST', x: 0.62, y: 0.29 },
{ index: 10, position: 'ST', x: 0.38, y: 0.29 },
],
'4-1-2-1-2': [
{ index: 0, position: 'GK', x: 0.5, y: 1 },
{ index: 1, position: 'RB', x: 0.83, y: 0.82 },
{ index: 2, position: 'CB', x: 0.61, y: 0.82 },
{ index: 3, position: 'CB', x: 0.39, y: 0.82 },
{ index: 4, position: 'LB', x: 0.17, y: 0.82 },
{ index: 5, position: 'RM', x: 0.83, y: 0.53 },
{ index: 6, position: 'CDM', x: 0.5, y: 0.645 },
{ index: 7, position: 'LM', x: 0.17, y: 0.53 },
{ index: 8, position: 'ST', x: 0.66, y: 0.28 },
{ index: 9, position: 'CAM', x: 0.5, y: 0.42 },
{ index: 10, position: 'ST', x: 0.34, y: 0.28 },
],
'4-1-2-1-2_narrow': [
{ index: 0, position: 'GK', x: 0.5, y: 1 },
{ index: 1, position: 'RB', x: 0.83, y: 0.82 },
{ index: 2, position: 'CB', x: 0.61, y: 0.82 },
{ index: 3, position: 'CB', x: 0.39, y: 0.82 },
{ index: 4, position: 'LB', x: 0.17, y: 0.82 },
{ index: 5, position: 'CM', x: 0.77, y: 0.53 },
{ index: 6, position: 'CDM', x: 0.5, y: 0.645 },
{ index: 7, position: 'CM', x: 0.23, y: 0.53 },
{ index: 8, position: 'ST', x: 0.66, y: 0.28 },
{ index: 9, position: 'CAM', x: 0.5, y: 0.42 },
{ index: 10, position: 'ST', x: 0.34, y: 0.28 },
],
'4-1-3-2': [
{ index: 0, position: 'GK', x: 0.5, y: 1 },
{ index: 1, position: 'RB', x: 0.83, y: 0.82 },
{ index: 2, position: 'CB', x: 0.61, y: 0.82 },
{ index: 3, position: 'CB', x: 0.39, y: 0.82 },
{ index: 4, position: 'LB', x: 0.17, y: 0.82 },
{ index: 5, position: 'CDM', x: 0.5, y: 0.66 },
{ index: 6, position: 'RM', x: 0.8, y: 0.5 },
{ index: 7, position: 'CM', x: 0.5, y: 0.5 },
{ index: 8, position: 'LM', x: 0.2, y: 0.5 },
{ index: 9, position: 'ST', x: 0.62, y: 0.3 },
{ index: 10, position: 'ST', x: 0.38, y: 0.3 },
],
'4-1-4-1': [
{ index: 0, position: 'GK', x: 0.5, y: 1 },
{ index: 1, position: 'RB', x: 0.83, y: 0.82 },
{ index: 2, position: 'CB', x: 0.61, y: 0.82 },
{ index: 3, position: 'CB', x: 0.39, y: 0.82 },
{ index: 4, position: 'LB', x: 0.17, y: 0.82 },
{ index: 5, position: 'RM', x: 0.865, y: 0.51 },
{ index: 6, position: 'CM', x: 0.665, y: 0.51 },
{ index: 7, position: 'CDM', x: 0.5, y: 0.64 },
{ index: 8, position: 'CM', x: 0.335, y: 0.51 },
{ index: 9, position: 'LM', x: 0.135, y: 0.51 },
{ index: 10, position: 'ST', x: 0.5, y: 0.3 },
],
'4-2-2-2': [
{ index: 0, position: 'GK', x: 0.5, y: 1 },
{ index: 1, position: 'RB', x: 0.83, y: 0.82 },
{ index: 2, position: 'CB', x: 0.61, y: 0.82 },
{ index: 3, position: 'CB', x: 0.39, y: 0.82 },
{ index: 4, position: 'LB', x: 0.17, y: 0.82 },
{ index: 5, position: 'CAM', x: 0.72, y: 0.46 },
{ index: 6, position: 'CDM', x: 0.61, y: 0.64 },
{ index: 7, position: 'CDM', x: 0.39, y: 0.64 },
{ index: 8, position: 'CAM', x: 0.28, y: 0.46 },
{ index: 9, position: 'ST', x: 0.65, y: 0.29 },
{ index: 10, position: 'ST', x: 0.35, y: 0.29 },
],
'4-2-3-1': [
{ index: 0, position: 'GK', x: 0.5, y: 1 },
{ index: 1, position: 'RB', x: 0.83, y: 0.82 },
{ index: 2, position: 'CB', x: 0.61, y: 0.82 },
{ index: 3, position: 'CB', x: 0.39, y: 0.82 },
{ index: 4, position: 'LB', x: 0.17, y: 0.82 },
{ index: 5, position: 'CDM', x: 0.6, y: 0.64 },
{ index: 6, position: 'CAM', x: 0.5, y: 0.46 },
{ index: 7, position: 'CDM', x: 0.4, y: 0.64 },
{ index: 8, position: 'RM', x: 0.75, y: 0.46 },
{ index: 9, position: 'ST', x: 0.5, y: 0.29 },
{ index: 10, position: 'LM', x: 0.25, y: 0.46 },
],
'4-2-4': [
{ index: 0, position: 'GK', x: 0.5, y: 1 },
{ index: 1, position: 'RB', x: 0.83, y: 0.82 },
{ index: 2, position: 'CB', x: 0.61, y: 0.82 },
{ index: 3, position: 'CB', x: 0.39, y: 0.82 },
{ index: 4, position: 'LB', x: 0.17, y: 0.82 },
{ index: 5, position: 'CM', x: 0.63, y: 0.57 },
{ index: 6, position: 'CM', x: 0.37, y: 0.57 },
{ index: 7, position: 'RW', x: 0.82, y: 0.34 },
{ index: 8, position: 'ST', x: 0.6, y: 0.3 },
{ index: 9, position: 'ST', x: 0.4, y: 0.3 },
{ index: 10, position: 'LW', x: 0.18, y: 0.34 },
],
'4-3-1-2': [
{ index: 0, position: 'GK', x: 0.5, y: 1 },
{ index: 1, position: 'RB', x: 0.83, y: 0.82 },
{ index: 2, position: 'CB', x: 0.61, y: 0.82 },
{ index: 3, position: 'CB', x: 0.39, y: 0.82 },
{ index: 4, position: 'LB', x: 0.17, y: 0.82 },
{ index: 5, position: 'CM', x: 0.8, y: 0.56 },
{ index: 6, position: 'CM', x: 0.5, y: 0.59 },
{ index: 7, position: 'CM', x: 0.2, y: 0.56 },
{ index: 8, position: 'ST', x: 0.77, y: 0.29 },
{ index: 9, position: 'CAM', x: 0.5, y: 0.38 },
{ index: 10, position: 'ST', x: 0.23, y: 0.29 },
],
'4-3-2-1': [
{ index: 0, position: 'GK', x: 0.5, y: 1 },
{ index: 1, position: 'RB', x: 0.83, y: 0.82 },
{ index: 2, position: 'CB', x: 0.61, y: 0.82 },
{ index: 3, position: 'CB', x: 0.39, y: 0.82 },
{ index: 4, position: 'LB', x: 0.17, y: 0.82 },
{ index: 5, position: 'CM', x: 0.735, y: 0.56 },
{ index: 6, position: 'CM', x: 0.5, y: 0.56 },
{ index: 7, position: 'CM', x: 0.265, y: 0.56 },
{ index: 8, position: 'CF', x: 0.72, y: 0.32 },
{ index: 9, position: 'ST', x: 0.5, y: 0.29 },
{ index: 10, position: 'CF', x: 0.28, y: 0.32 },
],
'4-3-3': [
{ index: 0, position: 'GK', x: 0.5, y: 1 },
{ index: 1, position: 'RB', x: 0.83, y: 0.82 },
{ index: 2, position: 'CB', x: 0.61, y: 0.82 },
{ index: 3, position: 'CB', x: 0.39, y: 0.82 },
{ index: 4, position: 'LB', x: 0.17, y: 0.82 },
{ index: 5, position: 'CM', x: 0.735, y: 0.56 },
{ index: 6, position: 'CM', x: 0.5, y: 0.56 },
{ index: 7, position: 'CM', x: 0.265, y: 0.56 },
{ index: 8, position: 'RW', x: 0.77, y: 0.31 },
{ index: 9, position: 'ST', x: 0.5, y: 0.29 },
{ index: 10, position: 'LW', x: 0.23, y: 0.31 },
],
'4-3-3_attack': [
{ index: 0, position: 'GK', x: 0.5, y: 1 },
{ index: 1, position: 'RB', x: 0.83, y: 0.82 },
{ index: 2, position: 'CB', x: 0.61, y: 0.82 },
{ index: 3, position: 'CB', x: 0.39, y: 0.82 },
{ index: 4, position: 'LB', x: 0.17, y: 0.82 },
{ index: 5, position: 'CM', x: 0.735, y: 0.57 },
{ index: 6, position: 'CAM', x: 0.5, y: 0.465 },
{ index: 7, position: 'CM', x: 0.265, y: 0.57 },
{ index: 8, position: 'RW', x: 0.77, y: 0.31 },
{ index: 9, position: 'ST', x: 0.5, y: 0.29 },
{ index: 10, position: 'LW', x: 0.23, y: 0.31 },
],
'4-3-3_defend': [
{ index: 0, position: 'GK', x: 0.5, y: 1 },
{ index: 1, position: 'RB', x: 0.83, y: 0.82 },
{ index: 2, position: 'CB', x: 0.61, y: 0.82 },
{ index: 3, position: 'CB', x: 0.39, y: 0.82 },
{ index: 4, position: 'LB', x: 0.17, y: 0.82 },
{ index: 5, position: 'CM', x: 0.735, y: 0.54 },
{ index: 6, position: 'CDM', x: 0.5, y: 0.61 },
{ index: 7, position: 'CM', x: 0.265, y: 0.54 },
{ index: 8, position: 'RW', x: 0.77, y: 0.31 },
{ index: 9, position: 'ST', x: 0.5, y: 0.29 },
{ index: 10, position: 'LW', x: 0.23, y: 0.31 },
],
'4-3-3_false9': [
{ index: 0, position: 'GK', x: 0.5, y: 1 },
{ index: 1, position: 'RB', x: 0.83, y: 0.82 },
{ index: 2, position: 'CB', x: 0.61, y: 0.82 },
{ index: 3, position: 'CB', x: 0.39, y: 0.82 },
{ index: 4, position: 'LB', x: 0.17, y: 0.82 },
{ index: 5, position: 'CM', x: 0.735, y: 0.53 },
{ index: 6, position: 'CDM', x: 0.5, y: 0.62 },
{ index: 7, position: 'CM', x: 0.265, y: 0.53 },
{ index: 8, position: 'RW', x: 0.79, y: 0.29 },
{ index: 9, position: 'CF', x: 0.5, y: 0.33 },
{ index: 10, position: 'LW', x: 0.21, y: 0.29 },
],
'4-4-1-1': [
{ index: 0, position: 'GK', x: 0.5, y: 1 },
{ index: 1, position: 'RB', x: 0.83, y: 0.82 },
{ index: 2, position: 'CB', x: 0.61, y: 0.82 },
{ index: 3, position: 'CB', x: 0.39, y: 0.82 },
{ index: 4, position: 'LB', x: 0.17, y: 0.82 },
{ index: 5, position: 'RM', x: 0.83, y: 0.56 },
{ index: 6, position: 'CM', x: 0.61, y: 0.61 },
{ index: 7, position: 'CM', x: 0.39, y: 0.61 },
{ index: 8, position: 'LM', x: 0.17, y: 0.56 },
{ index: 9, position: 'CF', x: 0.5, y: 0.42 },
{ index: 10, position: 'ST', x: 0.5, y: 0.27 },
],
'4-4-2': [
{ index: 0, position: 'GK', x: 0.5, y: 1 },
{ index: 1, position: 'RB', x: 0.83, y: 0.82 },
{ index: 2, position: 'CB', x: 0.61, y: 0.82 },
{ index: 3, position: 'CB', x: 0.39, y: 0.82 },
{ index: 4, position: 'LB', x: 0.17, y: 0.82 },
{ index: 5, position: 'RM', x: 0.83, y: 0.55 },
{ index: 6, position: 'CM', x: 0.61, y: 0.55 },
{ index: 7, position: 'CM', x: 0.39, y: 0.55 },
{ index: 8, position: 'LM', x: 0.17, y: 0.55 },
{ index: 9, position: 'ST', x: 0.65, y: 0.29 },
{ index: 10, position: 'ST', x: 0.35, y: 0.29 },
],
'4-4-2_B': [
{ index: 0, position: 'GK', x: 0.5, y: 1 },
{ index: 1, position: 'RB', x: 0.83, y: 0.82 },
{ index: 2, position: 'CB', x: 0.61, y: 0.82 },
{ index: 3, position: 'CB', x: 0.39, y: 0.82 },
{ index: 4, position: 'LB', x: 0.17, y: 0.82 },
{ index: 5, position: 'RM', x: 0.83, y: 0.5 },
{ index: 6, position: 'CDM', x: 0.61, y: 0.6 },
{ index: 7, position: 'CDM', x: 0.39, y: 0.6 },
{ index: 8, position: 'LM', x: 0.17, y: 0.5 },
{ index: 9, position: 'ST', x: 0.65, y: 0.29 },
{ index: 10, position: 'ST', x: 0.35, y: 0.29 },
],
'5-2-3': [
{ index: 0, position: 'GK', x: 0.5, y: 1 },
{ index: 1, position: 'RWB', x: 0.885, y: 0.77 },
{ index: 2, position: 'CB', x: 0.695, y: 0.82 },
{ index: 3, position: 'CB', x: 0.5, y: 0.82 },
{ index: 4, position: 'CB', x: 0.305, y: 0.82 },
{ index: 5, position: 'LWB', x: 0.115, y: 0.77 },
{ index: 6, position: 'CM', x: 0.65, y: 0.56 },
{ index: 7, position: 'CM', x: 0.35, y: 0.56 },
{ index: 8, position: 'RW', x: 0.77, y: 0.34 },
{ index: 9, position: 'ST', x: 0.5, y: 0.29 },
{ index: 10, position: 'LW', x: 0.23, y: 0.34 },
],
'5-3-2': [
{ index: 0, position: 'GK', x: 0.5, y: 1 },
{ index: 1, position: 'RWB', x: 0.885, y: 0.77 },
{ index: 2, position: 'CB', x: 0.695, y: 0.82 },
{ index: 3, position: 'CB', x: 0.5, y: 0.82 },
{ index: 4, position: 'CB', x: 0.305, y: 0.82 },
{ index: 5, position: 'LWB', x: 0.115, y: 0.77 },
{ index: 6, position: 'RM', x: 0.77, y: 0.5 },
{ index: 7, position: 'CM', x: 0.5, y: 0.58 },
{ index: 8, position: 'LM', x: 0.23, y: 0.5 },
{ index: 9, position: 'ST', x: 0.65, y: 0.29 },
{ index: 10, position: 'ST', x: 0.35, y: 0.29 },
],
'5-4-1': [
{ index: 0, position: 'GK', x: 0.5, y: 1 },
{ index: 1, position: 'RWB', x: 0.885, y: 0.77 },
{ index: 2, position: 'CB', x: 0.695, y: 0.82 },
{ index: 3, position: 'CB', x: 0.5, y: 0.82 },
{ index: 4, position: 'CB', x: 0.305, y: 0.82 },
{ index: 5, position: 'LWB', x: 0.115, y: 0.77 },
{ index: 6, position: 'RM', x: 0.83, y: 0.53 },
{ index: 7, position: 'CDM', x: 0.5, y: 0.645 },
{ index: 8, position: 'LM', x: 0.17, y: 0.53 },
{ index: 9, position: 'CAM', x: 0.5, y: 0.42 },
{ index: 10, position: 'ST', x: 0.5, y: 0.27 },
],
'5-4-1_flat': [
{ index: 0, position: 'GK', x: 0.5, y: 1 },
{ index: 1, position: 'RWB', x: 0.885, y: 0.77 },
{ index: 2, position: 'CB', x: 0.695, y: 0.82 },
{ index: 3, position: 'CB', x: 0.5, y: 0.82 },
{ index: 4, position: 'CB', x: 0.305, y: 0.82 },
{ index: 5, position: 'LWB', x: 0.115, y: 0.77 },
{ index: 6, position: 'RM', x: 0.83, y: 0.55 },
{ index: 7, position: 'CM', x: 0.61, y: 0.55 },
{ index: 8, position: 'CM', x: 0.39, y: 0.55 },
{ index: 9, position: 'LM', x: 0.17, y: 0.55 },
{ index: 10, position: 'ST', x: 0.5, y: 0.3 },
],
}
export function positionAt(formation: FormationName, index: number): FormationPosition | 'BENCH' | undefined {
if (index >= 11 && index <= 17) return 'BENCH'
return FORMATIONS[formation].find((slot) => slot.index === index)?.position
}
The 25 formation names are the values of formation.type in the API.
Building with an AI assistant? Point it to guide.playmfl.com/llms.txt.
