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

Revenue, cost and attendance model of a club. More...

Functions

double expectedRevenue (const LeagueEconomy &economy, std::uint8_t reputation)
 
std::size_t expectedPosition (const LeagueEconomy &economy, std::uint8_t reputation)
 
double expectedIncome (const LeagueEconomy &economy, std::uint8_t reputation)
 
double baseDemand (const LeagueEconomy &economy, std::uint8_t reputation)
 
double fairTicketPrice (const LeagueEconomy &economy, const ClubProfile &profile)
 
std::uint32_t attendance (const LeagueEconomy &economy, const ClubProfile &profile, double success, std::uint8_t opponent_reputation, MatchType type)
 
double monthlyBroadcasting (const LeagueEconomy &economy)
 
double monthlySponsorship (const LeagueEconomy &economy, std::uint8_t reputation)
 
double monthlyStaffCosts (const LeagueEconomy &economy, std::uint8_t reputation)
 
double monthlyFacilityCosts (const LeagueEconomy &economy, const ClubProfile &profile)
 
double playerWageShare (const LeagueEconomy &economy)
 
std::vector< std::int64_t > prizeMoney (const LeagueEconomy &economy, std::size_t league_size)
 
std::int64_t seasonTransferBudget (std::int64_t balance, double revenue)
 
std::int64_t availableTransferBudget (std::int64_t board_budget, std::int64_t balance, std::int64_t weekly_payroll, std::int64_t committed)
 
std::int64_t ownerRescue (std::int64_t balance, std::int64_t weekly_payroll)
 
double parachutePayment (const LeagueEconomy &top_division, int seasons_ago)
 
std::int64_t seasonWageBudget (const LeagueEconomy &economy, double revenue, std::int64_t weekly_payroll)
 
double wageIndex (double overall, int age)
 

Detailed Description

Revenue, cost and attendance model of a club.

Revenue is split into TV, continental prizes, gate and commercial income with the league's ECFIL-style mix. Richer, more reputable clubs earn more commercial and gate income while TV money is shared mostly equally.

Function Documentation

◆ attendance()

std::uint32_t ClubEconomy::attendance ( const LeagueEconomy &  economy,
const ClubProfile &  profile,
double  success,
std::uint8_t  opponent_reputation,
MatchType  type 
)

Attendance of a home match: capacity * interest * price factor, at most the capacity. interest = max(core, demand * exp(a * success)) for the opponent and competition; price factor = exp(-e * ln(r) - k * max(0, r - 1)^2) with r = price / ref, so gate income peaks a little above the reference price and an overpriced ticket empties the ground.

Parameters
successLeague position and form signal in [-1, 1].

◆ availableTransferBudget()

std::int64_t ClubEconomy::availableTransferBudget ( std::int64_t  board_budget,
std::int64_t  balance,
std::int64_t  weekly_payroll,
std::int64_t  committed 
)

Transfer money a club can commit today: the board's allowance, but never more than the cash left after a reserve of Finance::CASH_RESERVE_WEEKS of payroll and the instalments already owed; never negative.

◆ baseDemand()

double ClubEconomy::baseDemand ( const LeagueEconomy &  economy,
std::uint8_t  reputation 
)

Share of capacity filled at neutral form and the reference price.

◆ expectedIncome()

double ClubEconomy::expectedIncome ( const LeagueEconomy &  economy,
std::uint8_t  reputation 
)

Income the club can budget on per season: equal TV share, merit money at its expected finish, gate and commercial income, plus half of the continental money of its expected place (boards do not spend prize money they may miss). Every cost line and budget is a share of it, so a club that finishes where expected roughly breaks even; beating expectations or reaching continental places makes a profit.

◆ expectedPosition()

std::size_t ClubEconomy::expectedPosition ( const LeagueEconomy &  economy,
std::uint8_t  reputation 
)

Expected league finish (0 = champion) of a club with reputation.

◆ expectedRevenue()

double ClubEconomy::expectedRevenue ( const LeagueEconomy &  economy,
std::uint8_t  reputation 
)

Revenue potential per season of a club with reputation: the league's average revenue scaled by reputation. Gate and commercial income are shares of it.

◆ fairTicketPrice()

double ClubEconomy::fairTicketPrice ( const LeagueEconomy &  economy,
const ClubProfile &  profile 
)

Reference ticket yield that meets the league's gate-share target.

◆ monthlyBroadcasting()

double ClubEconomy::monthlyBroadcasting ( const LeagueEconomy &  economy)

Monthly equal share of the league's TV money.

◆ monthlyFacilityCosts()

double ClubEconomy::monthlyFacilityCosts ( const LeagueEconomy &  economy,
const ClubProfile &  profile 
)

Monthly stadium, training ground and operating costs.

◆ monthlySponsorship()

double ClubEconomy::monthlySponsorship ( const LeagueEconomy &  economy,
std::uint8_t  reputation 
)

Monthly commercial income.

◆ monthlyStaffCosts()

double ClubEconomy::monthlyStaffCosts ( const LeagueEconomy &  economy,
std::uint8_t  reputation 
)

Monthly non-player wages.

◆ ownerRescue()

std::int64_t ClubEconomy::ownerRescue ( std::int64_t  balance,
std::int64_t  weekly_payroll 
)

Owner money that rescues a club whose cash has fallen more than Finance::OWNER_RESCUE_TRIGGER_WEEKS of weekly_payroll into the red: enough to restore a cushion of OWNER_RESCUE_CUSHION_WEEKS; 0 otherwise.

◆ parachutePayment()

double ClubEconomy::parachutePayment ( const LeagueEconomy &  top_division,
int  seasons_ago 
)

Season parachute of a club relegated from the top division described by top_division, seasons_ago seasons after the season it went down (0 = the season just finished); 0 once the parachute has run out.

◆ playerWageShare()

double ClubEconomy::playerWageShare ( const LeagueEconomy &  economy)

Share of expected income a club spends on player wages.

◆ prizeMoney()

std::vector< std::int64_t > ClubEconomy::prizeMoney ( const LeagueEconomy &  economy,
std::size_t  league_size 
)

Season-end merit (broadcasting) money by final position (index 0 = champion). Continental prize money is paid by the continental competitions themselves, as the club earns it.

◆ seasonTransferBudget()

std::int64_t ClubEconomy::seasonTransferBudget ( std::int64_t  balance,
double  revenue 
)

Board's transfer allowance for a new season.

◆ seasonWageBudget()

std::int64_t ClubEconomy::seasonWageBudget ( const LeagueEconomy &  economy,
double  revenue,
std::int64_t  weekly_payroll 
)

Board's weekly wage allowance for a new season.

◆ wageIndex()

double ClubEconomy::wageIndex ( double  overall,
int  age 
)

Relative wage demand of a player: (overall / 65)^gamma times an age factor. Multiply by a club's scale to obtain a weekly wage.