babylon.models.vanguard_resources
Vanguard Economy resource model (Wayne County MVP).
The Vanguard Economy represents the player’s organizational capacity through three resource types that map to real organizer work:
Cadre Labor (CL): Hours available from committed members. Derived from
cadre_level * budget. Spent on high-skill actions (educate, investigate).Sympathizer Labor (SL): Hours available from supporters and contacts. Derived from
cohesion * territory_count. Spent on mass actions (mobilize, campaign).Reputation (REP): Social capital accumulated through successful actions. Grows from successful actions, decays from failures and heat. Unlocks advanced verbs and alliance possibilities.
Design Note
These resources are derived from the existing Organization model fields, not
stored separately. This avoids schema changes while making the economy legible
to the player. The VanguardResources model computes current values each tick.
Module Attributes
Cost of each player verb in (CL, SL, Budget). |
Functions
|
Check whether the player org can afford an action. |
Classes
|
Computed resource snapshot for a player organization. |
- class babylon.models.vanguard_resources.VanguardResources(**data)[source]
Bases:
BaseModelComputed resource snapshot for a player organization.
All fields are derived from Organization attributes at the current tick. This model is for display and action cost checking — it does not persist.
- Parameters:
cadre_labor (Annotated[float, Ge(ge=0.0), AfterValidator(func=~babylon.utils.math.quantize)])
sympathizer_labor (Annotated[float, Ge(ge=0.0), AfterValidator(func=~babylon.utils.math.quantize)])
reputation (Annotated[float, Ge(ge=0.0), Le(le=1.0), AfterValidator(func=~babylon.utils.math.quantize)])
budget (Annotated[float, Ge(ge=0.0), AfterValidator(func=~babylon.utils.math.quantize)])
heat (Annotated[float, Ge(ge=0.0), Le(le=1.0), AfterValidator(func=~babylon.utils.math.quantize)])
max_cadre_labor (Annotated[float, Ge(ge=0.0), AfterValidator(func=~babylon.utils.math.quantize)])
max_sympathizer_labor (Annotated[float, Ge(ge=0.0), AfterValidator(func=~babylon.utils.math.quantize)])
- cadre_labor
Available cadre work hours [0, inf).
- sympathizer_labor
Available sympathizer work hours [0, inf).
- reputation
Social capital [0, 1].
- budget
Cash on hand (passed through from Organization).
- heat
State attention (passed through from Organization).
- max_cadre_labor
Maximum CL this tick.
- max_sympathizer_labor
Maximum SL this tick.
- cadre_labor: Currency
- sympathizer_labor: Currency
- reputation: Probability
- budget: Currency
- heat: Probability
- max_cadre_labor: Currency
- max_sympathizer_labor: Currency
- classmethod from_organization(*, cadre_level, cohesion, budget, heat, territory_count, reputation=0.0)[source]
Compute vanguard resources from organization attributes.
- Formulas:
CL_max = cadre_level * 10 * (1 - heat * 0.5) SL_max = cohesion * territory_count * 5 * (1 - heat * 0.3) CL = min(CL_max, budget / 2) – cadre need to be paid SL = CL * 0.5 + territory_count – sympathizers follow cadre
- Parameters:
cadre_level (
float) – Organization cadre quality [0, 1].cohesion (
float) – Internal unity [0, 1].budget (
float) – Cash on hand.heat (
float) – State attention [0, 1].territory_count (
int) – Number of territories org operates in.reputation (
float) – Existing reputation (carried from previous tick).
- Return type:
- Returns:
VanguardResources snapshot.
- model_config: ClassVar[ConfigDict] = {}
Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].
- babylon.models.vanguard_resources.ACTION_COSTS: dict[str, tuple[float, float, float]] = {'aid': (0.5, 1.0, 25.0), 'attack': (1.0, 3.0, 15.0), 'campaign': (1.0, 3.0, 20.0), 'educate': (2.0, 0.5, 5.0), 'investigate': (3.0, 0.0, 2.0), 'mobilize': (0.5, 4.0, 8.0), 'move': (1.0, 0.5, 5.0), 'negotiate': (2.0, 0.0, 10.0), 'reproduce': (1.5, 1.0, 10.0)}
Cost of each player verb in (CL, SL, Budget). These are baseline costs; actual cost depends on target and context.
- babylon.models.vanguard_resources.check_can_afford(resources, verb)[source]
Check whether the player org can afford an action.
- Parameters:
resources (
VanguardResources) – Current vanguard resource snapshot.verb (
str) – Player verb string.
- Return type:
- Returns:
Tuple of (can_afford, reason). If can_afford is False, reason explains which resource is insufficient.