Player12
An open source football management simulator
Loading...
Searching...
No Matches
match_engine.h File Reference
#include <array>
#include <cstdint>
#include <limits>
#include <optional>
#include <random>
#include <span>
#include <string>
#include <string_view>
#include <vector>
#include "global/stats_config.h"
#include "global/types.h"
#include "model/lineup.h"
#include "model/match_context.h"
#include "model/match_events.h"
#include "model/match_rules.h"
#include "model/match_scenario.h"
#include "model/match_tracking.h"
#include "model/match_tuning.h"
#include "model/strategy.h"
#include "model/tactics.h"

Go to the source code of this file.

Classes

struct  PassDecision
 
struct  ScenarioDecision
 
struct  MatchPlayer
 
struct  MatchBall
 
struct  MatchStats
 
struct  MatchCommandRecord
 
struct  MatchPlayerInput
 
struct  MatchInputRecord
 
struct  MatchHighlight
 
class  MatchEngine
 
struct  MatchEngine::Shootout
 
struct  MatchEngine::PendingAdvantage
 
struct  MatchEngine::GoalkeeperControl
 
struct  MatchEngine::ShoutState
 
struct  MatchEngine::SlotTactic
 
struct  MatchEngine::ControlledShot
 
struct  MatchEngine::PassOption
 
struct  MatchEngine::SaveAttempt
 

Enumerations

enum class  MatchState {
  KICK_OFF , PLAYING , THROW_IN , GOAL_KICK ,
  CORNER_KICK , FREE_KICK , PENALTY , GOAL ,
  PENALTY_SHOOTOUT , HALF_TIME , FULL_TIME
}
 
enum class  TeamPhase {
  STOPPAGE , SET_PIECE , DEFENSIVE_BLOCK , DEFENSIVE_TRANSITION ,
  ATTACKING_TRANSITION , POSSESSION , FINAL_THIRD
}
 
enum class  PlayerIntent {
  HOLD_SHAPE , CARRY_BALL , OFFER_SUPPORT , RECEIVE_PASS ,
  RUN_IN_BEHIND , ATTACK_BOX , OVERLAP , PRESS_BALL ,
  COVER_PRESS , BLOCK_PASSING_LANE , MARK_OPPONENT , CLAIM_LOOSE_BALL ,
  RECOVER_SHAPE , GOALKEEP
}
 
enum class  PassIntent {
  RECYCLE , PROGRESSIVE , THROUGH_BALL , CROSS ,
  CUTBACK , SWITCH_PLAY , PRESSURE_RELEASE , SET_PIECE
}
 
enum class  ScenarioAction {
  NONE , SHOT , PASS , CARRY ,
  SHIELD , CLEAR
}
 
enum class  GoalkeeperState {
  SET_POSITION , SWEEP , RUSH , CLAIM ,
  DIVE , HOLD , DISTRIBUTE , RECOVER
}
 
enum class  MatchShout : std::uint8_t {
  PUSH_HIGHER , DROP_DEEPER , PRESS_MORE , CALM_DOWN ,
  ENCOURAGE , WORK_BALL_INTO_BOX , SHOOT_ON_SIGHT , STAND_OFF ,
  DEMAND_MORE , HIT_ON_COUNTER , KEEP_POSSESSION
}
 
enum class  MatchCommandType : std::uint8_t {
  STRATEGY , SHOUT , FORMATION , MOVE_TO_SLOT ,
  SUBSTITUTION , TEAM_TALK
}
 
enum class  MatchInputAction : std::uint8_t {
  NONE , PASS , LOFTED_PASS , SHOOT ,
  CLEAR , TACKLE , SLIDE_TACKLE , THROUGH_BALL
}
 
enum class  MatchFidelity : std::uint8_t { FULL , BACKGROUND }
 
enum class  MatchPlaybackMode { FULL_MATCH , HIGHLIGHTS }
 

Functions

std::string_view goalkeeperStateName (GoalkeeperState state)
 

Enumeration Type Documentation

◆ GoalkeeperState

enum class GoalkeeperState
strong

Semantic goalkeeper state. Animation stays out of the engine.

Enumerator
SET_POSITION 
SWEEP 
RUSH 
CLAIM 
DIVE 
HOLD 
DISTRIBUTE 
RECOVER 

◆ MatchCommandType

enum class MatchCommandType : std::uint8_t
strong

Kind of an external tactical change (see MatchCommandRecord).

Enumerator
STRATEGY 
SHOUT 
FORMATION 
MOVE_TO_SLOT 
SUBSTITUTION 
TEAM_TALK 

A team talk's modifier for one half (see setTeamTalkModifier).

◆ MatchFidelity

enum class MatchFidelity : std::uint8_t
strong

Simulation detail of a headless match (see MatchEngine::simulateToEnd).

Enumerator
FULL 

The live engine's 10 Hz fixed step: watched matches and quick results.

BACKGROUND 

Unwatched background fixtures: live play is identical to FULL, but the walk to each restart spot is simulated in coarser steps (MatchTuning::Timing::BACKGROUND_STOPPAGE_TICKS). Deterministic per seed and statistically equivalent to FULL; a given seed plays a different match than in FULL.

◆ MatchInputAction

enum class MatchInputAction : std::uint8_t
strong

One-shot action requested by an external controller (play mode).

Enumerator
NONE 
PASS 
LOFTED_PASS 
SHOOT 
CLEAR 
TACKLE 
SLIDE_TACKLE 
THROUGH_BALL 

A ground pass into the space ahead of a team-mate's run.

◆ MatchPlaybackMode

enum class MatchPlaybackMode
strong

How advancePlayback() presents the match.

Enumerator
FULL_MATCH 

Every simulated second is shown at the playback speed.

HIGHLIGHTS 

Only highlight windows are shown; the rest is simulated headless.

◆ MatchShout

enum class MatchShout : std::uint8_t
strong

Touchline instructions a manager can shout during play.

Enumerator
PUSH_HIGHER 
DROP_DEEPER 
PRESS_MORE 
CALM_DOWN 
ENCOURAGE 
WORK_BALL_INTO_BOX 
SHOOT_ON_SIGHT 
STAND_OFF 
DEMAND_MORE 
HIT_ON_COUNTER 
KEEP_POSSESSION 

◆ MatchState

enum class MatchState
strong
Enumerator
KICK_OFF 
PLAYING 
THROW_IN 
GOAL_KICK 
CORNER_KICK 
FREE_KICK 
PENALTY 
GOAL 
PENALTY_SHOOTOUT 

A level knockout match decided from the spot (clock stopped).

HALF_TIME 

Half-time, and the breaks before and during extra time.

FULL_TIME 

◆ PassIntent

enum class PassIntent
strong

Tactical purpose of the most recently executed pass.

Enumerator
RECYCLE 
PROGRESSIVE 
THROUGH_BALL 
CROSS 
CUTBACK 
SWITCH_PLAY 
PRESSURE_RELEASE 
SET_PIECE 

◆ PlayerIntent

enum class PlayerIntent
strong

High-level decision currently driving a player's renderer-independent AI.

Enumerator
HOLD_SHAPE 
CARRY_BALL 
OFFER_SUPPORT 
RECEIVE_PASS 
RUN_IN_BEHIND 
ATTACK_BOX 
OVERLAP 
PRESS_BALL 
COVER_PRESS 
BLOCK_PASSING_LANE 
MARK_OPPONENT 
CLAIM_LOOSE_BALL 
RECOVER_SHAPE 
GOALKEEP 

◆ ScenarioAction

enum class ScenarioAction
strong

Best and runner-up pass candidates plus the final chosen reason.

Enumerator
NONE 
SHOT 
PASS 
CARRY 
SHIELD 
CLEAR 

◆ TeamPhase

enum class TeamPhase
strong

Team-level context shared by individual player decisions.

Enumerator
STOPPAGE 
SET_PIECE 
DEFENSIVE_BLOCK 
DEFENSIVE_TRANSITION 
ATTACKING_TRANSITION 
POSSESSION 
FINAL_THIRD 

Function Documentation

◆ goalkeeperStateName()

std::string_view goalkeeperStateName ( GoalkeeperState  state)