Skip to content

Game.Pathfind.PathSpecification

Assembly: Assembly-CSharp.dll
Namespace: Game.Pathfind

Type: struct

Base: System.ValueType

Summary:
Represents a bundle of parameters and flags that configure how the pathfinder should evaluate and build a path. This struct groups cost metrics, allowed/forbidden edge characteristics, routing methods, access requirements and some small auxiliaries used by the pathfinding system (for example blockage markers and flow offsets). Instances are typically created and filled by AI/path managers before invoking the pathfinding routines.


Fields

  • public PathfindCosts m_Costs
    Contains cost weights/penalties used by the pathfinder (distance, time, lane changes, turns, etc.). These values influence route selection by tuning the relative cost of different path elements.

  • public EdgeFlags m_Flags
    Bit flags describing which edge characteristics are permitted or preferred (for example vehicle restrictions, one-way, highways, etc.). Used to include/exclude edges during graph traversal.

  • public PathMethod m_Methods
    Flags or enum values that select pathfinding behaviors or algorithmic variants (for example whether to use flow-based heuristics, prefer shortest-time vs shortest-distance, or special routing modes).

  • public int m_AccessRequirement
    Integer bitmask describing required access rights or vehicle categories (for example whether highways, pedestrian-only, public transport, or heavy vehicles are allowed). The pathfinder will filter edges that do not satisfy this requirement.

  • public float m_Length
    A target/limit or weighting for path length used by the pathfinder. Depending on context this can represent a desired path length or a length-related weight used when computing costs.

  • public float m_MaxSpeed
    Maximum permitted speed (units follow the game's convention) used when evaluating travel times or filtering edges that exceed a speed threshold.

  • public float m_Density
    A density weight (traffic/flow density) used to bias routing to avoid congested areas or to model vehicle spacing in cost calculation.

  • public RuleFlags m_Rules
    Additional rule flags that further restrict or modify allowed behavior (for example traffic rules, special lane rules or other game-specific constraints).

  • public byte m_BlockageStart
    Small value indicating the start index/level of a blockage region or quick marker used by pathing to represent partial blockages at the path start.

  • public byte m_BlockageEnd
    Small value indicating the end index/level of a blockage region or quick marker used by pathing to represent partial blockages at the path end.

  • public byte m_FlowOffset
    Byte offset/index into a per-edge/per-lane flow structure or buffer; used by flow-aware pathfinding to read/write flow-related data efficiently.

Properties

  • None (this is a simple public-value struct with public fields).

Constructors

  • public PathSpecification()
    Structs in C# have an implicit parameterless constructor that zero-initializes all fields. There is no explicit constructor defined in the source; create and initialize instances either via object initializer or by setting fields individually.

Methods

  • None (no methods are declared on this struct).

Usage Example

// Prepare a specification for a vehicle path search
var spec = new Game.Pathfind.PathSpecification
{
    m_Costs = new PathfindCosts(),      // fill with meaningful cost values as needed
    m_Flags = EdgeFlags.None,
    m_Methods = PathMethod.Default,
    m_AccessRequirement = 0,            // set appropriate access bitmask
    m_Length = 1200f,
    m_MaxSpeed = 25f,
    m_Density = 1.0f,
    m_Rules = RuleFlags.None,
    m_BlockageStart = 0,
    m_BlockageEnd = 0,
    m_FlowOffset = 0
};

// Pass 'spec' to the path manager / pathfinder API as required by the modding API.

Notes: - All fields are public and mutable; be careful to initialize all required fields before using the struct with the game's pathfinding routines. - The exact meaning and valid ranges of many fields (PathfindCosts, EdgeFlags, PathMethod, RuleFlags) depend on other game types and enums; consult their documentation/source for details when tuning pathfinding behavior.