1 of 13

Traffic AI System

Documentation

2 of 13

How to use with Unreal Engine 5 - Chaos Vehicle

3 of 13

Tutorial 1: How to use

Note: If you are using Unreal Engine 5, you need to enable “Chaos Vehicle” plugin first!

4 of 13

Tutorial 2: How to use

5 of 13

Tutorial 3: How to add custom mesh (UE 4)

6 of 13

Tutorial 4: How to integrate Traffic AI System with

custom vehicle system

7 of 13

Tutorial 5: 1.1 Update feature highlights

8 of 13

Tutorial 6: 1.2 Update feature highlights

9 of 13

Changelog 1.1 (07.09.2021)

Changes:

  • Improved behaviour at higher speeds
  • Vehicles can now pass obstacles at intersections
  • Passing obstacles is more smooth now
  • Vehicles placed in the world in editor will now be set to “Park” mode
  • In previous version overlapping vehicles (while far from player, not simulating physics and with disabled collisions) was destroyed when they started to simulate physics again to avoid shooting cars in the air. In 1.1 update overlapping vehicles will move away from the vehicle they are overlapping.
  • Changed method of setting car mode. Now there is special event to do that. It will set up everything automatically.
  • Changed a way of determining if the road is jammed
  • Cars are generating “Hit” and “Overlap” events in Traffic Car Component now.

New features:

  • Added “Navigate to point” event, where car can automatically find a way to the target.
  • Added “Follow target” mode when navigating to the point. In this mode, car can follow moving targets.
  • Cars can now change lanes
  • Added “OnAccident” event with some behaviours.
    • Stop on a side of the road
    • Stop
    • Run away
    • Car can also enable hazard lights now
  • Car can now be set to “Speeding” mode where it will ignore speed limit, try to pass all vehicles and ignore traffic lights
  • Cars can now honk when they detect specified actors in front of them

10 of 13

Changelog 1.2 (23.12.2021)

Changes:

  • Roads and traffic lights update rate is much slower when they are very far from the camera.
  • Traffic Path collision is set to “Query Only” now
  • “Static mesh” as a vehicle root component will no longer cause errors with “Appearance component”
  • “Class probability to spawn” variable (located in “BP_Traffic_Path_50_Parent” blueprint) is now deprecated. Probability of spawning a car can be set in “Spawn Cars” variable.
  • Car lights textures are now parameters
  • Improved car spawn visibility (multiple line traces that are checking if car is spawning behind an obstacle)
  • Improved car behaviour when passing obstacles near intersections
  • Cars can now spawn near the player and in camera view in the first frame of the game
  • Movement will be smoother when parked cars start driving
  • Cars will now reverse and park much more smoothly when they are not simulating physics

New features:

  • Basic visual damage system
  • Openable doors
  • Cars can now be dirty
  • Spawn queue for spawning specific vehicles nearby
  • “Validate references” checkbox/button on traffic paths that will check if references to traffic lights and other roads in all roads are valid
  • 4-way and 3-way stop intersection
  • “Predefined Path” AI mode that allows vehicles to follow a specific path
  • Traffic lights can be toggled manually now

New content:

  • Stop sign mesh
  • Dirtiness mask texture

Please watch the 1.2 feature highlights for information on how to use new features. (also coming soon)

1.2.1

  • Cars will now despawn when “Next Roads” is empty

1.2.2 UE4

  • Parts of “Construction Script” that was using “Get All Actors of class” node was moved to “Begin Play” due to issues it could potentially cause. The modified blueprints are: Traffic Path, Parked Car and Traffic Light.
  • Added support for Cine Camera location tracking for spawning vehicles.. You can change it in “BP_Traffic_Path_50_Parent” blueprint”.
  • You can now use a debug sphere to see if the spawning center location is correct. Click here for more information.

11 of 13

Changelog 1.2.1 UE5 (21.04.2022)

Changes:

  • Unreal Engine 5 support
  • Traffic AI System uses “Chaos Vehicle” plugin now. You need to enable it in “Plugins” window
  • New “Cine Camera” location tracking for spawning the traffic

Please watch the “How to use with Unreal Engine 5 - Chaos Vehicle” video for more detailed informations

1.2.2 UE5

  • Parts of “Construction Script” that was using “Get All Actors of class” node was moved to “Begin Play” due to issues it could potentially cause. The modified blueprints are: Traffic Path, Parked Car and Traffic Light.

12 of 13

Changelog 1.2.4 UE5 (17.08.2023)

Changes:

  • “Car Size” variable can now be set manually for each vehicle. This may be helpful for some custom meshes/vehicle systems.

  • You can debug this variable using new “Debug Car Size” variable located in the “BP_Traffic_Car_Component”. It shows green outline around vehicles The outline needs to have the same size as the car.

  • It is now possible to visualize the zone around the camera where vehicles simulate physics. To do this, go to “BP_Traffic_Path_50_Parent” and set “Debug disable physics distance” to true.

  • Vehicles had problems with stopping on steep uphill slopes. This issue is now fixed. Vehicles will stop even on very steep road.

  • Vehicles add more throttle when going uphill and apply more brake when going downhill.

  • Pedestrian traffic light had green light up and red light down. This is now fixed.

  • Assigning “Right side road” and “Left turn road” automatically for Left-hand traffic works correctly now

  • Some other small tweaks to make traffic more stable

13 of 13

Traffic AI System

If you have any questions, suggestions or any problem with Traffic AI System, please contact me at my email address.

lament.przemyslaw@gmail.com