Game.Pathfind.AvailabilityParameters
Assembly:
Assembly-CSharp (typical Unity game assembly containing game code)
Namespace: Game.Pathfind
Type:
struct
Base:
System.ValueType
Summary:
Simple value-type container used by the game's pathfinding systems to tune how availability scoring is computed. It exposes three floating-point tuning parameters commonly used to weight density, cost, and final result when evaluating path availability. This struct is plain data (no behavior) and is intended to be created and populated by calling code or configuration data used by pathfinding components.
Fields
-
public float m_DensityWeight
Weight applied to density-related factors when computing availability. Higher values increase the influence of density metrics on availability scoring. Use this to bias the algorithm toward or away from dense areas. -
public float m_CostFactor
Multiplier applied to path cost components. This scales how much raw cost (distance, travel time, penalties) affects availability. Increasing this value makes the algorithm favor lower-cost options more strongly. -
public float m_ResultFactor
Final multiplier applied to the computed availability result. Useful for scaling or normalizing the outcome before it is combined with other scores or thresholds.
Properties
- This struct exposes no properties; all members are public fields.
Constructors
public AvailabilityParameters()
The compiler provides a default parameterless constructor that initializes all floats to 0.0f. For practical use you'll typically assign values immediately after construction or provide your own helper constructor/initializer.
Methods
- This struct defines no methods.
Usage Example
// Create and initialize parameters for a particular pathfinding scenario:
var availParams = new Game.Pathfind.AvailabilityParameters
{
m_DensityWeight = 0.75f,
m_CostFactor = 1.2f,
m_ResultFactor = 0.9f
};
// Example usage in hypothetical pathfinding call
// PathfindingSystem.EvaluateAvailability(node, availParams);
Notes and tips: - Typical values depend on the calling system; common ranges are often around 0.0–2.0, but experiment to find values that produce desired routing behavior. - Because this is a value type, pass it by value for simple use, or ref/out if you need to modify it in-place without copying. - When integrating with mod code for Cities: Skylines 2, be mindful of serialization or config persistence if you want these parameters editable through mod settings.