# Easy Roads

If Easy Roads was used to build the road network, waypoints could be extracted automatically, and there is no need to manually draw waypoints on the entire road network.

## Requirements

{% hint style="warning" %}
Requires Easy Roads 3.3 to work. Version 3.3 is fully compatible with the current 3.2 version; nothing changes, just the waypoint information is added.
{% endhint %}

If you use the official release of 3.2 to create your environment, you'll have to upgrade it to 3.3 by importing the scripts from the demo project or downloading 3.3 from the official website.

The demo project is available for free on the Asset Store. Just log in with the account that owns Easy Roads, and it will be free to download:

[assetstore.unity.com/packages/tools/terrain/easyroads3d-demo-project-105045](https://assetstore.unity.com/packages/tools/terrain/easyroads3d-demo-project-105045?aid=1011l8QY4)

Version 3.3 is also available on the official website.

{% embed url="<https://www.easyroads3d.com/download.php>" %}

To download from the official website, you'll have to obtain a serial number for your account, and then you will be able to download the plugin. Follow the instructions from the website.

<figure><img src="https://1500817731-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FuflU4iIzTBjoLH93zTYD%2Fuploads%2FE7TdgKG9DOEWHqE2UpH7%2FDownload.PNG?alt=media&#x26;token=930e0eb3-8591-46cb-8bea-44fefa4943cd" alt=""><figcaption></figcaption></figure>

## Setup

Please follow the [quick-start](https://gley.gitbook.io/mobile-traffic-system/quick-start "mention") section first if you have not done it already to make sure the Mobile Traffic System is properly installed and working in your project.

Next, set your Grid and Layers as shown in the [prepare-scene](https://gley.gitbook.io/mobile-traffic-system/setup-guide/prepare-scene "mention")section.

#### Enable Easy Roads support:

Open the **Settings Window** go to **External Tools -> Easy Roads Setup** and click **Enable Easy Roads Support**

<figure><img src="https://1500817731-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FuflU4iIzTBjoLH93zTYD%2Fuploads%2FxAWEyoz7irZoayOW0f27%2Fimage_2024-02-05_135900797.png?alt=media&#x26;token=d0c6a8bc-2182-4954-a2ec-3d418a9bf8bc" alt=""><figcaption><p>Enable Easy Roads</p></figcaption></figure>

The scripts will start to compile at this step. If you get any errors inside your console make sure you are using version 3.3 of Easy Roads. see the [#requirements](#requirements "mention").

#### Extract Waypoints

Open the **Settings Window** go to **External Tools -> Easy Roads Setup**

Select the intersection type you want to use: [traffic-lights-intersection](https://gley.gitbook.io/mobile-traffic-system/setup-guide/traffic-lights-intersection "mention") or [priority-intersection](https://gley.gitbook.io/mobile-traffic-system/setup-guide/priority-intersection "mention")

<figure><img src="https://1500817731-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FuflU4iIzTBjoLH93zTYD%2Fuploads%2FWwB34a3H5lqO9FoxDv8g%2Fimage_2024-02-05_141255114.png?alt=media&#x26;token=548a6b8b-de48-4c1e-bffc-b9deb6a7a10d" alt=""><figcaption><p>Traffic Lights Intersection</p></figcaption></figure>

Set the **Green Light Time** and the **Yellow Light Time**. Each intersection will work according to the times set here.

<figure><img src="https://1500817731-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FuflU4iIzTBjoLH93zTYD%2Fuploads%2FJLfbfW9YK5kkFEBbkOQ0%2Fv2-EasyRoadsPriority.PNG?alt=media&#x26;token=73e92839-01c2-42a5-82c7-f79da5a4ea84" alt=""><figcaption><p>Priority Intersection</p></figcaption></figure>

If overtaking is needed check **Link lanes for overtake**.

Waypoint distance is the distance between two consecutive waypoints. If your city is full of curves, a lower distance works best. If it is mostly highway, a higher distance performs better. Try and see what the optimal value is for your road network.

Hit **Extract Waypoints** and the waypoints should be generated over your entire road network.

To activate traffic on your scene follow the [initializing-asset](https://gley.gitbook.io/mobile-traffic-system/setup-guide/initializing-asset "mention")section.

To configure the cars that spawn inside your scene check the [vehicle-pool](https://gley.gitbook.io/mobile-traffic-system/setup-guide/vehicle-pool "mention") section.

Check this video for more information:

{% embed url="<https://youtu.be/-GWru2d7fMs>" %}

{% hint style="warning" %}
Sometimes, when you extract the waypoints some errors like No lane data found on "Road Name" might appear.
{% endhint %}

This is because the waypoints were not enabled for that road type.&#x20;

To fix it, select that road type in Easy Roads, go to Settings -> Lane Data add some lanes to your road, and update the scene instances.

&#x20;Also, make sure Generate Lane data is enabled from AI Traffic.

For more details check this video:

{% embed url="<https://youtu.be/vTAW0jilybI?feature=shared>" %}
