Skip to content

Game.Prefabs.PollutionParameterData

Assembly: Assembly-CSharp (game's main assembly; may vary by build/mod)
Namespace: Game.Prefabs

Type: struct

Base: System.ValueType — implements Unity.Entities.IComponentData, Unity.Entities.IQueryTypeParameter

Summary:
Holds configurable parameters that describe how a particular prefab emits and interacts with pollution (air, ground, and noise) in Cities: Skylines 2. This data component is intended to be attached to prefab entities to control multipliers, radii, fade rates, wind advection, plant/soil interactions, and related notification entities and limits. Fields are mostly unitless multipliers or radii and are used by the simulation systems that propagate and apply pollution effects.


Fields

  • public float m_GroundMultiplier
    Controls how strongly this prefab generates ground (soil) pollution. Treated as a multiplier applied to the base ground pollution emission of the prefab.

  • public float m_AirMultiplier
    Controls how strongly this prefab generates air pollution. Treated as a multiplier applied to the base air pollution emission.

  • public float m_NoiseMultiplier
    Controls noise emission strength for this prefab. Acts as a multiplier on base noise output.

  • public float m_NetAirMultiplier
    Multiplier for air pollution specifically produced by network-related sources (e.g., roads). Used when the source is treated as a network object.

  • public float m_NetNoiseMultiplier
    Multiplier for noise pollution from network sources.

  • public float m_GroundRadius
    Radius (distance) over which ground pollution from this source is spread/affects the environment. Units are in game world distance units.

  • public float m_AirRadius
    Radius of influence for air pollution spread from this source.

  • public float m_NoiseRadius
    Radius over which noise is audible/affects nearby entities.

  • public float m_NetNoiseRadius
    Radius for noise emitted by network (road) sources.

  • public float m_WindAdvectionSpeed
    Speed at which airborne pollution is advected by wind for this source. Higher values make air pollution move faster with wind.

  • public short m_AirFade
    Tweakable fade value for air pollution attenuation (short integer). Typically used in the falloff calculation; exact scale is determined by the pollution simulation.

  • public short m_GroundFade
    Fade value for ground pollution attenuation.

  • public float m_PlantAirMultiplier
    Multiplier that represents how effective plants (trees/vegetation) are at mitigating this source's air pollution. Values <1 reduce pollution more.

  • public float m_PlantGroundMultiplier
    Multiplier representing plant effect on ground pollution.

  • public float m_PlantFade
    Additional fade factor applied when plants are present; modifies how plant coverage reduces pollution with distance.

  • public float m_FertilityGroundMultiplier
    Multiplier describing how ground pollution affects soil fertility. Higher values mean stronger negative effect on fertility from ground pollution.

  • public float m_DistanceExponent
    Exponent used in the distance-based falloff formula. Controls how quickly pollution decreases with distance (e.g., linear vs. quadratic falloff).

  • public Entity m_AirPollutionNotification
    Entity reference to a notification/popup prefab that should be triggered when air pollution thresholds are crossed for this source (null/Entity.Null if none).

  • public Entity m_NoisePollutionNotification
    Entity reference to a notification prefab for noise pollution.

  • public Entity m_GroundPollutionNotification
    Entity reference to a notification prefab for ground pollution.

  • public int m_AirPollutionNotificationLimit
    Limit/count used by the notification system for air pollution (e.g., how many notifications can be shown or a threshold limit). Exact semantics depend on notification system usage.

  • public int m_NoisePollutionNotificationLimit
    Notification limit for noise pollution.

  • public int m_GroundPollutionNotificationLimit
    Notification limit for ground pollution.

  • public float m_AbandonedNoisePollutionMultiplier
    Multiplier applied to noise pollution when the source becomes abandoned. Typically increases or modifies noise emitted by abandoned buildings.

  • public int m_HomelessNoisePollution
    Integer parameter related to noise contribution from homeless-related simulation (game-specific usage). Could be a flag or value added to noise when homelessness conditions apply.

  • public int m_GroundPollutionLandValueDivisor
    Divisor used to compute the negative impact of ground pollution on land value. Larger divisors reduce the per-unit impact on land value.

Properties

  • This type exposes no C# properties; it is a plain data struct with public fields used by ECS systems.

Constructors

  • public PollutionParameterData()
    Default value-type constructor. When added to an entity without explicitly setting fields, numeric fields will be zero-initialized. Set relevant fields after construction or use an object initializer to provide desired defaults.

Methods

  • This struct defines no methods. All behavior is implemented by the game's pollution simulation systems that read these fields.

Usage Example

// Example: creating an entity with pollution parameters and assigning values.
// Requires Unity.Entities and a valid World/EntityManager (typical in mod/system setup).

var em = World.DefaultGameObjectInjectionWorld.EntityManager;
var entity = em.CreateEntity();

// Initialize pollution parameters for a factory prefab
var pollution = new PollutionParameterData
{
    m_GroundMultiplier = 1.2f,
    m_AirMultiplier = 1.5f,
    m_NoiseMultiplier = 1.3f,
    m_GroundRadius = 10f,
    m_AirRadius = 30f,
    m_NoiseRadius = 20f,
    m_WindAdvectionSpeed = 2.0f,
    m_DistanceExponent = 2.0f,
    m_PlantAirMultiplier = 0.7f, // plants reduce air pollution by 30%
    m_FertilityGroundMultiplier = 1.5f,
    m_AirPollutionNotification = someNotificationEntity,
    m_AirPollutionNotificationLimit = 5,
    // ...set other fields as needed
};

em.AddComponentData(entity, pollution);

Notes: - Values and exact interpretation (units, thresholds) are determined by the game's pollution simulation systems. When modding, tweak values playfully and test in-game to observe effects.