Road Network Workflow

This guide covers the full step-by-step process of building and configuring a functional city road network from scratch.

Phase 1: Initial Setup

  1. Create the initial scene base objects via the Unity toolbar.

  2. Create the required Road Segments.

  3. Add all created segments as children to the Road Parent object in your scene hierarchy.

Phase 2: Path & Node Creation

  1. Create the necessary paths using the editor tools.

  2. Configure specific path parameters such as speed limits, traffic groups, and lanes (read more about path customization).

  3. Connect the adjacent road segments together. For detailed instructions on automation and manual tools, see the How To Connect Roads guide.

  4. Adjust the Traffic lights and intersection timings.

Phase 3: Baking & Subscenes

  1. Select the Road Parent component in the hierarchy.

    Road Parent Inspector View
  2. Click the Bake button.

    Warning

    Data baking must be done after every road modification and strictly before entering Play Mode. For more details, see Baking Info.

  3. Generate the Entity Subscene. This is a one-time procedure to convert standard GameObjects into high-performance DOTS entities.

Next Steps

For any further modifications to existing roads, layouts, or runtime parameters, please refer to the Road Editing Workflow.

Entity Subscene Creation

From DOTS 1.0 onwards, all entity conversions must be done using subscenes. It’s necessary to create a separate subscene for roads.

_images/Hub.png
Steps:
  1. Select Hub in the scene.

  2. Select Entity subscene path the path to create a subscene.

  3. Enter the Entity subscene name or use the default name.

  4. On/off autosync configs (before migrating the configs to the subscene, they will be synchronized with the configs that are in the Hub).

  5. On/off copy physics shapes feature (read more about physics shape transferring) [required if you plan to use DOTS physics].

  6. Press the Generate button.

Config Editing Workflow

There are 4 variants to edit configs:

Main Scene Editing

_images/MainSceneExample.png

Steps

  1. Select Hub in the scene.

  2. After editing any config in the main scene Hub press the Copy To Subscene button or if the config is a non-scriptable object, apply the prefab to the selected config row.

    _images/Hub.png

Directional Editing

_images/EntitySubSceneExample.png

Steps

  1. Open the EntitySubScene subscene.

  2. Edit any config.

  3. After editing any config in the subscene, in the Hub press the Copy From Subscene button or if the config is a non-scriptable object, apply the prefab to the selected config row in the subscene.

  4. Save & close subscene.

Manual Sync Local Config

Steps

  1. Change the desired value of the desired config.

  2. After that, the Sync To Subscene button will appear to synchronize this config with the subscene.

Auto-Sync Local Config

Steps

  1. Open project settings from the Unity toolbar:

    • Edit/ProjectSettings/604Spirit/City Settings/

  2. Tick on Sync Config On Change.

  3. After that, any configuration changes made to the main scene are automatically synchronized to the subscene.