Simple Traffic System

Simple Traffic System allows for quick creation of waypoint based routes that can be interconnected in a modular way to create traffic routes on roads in your scenes. The primary logic is highly optimized using the new C# Job System and Burst Compiler for multi-threading, allowing you to use more of your performance budget for other content.

AI traffic logic is handled by a single AI Traffic Controller that AI Traffic Cars register to. This is a data oriented logic structure and allows the AI logic to run in parallel jobs spread across all available cores to reduce cpu usage on the main thread.

Detailed tutorial videos are available to help teach proper workflow and demonstrate available features.

Asset Store

User Manual

New support for CiDy 2 allow 1 click traffic system generation on CiDy roads.

Key Features

  • No DLLs: Full source provided!

  • Modular: create, connect, and edit waypoint routes for AI cars to follow.

  • Waypoint Based: each waypoint can set speed limit, call stop driving, be a junction to new route point(s), or trigger custom events via Unity inspector.

  • Traffic Lights: control when AI cars can exit waypoint routes.

  • Yield Triggers: control when AI cars can proceed to next waypoint at intersections with traffic lights.

  • Traffic Stops: control when AI cars can exit waypoint routes.

  • Pooling System: disables cars far away from the player, and spawn cars around the player; allows scaling up scene size without using more cars.

  • Unity Physics Components: AI cars use Rigidbody and Wheel Colliders.

  • Unity Physics Components: AI cars use Rigidbody and Wheel Colliders.

  • Vehicle Types: define which cars can spawn/merge onto which routes.

  • Volume Sensors: more accurate detection compared to raycasts; uses layer mask to determine which objects should be detected.

Editor Utility Tools

  • Supports Undo/Redo

  • STS Tools Window: select from various tools to help automate waypoint route configuration tasks, reducing the need to dig through the hierarchy to configure references and settings.

  • Lane Connector: draws handles in the scene view over end of route waypoints, select 2 routes to auto configure lane change points.

  • Route Connector: draws handles in the scene view over route waypoints to create route connections between waypoints.

  • Route Editor: view/edit all waypoints from the selected route.

  • Signal Connector: draws handles in the scene view over end of route waypoints and traffic lights. Used to connect/disconnect route traffic signal lights.

  • Spawn Points: draws handles in the scene view over waypoints to manually add/remove spawn points, randomly assign spawn points to all waypoints, or remove spawn points from all waypoints.

  • Spline Route Creator: procedurally generates multiple waypoint routes and their waypoints along a spline with a unique offset for each, allowing you to quickly create routes and waypoints on large roads with curves or inclines.

  • Stop Connector: draws handles in the scene view over end of route waypoints and traffic stops. Used to connect/disconnect route traffic stops.

  • Yield Triggers: draws handles in the scene view over route waypoints, and yield triggers. Used to connect/disconnect waypoints and yield triggers.

Project Requirements

• Player Settings (Edit → Project Settings → Player)

  • API Compatibility Level .Net 4.x

• Package Manager Dependencies (auto installed on import)

  • Burst 1.4.1
  • Collections 0.1.1

• To use the burst compiler in standalone builds, install the Windows SDK and VC++ toolkit from the Visual Studio Installer.

4 Likes

The package has been submitted to the asset store and is currently pending review.

Looking good man. :slight_smile:

1 Like

looks like it has branching routes, too. I think you missed to mention them
white and yellow car here
5286342--530208--intersect.jpg
red and green car here
5286342--530211--intersect2.jpg

Yes, route endpoints can have multiple connections to new routes, if more than 1 connection is assigned in the new route point array the new route is chosen randomly.

1 Like

Stephen what is the project name at unity store for search???

The package is still pending review, I’ll post here when Unity approves it.

The package is approved and now available on the asset store.

Version 1.0.1 submitted.

• Added a ‘Reverse Waypoints’ function to the AITrafficWaypointRoute; this is useful to reduce configuration time when setting up multiple parallel lanes for opposite direction.

5332242--537258--ReverseWaypoints.gif

5332242--537261--ReverseWaypoints_.gif

2 Likes

Hi Sephen

it is great packages. good sales.

I have 2 question

  1. This asset is included
    Arcade Racer: Racing Game Development Kit
    asset?

  2. if it is not included is there a discount for who has arcade racer?

thanks in advance.

King regards.

That are completely unrelated assets, made by different devs.

If is not included in the description, simply don’t assume it is there.

1 Like

AR:RGDK is mine, but it’s unrelated to STS so there’s no discount. AR:RGDK does include a traffic system, if you haven’t seen the tutorials are here and here; the best place to ask about these would be in the AR:RGDK thread .

STS is a more optimized traffic system using only the required logic and variables with C# Jobs and Burst Compiler for a more simple and lightweight implementation.

1 Like

Ah it is indeed. Sorry. I looked before, and I had some vision blur I think :slight_smile:
I thought I have seen other name/icon.

1 Like

It’s all good, no worries :slight_smile:

I got tired of digging through all the waypoint routes and their points to manually connect routes, so I made an editor window that will load all routes from scene and provide handles in scene view to help make these connections.

5348589--540147--RouteConnector_Window.gif

1 Like

Version 1.0.2 submitted.

• Added ‘Tools > Simple Traffic System > Route Connector Window’. This draws handles in the scene view over route waypoints used to create route connections between waypoints without needing to manually select the gameobjects.

1 Like

I built a spline based tool to manage configuring multiple routes and waypoints for adjacent lanes much faster and efficient. Since it’s spline based, it works well for curved roads and inclines.

This helps automates much of the layout process to reduce the amount of work required to configure traffic lanes.

5359920--541935--Route Creator.gif

2 Likes

Version 1.0.3 submitted.

• Added spine based ‘Route Creator’ to create multiple AITrafficWaypointRoutes and generate their waypoints along a spline with offset for each. This allows for fast creation of routs and points and helps reduce the amount of work required compared to manually creating each route and waypoint on the routes.

3 Likes

Might I suggest some asset integration scripts? Might help get more buyers for your asset.

I’m pretty sure EasyRoads and RoadArchitect provided spline points, so you can automatically get them all and place the lanes. I believe the newest 3.3 beta of EasyRoads even has full AI lane data.

1 Like

Thanks for the suggestion, maybe I’ll check it out.