Waypoint Priority Setup

In the Mobile Traffic System, vehicles are continuously spawned around the player, while those far away are removed to maintain vehicle density around the player.

For instance, to distinguish between a highway and a secondary road, the priority property was introduced for each waypoint. This feature enables highways to have a higher vehicle density compared to secondary roads.

Priority Setup

Select a waypoint within the scene and adjust the Spawn priority property for it.

Pressing the Set Priority button will apply that priority to all its neighboring waypoints that do not already have a priority assigned.

For instance, if you select a waypoint at the beginning of a highway and set the priority to 10, that priority value of 10 will be conveyed throughout the entire highway and adjacent roads.

At the end of the highway, select a waypoint and reset the priority back to 1. This ensures that your highway maintains a priority of 10 while the remaining roads retain a priority of 1.

How does the priority work

Priority plays a crucial role in the selection of a waypoint for spawning a vehicle. When multiple waypoints exist with a priority of 1, each of them has an equal chance of being selected, 1/10 if there are 10 waypoints.

Comparatively, if there's a waypoint with a priority of 10 and another with a priority of 1, the waypoint with a priority of 10 will be chosen approximately 10 times more frequently than the one with a priority of 1.

Therefore, increasing the priority property significantly heightens the chances of a waypoint being randomly selected for vehicle spawning on top of it.

Priority Visualization

To visualize the priority setup across the entire scene, navigate to the Settings Window -> Waypoint Priority Setup. The visualization tool will then open, facilitating the visualization of the priority configuration.

In the following image, roads marked in blue have a priority of 1, while the highway has a priority of 10. This indicates that, theoretically, the highway will be 10 times more populated than the adjacent roads.

To create the following example, assign a higher priority for each highway lane at the beginning, and reset the priority back to 1 at the end of each highway lane.

Last updated