Out-of-Position Penalty
A starter placed in a formation slot that isn't his position plays below his overall. The penalty depends on the player's positions (as the API returns them, primary first) and on the slot's position:
- The slot is his primary position: no penalty.
- The slot is his secondary or tertiary position: −1.
- Otherwise, the penalty depends on his primary position and the slot: the matrix below. Pairs close on the pitch cost 5 or 8; every other pair costs 20, including any outfield player in goal and a goalkeeper anywhere else.
The played overall is the player's overall minus the penalty. Only the starting eleven (indexes 0 to 10) is concerned: the bench has no position.
This is the rule the MFL backend applies (positionMalusHelper) when it fills a lineup automatically and when it computes the overall of an Arena team.
The calculator below gives the overall at the player's primary position, and what he plays at in a slot of another position.
| Primary ↓ / slot → | GK | RB | RWB | CB | LB | LWB | CDM | CM | RM | LM | CAM | RW | LW | CF | ST |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| GK | 0 | 20 | 20 | 20 | 20 | 20 | 20 | 20 | 20 | 20 | 20 | 20 | 20 | 20 | 20 |
| RB | 20 | 0 | 5 | 8 | 8 | 20 | 20 | 20 | 8 | 20 | 20 | 20 | 20 | 20 | 20 |
| RWB | 20 | 5 | 0 | 20 | 20 | 8 | 20 | 20 | 8 | 20 | 20 | 8 | 20 | 20 | 20 |
| CB | 20 | 8 | 20 | 0 | 8 | 20 | 8 | 20 | 20 | 20 | 20 | 20 | 20 | 20 | 20 |
| LB | 20 | 8 | 20 | 8 | 0 | 5 | 20 | 20 | 20 | 8 | 20 | 20 | 20 | 20 | 20 |
| LWB | 20 | 20 | 8 | 20 | 5 | 0 | 20 | 20 | 20 | 8 | 20 | 20 | 8 | 20 | 20 |
| CDM | 20 | 20 | 20 | 8 | 20 | 20 | 0 | 5 | 20 | 20 | 8 | 20 | 20 | 20 | 20 |
| CM | 20 | 20 | 20 | 20 | 20 | 20 | 5 | 0 | 8 | 8 | 5 | 20 | 20 | 20 | 20 |
| RM | 20 | 8 | 8 | 20 | 20 | 20 | 20 | 8 | 0 | 8 | 20 | 5 | 20 | 20 | 20 |
| LM | 20 | 20 | 20 | 20 | 8 | 8 | 20 | 8 | 8 | 0 | 20 | 20 | 5 | 20 | 20 |
| CAM | 20 | 20 | 20 | 20 | 20 | 20 | 8 | 5 | 20 | 20 | 0 | 20 | 20 | 5 | 20 |
| RW | 20 | 20 | 8 | 20 | 20 | 20 | 20 | 20 | 5 | 20 | 20 | 0 | 8 | 20 | 20 |
| LW | 20 | 20 | 20 | 20 | 20 | 8 | 20 | 20 | 20 | 5 | 20 | 8 | 0 | 20 | 20 |
| CF | 20 | 20 | 20 | 20 | 20 | 20 | 20 | 20 | 20 | 20 | 5 | 20 | 20 | 0 | 5 |
| ST | 20 | 20 | 20 | 20 | 20 | 20 | 20 | 20 | 20 | 20 | 20 | 20 | 20 | 5 | 0 |
out-of-position.ts
// MFL out-of-position penalty: how much overall a starter loses in a formation slot
// that is not his position. Generated from mfl-lambdas positionMalusHelper by
// mfl-guide scripts/generate-positions.mjs.
//
// - slot = the player's primary position (positions[0]) -> 0
// - slot = his secondary or tertiary position (positions[1] or [2]) -> 1
// - otherwise -> PRIMARY_TO_SLOT[primary][slot] (20 when the pair has no specific value)
// Played overall = the player's overall - penalty. Bench players (indexes 11-17) get no penalty.
export type Position = 'GK' | 'RB' | 'RWB' | 'CB' | 'LB' | 'LWB' | 'CDM' | 'CM' | 'RM' | 'LM' | 'CAM' | 'RW' | 'LW' | 'CF' | 'ST'
export const SECONDARY_POSITION_PENALTY = 1
export const PRIMARY_TO_SLOT: Record<Position, Record<Position, number>> = {
GK: { GK: 0, RB: 20, RWB: 20, CB: 20, LB: 20, LWB: 20, CDM: 20, CM: 20, RM: 20, LM: 20, CAM: 20, RW: 20, LW: 20, CF: 20, ST: 20 },
RB: { GK: 20, RB: 0, RWB: 5, CB: 8, LB: 8, LWB: 20, CDM: 20, CM: 20, RM: 8, LM: 20, CAM: 20, RW: 20, LW: 20, CF: 20, ST: 20 },
RWB: { GK: 20, RB: 5, RWB: 0, CB: 20, LB: 20, LWB: 8, CDM: 20, CM: 20, RM: 8, LM: 20, CAM: 20, RW: 8, LW: 20, CF: 20, ST: 20 },
CB: { GK: 20, RB: 8, RWB: 20, CB: 0, LB: 8, LWB: 20, CDM: 8, CM: 20, RM: 20, LM: 20, CAM: 20, RW: 20, LW: 20, CF: 20, ST: 20 },
LB: { GK: 20, RB: 8, RWB: 20, CB: 8, LB: 0, LWB: 5, CDM: 20, CM: 20, RM: 20, LM: 8, CAM: 20, RW: 20, LW: 20, CF: 20, ST: 20 },
LWB: { GK: 20, RB: 20, RWB: 8, CB: 20, LB: 5, LWB: 0, CDM: 20, CM: 20, RM: 20, LM: 8, CAM: 20, RW: 20, LW: 8, CF: 20, ST: 20 },
CDM: { GK: 20, RB: 20, RWB: 20, CB: 8, LB: 20, LWB: 20, CDM: 0, CM: 5, RM: 20, LM: 20, CAM: 8, RW: 20, LW: 20, CF: 20, ST: 20 },
CM: { GK: 20, RB: 20, RWB: 20, CB: 20, LB: 20, LWB: 20, CDM: 5, CM: 0, RM: 8, LM: 8, CAM: 5, RW: 20, LW: 20, CF: 20, ST: 20 },
RM: { GK: 20, RB: 8, RWB: 8, CB: 20, LB: 20, LWB: 20, CDM: 20, CM: 8, RM: 0, LM: 8, CAM: 20, RW: 5, LW: 20, CF: 20, ST: 20 },
LM: { GK: 20, RB: 20, RWB: 20, CB: 20, LB: 8, LWB: 8, CDM: 20, CM: 8, RM: 8, LM: 0, CAM: 20, RW: 20, LW: 5, CF: 20, ST: 20 },
CAM: { GK: 20, RB: 20, RWB: 20, CB: 20, LB: 20, LWB: 20, CDM: 8, CM: 5, RM: 20, LM: 20, CAM: 0, RW: 20, LW: 20, CF: 5, ST: 20 },
RW: { GK: 20, RB: 20, RWB: 8, CB: 20, LB: 20, LWB: 20, CDM: 20, CM: 20, RM: 5, LM: 20, CAM: 20, RW: 0, LW: 8, CF: 20, ST: 20 },
LW: { GK: 20, RB: 20, RWB: 20, CB: 20, LB: 20, LWB: 8, CDM: 20, CM: 20, RM: 20, LM: 5, CAM: 20, RW: 8, LW: 0, CF: 20, ST: 20 },
CF: { GK: 20, RB: 20, RWB: 20, CB: 20, LB: 20, LWB: 20, CDM: 20, CM: 20, RM: 20, LM: 20, CAM: 5, RW: 20, LW: 20, CF: 0, ST: 5 },
ST: { GK: 20, RB: 20, RWB: 20, CB: 20, LB: 20, LWB: 20, CDM: 20, CM: 20, RM: 20, LM: 20, CAM: 20, RW: 20, LW: 20, CF: 5, ST: 0 },
}
// `positions`: the player's positions as the API returns them, primary first.
export function outOfPositionPenalty(positions: Position[], slot: Position): number {
const [primary, secondary, tertiary] = positions
if (!primary) return 0
if (primary === slot) return 0
if (secondary === slot || tertiary === slot) return SECONDARY_POSITION_PENALTY
return PRIMARY_TO_SLOT[primary][slot]
}
export function playedOverall(overall: number, positions: Position[], slot: Position): number {
return overall - outOfPositionPenalty(positions, slot)
}
Building with an AI assistant? Point it to guide.playmfl.com/llms.txt.
