Skip to content

Game.Pathfind.PathfindParameters

Assembly: Assembly-CSharp (typical for game/mod code; adjust if different)
Namespace: Game.Pathfind

Type: struct

Base: System.ValueType

Summary:
A plain data container used to pass parameters and configuration into the pathfinding routines. Holds target entities, authorization tokens, cost/weight settings, speed/size constraints, limits and flags that control how paths are generated and filtered. Intended for use with Unity ECS/Jobs-style systems (lightweight POD struct).


Fields

  • public Entity m_ParkingTarget
    Entity representing a target parking location or parking-related entity for which the path is being found. Set to Entity.Null when no specific parking target is required.

  • public Entity m_Authorization1
    An entity token used by the pathfinder to check or mark authorization/permission state for special path logic. Purpose and interpretation are context-dependent (game systems may use this to indicate ownership or access permission).

  • public Entity m_Authorization2
    A second authorization token. Provides an additional handle for systems that need two separate authorization checks or markers.

  • public PathfindWeights m_Weights
    Struct containing weight values used to compute path costs (for example, weights for distance, time, congestion, turns). Adjust weights to influence path selection priorities.

  • public float2 m_MaxSpeed
    Two-component float used to represent maximum speed constraints applied during pathfinding. float2 is used to pack two related speed values (exact semantics depend on the consumer code — e.g., different components for different movement modes or axes). If a single max speed is needed, set both components the same.

  • public float2 m_WalkSpeed
    Two-component walk speed parameters (used for pedestrian or walking movement). As with m_MaxSpeed, the exact meaning of the two components depends on the pathfinder implementation; commonly used to differentiate movement modes/conditions.

  • public float2 m_ParkingSize
    Size of the parking footprint, stored as a float2 (e.g., width and length). Used when determining whether a candidate parking location can accommodate the vehicle or object.

  • public float m_ParkingDelta
    Tolerance or buffer applied to parking size checks — a small allowed delta when comparing parking footprint to parking space size. Use to loosen or tighten parking fit checks.

  • public float m_MaxCost
    Maximum allowed cost for candidate paths. Paths with a computed cost greater than this value should be rejected/pruned. Use this to limit search scope; set to a large value to effectively disable pruning.

  • public int m_MaxResultCount
    Maximum number of path results the search should return. Limits memory/work when multiple candidate results are collected.

  • public PathMethod m_Methods
    Bitmask/enum specifying which pathfinding methods or algorithms are allowed/enabled for this query. Combine flags as appropriate to allow multiple methods.

  • public PathfindFlags m_PathfindFlags
    Flags controlling pathfinder behavior (e.g., additional constraints, toggles for special cases). Interpret values according to the PathfindFlags enum.

  • public RuleFlags m_IgnoredRules
    Mask of rule flags to ignore during evaluation. Use to bypass specific game rules when generating paths.

  • public RuleFlags m_SecondaryIgnoredRules
    A secondary mask of rule flags to ignore. Provides an additional level of rule suppression if needed.

Properties

  • (none — this is a plain public-field struct)

Constructors

  • public PathfindParameters()
    Default value-type constructor (compiler-provided). All fields will be default-initialized (e.g., Entities = Entity.Null, numeric fields = 0). For meaningful queries, construct a PathfindParameters instance and set the relevant fields before passing to pathfinding systems.

Methods

  • (none — this struct does not declare methods)

Usage Example

// Create and configure parameters for a pathfinding query:
var parameters = new PathfindParameters
{
    m_ParkingTarget = Entity.Null, // no specific parking entity
    m_Authorization1 = someAuthEntity,
    m_Authorization2 = Entity.Null,
    m_Weights = new PathfindWeights { /* set weights as needed */ },
    m_MaxSpeed = new float2(20f, 20f),   // example: max speeds
    m_WalkSpeed = new float2(5f, 5f),    // example: pedestrian speeds
    m_ParkingSize = new float2(2.0f, 4.5f),
    m_ParkingDelta = 0.1f,
    m_MaxCost = 10000f,
    m_MaxResultCount = 4,
    m_Methods = PathMethod.SomeMethodFlag,
    m_PathfindFlags = PathfindFlags.None,
    m_IgnoredRules = RuleFlags.None,
    m_SecondaryIgnoredRules = RuleFlags.None
};

// Pass `parameters` into the pathfinding system or job that expects it.

Notes and tips: - Because this is a simple POD struct, it is cheap to copy and suitable for use in jobs. Ensure any referenced Entity tokens are valid in the ECS world context. - The exact semantics of float2 fields (m_MaxSpeed, m_WalkSpeed) and the meaning of authorization entities depend on the calling code and higher-level systems in the mod/game; refer to callers or related types (PathfindWeights, PathMethod, PathfindFlags, RuleFlags) for precise interpretations. - When integrating with Burst or Jobs, keep dependencies on managed objects out of this struct — it should remain value-based and unmanaged-friendly.