Version 0.0.25 Released!


This update continues to focus on the AI of the game.  This time we shift focus back to the traffic NPCs. 

Summary

  • Traffic are more aware of vehicles around them and adjust speed accordingly
  • Fixed traffic always turn right on red
  • Improved turning accuracy on right turns slowing down better to negotiate the turn
  • Reduce aggressive traffic collisions with other cars.  Traffic NPCs will occasionally still ram (and continue to ram) other cars but it happens less frequently now.
  • Traffic yields to oncoming vehicles while making left turns
  • Traffic will attempt to change lanes around upcoming traffic jams if it is safe to do so
  • Traffic will attempt to go around disabled vehicles when stuck in a traffic jam for an extended period.   Often they will back up and attempt to go around. This uses an existing system for "getting unstuck" so sometimes it has hilarious results.
  • Traffic will change lanes organically over the course of their routes.
  • Upgraded Unreal Engine version used from 5.1.0 to 5.1.1.


Update Details

Lane Changes

As we can see from the footage above, the traffic vehicle is moving along the waypoints set up by the spline movement system.  Using the existing perception system integration, it sees a line of cars ahead.  It computes the average speed of those cars relative to its current speed and based on a threshold decides that it is best to change lanes to go around.  In this case the cars are not moving so the check obviously passes.  When determining if a lane change is viable, it is scanning the cars that exist up ahead in that lane.  If there were cars in its direct path then the lane change check would fail, and the car would be forced to stop.  In this case though the lane is clear so it picks the adjacent lane and starts moving along it.  In order to make a smooth transition, the distance up ahead is configured to be several car lengths (currently 10) as that experimentally resulted in a smooth transition.


Left Turn

In above image, we can see that the blue hatchback car is approaching the player on opposite side of road and wants to make a left turn.  It detects that the player is heading toward it in an oncoming lane at a speed that will prevent that car from being able to clear the turn without a collision or impeding the oncoming car.  The blue car decides it is best to stop and wait for the car to pass before continuing on its turn.  We can see from the image though that the blue car is violating a best practice of keeping the wheels straight before starting a turn.  This wheels turning issue can be fixed in a future update.

Get Police Chase Simulator

Leave a comment

Log in with itch.io to leave a comment.