Road & Traffic System

Website
Webplayer

BUY NOW!

If you need support email us at:
support at wireddevelopments dot com
as we do not monitor these forums. Also check the website link above for all tutorials and documentation on this plugin.

Road & Traffic System is a plugin designed for Unity to allow users to quickly create and simulate small or large dynamic traffic networks for any kind of vehicles via placement of different road pieces and traffic lights.

The system is very customizable with an integrated Unity Editor toolkit.

Users have the ability to customize their own road pieces and extend on the base road pieces and traffic lights available to them in the Road & Traffic System.

Full customization for vehicle pathing, chance to change lanes, chance to turn, vehicle detection, intersection detection, acceleration, velocity and much more.

Full instructions, videos and tutorials on how to use and customise the Road and Traffic System!

The website is up so you can read a lot more on the system here. We will be updating frequently and video tutorials will also flow fairly regularly so stay visit often to get all the info on Road & Traffic System for Unity3D.

The first of many videos has been uploaded and you can find it on the website and also right here!

  1. How to get started! - Spawn and Link Road Pieces, Create a Loop and Spawn Traffic
  1. How to create a loop
  1. How to create a T Intersection
  1. How to create a 4 Way Intersection
  1. How to create Traffic Lights

Unfortunately we can only show 5 videos in this blog entry… please check out this video on the documentation section of the Road & Traffic System here. Additional videos include:

    1. How to Spawn Vehicles
    1. How to Scale the Traffic System ( Road Pieces )
    1. How to setup your own vehicles
    1. How to create highways
    1. How to create highway off-ramps
    1. How to change the appearance of your road
    1. How to switch the direction of road pieces and individual lanes
    1. How to link opposite lanes together
    1. How to create a custom road piece

Check out the Webplayer here

Also available is the Android Demo, download here
(identical to the Webplayer but you can see it running on your device!)















Updates

Version 2.0.1

  • Traffic Lights now have arrows for all turning lanes
  • Slight variation in lane position, so cars don’t follow each other exactly on the same line
  • Slight variation of speed in cars, so cars don’t move at exactly the same speed behind each other
  • Cars now have the option to automatically check at intersections to make sure the intersection is clear. It was set to true by default to allow for tight road networks to function properly but we have created an option for this in the TrafficSystemIntersection.cs script (check/uncheck “Ignore Can Fit Across Intersection Check”) to relax this check as users might not need it.
  • Cars will randomly enter an intersection on yellow to provide additional realistic simulation
  • A TrafficSystemCameraFollow.cs class is added to provide customisable camera following functionality so users can attach a camera to any spawned vehicle and toggle through them to follow the vehicle. (current keys to toggle are ‘,’ or ‘.’ or you can click on a vehicle in the scene to follow it, provided the script is in your current scene.
  • A TrafficSystemVehiclePlayerAuto.cs script is added to allow users to control an AI car with directions on where the car should go when it gets to multiple directions… Google wanted this one :wink:

Version 2.0

  • ALL NEW road pieces in High Detail and Mobile Detail!
  • Roundabouts are here for 2, 4 and 6 Lanes!
  • New 2, 4 and 6 Lane corner road pieces with realistic curves.
  • AI car braking now has progressive slow down and accelerate.
  • You can enable all car front lights instantly. Perfect for night scenes. Just call the function “TrafficSystem.Instance.SetAllVehicleFrontLights( true/false )” found in the TrafficSystem.cs script
  • Road Pieces now have speed limits so vehicles can determine what speed they should be doing at certain locations on your road network. If a speed limit isn’t given to a certain set of road pieces than the global “TrafficSystem.cs” m_globalSpeedLimit is used. Like everything, this can be enabled and disabled per vehicle prefab so you are not bound to using this for all or individual vehicles.
  • Reveal buttons for all links so you can display all links before connecting them (makes development of road networks very easy!)
  • All (T and Cross) Intersections and Roundabouts are fully constructed for you in 2, 4 and 6 Lane Prefabs, just drop and use!
  • Fix for collision causing cars to spin at one position constantly. This is caused by the collider of the vehicle coming in contact with the collider on the ground. All cases can be sorted by setting the “Offset Pos Val” of a vehicle “under” the lowest point of the vehicle so that the vehicle collider never really comes in contact with the ground while still looks like it is driving on the road. There is a nice little yellow square representing the Offset Pos Val in the editor now to make things super easy to tune.
  • Many more smaller improvements to help with road network construction and custom vehicle construction.

Version 1.0.10

  • AI car braking now has progressive slow down and accelerate.
  • You can enable all car front lights instantly. Perfect for night scenes. Just call the function “TrafficSystem.Instance.SetAllVehicleFrontLights( true/false )” found in the TrafficSystem.cs script
  • Road Pieces now have speed limits so vehicles can determine what speed they should be doing at certain locations on your road network. If a speed limit isn’t given to a certain set of road pieces than the global “TrafficSystem.cs” m_globalSpeedLimit is used. Like everything, this can be enabled and disabled per vehicle prefab so you are not bound to using this for all or individual vehicles.
  • Fix for collision causing cars to spin at one position constantly. This is caused by the collider of the vehicle coming in contact with the collider on the ground. All cases can be sorted by setting the “Offset Pos Val” of a vehicle “under” the lowest point of the vehicle so that the vehicle collider never really comes in contact with the ground while still looks like it is driving on the road. There is a nice little yellow square representing the Offset Pos Val in the editor now to make things super easy to tune.

Version 1.0.9

  • Spawn random vehicles on startup. Just slide the custom editor to fill 1% to 100% of your road network on startup!
  • Option to kill the vehicle when they have no path (TrafficSystemVehicle.cs)
  • Wheel rotation now has a multiplier that users can tweak so wheel rotation speeds are correct for larger or smaller wheels.
  • Front headlights added.
  • Vehicles fitted with Audio Source and engine sounds + horn sounds (new audio clips)
  • Option to activate flashing lights and horn on AI vehicle crash
  • Crash collision fixed (TrafficSystemVehicle.cs)
  • Spawners now pool the total amount of vehicles to be spawned on initial run-time so there is no overhead of Instantiation during gameplay (TrafficSystemVehicle.cs)
  • Pathing bugs fixed for larger vehicles.
  • New Offset Pos Val on TrafficSystemVehicle.cs script with yellow visual indicator to determine how far off the ground a vehicle should be pathing.

As always we appreciate the feedback!

I will do the next GTA with this asset :smile:

New website is up and the first of many tutorial videos too (edit in original post)… many more video tutorials to come to make sure the system is as simple and understandable as possible!

Do you have an estimate on how much it will cost???

$50 was the ballpark we were looking at.

Does this come with pathfinding abilities, e.g. telling a vehicle to drive to a specified/the nearest node of a certain type?

And could this be applied to railroads as well?

I really like this.It is a great idea.

The current version gives you the ability to create the road network, traffic light network and allows vehicles to traverse the network to simulate small, medium or large traffic system (on mobile too as the overhead is very small). Currently the support to tell a vehicle to go from X road piece node to Y road piece node doesn’t exist but it is on the feature list after release.

The system is very customisable so you can make any kind of pieces for sure (video of “How to create a custom road piece” now on the website), we just chose road because that is what we needed but rail pieces would work fine too.

Second video added to show how you create a loop.
“2. How to create a loop” → can be found in the original post above or you can view this on the official “Road & Traffic System” website under the documentation page: http://wireddevelopments.com/trafficsystem/documentation.php

We are trying to keep this system as simple as possible and steer away from a complex user experience with the tools. Few clicks here and there is as far as we want the user to have to strain their brain… hopefully we are managing to provide this simplistic outcome for you guys.

There are some complex functionality demos to come but we hope to keep the user interaction part of it simple to achieve the complex result. Also keep in mind we are still very focused on making sure this runs super fast on mobile - that is one of our biggest goals as there are some solutions to road and traffic out there but none that really cater to mobile that we have found. Interested to hear some that are aimed at mobile?

Here is a suggestion for later development.You need to have each car start at particular place and have them randomly select the times that they start.To make it look real.

You can already do this. We have a prefab you can place (multiple times obviously) anywhere in the world. Once placed, you select the node that you want it start spawning random vehicles at with a bunch of different randomised options, like vehicle random min / max velocity, delay between each spawn, and also does sanity checks to make sure there is room to spawn a vehicle in the first place.

The Road & Traffic System - Android Demo is now available for you to test out on your mobile device. Additional options included such as Shadows (on and off) and FPS counter to make sure you’re happy with the systems mobile performance before considering if it is right for your traffic system needs!

Android Demo can be found on our website, in the original post above or here

Third and Fourth video added to show how you create a T Intersection and a 4 Way Intersection.
“3. How to create a T Intersection” & “4. How to create a 4 Way Intersection” → again, can be found in the original post above or you can view this on the official “Road & Traffic System” website under the documentation page: http://wireddevelopments.com/trafficsystem/documentation.php

We are always improving our systems to be as simple as possible, please give us some feedback on whether you understanding the creation of a T Intersection from the video tutorial?

The video for spawning vehicles with the Traffic System Vehicle Spawner is up → “6. How to Spawn Vehicles”
Unfortunately we can only show 5 videos in this blog entry… please check out this video on the documentation section of the Road & Traffic System here

The video for scaling the Traffic System ( Road Pieces ) to simply fit your existing scene layout / scale is up → “7. How to Scale the Traffic System ( Road Pieces )”. Check out this video on the documentation section of the Road & Traffic System here

The video for adding your own vehicles into the Traffic System is up → “8. How to setup your own vehicles”. Check out this video on the documentation section of the Road & Traffic System here

The video for creating highways in the Traffic System is up → “9. How to create highways”. Check out this video on the documentation section of the Road & Traffic System here

The video for creating highway off-ramps in the Traffic System is up → “10. How to create highway off-ramps”. Check out this video on the documentation section of the Road & Traffic System here

The video for customizing the appearance of your road in the Traffic System is up → “11. How to change the appearance of your road”. Check out this video on the documentation section of the Road & Traffic System here

The videos for switch lane direction and linking opposite lanes together in the Traffic System are up → “12. How to switch the direction of road pieces and individual lanes” and “13. How to link opposite lanes together”. Check out these videos on the documentation section of the Road & Traffic System here