Traffic Node

Traffic node is a set of traffic node entities that are connected to other traffic node entities by a path

Settings

Cached

_images/TrafficNode.png
Traffic light crossroad : the crossroad to which the node belongs.
Traffic light handler : traffic light that the traffic node is linked (TrafficLightHandler).

Lane Data

_images/TrafficNode2.png
Lanes : right side lanes (to connect TrafficNodes within a RoadSegment).
External lanes : left side lanes (to connect nodes in external RoadSegments) (additonal info).

Settings

_images/TrafficNode3.png
Lane count : number of lanes.
Lane width : lane width.
Divider width : divider line width.
Chance to spawn : chance of the vehicle spawning in the node.
Weight : weight of the node for route selection by traffic.
Custom achieve distance : custom distance to achieve a node (if 0 value default value will be taken).
Capacity : capacity of the nodes (used for parking, bus station, etc…).
Light type:
  • Right : right-hand lanes have traffic lights.

  • Left : left-hand lanes have traffic lights.

  • Right and left : right and left lanes have traffic lights.

Is one way : all lanes are one-way traffic lanes (more info).
Is end of one way : node ends one-way traffic for this RoadSegment (more info).
Lock path auto creation : on/off prevent auto path creation (more info).
Auto path is created : auto path is created (more info).

Traffic Node Type

Default

Destroy vehicle

Node where the vehicle entity is destroyed (useful for nodes outside the map).

Idle

Node where the vehicle is idling.

Trigger

Node to notify the user that the entity has reached the node.

How to use:

  • Activate TriggerNodeConfig & sync with the subscene.

    _images/TrafficNodeTrigger1.png
  • If you need to subscribe to this reach event, use Traffic Node Service.

    _images/TrafficNodeTrigger2.png

If you need to associate a scene object with the trigger event, follow these steps:

  • Activate EntityBindingConfig & sync with the subscene.

    _images/entityBindingConfig.png
  • Create a new game object in the scene where the trigger is expected (e.g. cube).

    _images/TrafficNodeTrigger3.png
  • Add TriggerNodeHybridListener component.

    _images/TrafficNodeTrigger4.png
  • Press + button in the inspector.

    _images/TrafficNodeTrigger5.png
  • Press + on the scene node to which you want to associate the current scene object with the entity.

    _images/TrafficNodeTrigger6.png

    Source scene example.

    _images/TrafficNodeTrigger7.png

    Selected node example.

  • Now you can listen to entities arriving on this node by subscribing to TriggerNodeHybridListener.OnTriggerEnter with code in the TriggerNodeHybridListener component or by using UnityEvent in the inspector of this component.

Trigger And Destroy

Node to notify the user that the entity has reached the node & then destroy the entity. Use case is the same as the Trigger type.

Buttons

Connect : node will try to connect to other nodes if no external paths are created yet.
Force connect : node will try to connect to other nodes whether it is connected now or not (except Lock path auto creation option is enabled).
Resize : resize collider of node.

OneWay Node Info

Oneway node description example:

_images/OnewayExample.png
Node example key features:
  • Node 1:
    • Is one way [enabled]

    • Source path is in the : [Lanes]

    • External Lanes [Always empty]

  • Node 2:
    • Is one way [enabled]

    • Is end one way [enabled]

    • Source path is in the : [External Lanes]

    • Lanes [Always empty]

Direction Connection Info

Rightside Lanes

Rightside lanes (default lanes) connect TrafficNodes within a RoadSegment.

_images/ConnectionInfoExampleRightSide.png

Rightside lanes example.

Leftside Lanes

Leftside lanes (external lanes) connect TrafficNodes in external RoadSegments (external connection example).

_images/ConnectionInfoExampleLeftSide.png

Leftside lanes example.

Warning

Intersecting External paths should be replaced by a separate segment to bake the intersection of the paths.

Node Rotation

Direction of each TrafficNode must be opposite to the center of the segment

_images/TrafficNodeDirectionExample.png
Example description:
  • The arrow represents the forward rotation of the node.

  • Purple arrows the direction of the outer nodes of the segment.

  • Blue arrows the direction of the internal segment oneway nodes.

Auto-path Connection

How To Use

Note

  • To prevent auto-path connection for the selected TrafficNode enable Lock path auto creation in the settings of the node.

  • Each TrafficNode has a box collider whose is size calculated based on the number of lanes, their width, and the type of lanes (one-way or not).

  • Make sure that the direction of the node is set correctly.

_images/AutopathConnectionExample2.png

Auto path connection example.

CullState Info

States

  • Culled : entity not available for spawning.

  • CloseToCamera : entity available for spawn.

  • InVisionOfCamera : entity available for spawn only during the initial scene start.