Path

Path is a set of waypoints along which vehicles travel and is a connection between traffic nodes.

How To Create

Paths are generated in RoadSegment using RoadSegmentCreator or you can add them to existing Road Segments using the Path Creator tool

How To Customize

Settings

There are two ways to edit:
  1. Directly in the Inspector.

  2. Using the Advanced Settings Window.

Nodes

How To Move

  1. Enable Show handles option.

  2. Drag the desired path handles.

How Add & Remove

  1. Enable Show handles option.

  2. Enable Show edit buttons option.

  3. Press the + button to add or press the x to remove node.

Path Settings

Cached values

_images/PathCachedValues.png
Source traffic node : source node traffic from which the path starts.
Path connection type:
Nodes : key nodes for creating curves (Bezier).
Waypoints : waypoints of path.
Intersects : intersection points with other paths (baked data) (example).

Settings

_images/PathSettings.png
Path length : path length (baked value).
Path curve type:
  • Straight line : default point to point line.

  • Bezier cube : bezier cube curved line.

  • Bezier quad : bezier quad curved line.

Path road type:
  • Straight road : is used to automatically calculate lane changing by traffic.

  • Turn road

Traffic mask group: group types of traffic vehicles that can go on this path.

Priority : order of crossing intersected paths (vehicle with the higher priority gets through first).
Waypoints count per curve : number of waypoints in the curve segment.
Path speed limit : speed limit for the entire route
Connected lane index : connected lane index.
Hightlight normalized length : normalized length of the highlighted path (editor only).
Rail : cars entering this path will move with a rail movement.
Reversed connection side : path will be connected to the opposite side of the node.

Visual Settings

_images/PathVisualSettings.png

Common settings

Show info on select : shared parameter between paths instances that automatically enables Show info waypoints on selecting new path.
Show info waypoints : show info of waypoints in the scene.
Lock Y axis : lock Y-axis for position handles of nodes.
Show intersected points : show intersected points in the scene.
Show handles : show position handles for nodes.
Show edit buttons : show edit buttons for path (add/remove nodes).
Hightlight color : hightlight color of the path.
Show Y position : show Y-position of nodes.

Curved settings

_images/PathCurveSettings.png
Draw tangent : on/off tangents in the scene.
Clamp tangent : two position handles of tangent will move together.
Convert to StraightLine : converts a Curved line into a Straight line.

Path point settings

_images/PathPointSettings.png
Auto attach path : automatically attach the last node of the source to the connected path.
Show attach path buttons : on/off connect path buttons in the scene.

Buttons

Open path settings : open Path Settings Window.
Create path : generation and positioning of waypoints based on the position of the nodes and the selected curve.
Add custom light : custom TrafficLightHandler will be added to the path.
Reset speed limit : each waypoint will be assigned a common speed limit of path.

Traffic Node connection

Default connection between traffic nodes in road segment, used in most cases.

Path Point connection

Is used to connect one path to another in a path in a custom point.

How To Use

  1. Select source path in the scene.

  2. Select Path connection type to Path Point in the inspector.

  3. Enable Show attach path buttons.

  4. Select desired path.

  5. Customize position handles of source path nodes.

Waypoint Info

The path is made up of these waypoints, which direct each vehicle.

_images/PathNode.png
Speed limit : the maximum speed of the vehicle when it reaches this waypoint.
Backward direction : when this option is activated, the vehicle will reverse (test scene).
Custom group : override traffic group for the current path node.

Note

You can debug the group nodes here.

Traffic Group Info

  • Each path contains a mask which, depending on the mask type, contains a group of the selected TrafficGroupType.

  • A vehicle that has the correct TrafficGroupType can be driven or spawned on this path.

  • If the vehicle enters the forbidden path or path node, it will automatically try to change the current lane (test scene).

    Note

    • You can change the available types in the Global Settings or in the enum file:
      • TrafficGroupType.cs

    • You can debug the path group here.

How To Change

  1. Open the Global Settings window.

    _images/GlobalSettingsOpen.png
  2. Select the Traffic Group Types tab.

    _images/GlobalSettingsTab.png
  3. Rename, remove, add groups as you wish.

  4. After making any changes, click on the Save button.

Traffic Group Settings

How To Create

Settings automatically created if missing in project path Assets/Resources/Spirit604/TrafficGroupMaskSettings.asset.

_images/TrafficGroupSettingsProjectPath.png

Settings

Contains the types of default group and user-created groups.

_images/TrafficGroupSettings.png

Mask Types

Default

Default group of the TrafficGroupType that defined in the settings.

Allowed

User-selected TrafficGroupType types that can go through the path.

Forbidden

User-selected TrafficGroupType types that are forbidden the path (not selected in the list is allowed).

Custom Group

Custom group of TrafficGroupType that defined in the settings.

Advanced Settings Window

How To Open

  1. Select the Path.

  2. Press Open Path Settings button in the inspector.

Settings

_images/PathSettingsWindow1.png

Common settings

Draw additional settings : displays additional settings for each waypoint (Backward Movement, Traffic Group).

Custom settings

Speedlimit change type :

Single

Single - change each waypoint one at a time.

_images/PathSettingsWindow1.png
_images/PathSettingsWindow2.png

Draw additional settings enabled.

Multiple

Multiple - the speed limit will be changed on the selected section.

_images/PathSettingsWindowMultiple1.png
Multiple node change type:
  • Fixed : all waypoints change speed limit.

  • Interpolatespeed will be interpolated from the beginning of the section to the end.
    • Interpolate type :
      • Node index : speed is interpolated relative to the waypoint index.

      • Distance : speed is interpolated relative to the position of the waypoint.

    • Start speed limit : initial speed limit of the section.

    • End speed limit : end speed limit of the section.

How to use:
  • Select the start and end of the section in the window or switch on the Draw Select Buttons and select the start (S) and end (E) in the scene.

  • Set the parameter Selected Path Speed Limit to the value you need.
    _images/PathSettingsWindowMultiple5.png
  • Click Set Speed Limit.
    _images/PathSettingsWindowMultiple6.png

    Result.

_images/PathSettingsWindowMultiple2.png

Source path example.

_images/PathSettingsWindowMultiple3.png

Draw Select Buttons enabled “S” (start) “E” (End) example.

_images/PathSettingsWindowMultiple4.png

Path section selected (green circles start & end of section) example.

_images/PathSettingsWindowMultiple7.png

Interpolating settings example.

_images/PathSettingsWindowMultiple8.png

Interpolating result.

All way

All way - all path waypoints will change the speed limit according to the set options.

_images/PathSettingsWindowAllway1.png
Multiple node change type:
  • Fixed : all waypoints change speed limit.

  • Interpolatespeed will be interpolated from the beginning of the section to the end.
    • Interpolate type :
      • Node index : speed is interpolated regarding to the waypoint index.

      • Distance : speed is interpolated regarding the position of the waypoint.

    • Start speed limit : initial speed limit of the section.

    • End speed limit : end speed limit of the section.

How to use:
  • Set the parameter Selected Path Speed Limit to the value you need.
    _images/PathSettingsWindowAllway1.png
  • Click the Set Speed Limit button.
    _images/PathSettingsWindowAllway2.png

    Result.

Custom section

Custom section - the section with the custom speed is automatically generated depending on the parameters.

_images/PathSettingsWindowSection1.png
Path section type:
  • Start of path : section will be created at the beginning of the path.

  • End of path : section will be created at the end of the path.

  • All path : section will be generated all along the path.

Path section create type:
  • Clear path nodes : waypoints will be generated anew each time a section is created.

  • Use exist nodes : existing waypoints will be used for the section.

Section length : length of the created section.
Section waypoints : number of waypoints of the created section.
Start speed limit : initial speed of the section.
End speed limit : end speed of the section.
How to use:
  • Set all parameters.

  • Click Create SpeedLimit Segment.

_images/PathSettingsWindowSection2.png

Source path.

_images/PathSettingsWindowSection3.png

Result.

Baking Info

Each path bakes the data to speed up the entity conversion. How to bake.

Baked Data: