Game.Prefabs.BuildingEfficiencyParameterData
Assembly:
Namespace: Game.Prefabs
Type: struct
Base: IComponentData, IQueryTypeParameter
Summary:
Contains per‑building prefab parameters that control how various utility/service shortfalls, pollution and staffing issues affect a building's operational efficiency. This component is intended to be attached to building prefabs and read by the simulation systems to compute penalties or multipliers that change a building's production/service output over time (for example when electricity, water or staff are missing). The fields include curve factors, threshold values, penalty magnitudes and delay/grace periods used by the building efficiency simulation.
Fields
-
public AnimationCurve1 m_ServiceBudgetEfficiencyFactor
Curve that maps a service budget (or budget level) to an efficiency multiplier. Used to scale building efficiency based on the service budget assigned to that building (for example, lower budgets may reduce efficiency). AnimationCurve1 is a game/engine curve type similar to Unity's AnimationCurve. -
public float m_LowEfficiencyThreshold
Threshold value under which the building is considered to have "low efficiency". This might be used to trigger different behavior (e.g., reduced production state, alerts or to decide when to apply certain penalties). -
public float m_ElectricityPenalty
Magnitude of the immediate penalty (typically a multiplier reduction or additive penalty) applied to efficiency when electricity is missing. The exact interpretation (multiplicative vs additive) depends on the consuming systems, but this field represents how strongly lack of electricity hurts the building. -
public float m_ElectricityPenaltyDelay
Delay (in seconds or simulation time units used by the game) before the electricity penalty is applied after electricity becomes unavailable. Allows short outages to be tolerated before efficiency is reduced. -
public AnimationCurve1 m_ElectricityFeeFactor
Curve used to compute a fee/efficiency factor related to electricity — for example, to determine how electricity costs or availability scale efficiency over a range of values. The exact curve domain depends on how the simulation queries it (e.g., consumption or budget percent). -
public float m_WaterPenalty
Penalty magnitude applied when water is missing or insufficient. -
public float m_WaterPenaltyDelay
Delay before the water penalty is applied after water becomes unavailable or insufficient. -
public float m_WaterPollutionPenalty
Penalty applied to efficiency when water is polluted. Represents how water pollution degrades building performance (e.g., health or production). -
public float m_SewagePenalty
Penalty applied when sewage services are missing or overloaded. -
public float m_SewagePenaltyDelay
Delay before sewage-related penalties are applied after a sewage problem appears. -
public AnimationCurve1 m_WaterFeeFactor
Curve used to compute a fee/efficiency factor related to water (analogous to m_ElectricityFeeFactor). Used to map water-related inputs to efficiency or fees. -
public float m_GarbagePenalty
Penalty applied when garbage collection/service is missing or insufficient, reducing building efficiency. -
public int m_NegligibleMail
Threshold (likely an integer count or flag) used to decide whether missing mail is negligible. If missing mail is below this value, it may not cause an efficiency penalty. -
public float m_MailEfficiencyPenalty
Penalty applied to efficiency when mail services are lacking. -
public float m_TelecomBaseline
Baseline parameter for telecommunications availability or quality. This value can be used to compute telecom‑related efficiency modifiers (for example, a baseline quality level). -
public float m_MissingEmployeesEfficiencyPenalty
Penalty applied when a building is understaffed (missing employees). Reduces building efficiency according to the magnitude specified. -
public float m_MissingEmployeesEfficiencyDelay
Delay before the missing employee penalty is applied after employees become missing or levels fall below required staffing. -
public short m_ServiceBuildingEfficiencyGracePeriod
A short grace period (in ticks/seconds or other internal time unit) during which service buildings are not penalized after a service disruption. This allows temporary problems to be tolerated for service buildings specifically. -
public float m_SickEmployeesEfficiencyPenalty
Penalty applied when employees are sick (e.g., due to pollution or disease) reducing building efficiency.
Properties
- None. This type is a plain data struct with public fields.
Constructors
public BuildingEfficiencyParameterData()
Default value constructor generated for the struct. When created without initialization, numeric fields default to 0 and AnimationCurve1 fields default to their default/empty instances. When authoring or editing prefab data, explicitly initialize fields to meaningful values (curves for factors, reasonable delays for penalties).
Methods
- None. This is a data container; behavior is implemented in simulation systems that read this component.
Usage Example
// Example: creating and assigning parameters for a building prefab (conceptual)
var effParams = new Game.Prefabs.BuildingEfficiencyParameterData
{
m_ServiceBudgetEfficiencyFactor = /* create AnimationCurve1 mapping budget% -> efficiency */,
m_LowEfficiencyThreshold = 0.35f,
m_ElectricityPenalty = 0.5f,
m_ElectricityPenaltyDelay = 10f, // seconds
m_ElectricityFeeFactor = /* AnimationCurve1 */,
m_WaterPenalty = 0.4f,
m_WaterPenaltyDelay = 8f,
m_WaterPollutionPenalty = 0.2f,
m_SewagePenalty = 0.3f,
m_SewagePenaltyDelay = 12f,
m_WaterFeeFactor = /* AnimationCurve1 */,
m_GarbagePenalty = 0.25f,
m_NegligibleMail = 2,
m_MailEfficiencyPenalty = 0.1f,
m_TelecomBaseline = 1.0f,
m_MissingEmployeesEfficiencyPenalty = 0.6f,
m_MissingEmployeesEfficiencyDelay = 30f,
m_ServiceBuildingEfficiencyGracePeriod = 5,
m_SickEmployeesEfficiencyPenalty = 0.2f
};
// In ECS you would add this to a prefab entity so the simulation systems can read it:
// entityManager.AddComponentData(prefabEntity, effParams);
Notes and tips for modders: - Treat the curve fields (AnimationCurve1) as primary ways to shape how efficiency scales across a range — use them for nuanced balancing rather than a single flat penalty. - Delays and grace periods are useful to create tolerance for short outages; increasing them makes services more resilient to transient issues. - Penalty values are interpreted by the simulation; small values (0.1–0.5) are common for partial penalties, while values closer to 1.0 typically represent severe reduction. Test changes in‑game to observe exact effects.