Road Segment Creator

Road Segment Creator is a tool for creating and customizing a RoadSegment

How To Use

Youtube tutorial.

  1. Create a RoadSegment.

  2. Place the segment at the desired position.

  3. By default, RoadSegment prefab contains RoadSegmentCreator component.

  4. Select the Road segment type depending on the shape of your intersection.
    _images/RoadsegmentCreatorGeneralSettings.png
  5. In the other tab, you can convert any Standard shape segment to a Custom segment for more flexibility (also check out the new Auto-Crossroads feature for automatic crossroad generation).

  6. Adjust general settings.

  7. Adjust custom settings.

  8. Customize light settings.

  9. Customize path settings.

  10. Add RoadSegment to the RoadParent as children.

Standard Shapes

Youtube tutorial.

Default Crossroad

_images/RoadsegmentCreatorDefaultCrossroadSettings.png
Direction count : number of sides of the crossroad.
_images/RoadSegmentDefault.png

Example.

Turn Road

_images/RoadSegmentTurnRoadSettings.png
Node 1 offset : node 1 offset on the X-axis.
Node 2 offset : node 2 offset on the X-axis.
Additional local angle 1 : additional node 1 rotation angle.
Additional local angle 2 : additional node 2 rotation angle.
_images/RoadSegmentTurnRoad.png

Example.

Straight Road

_images/RoadSegmentStraightSettings.png
Node 1 offset : node 1 offset on the X-axis.
Node 2 offset : node 2 offset on the X-axis.
Traffic node height 1 : node 1 offset on the Y-axis.
Traffic node height 2 : node 2 offset on the Y-axis.
_images/RoadSegmentStraight.png

Example.

Merge Crossroad

_images/RoadSegmentTransitionCrossroadSettings.png
Direction count : number of sides of the crossroad.
Sub-lane count : number of sub-lanes (a sub-lane is a lane with a different number of lanes than the main lane).
SubTrafficNode distance from center : distance between the SubTrafficNode (node that contains a sub-lane) and the center of the segment.
_images/RoadSegmentTransitionCrossroad.png

Example.

Merge Straight Road

_images/RoadSegmentTransitionStraightRoadSettings.png
Sub-lane count : number of sub-lanes (a sub-lane is a lane with a different number of lanes than the main lane).
Node 1 offset : node 1 offset on the X-axis.
Node 2 offset : node 2 offset on the X-axis.
Traffic node height 1 : node 1 offset on the Y-axis.
Traffic node height 2 : node 2 offset on the Y-axis.
_images/RoadSegmentTransitionStraightRoad.png

Example.

Merge Crossroad To Oneway Road

_images/RoadSegmentTransitionCrossroadToOneWaySettings.png
Direction count : number of sides of the crossroad.
Sub-lane count : number of sub-lanes (a sub-lane is a lane with a different number of lanes than the main lane).
SubTrafficNode distance from center : distance between the SubTrafficNode (node that contains a sub-lane) and the center of the segment.
Is enter of oneway : if it is on, it is the start of one-way traffic, if it is off, it is the end of one-way traffic.
_images/RoadSegmentTransitionCrossroadToOneWay.png

Example.

Oneway Straight

_images/RoadSegmentOneWayStraightSettings.png
Node 1 offset : node 1 offset on the X-axis.
Node 2 offset : node 2 offset on the X-axis.
Traffic node height 1 : node 1 offset on the Y-axis.
Traffic node height 2 : node 2 offset on the Y-axis.
Should revert direction : direction of the crossroad lanes will be reversed.
_images/RoadSegmentOneWayStraight.png

Example.

Oneway Turn

_images/RoadSegmentOneWayTurnSettings.png
Node 1 offset : node 1 offset on the X-axis.
Node 2 offset : node 2 offset on the X-axis.
Additional local angle 1 : additional node 1 rotation angle.
Additional local angle 2 : additional node 2 rotation angle.
Should revert direction : direction of the crossroad lanes will be reversed.
_images/RoadSegmentOneWayTurn.png

Example.

Custom Straight Road

Creator for creating straight roads of any shape.

Youtube tutorial.

How To Use

  1. Place the custom straight segment where you want it.

  2. Place the traffic nodes at the start and the end of the path (or expand the road by holding left-shift key and clicking the left-mouse button).

  3. Rotate the TrafficNodes in the direction of the route (make sure that the rotation of the nodes is set correctly).

  4. Adjust the number of lanes and the speed limit of the segment.

  5. If necessary, add more additional nodes to the paths (by pressing + in the scene) [optional step].

  6. Rotate the nodes of the paths according to the direction of the path [optional step].

  7. Snap TrafficNodes to the surface by pressing the Snap To Surface button if necessary [optional step].

  8. Complete all the default steps.

Settings

Custom Settings

_images/RoadSegmentCustomStraightCustomSettings.png
One way : segment contains only one-way paths.
Lock Y axis move : lock the Y axis to move the nodes.
Show Y position : show Y position of the nodes.

Snap Node Settings

_images/RoadSegmentCustomStraightSnapNodeSettings.png

Info.

Snap Surface Settings

_images/RoadSegmentCustomStraightSnapSurfaceSettings.png
Snap surface offset : offset between snap point and the node (Y axis).
Node Buttonswhich node you want to snap to.
  • All

  • Node1

  • Node2

Buttons:
  • Snap to surface: snap selected nodes to the surface.

Snap Line Settings

Creates additional path nodes along the curved meshes of the collider to make the path follow the shape of the collider (v 1.0.4+).

_images/RoadSegmentCustomStraightSnapLineSettings.png
Angle threshold : minimum angle between normal faces to create new path nodes.
Min waypoint offset : min offset between generated path nodes.
Snap surface offset : offset between snap point and the node (Y axis).
_images/SnapLineExample.gif

Example.

Path Settings

_images/RoadSegmentCustomStraightPathSettings.png
Show edit buttons path nodes : on/off edit (add & remove) button paths of node.
Show traffic node handles : on/off traffic node position handles.
Show traffic node forward : on/off display of node’s forward direction.
Speedlimit : speed limit for all paths of the segment.

Examples

_images/RoadSegmentCustomStraight.png

Source segment example.

_images/RoadSegmentCustomStraight2.png

Complex shape example.

_images/RoadSegmentCustomStraightSnapExample.png

Surface snapping example.

Custom Segment

Creator for creating segments of any shape and complexity.

Youtube tutorial.

How To Use

  1. Place the custom segment where you want it.

  2. Toggle on Custom settings parameter.

  3. Select the New node settings type & create a new TrafficNode by pressing the Add Traffic Node button [optional step].

  4. Place & rotate all created TrafficNode according to your needs (make sure that the rotation of the nodes is set correctly).

  5. Snap TrafficNodes to the surface by pressing the Snap To Surface button if required [optional step].

  6. Open the PathCreator tool to quickly create paths between nodes or auto-generate crossroad.

  7. Complete all the default steps.

    Note

    You can convert any default template to Custom Segment in the Other settings tab.

Settings

New Node Settings

_images/RoadSegmentCustomNewNodeUniqueSettings.png
Custom settings : on/off custom settings for advanced node customization.
New node settings type [custom settings enabled] new TrafficNode will be created like:
  • Prefab : new prefab.

  • Unique : created with unique defined settings.

  • Copy last : will be created with the settings of the last created node.

  • Copy selectedwill be created with the settings of the selected node.
    • Copy node index

Custom Path Settings

_images/RoadSegmentNodeHandles.png
Show traffic node handles : on/off handles of TrafficNodes
Show traffic node forward : on/off display of TrafficNode forwading.

Additional Settings

Extrude Lane

_images/ExtrudeLaneSettings.png

How to use:

  1. Drag the green sphere from where you want the new lane to start.

  2. Drop the cursor where you want the lane to end.

  3. Adjust the position handle of the new path.

  4. Press E key or press Create button in the inspector to create new lane.

_images/ExtrudeLaneExample.gif

Example.

Custom Settings

_images/RoadSegmentCustomCustomSettings.png
Lock Y axis move : lock the Y axis to move the nodes.
Show Y position : show Y position of the nodes.

Snap Node Settings

_images/RoadSegmentCustomSnapNodeSettings.png

Info.

Custom TrafficNode Editor Window

Window that you can configure each TrafficNode settings. Custom settings should be enabled.

_images/RoadSegmentCustomTrafficNodeEditorWindow.png

Examples

_images/RoadSegmentCustomExample.png

Example.

Settings Description

Snap Node Settings

Snap object type:
  • All : snap TrafficNode & Path node.

  • Traffic node : only TrafficNode.

  • Path node : only Path node.

Auto-snap position on/off position snapping.
  • Add half offset : the snapped object is shifted by half of the set snapping size.

Auto snap custom size : snapping value.
Auto round rotation:on/off rotation snapping.
  • Round angle : snapping angle value.

Components

General settings

_images/RoadsegmentCreatorGeneralSettings.png
Lane count : number of lanes.
Lane width : lane width.
Crossroad width : distance between traffic nodes.
Path corner offset : offset to change the rotation angle of curved paths.

Custom settings

Custom settings.

Light settings

_images/RoadsegmentCreatorLightSettings.png

Youtube tutorial.

How To Use

  1. Turn on traffic light option.

  2. Select Light prefab type.

  3. Set the traffic light offset or enable Light handle type.

  4. If you want to configure the traffic lights individually, select the Node button with the appropriate index.

Traffic lights

Show light indexes : on/off display light TrafficLightHandler index around traffic nodes and traffic lights in the scene.
Min TrafficNodes count for add light : minimum number of traffic nodes in the segment to add traffic light.
Add traffic light : add traffic light to the segment.
Light handle type:
  • None

  • Position : enable position handle for traffic lights.

  • Rotation : enable rotation handle for traffic lights.

Selected light prefab typeprefab of the traffic light to be added [can be changed in creator settings].
  • Oneway

  • Two way

  • Four way

Light location :
Traffic lights offset : local traffic light offset relative to traffic node.
Light angle offset settings:
  • Angle offset : local rotation angle of the traffic light.

  • Flip index : switches to the opposite light index in the traffic light.

Pedestrian lights

Add pedestrian lights : add pedestrian light to the segment.
Pedestrian light offset : local pedestrian light offset relative to traffic node
Pedestrian angle offset : pedestrian light rotation angle offset.

Path settings

_images/RoadsegmentCreatorPathSettings.png

Node selection panel

How to customize path:
  1. Select TrafficNode on the inspector panel.

  2. Select desired path on the inspector panel (it will be highlighted in the scene).

  3. Adjust the position of the path nodes (make sure path handles is enabled).

  4. Press Open Path Settings button to customize Path settings window.

Road settings

StraightRoad settings: [settings for straight paths of the segment]
  • Waypoint Straightroad count

  • Straight road path speed limit

  • Straight road priority

TurnRoad settings: [settings for turn paths of the segment]
  • Turn curve type

  • Waypoint turn curve count

  • Turnroad path speed limit

  • Turnroad priority

Scene settings

Show path handleson/off position handles in the scene.
  • Show edit buttons path nodes : on/off add & remove buttons nodes in the scene.

Show waypointson/off visual circle position of the waypoint in the scene.
  • Show waypoints info : on/off info of waypoints (local index, speedlimit).

Turn connection settings

Custom node turn settings : on/off the turn settings for each traffic node.
Left turn count : number of left turns from the traffic node.
Right turn count : number of right turns from the traffic node.
Lane left turn connection count : number of connections to the left from the lane traffic lane.
Lane right turn connection count : number of connections to the right from the lane traffic lane.

Segment handler settings

_images/RoadsegmentCreatorSegmentHandlerSettings.png
Show segment position handle : on/off position handle for segment.
Snap segment position : on/off snap segmant position.
Add half offset : the snapped object is shifted by half of the set snapping size.
Custom snap size : snapping value.
Snap surface offset : snap surface offset.
Snap layer mask : snap layermask.
Snap segment to surface : snap the segment to the surface.

Other settings

_images/RoadsegmentCreatorOtherSettings.png
Merge segment : opens the merge segment tool.
Convert to custom : converts the current segment to custom segment.
Save prefab paths : segment save prefab path.
Save to prefab : save segment to prefab.

Buttons

Rotate -90°/90° : rotate segment by 90° degree.
Recreate : recreate segment.
Clear : clear segment.

Hotkeys

Capslock : rotate segment by 90° degree.

Auto Crossroad

For automatic generation of custom crossroads, use this feature.

How To Use

  1. Create a Custom road segment.

    _images/AutoCrossroad0.png
  2. Open the Path Settings tab & enable the Auto-Crossroads option in the Additional Settings dialog.

    _images/AutoCrossroad1.png
  3. Press the Clear button to delete existing paths.

  4. Place Traffic nodes at the entrances/exits of the intersection.

    _images/AutoCrossroad2.png
  5. Press the Create button.

    _images/AutoCrossroad3.png
  6. If you want to avoid connection for certain Traffic nodes select indexes according to scene indexes & press Add button, then press Create button again.

  7. For example 1-3 & 3-1 nodes.
    _images/AutoCrossroad4.png
  8. 1-3 & 3-1 nodes no longer connected.

    _images/AutoCrossroad5.png

    Example result.

  9. If you are missing a connection, use the Path Creator to add missing paths.

Dead End

Destroy

If you want traffic to be destroyed at the dead end (e.g. when it drives beyond the scene), enable the Destroy vehicle type in the Traffic node.

U Turn

To create u turn path:

  1. Open Path Creator tool.

  2. Select desired Traffic node for u turn.

  3. Enable U turn option in the Node settings tab.

  4. Enable Connect same side option & set Source node side to External side.

  5. Press Create button.