.. _roadNetworkWorkflow: 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 ---------------------- #. Create the initial :ref:`scene base ` objects via the Unity toolbar. #. Create the required :ref:`Road Segments `. #. Add all created segments as children to the **Road Parent** object in your scene hierarchy. Phase 2: Path & Node Creation ----------------------------- #. Create the :ref:`necessary paths ` using the editor tools. #. Configure specific path parameters such as speed limits, traffic groups, and lanes (read more about :ref:`path customization `). #. Connect the adjacent road segments together. For detailed instructions on automation and manual tools, see the :ref:`How To Connect Roads ` guide. #. Create the necessary :ref:`Pedestrian nodes ` using the :ref:`PedestrianNode Creator ` if your city requires walking NPCs. #. Adjust the :ref:`Traffic lights ` and intersection timings. Phase 3: Advanced Elements (Optional) ------------------------------------- * **Traffic Areas:** Create :ref:`Traffic Areas ` if your map includes specific zones like congested parking lots. * **Public Transport:** Set up :ref:`Public Routes ` if you are planning to use :ref:`Buses or Trains ` with predefined routes. Phase 4: Baking & Subscenes --------------------------- #. Select the **Road Parent** component in the hierarchy. .. image:: /images/road/installation/RoadParent.png :alt: Road Parent Inspector View :align: center #. Click the **Bake** button. .. warning:: Data baking must be done after *every* road modification and strictly before entering Play Mode. For more details, see :ref:`Baking Info `. #. Generate the :ref:`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 :ref:`Road Editing Workflow `. .. _roadEntitySubscene: Entity Subscene Creation ---------------- From `DOTS 1.0 `_ onwards, all entity conversions must be done using subscenes. It's necessary to create a separate :ref:`subscene ` for roads. .. image:: /images/road/installation/Hub.png Steps: #. Select :ref:`Hub ` in the scene. #. Select `Entity subscene path` the path to create a :ref:`subscene `. #. Enter the `Entity subscene name` or use the default name. #. On/off autosync configs (before migrating the configs to the :ref:`subscene `, they will be synchronized with the configs that are in the :ref:`Hub `). #. On/off copy physics shapes feature (read more about :ref:`physics shape transferring `) **[required if you plan to use DOTS physics]**. #. Press the `Generate` button. #. All created :ref:`RoadSegments ` and :ref:`PedestrianNodes ` will automatically be moved to the :ref:`subscene `. .. _configEdit: Config Editing Workflow ---------------- There are 4 variants to edit configs: Main Scene Editing ~~~~~~~~~~~~ .. image:: /images/road/installation/MainSceneExample.png Steps """""""""""""" #. Select :ref:`Hub ` in the scene. #. After editing any config in the main scene :ref:`Hub ` press the `Copy To Subscene` button or if the config is a non-scriptable object, apply the prefab to the selected config row. .. image:: /images/road/installation/Hub.png Directional Editing ~~~~~~~~~~~~ .. image:: /images/road/installation/EntitySubSceneExample.png Steps """""""""""""" #. Open the `EntitySubScene` :ref:`subscene `. #. Edit any config. #. After editing any config in the subscene, in the :ref:`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. #. Save & close :ref:`subscene `. Manual Sync Local Config ~~~~~~~~~~~~ Steps """""""""""""" #. Change the desired value of the desired config. #. After that, the `Sync To Subscene` button will appear to synchronize this config with the subscene. Auto-Sync Local Config ~~~~~~~~~~~~ Steps """""""""""""" #. Open project settings from the `Unity` toolbar: * `Edit/ProjectSettings/604Spirit/City Settings/` #. Tick on `Sync Config On Change`. #. After that, any configuration changes made to the main scene are automatically synchronized to the subscene.