> ## Documentation Index
> Fetch the complete documentation index at: https://docs.sonoransoftware.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Getting Started

> Get started with configuring Traffic Engine for your community.

## Installation

> [accordion] Step 1: Install the Resource
>
> Place the Traffic Engine resource into your server's resources folder.
>
> Example:
>
> ```
> resources/[trafficengine]/sonoran-trafficengine
>
> ```
>
> * ![](https://docs-assets.sonoransoftware.com/sha256/20/20149d3db9e0cafd3ce4b34c2541d471d945f0f6ee04e195e96c40cd9f3c6034.png)

> [accordion] Step 2: Ensure the Resource
>
> Ensure and start Traffic Engine to your server's `server.cfg` file.
>
> ```
> ensure sonoran-trafficengine
> ```
>
> * ![](https://docs-assets.sonoransoftware.com/sha256/8b/8b2855a911f7e40ad0ecfd76e723c4ed041617998f50852f2bb0526a9f6244b3.png)

> [accordion] Step 3: Configure Permissions
>
> Traffic Engine uses ACE permissions for administrative access.
>
> Add the following permission to your server configuration:
>
> ```
> add_ace group.admin trafficengine.admin allow
> ```
>
> Example:
>
> ```
> add_principal identifier.fivem:123456 group.admin
> add_ace group.admin trafficengine.admin allow
> ```

## Traffic Engine Menu

> [accordion] Opening Traffic Engine
>
> Administrators can access Traffic Engine in-game using:
>
> ```
> /trafficengine
> ```
>
> This command opens the Traffic Engine administrative toolset.
>
> ![](https://docs-assets.sonoransoftware.com/sha256/a4/a48ec77858cdd78eebbc9685cf53a7e3a4a5f33a396e095d45520d97416fcad6.png)
>
> This menu allows for the creation of [regions](https://docs.sonoransoftware.com/store/traffic-engine/getting-started.md#region-creation), [zones](https://docs.sonoransoftware.com/store/traffic-engine/getting-started.md#zone-creation), [breakdowns](https://docs.sonoransoftware.com/store/traffic-engine/getting-started.md#breakdowns), and [debris](https://docs.sonoransoftware.com/store/traffic-engine/getting-started.md#debris) management.

## Region and Zone Management

> [accordion] What are Regions?
>
> **Regions**
>
> A region represents a large section of the map and acts as the parent for all traffic behavior within that area.
>
> **Example Regions:**
>
> * City Region: `Los Santos`
> * County Region: `Blaine County`
> * Rural Region: `Paleto Bay`

> [accordion] What are Zones?
>
> Zones are smaller areas inside a region.
>
> Examples:
>
> * Downtown Los Santos
> * Interstate 1
> * Airport Access Road
> * Mirror Park
>
> Zones allow you to override regional settings and create unique traffic behavior in specific locations.
>
> For example:
>
> | Area | Morning/Evening Rush Hour Density Value 1-3 |
> | - | - |
> | Los Santos Region | 3 |
> | Legion Square Zone | 2 |

> [accordion] Region Creation
>
> To create a region:
>
> 1. [Open the menu](https://docs.sonoransoftware.com/store/traffic-engine/getting-started.md#traffic-engine-menu) with `/trafficengine`
> 2. Select **Create Category** > **Region**
> 3. Configure the region's name and rush hour settings:
>
> Morning Rush Multiplier
>
> * How dense will the traffic in this region become during the morning rush hour time?
> * These values can be edited as a baseline in the config.lua as a blanket while the regions in game can have their own values.
>
> ![](https://docs-assets.sonoransoftware.com/sha256/33/33ec3ff80c6ecdf4fe99e198ef27191abb5eb54f7b1919f0958bbaff17ced169.png)
>
> Evening Rush Multiplier
>
> * How dense will the traffic in this region become during the morning rush hour time?
> * These values can be edited as a baseline in the config.lua as a blanket while the regions in game can have their own values. As seen as above.
>
> ![](https://docs-assets.sonoransoftware.com/sha256/8a/8ac7240a5f8b88b7ebe0d59f71d291756b881b1177d14bf3f207343d7759f7ad.png)
>
> ![](https://docs-assets.sonoransoftware.com/sha256/03/03ef241764cf48d7be007e6c5e28398952e52b91480e1888d42e75138f072e97.png)
>
> ![](https://docs-assets.sonoransoftware.com/sha256/02/024bcd86dd36fbfb3f9490134372c4159d931879f64898aee3737a5394f18d68.png)
>
> 4. Place Nodes
>
> * Add nodes by placing them down by pressing E to draw out your zone. Press Enter to confirm
> * Regions are substantially taller and deeper than a zone.
>
> ![](https://docs-assets.sonoransoftware.com/sha256/d7/d74824cff38560511fe99fff9efe6049349e33e039b09621d467833ed1212c7a.png)

> [accordion] Zone Creation
>
> To create zones inside of the region:
>
> 1. [Open the menu](https://docs.sonoransoftware.com/store/traffic-engine/getting-started.md#traffic-engine-menu) with `/trafficengine`
> 2. Select **Create Category** > **Zone**
> 3. Configure the zone's settings:
>
> Breakdown Allowance
>
> *
>
> ```
> <figure><img src="../.gitbook/assets/image (10).png" alt=""><figcaption></figcaption></figure>
> ```
>
> Debris Allowance
>
> *
>
> ```
> <figure><img src="../.gitbook/assets/image (11).png" alt=""><figcaption></figcaption></figure>
> ```
>
> 4. Place Spawn Zones
>
> * Configure spawn points for the breakdowns and debris by pressing **E**, to save press **Enter**.
> * When blue nodes appear those are temporary locations, you can remove or save their location by going to a new area then press E
>
> ![](https://docs-assets.sonoransoftware.com/sha256/a0/a0bd62a0181c57c0f5b470b62fc2d0bc9612cae9984852022cd74c58586826fa.png)

> [accordion] Region and Zone Deletion
>
> Delete zones or regions from the in-game menu.
>
> Note that any changes will be saved automatically, save a backup file if you wish to revert your changes.
>
> *
>
> ```
> <figure><img src="../.gitbook/assets/image (21).png" alt=""><figcaption></figcaption></figure>
> ```

### Debris

> [accordion] Configuring Debris Spawning
>
> Debris will automatically spawn inside the zone depending on the maximum amount of debris allowance set when [first creating the zone](https://docs.sonoransoftware.com/store/traffic-engine/getting-started.md#zone-creation).
>
> Debris spawn frequency will be based on the `config.Debris` `chance` value.
>
> Users can also manually spawn debris at a specific location in a zone via the in-game menu. To manually spawn a debris, navigate to **Spawn Category** > **Debris**.
>
> ![](https://docs-assets.sonoransoftware.com/sha256/b5/b5b602f12a758ff5a3f0c818a772802c4f1d004cef16a1aa8434cdc431213296.png)
>
> ![](https://docs-assets.sonoransoftware.com/sha256/0e/0e42c337b81e632afbf71811cd2042665ae6fdeea31b1e7a290b6c55c3cb6dcc.png)
>
> The `Config.Debris` values can be tweaked for further customization.
>
> ![](https://docs-assets.sonoransoftware.com/sha256/3c/3cda53cd16db640aeced0dd25ed6b2bfb2d07709b63f4f87216ba4675186e67d.png)
>
> `tickIntervalMs` - How often the breakdown system checks whether it should try to spawn one.
>
> `spawnCooldownMs` - Cooldown after a successful breakdown before another normal spawn can happen.
>
> `guaranteedSpawnIntervalMs` - Maximum time allowed without a breakdown before the system forces a guaranteed attempt.
>
> `eventActiveSeconds` - How long a breakdown stays active before expiring.
>
> `nodeGracePeriodSeconds` - How long a used breakdown node stays locked before it can be reused.
>
> `minPlayerDistance` - Minimum distance a player must be from the node for a breakdown to spawn.
>
> `cleanupTimeMs` - Cleanup timer used to remove the breakdown scene after it expires.
>
> `cleanupWhenPlayersFar` - If enabled, cleans up breakdowns early when players move far enough away.
>
> `useRoadBlockingFallback` - If enabled, blocks road pathing around the breakdown when needed.
>
> `allowPedSpawnWithBreakdown` - If enabled, allows a stranded ped to spawn with the breakdown vehicle.

> [accordion] Cleanup Debris
>
> ![](https://docs-assets.sonoransoftware.com/sha256/c2/c2b93ede11c0fb9a496d08d298082564c2365be522176cdfe4f55c2ea69d0475.png)
>
> Roadway debris can be cleaned up and removed by interacting and holding **E** on the debris.
>
> This allows law enforcement, sanitation, DOT, civilians, or anyone else to clear debris from the roadways.

### Breakdowns

> [accordion] Vehicle Breakdowns
>
> Breakdowns will automatically spawn inside the zone depending on the maximum amount of breakdown allowance set when [first creating the zone](https://docs.sonoransoftware.com/store/traffic-engine/getting-started.md#zone-creation).
>
> * ![](https://docs-assets.sonoransoftware.com/sha256/46/466604d7ae3861b552c9249b0e152a14f39cc7a8a010f0068f2211bc592f70bd.png) ![](https://docs-assets.sonoransoftware.com/sha256/b7/b702b265a1a8843b56cce8c189dbd667970869bb48ae3980a602694fb1660679.png)
>
> Breakdown spawn frequency will be based on the `config.Breakdowns` `chance` value.
>
> Users can also manually spawn breakdowns at a specific location in a zone via the in-game menu. To manually spawn a breakdown, navigate to **Spawn Category** > **Breakdown**.
>
> ![](https://docs-assets.sonoransoftware.com/sha256/f4/f4db22e1f1d65d4d950f26856307f1ef31eb713f2e3024bd8364735155074e58.png)
>
> When a breakdown spawns, it can be one of several severity scenarios. Higher level breakdowns can also spawn [emergency services](https://docs.sonoransoftware.com/store/traffic-engine/getting-started.md#emergency-response) that will respond to it.
>
> Breakdowns slow the speed of traffic substantially, causing traffic jams if players are in the area.
>
> Config.Breakdowns:
>
> ```
> enabled = true,
> ```
>
> Turns the breakdown system on or off.
>
> ```
> chance = 1.00,
> ```
>
> Base chance for a breakdown event to occur when the system rolls.
>
> ```
> chanceIncreasePerMiss = 0.08,
> ```
>
> Adds 8% to the breakdown chance after each failed roll.
>
> ```
> rushHourChanceIncreaseBonus = 0.20,
> ```
>
> Adds an extra 20% chance during configured rush-hour periods.
>
> ```
> maxActive = 500,
> ```
>
> Maximum number of active breakdowns allowed server-wide.
>
> ```
> maxActivePerZone = 10,
> ```
>
> Maximum number of active breakdowns allowed in a single zone.
>
> ```
> maxActivePerRegion = 30,
> ```
>
> Maximum number of active breakdowns allowed in a single region.
>
> ```
> trafficBlockRadius = 30.0,
> ```
>
> Distance around the breakdown where AI traffic will react and avoid the scene.

### Emergency Response

> [accordion] Breakdown Emergency Response
>
> When a high level [vehicle breakdown](https://docs.sonoransoftware.com/store/traffic-engine/getting-started.md#breakdowns) spawns, fire and EMS vehicles can also spawn nearby for added realism.
>
> Users can also manually spawn emergency vehicles at a specific location in a zone via the in-game menu. To manually spawn an emergency vehicle, navigate to **Spawn Category** > **Emergency**. Emergency Nodes will show up in blue when manually placed.
>
> ![](https://docs-assets.sonoransoftware.com/sha256/84/84f8518b08bb09d7017746dc09472986c679ffe8e266f39d73cade869f7d5470.png)

## Calm AI

> [!WARNING]
>
> Traffic Engine will conflict with scripts like **Calm AI** and other traffic management scripts.
>
> Disable any existing traffic management scripts and use only Traffic Engine for these features.

> [accordion] Calm AI Traffic Management
>
> Many communities use traffic and AI management systems like "Calm AI". These scripts manage the overall traffic density across the map and AI aggressiveness behavior.
>
> Because Traffic Engine will conflict with any existing Calm AI script, these features are built in.
>
> Go to config.lua and find this value to apply Override or not depending on what traffic manager you use.
>
> ```lua theme={null}
> Config.CalmAI = {
>     -- MASTER TOGGLE FOR CALM AI POPULATION OVERRIDES. | BOOLEAN | TRUE OR FALSE
>     enabled = true,
>     -- HOW MANY VEHICLES ARE DRIVING AROUND THE MAP. LOWER = LESS MOVING TRAFFIC. | NUMBER | 0.0 TO 3.0
>     VehDensity = 0.85,
>     -- HOW MANY RANDOMLY SPAWNED TRAFFIC VEHICLES ARE AROUND. LOWER = LESS RANDOM TRAFFIC. | NUMBER | 0.0 TO 3.0
>     RanVehDensity = 0.65,
>     -- HOW MANY PARKED CARS ARE AROUND THE MAP. LOWER = FEWER PARKED CARS. | NUMBER | 0.0 TO 3.0
>     ParkCarDensity = 0.95,
>     -- HOW MANY WALKING/STREET AI PEDS ARE AROUND. LOWER = FEWER PEDS. | NUMBER | 0.0 TO 1.0
>     PedDensity = 0.75,
>     -- HOW MANY SCENARIO PEDS ARE RUNNING EMOTES/TASKS. LOWER = FEWER SCENE PEDS. | NUMBER | 0.0 TO 1.0
>     ScenePedDensity = 0.35,
>     -- TRUE DISABLES VANILLA AI DISPATCH. FALSE LEAVES VANILLA DISPATCH ON. | BOOLEAN | TRUE OR FALSE
>     DispatchDead = true
> ```


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.