Game.EconomyParameterData
Assembly: Assembly-CSharp
Namespace: Game.Prefabs
Type: struct
Base: IComponentData, IQueryTypeParameter
Summary:
EconomyParameterData is a plain data component used by the game's ECS to hold global economic and policy parameters that affect wages, consumption, production efficiency, refunds, upkeep and other economic mechanics in Cities: Skylines 2. It uses Unity.Mathematics types (float2, float3) and a custom AnimationCurve1 for curve-driven parameters. This struct is intended to be attached / read as an IComponentData in systems that simulate city economy and building behaviors.
Fields
-
public float m_ExtractorCompanyExportMultiplier
Multiplier applied to exporter company exports (affects income from resource extraction companies). -
public int m_Wage0
Base wage for job level 0. -
public int m_Wage1
Base wage for job level 1. -
public int m_Wage2
Base wage for job level 2. -
public int m_Wage3
Base wage for job level 3. -
public int m_Wage4
Base wage for job level 4. -
public float m_CommuterWageMultiplier
Multiplier applied to wages for commuters (adjusts wages when a worker commutes to another city/area). -
public int m_CompanyBankruptcyLimit
Threshold value used to determine company bankruptcy behavior (e.g., negative balance limit). -
public int m_ResidentialMinimumEarnings
Minimum earnings considered for residential citizens (used in welfare / eligibility checks). -
public int m_UnemploymentBenefit
Base unemployment benefit paid out to unemployed citizens. -
public int m_Pension
Pension payment amount for retired citizens. -
public int m_FamilyAllowance
Family allowance amount (child/family support). -
public float2 m_ResourceConsumptionMultiplier
Per-resource-type consumption multipliers (float2 suggests two tracked resource types or a packed pair). -
public float m_ResourceConsumptionPerCitizen
Base resource consumption per citizen. -
public float m_TouristConsumptionMultiplier
Consumption multiplier applied to tourists (how much tourists consume relative to citizens). -
public float m_WorkDayStart
Work day start time (usually represented as a fractional hour/time value). -
public float m_WorkDayEnd
Work day end time. -
public float m_IndustrialEfficiency
Multiplier/efficiency value for industrial production. -
public float m_CommercialEfficiency
Multiplier/efficiency value for commercial businesses. -
public float m_ExtractorProductionEfficiency
Production efficiency specifically for extractor industries. -
public float m_TrafficReduction
Factor representing how traffic reduces productivity / efficiency. -
public float m_MaxCitySpecializationBonus
Maximum bonus from city specialization policies or specialization level. -
public int m_ResourceProductionCoefficient
Integral coefficient affecting resource production scaling. -
public float3 m_LandValueModifier
Land value modifiers (likely per zone type or preset categories; stored in float3). -
public float3 m_RentPriceBuildingZoneTypeBase
Base rent price for different building/zone types (float3 holds multiple bases). -
public float m_MixedBuildingCompanyRentPercentage
Percentage of rent that goes to companies in mixed-use buildings. -
public float m_ResidentialUpkeepLevelExponent
Exponent used to calculate residential upkeep scaling with building level. -
public float m_CommercialUpkeepLevelExponent
Exponent used to calculate commercial upkeep scaling with building level. -
public float m_IndustrialUpkeepLevelExponent
Exponent used to calculate industrial upkeep scaling with building level. -
public int m_PerOfficeResourceNeededForIndustrial
Number of office-related resources required per industrial unit (affects supply chain). -
public float m_UnemploymentAllowanceMaxDays
Maximum number of days unemployment allowance is paid. -
public int m_ShopPossibilityIncreaseDivider
Divider used in shop probability/possibility calculation (tunes shop spawning logic). -
public float m_CityServiceWageAdjustment
Multiplier applied to wages for city service jobs (used in GetWage when cityServiceJob is true). -
public int m_PlayerStartMoney
Starting money awarded to the player at game start. -
public float3 m_BuildRefundPercentage
Refund percentages for building removal (per category stored in a float3). -
public float3 m_BuildRefundTimeRange
Time range used to scale building refunds based on how long a building has existed. -
public float m_RelocationCostMultiplier
Multiplier applied to relocation costs. -
public float3 m_RoadRefundPercentage
Refund percentages for road removal (per road type / category). -
public float3 m_RoadRefundTimeRange
Time range used for road refund scaling. -
public int3 m_TreeCostMultipliers
Integer multipliers for tree placement/removal costs (per tree type/category). -
public AnimationCurve1 m_MapTileUpkeepCostMultiplier
Curve used to determine upkeep cost multiplier for map tiles (custom curve type). -
public float2 m_LoanMinMaxInterestRate
Min/max interest rates for loans (float2 = [min, max]).
Properties
- None (this struct exposes public fields and a public method; no C#-style properties are defined).
Constructors
public EconomyParameterData()
Default value-type constructor (auto-generated). All numeric fields default to zero; populate fields explicitly when creating instances to meaningful gameplay values. Because this is used as IComponentData, components are typically created and set via EntityManager or conversion systems.
Methods
public int GetWage(int jobLevel, bool cityServiceJob = false)
Returns the computed wage (int) for a given job level (0..4). If cityServiceJob is true, the method applies m_CityServiceWageAdjustment as an additional multiplier. If jobLevel is outside 0..4 the method returns 0.
Behavior summary: - Applies city service multiplier: num = cityServiceJob ? m_CityServiceWageAdjustment : 1f - Returns (int)(m_WageN * num) for N = jobLevel (0..4) - Returns 0 for any other jobLevel value
Usage Example
// Example: reading wages from an EconomyParameterData instance
EconomyParameterData econParams = /* obtain from EntityManager or injected system data */;
// Normal wage for level 2 worker
int wageLevel2 = econParams.GetWage(2);
// Wage for a level 3 city service job (applies city service adjustment)
int cityServiceWageLevel3 = econParams.GetWage(3, cityServiceJob: true);
// Example creating and assigning default values (when adding as a component)
EconomyParameterData customParams = new EconomyParameterData
{
m_Wage0 = 100,
m_Wage1 = 200,
m_Wage2 = 350,
m_Wage3 = 600,
m_Wage4 = 900,
m_CityServiceWageAdjustment = 1.1f,
m_PlayerStartMoney = 50000,
m_UnemploymentBenefit = 50,
// ... set other fields as needed
};
// Add to an entity (pseudo-code, using EntityManager)
entityManager.AddComponentData(cityEntity, customParams);
// Then elsewhere:
int pWage = customParams.GetWage(1);
{{ Additional notes: - This struct is designed for use inside ECS systems (IComponentData); do not expect UnityEngine MonoBehaviour serialization semantics. - Types float2/float3 are from Unity.Mathematics. AnimationCurve1 is a game-specific curve wrapper — treat like a serializable curve for lookup. - Because most fields are public and primitive, tuning these values changes many game systems (wages, refunds, upkeep). When modding, adjust cautiously and test interactions (e.g., bankruptcies, unemployment flows). }}