The purpose of this extension is to facilitate logging of vehicle specific stats. The stats are organized in five modules:
*.csv
files in the output directory.The Vehicle Stats Logger is usable either via the Lua API or as a UI app.
Note : The interested user can find more on the extensions here .
startLogging()
Starts the logging. Beware that any data in the output directory from previous logging sessions may be overwritten. To minimize the impact on the game’s performance, the logger collects stats and flushes the information periodically to the output files.
stopLogging()
Flushes any remaining data to the output files and stops logging.
applySettingsFromJSON(fpath)
Updates the the settings as specified in the given json file. The file is expected to be in
the following location:
C:\Users\<Your username>\AppData\Local\BeamNG.[drive,research]\<version number>\[fpath]
writeSettingsToJSON(fpath)
Writes all available setings to a json file. The purpose of this functionality is to facilitate the acquisition of a valid template to adjust the options as needed. Depending on the executable used, the file can be found at the following location:
C:\Users\<Your username>\AppData\Local\BeamNG.[drive,research]\<version number>\[fpath]
The user can launch the Lua API and load the extension with
extensions.load("vehicleStatsLogger")
as in :
Lua API.
Then type
vehicleStatsLogger.startLogging()
to start data collection and
vehicleStatsLogger.stopLogging()
to end it.
The data is saved in C:\Users\<Your username>\AppData\Local\BeamNG.[drive,research]\<version number>\VSL
.
It is also possible to modify some settings directly through the modules variables. The module’s settings are structured as follows:
settings = {
outputDir = "VSL",
updatePeriod = 5,
useModule = {
Engine = true,
General = true,
Inputs = true,
Powertrain = true,
Wheels = true
},
...
}
Thus, it is possible to quickly adjust the overall settings without using a json file for the respective vehicle:
extensions.vehicleStatsLogger.settings.outputDir = "VehicleNo7895"
extensions.vehicleStatsLogger.settings.updatePeriod = 10
extensions.vehicleStatsLogger.settings.useModule.Wheels = false
As this is an extension on the vehicle side, the above code examples needs to be executed in a vehicle’s lua VM.
Alternative to loading the extension manually, we also provide an app that supports the functionalities presented above. It is called Log Vehicle Stats (research) and can be found among BeamNG’s default apps.
UI App