.. _structure: Structure ============ .. _projectScenes: Project Scenes ---------------- #. **Demo** : the main optimized :ref:`demo scene ` of the project (read more about scene structure :ref:`here `). #. **Demo Mono** : the new demo scene of the project, which contains an example of traffic & NPCs fully interacting with monobehaviour scripts (v1.1.0+). #. **Demo source** : same as `Demo` scene, but contains raw 3D models without optimization, also scene :ref:`streaming objects ` are disabled, including :ref:`static physics colliders `. #. **RuntimeTile Road Demo** : :ref:`sample scene ` showing how to create a city builder based on tiles (runtime spline can be used with `Road Constructor `_ plugin). **(new)** #. **RuntimeTile Road Mobile Demo** : :ref:`sample scene ` showing how to create a city builder based on tiles *[mobile version]*. **(new)** #. **Runtime ChunkRoad Demo** : :ref:`sample scene ` demonstrating the road chunks added at runtime. **(new)** #. **Runtime CustomRoad Demo** : :ref:`sample scene ` to demonstrate the use of the `API` to generate run-time roads from `Unity` spline roads or from custom data. **(new)** #. **Runtime RawData Demo** : :ref:`sample scene ` that demonstrates the generation of a road from raw data at runtime. **(new)** #. **Custom Train Demo** : an example of how a 3rd party train solution can be integrated. **(new)** #. **Traffic test scene** : :ref:`traffic test scene ` where all parameters can be tested with a set of most :ref:`traffic ` situations. #. **Pedestrian test scene** : :ref:`pedestrian test scene ` where the workability of entities can be tested. #. **Props test scene** : :ref:`props test scene ` where the workability of entities can be tested. #. **City stress scene** : stress scene that combines thousands of :ref:`vehicles ` and :ref:`pedestrians `. #. **City stress scene mobile** : mobile version of `City stress scene`. #. **Traffic stress scene** : stressed scene is extremely crowded with :ref:`vehicles `. #. **Traffic stress scene mobile** : mobile version of `Traffic stress scene`. #. **Pedestrian stress scene** : stressed scene is extremely crowded with :ref:`pedestrians `. #. **Pedestrian stress scene mobile** : mobile version of `Pedestrian stress scene`. #. **Pedestrian animation stress scene** : performance scene comparison between :ref:`Unity Animator ` animations and :ref:`GPU animations `. #. **Vehicle physics stress scene** : stress scene for the thousands cars with :ref:`Custom vehicle controller `. #. **Vehicle custom physics test scene** : scene for testing various parameters of the :ref:`Custom vehicle controller `. .. _sceneStructure: Scene Hierarchy ---------------- .. image:: /images/road/sceneStructure.png :alt: Scene Hierarchy Diagram :align: center .. _mainScene: #. **Main scene**. #. **City debugger** : contains all the :ref:`debuggers ` for the city. .. _hub: #. **Hub** : contains the :ref:`Entity Subscene Generator ` (:ref:`read more ` on how to create it). #. **City Settings Initializer** : contains the :ref:`General Settings ` of the `DOTS` city [moved to the `Config` tab]. #. **Main scene configs** (read more about the :ref:`config editing ` workflow). #. **Pools** : contains all the entity presets. #. **Spawnpoint** : spawnpoint of the player (assigned in the `PlayerSpawner` if built-in solution in use). .. _subscene: #. **Subscene** (`EntitySubScene`) : subscene into which all of the entities are converted (generated by the :ref:`Entity Subscene Generator `). #. **Subscene configs** (read more about the :ref:`config editing ` workflow). #. **EntityRoadRoot** : object root generated by the :ref:`Entity Subscene Generator `. #. **Road** : :ref:`road parent ` (read more about the :ref:`road editing ` workflow). Scene Components ---------------- .. _roadParentInfo: Road Parent ~~~~~~~~~~~~ The root of all crossroads in the scene. .. image:: /images/road/installation/RoadParent.png :alt: Road Parent Component View :align: center How To Use """""""""""""" Read more in the :ref:`Road Network Workflow ` section. Settings """""""""""""" Connection waypoint offset Automatically adds a :ref:`waypoint ` at each selected offset to the :ref:`automatically ` created :ref:`paths ` (if the value is greater than zero). Cast distance Raycast connection distance between :ref:`Traffic nodes `. If set to zero, the value is infinite. Multi angle raycast Multi-angle raycasting along the Z-axis. Connect crosswalks Auto-connect :ref:`Pedestrian node ` crosswalks. Utils """""""""""""" Add crossroads Adds a scene crossroad if it is missing. Connect pedestrian nodes Automatically connects :ref:`pedestrian nodes ` that have :ref:`auto-connection ` configured. Clear unattached paths Deletes the :ref:`paths ` that are not connected to any :ref:`TrafficNode `. Buttons """""""""""""" Connect segments Creates the :ref:`automatically generated paths ` for missing paths of :ref:`external ` nodes. Force connect segments Creates the :ref:`automatically generated paths ` for all paths of :ref:`external ` nodes. If a path was previously created & autopath lock is off for the :ref:`Traffic node `, the path will be overridden. Bake path data Bakes the road data (:ref:`read more about baking `). .. _subsceneGenerator: Entity Subscene Generator ~~~~~~~~~~~~~~~~~~~~~~~~~~ .. image:: /images/road/installation/HubInfo.png :alt: Entity Subscene Generator View :align: center Where To Find """""""""""""" 1. Create a :ref:`city base ` **[if missing, optional step]**. 2. Select the :ref:`Hub ` in the scene. How To Use """""""""""""" Read more in the :ref:`Road Entity Subscene ` section. Settings """""""""""""" Entity subscene save path Save path of the :ref:`subscene `. Entity subscene name Name of the :ref:`subscene `. Autosync configs On/off auto-sync config on the :ref:`main scene ` & :ref:`subscene `. Move tools On/off moving of the following tools: :ref:`PedestrianNode Creator `, :ref:`RoadSegmentPlacer `. Move lights On/off moving of the :ref:`subscene ` lights. Move props On/off moving of :ref:`props `. Move surface On/off moving of the selected physics surface. Copy physics shapes On/off feature of physics shape :ref:`cloning `. Config """""""""""""" Copy to subscene The :ref:`subscene ` configs will be synchronized with the :ref:`main scene `. Copy from subscene The :ref:`main scene ` configs will be synchronized with the :ref:`subscene `. Buttons """""""""""""" Generate Generates the :ref:`subscene `. Move back Move the road from the :ref:`subscene ` to the :ref:`main scene ` (can be useful for editing roads in the :ref:`main scene ` due to Editor performance). PedestrianNode Transfer Service ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Tool for cloning :ref:`Pedestrian nodes ` that are part of the prefab from the :ref:`main scene ` to the :ref:`subscene `. .. image:: /images/road/installation/PedestrianNodeTransferService.png :alt: PedestrianNode Transfer Service View :align: center .. note:: For example, can be useful to separate the `Building prefab` asset and its attached :ref:`Pedestrian nodes `. How To Use """""""""""""" Automatically used by the :ref:`Entity Subscene Generator `. .. _physicsShapeTransfer: PhysicsShape Transfer Service ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ * This tool only works for `DOTS` if the `DOTS` simulation type is selected in the :ref:`General Settings `. * Tool for cloning physical shapes from the :ref:`main scene ` to the :ref:`subscene `. * There is also a tool to maintain both the `default physical world `_ and the `DOTS physical world `_ at the same time, so that `default colliders `_ and `DOTS colliders `_ exist at the same time if you need to use `default colliders `_ in `MonoBehaviour `_ classes. Current project use cases: * Keep `default colliders `_ to work with :ref:`Legacy ragdoll `. * Cloning of physical shapes from the :ref:`main scene ` to split them into subscene pieces by using :ref:`SubSceneChunk Creator ` or cloned into the :ref:`main subscene ` by using :ref:`Entity Subscene Generator `. .. note:: The tool can only use one tool at a time, either an :ref:`Entity Subscene Generator ` or a :ref:`SubSceneChunk Creator `. Settings """""""""""""" .. image:: /images/road/installation/PhysicsShapeTransferService.png :alt: PhysicsShape Transfer Service Settings View :align: center Clean components Removes all components from the physics shape. Clean childs Removes all childs from the physics shape. Search type Searching shapes by layer or tag. Proccesing type * **Stay previous** : cloning found `PhysicsShape `_ or `Collider `_ to :ref:`subscene `, useful to keep `default collider `_ and `Unity.Physics collider `_ running at the same time. * **Disable collider** : cloning found `PhysicsShape `_ or `Collider `_ to :ref:`subscene ` and disable it in the main scene. Preinit layer Enable :ref:`pre-init ` cull state for physics objects. New layer Assigns new layer for cloned shape.