Quick Start

Initial Components

  1. Create a new scene.

  2. In the Unity toolbar open:

    Spirit604/CityEditor/Create/City Base

    _images/CityBase.png
  3. This window appears for the first time:

    _images/CityBase2.png
  4. Select Hub Base.

  5. Description:
    • Hub Base : clean root prefab with just traffic simulation without any extra stuff (player should be spawned with your own script or simply drag & drop into the scene).

  6. Press Create button.

Hub Base

  1. Initial scene example:

    _images/ExampleScene2.png
  2. By default, the Cull point is automatically generated as a child of the main camera.

  3. If you want to add your own player that interacts with traffic, read here [optional step].

  4. The next step is to configure Scene

Scene

  1. Add Road segments to the scene (Use Ctrl+D to duplicate and Caps Lock to rotate).

    _images/Tutorial1.gif
  2. In the Road Parent press Force connect segments button.

    _images/Tutorial2.gif
  3. In the Road Parent press Bake Path Data button (should be done after each road edit & before starting the scene) & select Hub object on the scene & generate a subscene.

    _images/Tutorial4.gif
  4. For more information on how to create a road, read the Road Network Workflow.

  5. Create a ground, if missing (GlobalSurfaceCollider example prefab) & set the layer for your ground surfaces to Ground (18) & layer for your static objects to StaticPhysicsShape (22) (read more about PhysicsShapeTransfer service, if you are going to use DOTS only). For DOTS cars, the ground surface should be on a sub-scene. For mono cars, the ground surface should be on the main scene.

    _images/Tutorial5.gif
  6. If you plan to use Hybrid Mono vehicles, set the World simulation type to Hybrid mono in the General settings config [optional step].

  7. Create your own traffic vehicles or temporarily use the built-in traffic already added [optional step].

  8. If you have created your own traffic, make sure the raycasting layer matches your ground collider layer (traffic prefabs can be found in TrafficCarEntityPoolBakerRef at the scene).

  9. In the Cull config, adjust culling distance at which road objects, traffic etc. will be activated & use Cull debug to view culling states [optional step].

  10. In the Traffic settings, disable Cull physics if you don’t want cars to disable their physics when they’re far away [optional step].

  11. Add & customize game sounds [optional step].

  12. By default, the Unity.Entities is not rendered on the Sceneview, to fix this follow these steps:
    1. In the Unity editor toolbar select:

      Edit/Preferences

    2. Select the Entities tab.

    3. Set Scene view mode to Runtime Data.

      _images/EntitiesDisplay.png
  13. Launch the scene.

    _images/Tutorial7.gif

    Result example.

Demo Lite Scene

  1. In the Project Folder view, select the following scene:

    DotsCity/Samples/Demo City/Scenes/Demo Lite

  2. Press Play button.

  3. Read more about Project Scenes & Scene Structure.

Demo Mono Lite Scene

  1. In the Project Folder view, select the following scene:

    DotsCity/Samples/Demo City/Scenes/Demo Mono Lite

  2. Press Play button.

  3. Read more about Project Scenes & Scene Structure.