|
Player12
An open source football management simulator
|
How an AI club negotiates to buy one of the managed club's players, and how the player feels about the move. More...
Classes | |
| struct | BuyerContext |
| struct | BuyerReply |
| struct | RejectionEffect |
| struct | StanceFacts |
Enumerations | |
| enum class | Move : std::uint8_t { Bid = 0 , Improved , FinalOffer , Restated , Counter , AskingPrice , Accepted , WalkedAway , COUNT } |
| enum class | Why : std::uint8_t { WithinBudget , Improved , MoreInstalments , AddOnsInsteadOfCash , AddOnsTrimmed , SellOnCut , CashLimited , FinalOffer , Unrealistic , Insulted , OutOfPatience , RivalBids , DeadlineDay , WageBudget , COUNT } |
| enum class | Decision : std::uint8_t { Accept , Counter , WalkAway } |
| enum class | PlayerStance : std::uint8_t { AskedToLeave , WantsBiggerClub , Open , HappyHere , Reluctant } |
Functions | |
| bool | byBuyer (Move move) |
| const char * | moveKey (Move move) |
| const char * | whyKey (Why why) |
| double | appearanceOdds (std::uint16_t target) |
| double | goalOdds (std::uint16_t target) |
| double | sellOnCostPerPercent (int age) |
| double | buyerCost (const OfferTerms &terms, int age) |
| std::uint32_t | agentFee (std::uint32_t fee) |
| std::int64_t | signingCash (const OfferTerms &terms) |
| bool | deadlinePressure (int days_to_deadline) |
| double | effectiveCeiling (const BuyerContext &context) |
| BuyerReply | respond (const BuyerContext &context, const OfferTerms ¤t, const OfferTerms &asked, bool firm, double roll) |
| OfferTerms | openingBid (std::uint32_t ceiling, int age, std::uint8_t rivals, double share_roll, double add_on_roll) |
| std::uint8_t | drawPatience (double roll, int days_to_deadline) |
| int | replyDelay (double roll, int days_to_deadline) |
| const char * | stanceKey (PlayerStance stance) |
| PlayerStance | stanceFor (const StanceFacts &facts) |
| double | termsRefusalChance (PlayerStance stance) |
| bool | isBigBid (const OfferTerms &terms, int, std::uint32_t market_value) |
| RejectionEffect | rejectionEffect (PlayerStance stance, bool big_bid, std::uint8_t ambition) |
How an AI club negotiates to buy one of the managed club's players, and how the player feels about the move.
The buyer has a hidden ceiling on what the deal may cost it, measured by buyerCost(): cash now counts in full, instalments are discounted, add-ons cost their odds of being paid and a sell-on clause the expected share of a future sale. It answers the club's counters with its own structures (a higher fee spread over more years, add-ons instead of cash, a smaller sell-on), loses patience after a few rounds, walks away from demands far beyond its ceiling, pays more against rival bidders and near the deadline. Pure rules: every draw is passed in, so the answers are deterministic.
|
strong |
|
strong |
One step of the talks over an incoming offer (values are persisted).
|
strong |
How the player feels about the move (shown in the talks).
|
strong |
| std::uint32_t BuyerNegotiation::agentFee | ( | std::uint32_t | fee | ) |
Agent fee the buyer pays on top of fee.
| double BuyerNegotiation::appearanceOdds | ( | std::uint16_t | target | ) |
Odds that an appearance add-on with target matches is paid.
| double BuyerNegotiation::buyerCost | ( | const OfferTerms & | terms, |
| int | age | ||
| ) |
What terms cost the buyer in present value (agent fee excluded).
| bool BuyerNegotiation::byBuyer | ( | Move | move | ) |
True for the moves made by the buying club.
| bool BuyerNegotiation::deadlinePressure | ( | int | days_to_deadline | ) |
True in the last days of an open window.
| std::uint8_t BuyerNegotiation::drawPatience | ( | double | roll, |
| int | days_to_deadline | ||
| ) |
Counters the buyer will answer (fewer near the deadline).
| double BuyerNegotiation::effectiveCeiling | ( | const BuyerContext & | context | ) |
The ceiling lifted by rival bids and deadline pressure.
| double BuyerNegotiation::goalOdds | ( | std::uint16_t | target | ) |
Odds that a goal add-on with target goals is paid.
| bool BuyerNegotiation::isBigBid | ( | const OfferTerms & | terms, |
| int | age, | ||
| std::uint32_t | market_value | ||
| ) |
A bid worth at least BIG_BID_VALUE_SHARE of the market value.
| const char * BuyerNegotiation::moveKey | ( | Move | move | ) |
Language key naming move (e.g. "OFFER_MOVE_BID").
| OfferTerms BuyerNegotiation::openingBid | ( | std::uint32_t | ceiling, |
| int | age, | ||
| std::uint8_t | rivals, | ||
| double | share_roll, | ||
| double | add_on_roll | ||
| ) |
Opening bid of a club with ceiling: a share of it drawn with share_roll (higher with rivals), the usual AI structure and, drawn with add_on_roll, an appearance add-on.
| RejectionEffect BuyerNegotiation::rejectionEffect | ( | PlayerStance | stance, |
| bool | big_bid, | ||
| std::uint8_t | ambition | ||
| ) |
| int BuyerNegotiation::replyDelay | ( | double | roll, |
| int | days_to_deadline | ||
| ) |
Days until the buyer answers a counter; 0 = the same day.
| BuyerReply BuyerNegotiation::respond | ( | const BuyerContext & | context, |
| const OfferTerms & | current, | ||
| const OfferTerms & | asked, | ||
| bool | firm, | ||
| double | roll | ||
| ) |
Answer to the club's asked terms while current is on the table. firm marks a named price: the buyer meets it, makes its final offer or leaves. roll in [0, 1) picks how the buyer reshapes its proposal.
| double BuyerNegotiation::sellOnCostPerPercent | ( | int | age | ) |
Expected cost per unit of fee of a 1% sell-on for a player of age.
| std::int64_t BuyerNegotiation::signingCash | ( | const OfferTerms & | terms | ) |
Cash the buyer pays on signing: the upfront part and the agent fee.
| PlayerStance BuyerNegotiation::stanceFor | ( | const StanceFacts & | facts | ) |
| const char * BuyerNegotiation::stanceKey | ( | PlayerStance | stance | ) |
Language key describing stance.
| double BuyerNegotiation::termsRefusalChance | ( | PlayerStance | stance | ) |
Chance he fails to agree personal terms once the clubs agree.
| const char * BuyerNegotiation::whyKey | ( | Why | why | ) |
Language key describing why (e.g. "OFFER_WHY_IMPROVED").