Integration: Realistic Traffic Controller

Table of Contents

Realistic Traffic Controller (RTC) is a separate BoneCracker Games product that provides AI-driven traffic simulation with lane-following, traffic lights, intersections, and vehicle spawning. The RCCP integration package allows RTC traffic vehicles to use the RCCP drivetrain, and enables the player's RCCP vehicle to coexist with RTC's traffic system.


Overview

Realistic Traffic Controller manages:

The RCCP integration bridges the two systems so that:


Prerequisites

  1. Realistic Traffic Controller installed in your project. Purchase from the Unity Asset Store.
  2. Realistic Car Controller Pro installed and working.

Installing

Step 1: Import Realistic Traffic Controller

If RTC is not already in your project, purchase and import it from the Asset Store.

Step 2: Import the RCCP Integration Package

  1. Open the RCCP Welcome Window: Tools > BoneCracker Games > Realistic Car Controller Pro > Welcome Window.
  2. Navigate to the Addons tab.
  3. Under Realistic Traffic Controller, you will see two buttons:
  1. Click Import Integration For Realistic Traffic Controller.
  2. Unity imports RCCP_RealisticTrafficControllerIntegration.unitypackage from Addons/Installers/.
  3. Wait for Unity to recompile.

The installer package is located at:


Assets/Realistic Car Controller Pro/Addons/Installers/RCCP_RealisticTrafficControllerIntegration.unitypackage

After import, the integration files are installed to:


Assets/Realistic Car Controller Pro/Addons/Installed/Realistic Traffic Controller/

Scripting Symbol

The RTC integration uses the BCG_RTRC scripting symbol. This is typically set automatically when RTC and the integration package are both present.

SymbolSourceRequired
BCG_RTRCRTC integration (automatic)Yes

The BCG_ENTEREXIT vehicle script also references BCG_RTC for camera detection when RTC vehicles are used with the enter-exit system.


Setup Guide

Step 1: Set Up the Traffic Network

Follow RTC's documentation to create your traffic lane network:

  1. Create road splines using RTC's road editor.
  2. Set up intersections with traffic light controllers.
  3. Configure lane speed limits and connectivity.
  4. Place the RTC traffic spawner in the scene.

Step 2: Configure RCCP Vehicles as Traffic Participants

The integration allows RCCP vehicle prefabs to be used as traffic vehicles:

  1. Create RCCP vehicle prefabs that will serve as traffic vehicles.
  2. Register them with RTC's vehicle pool (in the RTC traffic spawner configuration).
  3. The integration component bridges RTC's AI input to RCCP's input system, so the traffic AI controls throttle, brake, and steering through RCCP's drivetrain.

Step 3: Configure the Player Vehicle

The player's RCCP vehicle must be recognized by the traffic system:

  1. Ensure the player vehicle is on the correct physics layer.
  2. RTC's traffic AI uses raycasting and layer-based detection to identify obstacles. The player vehicle's layer must be included in RTC's obstacle detection layers.
  3. Configure RTC's settings to treat the player's layer as a "vehicle" obstacle.

Step 4: Layer Configuration

Proper layer setup is critical for traffic interaction:

Layer PurposeDescription
Traffic vehiclesLayer assigned to RTC-managed traffic vehicles.
Player vehicleLayer assigned to the player's RCCP vehicle.
Road/terrainLayer for road surfaces and terrain.

Both traffic and player vehicle layers must be included in each other's collision and detection matrices. Configure this in Edit > Project Settings > Physics (Layer Collision Matrix).


Features

Traffic AI Behavior

When using RCCP vehicles as traffic participants, the traffic AI:

Traffic Spawning and Despawning

RTC's traffic spawner creates and destroys traffic vehicles based on distance from a reference point (usually the player camera):

Traffic Lights

RTC manages traffic light phases at intersections. Traffic vehicles respect signals automatically. The player is not forced to stop at red lights (no gameplay enforcement), but traffic vehicles will stop, creating realistic intersection behavior.


Common Issues

Traffic not spawning

Traffic colliding with the player

Traffic vehicles not moving

Traffic vehicles driving through red lights

Performance issues with many traffic vehicles


Removing the Integration

  1. Delete the folder: Assets/Realistic Car Controller Pro/Addons/Installed/Realistic Traffic Controller/.
  2. If the BCG_RTRC scripting symbol is still defined, remove it from Edit > Project Settings > Player > Scripting Define Symbols.
  3. Wait for Unity to recompile.

Note: Removing the integration does not remove RTC itself. RTC will continue to work independently; it simply will not use RCCP vehicles as traffic participants.


See Also


Support: bonecrackergames@gmail.com | www.bonecrackergames.com

Need help? See Troubleshooting