Scenario Guide:
First, let us introduce the concept of the ‘Scenario Guide’. This is an implicit playback mode, which differs from the actual execution of the scenario in that no actual vehicles move. Instead, Vehicle Guide Boxes are used to represent the position of the vehicles. The idea is to give the user an accurate idea of where the vehicles will be at given times, in order to create cue-points on trajectories and enter the detail required for the final scenario execution.
The Scenario Guide can be thought of as a way to audition certain portions of the time interval to get an approximation of what will happen in the actual execution of the scenario (where all the vehicles move together, in time).
The vehicle Guide Boxes (black wireframe cuboids) take on the length, width, and height dimensions of the vehicle which they represent. For example, a car will have a fairly small box, whereas a bus will have a very long box. This allows the user to know not just where the front of the vehicle will be at a given time, but also the back and sides, which is useful for scripting tight scenarios such as where vehicles move in behind other vehicles.
Note: BeamNG is limited by the number of vehicles which can be executed at the same time, a number which depends on the user’s hardware performance. However, there can be many more trajectories than this which are active in the scenario guide, since it is computationally cheap. One example where this may be useful, would be if third-party software such as Eclipse Sumo was used to generate a lot of traffic on a road network (eg 300 vehicle trajectories) then this was imported to BeamNG (not currently supported). In such a case, the user cannot execute all 300 vehicles at one time due to hardware restrictions, but using the Scenario Guide, they can audition all of these trajectories and choose the ones which produce interesting results, so that they take a number which is under the vehicle limit of the simulation.
Tool Window:
A marked-up illustration of the ScriptAI Editor’s main tool window is shown below. This is the window which first appears when the ScriptAI Editor mode is selected in the World Editor.
The purpose of this window is twofold; first, to offer a main hub from which to access all the sub-components of the ScriptAI Editor, but also to manage the global properties of the scene, such as time-transport and global flags.
From here, the ScriptAI Editor sub windows can be opened or closed.
Note: Hovering over any part of the tool window will also reveal a tool-tip, to provide some help.
Scene Time Slider:
The entirety of the top row of the tool window comprises the Scene Time Slider. When vehicle trajectories are loaded into the scene, the slider text will display the scene time interval in [start, end] format, and also the current time (to the left of the forward slash). Times are all in seconds.
The slider position corresponds to the current time, and can be dragged anywhere in the interval, as required.
The scene time is used to represent the Scenario Guide (when the scenario is not being executed), or is used to represent the actual scenario time (when it is being executed).
Time-Transport Control:
Directly below the center of the Scene Time Slider, we find the Time-Transport Controls. These are buttons which allow for real-time playback of the scenario guide, along with rewind and fast-forward. If the scenario guide is currently playing, the ‘Play’ button will change to ‘Stop’ to allow stopping of the playback.
Playback can also be looped by checking the ‘Loop’ checkbox to the right of the Time-Transport buttons. If looping is enabled, then when the end of the scene time interval has been reached, playback will commence from the start (time = 0s).
Vehicles Window:
The first of three sub-windows. This button toggles whether or not the Vehicles sub-window is open. If the window is open - the button will appear grey. If closed, it will appear white.
Contained in this sub-window is a list of all the currently-loaded vehicles. For more information, see the Vehicles Window page of this documentation.
Trajectory List Window:
The second of three sub-windows. This button toggles whether or not the Trajectory List sub-window is open. Again, if the window is open - the button will appear grey. If closed, it will appear white.
Contained in this sub-window is a list of all the currently-loaded vehicle trajectories. For more information, see the Trajectory List Window page of this documentation.
Camera Path Window:
The third of three sub-windows. This button toggles whether or not the Camera Path sub-window is open. Again, if the window is open - the button will appear grey. If closed, it will appear white.
Contained in this sub-window is information about the (optional) camera path trajectory, which executes alongside the scenario upon final execution. For more information, see the Camera Path Window page of this documentation.
Execute Scene:
This button will execute the full scenario; all vehicles linked to trajectories will move, and the camera path trajectory will be followed. Upon execution, the button graphic changes to ‘Stop Execution’. Pressing this will simple stop the execution and go back to the main editor mode.
Depending on the trajectory editing which is done, the button graphic may appear as a stopwatch. This means that there is at least one vehicle-linked trajectory which has a start time which is less than zero. The scenario cannot be executed like this, so pressing the stopwatch button will normalize all trajectory times such that the earliest time will be time = 0s. All of the details which the user programmed into the scenario will be kept (it will just be moved to a different relative time).
The Execute button will only be visible if there is at least one vehicle-linked trajectory, thus making the scene interval non-zero. Otherwise, there is nothing to be executed.
Note: Depending upon which options are selected, some of the editor display graphics may or may not be visible during execution. For a completely clear view of the scenario, such as for recording purposes, the ScriptAI Editor toolbar (and other windows) can be moved outside the simulation window or to another screen.
Overlay:
This checkbox is used to overlay other vehicle-linked trajectories during recording. If this is checked, then a new vehicle trajectory is recorded, all of the other trajectories in the session (which are linked to vehicles) will also execute. This allows the user to manually see where the other cars will be, as they drive. If this is not checked, no other vehicle trajectories are executed during recording.
For example, let us say we record a vehicle travelling along a highway. Then we want to record a second vehicle come alongside this vehicle and move into the same lane as the first vehicle, just in front of it. To do this, it is easier to know where the first vehicle is during the recording of the second vehicle. The overlay feature is ideal in such circumstances.
Display:
This checkbox is used to keep the ScriptAI Editor graphics (the trajectory lines, etc) when a scenario is being executed. If the checkbox is checked, the graphics will be visible during execution. If it is not checked, they will disapear during execution, then re-appear when execution has been completed (when the time transport has reached the end of the scenario interval on the Tool Window).
File Options:
These two buttons are used to save and load ScriptAI Editor sessions. The ‘Save’ icon will only be visible if there is information to save (such as a created vehicle trajectory). When clicking these buttons, a file dialog will open allowing the user to pick and choose where to save/ from where to load the .json file with the session data.
The session data includes three components:
i) All the vehicles loaded into the scene (including their part configuration data).
ii) All trajectory information which is loaded (everything in the Trajectory List window).
iii) The Camera Path Trajectory information.