NPC Vehicles
Placing NPC Vehicles
NPC Vehicles are vehicle models that automatically drive around the scene using a combination of internal driving algorithms and the map data of the currently loaded location. They allow the user to design different scenarios around the ego-vehicle.
Navigate to Edit >> Scenario >> Scenario Edit Mode from the main menu bar. Once in Scenario Edit Mode, the simulator will by default automatically enter placement mode.
Choose the desired type of vehicle from the selection list window, then use Shift + Left Click along a road to place an NPC vehicle.
Alt + Left Click will delete a placed vehicle from the simulation scene.
Different View Modes
By default once Scenario Edit Mode is activated, the simulator screen will shift to Perspective View Mode. The main scene camera is no longer fixed to the ego-vehicle, allowing the user to rotate and move to different parts of the map. Use the WASD keys and the mouse (right-click) to move.
Read more about different camera view modes such as the Top-Down View Mode here.
NPC Vehicle Settings
Once an NPC vehicle has been placed, a separate Object Setting window should appear below the Object List window. When multiple vehicles have been placed, you can switch between vehicles by clicking on a vehicle within the simulation scene.
Closed Loop: Sets a closed-loop path so that the NPC vehicle continuously drives along a looped course.
Desired Velocity: Sets the velocity the spawned vehicle will move at.
Link: Vehicle speed is set to a percentage of a road’s speed limit.
Custom: Vehicle speed can be set explicitly to a user-specified speed. (units in km/h)
Path Mode: Sets how the NPC vehicle moves around the map.
Fixed: Automatically enters this mode when a destination node has been set.
Random: No destination has been fixed and the vehicle will randomly choose a lane at each intersection until it reaches a sink node.
Current Link Index: Shows the link ID the NPC vehicle is traveling along.
Target Link Index: Shows the link ID the NPC vehicle will reach next.
Path Offset: Sets how the NPC vehicle drives along its lane. A path offset of 0 indicates the vehicle will follow the lane centerline.

Setting a Destination for NPC Vehicles
By default, all NPC vehicles in MORAI SIM will randomly search for viable paths for each map. However, this does not allow for the user to accurately control NPC vehicle behavior.
To set a destination for an NPC vehicle, while in Scenario Edit Mode,
Select an NPC vehicle (confirm the desired vehicle is properly selected by checking the Object Setting window)
While the vehicle is selected, Ctrl + Left Click at a desired destination point.
If a valid path can be made from the vehicle’s current location, a red sphere will be placed at the clicked location.
Else a number of error messages will be displayed on the screen.
Press the Escape button to exit Scenario Edit Mode - the NPC vehicle should immediately start to drive towards the destination.