Player12
An open source football management simulator
Loading...
Searching...
No Matches
YouthModel Namespace Reference

Pure academy rules (tested without a world). More...

Functions

IntakeClass planIntake (const IntakeInputs &inputs, std::uint64_t world_seed, std::uint16_t year, TeamID team_id)
 
IntakePreview summarize (const IntakeClass &intake)
 
float regionTalent (Language country)
 
int firstProfessionalAge (Language country)
 
float academyGrade (const IntakeInputs &inputs)
 
std::size_t u18SquadLimit (float grade)
 
int computerSignings (float grade, std::size_t candidates)
 
std::uint32_t scholarshipWage (LeagueID league_id)
 
std::uint8_t youthContractYears (int age)
 
bool isHomegrown (int joined_age, int age)
 
YouthActionResult reserveEligibility (int age, PlayerRole role, const ReserveQuota &quota)
 
float staffProfessionalism (std::uint64_t world_seed, StaffID staff_id)
 
const char * staffStyleKey (float professionalism)
 
const char * personalityKey (const PlayerTraits &traits)
 
const char * qualityKey (IntakeQuality quality)
 
const char * contractKey (YouthContract contract)
 
const char * requestResultKey (UpgradeRequestResult result)
 
const char * actionResultKey (YouthActionResult result)
 
std::pair< int, int > simulateMatch (float home_strength, float away_strength, WorldRng &rng)
 
std::int64_t upgradeCost (AcademyUpgrade kind, int target, LeagueID league_id)
 
int upgradeDays (AcademyUpgrade kind, int target)
 
std::uint8_t upgradeTarget (AcademyUpgrade kind, int current)
 

Variables

constexpr std::uint8_t PREVIEW_MONTH = 2
 
constexpr std::uint8_t PREVIEW_DAY = 1
 
constexpr std::uint8_t INTAKE_MONTH = 3
 
constexpr std::uint8_t INTAKE_DAY = 15
 
constexpr int DECISION_DAYS = 30
 
constexpr int U18_MAX_AGE = 18
 
constexpr int U21_MAX_AGE = 21
 
constexpr std::size_t U21_OVERAGE_OUTFIELD = 3
 
constexpr std::size_t U21_OVERAGE_GOALKEEPERS = 1
 
constexpr std::size_t U21_SQUAD_LIMIT = 16
 
constexpr int HOMEGROWN_SEASONS = 3
 
constexpr int MINOR_CONTRACT_YEARS = 3
 
constexpr int SIGN_MIN = 2
 
constexpr int SIGN_MAX = 12
 
constexpr int PRO_POLICY_AGE = 17
 

Detailed Description

Pure academy rules (tested without a world).

Function Documentation

◆ academyGrade()

float YouthModel::academyGrade ( const IntakeInputs &  inputs)

Academy grade in [0, 1]: youth facilities, recruitment reach, junior coaching and the head of youth development, like an audited academy category.

◆ actionResultKey()

const char * YouthModel::actionResultKey ( YouthActionResult  result)

Language key of an action result.

◆ computerSignings()

int YouthModel::computerSignings ( float  grade,
std::size_t  candidates 
)

How many of candidates a computer-managed academy of grade signs (before squad room).

◆ contractKey()

const char * YouthModel::contractKey ( YouthContract  contract)

Language key of a contract type.

◆ firstProfessionalAge()

int YouthModel::firstProfessionalAge ( Language  country)

Age of the first professional contract in a country (16 or 17). [RR]

◆ isHomegrown()

bool YouthModel::isHomegrown ( int  joined_age,
int  age 
)

Club-trained after at least three academy seasons before turning 21.

◆ personalityKey()

const char * YouthModel::personalityKey ( const PlayerTraits &  traits)

Language key describing a personality in a word or two.

◆ planIntake()

IntakeClass YouthModel::planIntake ( const IntakeInputs &  inputs,
std::uint64_t  world_seed,
std::uint16_t  year,
TeamID  team_id 
)

The intake of team_id in year. Every candidate draws from its own keyed stream, so the preview in February describes exactly the group that arrives in March (unless the inputs changed in between).

◆ qualityKey()

const char * YouthModel::qualityKey ( IntakeQuality  quality)

Language key of an intake verdict (e.g. "YOUTH_QUALITY_GOLDEN").

◆ regionTalent()

float YouthModel::regionTalent ( Language  country)

Potential shift (overall points) of a country's talent pool.

◆ requestResultKey()

const char * YouthModel::requestResultKey ( UpgradeRequestResult  result)

Language key of a board answer.

◆ reserveEligibility()

YouthActionResult YouthModel::reserveEligibility ( int  age,
PlayerRole  role,
const ReserveQuota &  quota 
)

Whether a player of age and role may join a U21 squad whose over-age places are used as in quota: Ok, or OverageFull when he is over 21 and his kind of over-age place is taken.

◆ scholarshipWage()

std::uint32_t YouthModel::scholarshipWage ( LeagueID  league_id)

Weekly scholarship stipend in a league.

◆ simulateMatch()

std::pair< int, int > YouthModel::simulateMatch ( float  home_strength,
float  away_strength,
WorldRng &  rng 
)

Goals of a U18 match from the two teams' strengths (mean overall).

◆ staffProfessionalism()

float YouthModel::staffProfessionalism ( std::uint64_t  world_seed,
StaffID  staff_id 
)

Hidden working style of a staff member in [0, 1] (0.7+ professional), derived from the world seed and the staff id.

◆ staffStyleKey()

const char * YouthModel::staffStyleKey ( float  professionalism)

Language key of a staff working style.

◆ summarize()

IntakePreview YouthModel::summarize ( const IntakeClass &  intake)

The head of youth development's summary of an intake.

◆ u18SquadLimit()

std::size_t YouthModel::u18SquadLimit ( float  grade)

Largest U18 squad a computer-managed academy of grade keeps.

◆ upgradeCost()

std::int64_t YouthModel::upgradeCost ( AcademyUpgrade  kind,
int  target,
LeagueID  league_id 
)

Cost of the next step of an academy investment in a league.

◆ upgradeDays()

int YouthModel::upgradeDays ( AcademyUpgrade  kind,
int  target 
)

Days needed to complete the next step of an academy investment.

◆ upgradeTarget()

std::uint8_t YouthModel::upgradeTarget ( AcademyUpgrade  kind,
int  current 
)

Next level of an academy investment (capped at 100).

◆ youthContractYears()

std::uint8_t YouthModel::youthContractYears ( int  age)

Seasons of a youth contract signed at age.

Variable Documentation

◆ DECISION_DAYS

constexpr int YouthModel::DECISION_DAYS = 30
inlineconstexpr

Days the manager has to offer contracts after intake day.

◆ HOMEGROWN_SEASONS

constexpr int YouthModel::HOMEGROWN_SEASONS = 3
inlineconstexpr

Club-trained status: seasons at the academy between 15 and 21. [RR]

◆ INTAKE_DAY

constexpr std::uint8_t YouthModel::INTAKE_DAY = 15
inlineconstexpr

◆ INTAKE_MONTH

constexpr std::uint8_t YouthModel::INTAKE_MONTH = 3
inlineconstexpr

◆ MINOR_CONTRACT_YEARS

constexpr int YouthModel::MINOR_CONTRACT_YEARS = 3
inlineconstexpr

Contracts of minors are capped at three seasons. [RR]

◆ PREVIEW_DAY

constexpr std::uint8_t YouthModel::PREVIEW_DAY = 1
inlineconstexpr

◆ PREVIEW_MONTH

constexpr std::uint8_t YouthModel::PREVIEW_MONTH = 2
inlineconstexpr

◆ PRO_POLICY_AGE

constexpr int YouthModel::PRO_POLICY_AGE = 17
inlineconstexpr

Computer-managed clubs offer first professional contracts from this age (never below the country's legal minimum). [RR 4, FW 5]

◆ SIGN_MAX

constexpr int YouthModel::SIGN_MAX = 12
inlineconstexpr

◆ SIGN_MIN

constexpr int YouthModel::SIGN_MIN = 2
inlineconstexpr

Computer-managed clubs sign between these numbers per intake: a handful at small academies, 8-12 scholars at the best. [RR 4.3, FW 5]

◆ U18_MAX_AGE

constexpr int YouthModel::U18_MAX_AGE = 18
inlineconstexpr

Oldest age allowed in the U18 squad (season age).

◆ U21_MAX_AGE

constexpr int YouthModel::U21_MAX_AGE = 21
inlineconstexpr

Oldest age of a regular U21 player (season age).

◆ U21_OVERAGE_GOALKEEPERS

constexpr std::size_t YouthModel::U21_OVERAGE_GOALKEEPERS = 1
inlineconstexpr

◆ U21_OVERAGE_OUTFIELD

constexpr std::size_t YouthModel::U21_OVERAGE_OUTFIELD = 3
inlineconstexpr

Over-age players a U21 squad may hold: three outfield players and a goalkeeper, as in the professional development leagues. [RR]

◆ U21_SQUAD_LIMIT

constexpr std::size_t YouthModel::U21_SQUAD_LIMIT = 16
inlineconstexpr

Largest U21 squad a computer-managed club keeps. [P]