![]() |
VR-Forces Developer's Guide
|
The Database Logger allows developers to save data to an SQL database. The built-in implementation outputs data to an SQLite database file. However, an example plugin, databaseConnection, implements a connection to a MySQL database server. This example could serve as a starting point for developing further database connection implementations.
To enable database logging, you must configure it in ./appData/settings/databaseConfig.mtl. This file is commented to indicate what each parameter does. The key parameters to set for basic functionality are database-logger-type and database-connection-type.
Once configured, the next time you start VR-Forces it will automatically begin writing the the configured SQLite file or connecting and outputting to the configured MySQL server.
VR-Forces outputs a number of tables of data by default. Each table corresponds to some event in the simulation. Some events are written for EntityLevel simulations, others for AggregateLevel simulations, and some are valid for both. For a full list of the default database events, please refer to VR-Forces Database Events.
Developers can also add their own database events. There are two ways to do this.
VR-Forces does not provide any out-of-the-box reading or analysis tools for database logging. SQLite and MySQL both have many existing tools available for general database browsing. If you wish to perform specific analysis of the data, VR-Forces provides several simple example Python scripts. Please refer to the databaseClients examples for more information.
The following is a list of the important classes in the sim engine for performing database logging. Please see the documentation on these classes for further details.