|
VR-Engage
2.3
|
This page describes the installed toolkit examples build, not the developer-tree build. Use the scripts and CMake files supplied with the matching toolkit.
Use Visual Studio 2022 with the C++ desktop workload, MSVC v143, and x64 support. The maintained solution-generation script selects the "Visual Studio 17 2022" generator; that generator uses v143 by default. CMake must be available on the command-line PATH.
Use CMake 3.21 or newer for this Visual Studio generator, as documented in the CMake Visual Studio 2022 generator reference. The example scripts' older CMake 3.16 prerequisite comment does not account for the selected generator. The examples CMake project selects C++14 and the RelWithDebInfo configuration. The root developer-tree CMake project has its own requirements; do not substitute this examples workflow for it.
Install compatible VR-Engage, VR-Forces, VR-Link, MAK RTI, and Qt development packages. Headers alone are insufficient: the examples also use toolkit libraries and runtime dependencies. Keep SDK versions and architecture consistent with the VR-Engage installation being extended.
The CIGI toolkit is optional for the general examples solution, but is needed when building the CIGI Host Extension example. The generator enables/disables that group through BUILD_CIGI_EXAMPLES.
The solution-generation script validates MAK_VRFDIR, MAK_VRLDIR, MAK_RTIDIR, and QTDIR. MAK_CIGIDIR is optional; its availability controls the CIGI examples option. examples/CMakeLists.txt computes MAK_VREDIR from the parent of the examples directory.
Edit examples/setupEnv.bat for the actual compatible installations. Its shipped paths are template values, not recommended versions for every VR-Engage release. The generation script calls that file when present; otherwise it uses the existing environment. CMake caches the dependency paths, so review the cache when changing installations.
| Variable | Purpose |
|---|---|
MAK_VRFDIR | VR-Forces development installation |
MAK_VRLDIR | VR-Link development installation |
MAK_RTIDIR | MAK RTI development installation |
QTDIR | Qt development installation used by the examples |
MAK_CIGIDIR | Optional CIGI development installation |
MAK_VREDIR | Computed by the examples CMake from its parent directory |
Run batch commands from a Windows command prompt, preferably a Visual Studio developer command prompt. The solution generator calls setupEnv.bat in its own command environment. Calling a batch file from PowerShell does not import its environment changes back into the PowerShell session.
Frontend plugins add Player Station components, UI, and input handling. Examples include notification, playerStateAttribute, and vehicleBlinkerFrontend. Simulation plugins add backend actuators, sensors, or other entity behavior. Examples include vehicleBlinkerSim and customProjectile. Shared libraries hold common messages or utilities used by their consumers. customPdu/commentMessage and entityDetection/entityDetectionShared show this pattern.
Frontend plugins normally install beneath plugins64/vrEngage/release. Simulation plugins normally install beneath plugins64/vrForces/release. Shared runtime libraries install to bin64. The exact output filename comes from each target's OUTPUT_NAME.
For example, the notification target produces exampleNotification, and the shared Comment target produces exampleCommentMessage. Do not look for unprefixed notification.dll or commentMessage.dll based only on the CMake target name. See Plugin Architecture for loader configuration and exports.
The maintained example output names and destinations include:
| Installed path, relative to the VR-Engage root | Contents |
|---|---|
bin64/exampleCommentMessage.dll | Shared Comment message library |
plugins64/vrEngage/release/exampleNotification.dll | Notification frontend module |
plugins64/vrEngage/release/exampleVehicleBlinkerFrontend.dll | Blinker frontend module |
plugins64/vrForces/release/exampleVehicleBlinkerSim.dll | Blinker simulation module |
plugins64/vrForces/release/exampleCustomProjectile.dll | Custom Projectile simulation module |
appData/plugins/ | Enabled simulation plugin records |
data/simulationModelSets/examples/ | Example model sets, roles, and input data |
These filenames come from the corresponding maintained target CMake files. A target name, output filename, and runtime plugin record are distinct things. The install destination does not automatically append the release subdirectory. VR-Vantage/network plugins can have additional protocol-specific destinations; use their project's own rules.
Locate the installed toolkit's examples directory and edit its setupEnv.bat. Set each variable to the compatible development installation on that machine. Do not copy another developer's paths or assume the template's product-version names match your release.
Before generation, confirm those paths contain the expected include, lib64, and runtime directories. The generator reports unset variables and nonexistent installation paths before invoking CMake. If MAK_CIGIDIR is absent or invalid, the CIGI example group is disabled rather than treated as a required dependency for every example.
From the installed toolkit's examples directory, run the maintained generator:
Source: examples/buildExampleSolution.bat. The script validates dependency directories, creates/enters build, and runs the Visual Studio CMake generator. The project name in examples/CMakeLists.txt is Examples, so the generated solution is examples\build\Examples.sln, not VR-Engage-Examples.sln.
Generation produces project files; it does not compile the examples. Re-run the script when changing the enabled example groups or adding/removing subdirectories. Keep the script's dependency checks rather than bypassing them with an unrelated developer-tree build.
build\Examples.sln in Visual Studio 2022.RelWithDebInfo configuration.The root examples CMake sets CMAKE_VS_INCLUDE_INSTALL_TO_DEFAULT_BUILD, so the default solution build includes the INSTALL project. Installation rules can reference every enabled target; do not assume a full install works when those outputs have never been built.
From the generated examples\build directory, the equivalent CMake commands are:
The first command compiles; the second executes the generated installation rules. Installation must be able to write to the toolkit directories selected by the project. Do not substitute Debug or assume the example solution exposes the developer tree's Unoptimized configuration: its CMAKE_CONFIGURATION_TYPES is explicitly RelWithDebInfo.
Use each target's actual CMake install destinations. For the notification module, the maintained rule is:
Confirm the deployed output matches the target's filename and directory. Frontend discovery uses the configured directory; backend loading also needs a valid enabled plugin record. The loader's current diagnostics use vreUtil/logger.h; do not assume a fixed log filename or directory independent of application logging configuration.
Check the target's actual OUTPUT_NAME, destination, and output timestamp. For a frontend module, confirm it is in the effective frontend plugin directory and exports the expected C-linkage hook. For a simulation module, confirm the applicable XML record is enabled and selects the installed DLL for the active configuration. Shared DLLs must be reachable by every consumer process.
Then exercise the example's documented scenario or role:
Building and copying a DLL does not by itself install the role, input files, UI assets, or plugin record. The example's README and CMake/data configuration specify those additional prerequisites.
examples/CMakeLists.txt defines VREngageDebug, VRForcesVREngageDISLocalhost, and VRForcesVREngageHLA. The first launches VR-Engage from its installation. The other targets use generated batch files under examples/batchFiles with matching exercise connection names. They are Visual Studio debugging targets, not DLL plugins.
| Shortcut | Launch and intended use |
|---|---|
VREngageDebug | VR-Engage from ${MAK_VREDIR}/bin64; useful for frontend/ownship examples |
VRForcesVREngageDISLocalhost | VR-Forces launcher and VR-Engage with "DIS (7) localhost" |
VRForcesVREngageHLA | VR-Forces launcher and VR-Engage with "HLA 1516 Evolved" |
The projects are grouped under Shortcuts in Solution Explorer. Right-click the desired project and select Debug > Start New Instance. They use VS_DEBUGGER_COMMAND and VS_DEBUGGER_WORKING_DIRECTORY; they are not new network configurations created by the plugin. The named exercise connections must exist in the compatible installed settings.
The actual VR-Engage-only target configuration is:
The DIS/HLA batch files launch the VR-Forces launcher and VR-Engage with the configured connection names. The names must exist in the installed connection settings.
Build the enabled example set once before relying on the whole INSTALL project. Its installation rules reference outputs from the enabled subprojects, including shared libraries. An unrelated enabled example that has never been built can therefore prevent a whole install from completing.
For Visual Studio, build the selected example project, then run INSTALL with the required enabled outputs present. For a command-line iteration from examples\build, use:
Related targets can be selected together:
The targets in these commands are defined by the maintained examples/CMakeLists.txt. The install command still runs the enabled installation rules; it is not automatically limited to the target named in the preceding build command.
Build the affected example target after source changes, then deploy its current output using the maintained installation workflow. A whole install still needs outputs from all enabled targets. Changing scripts, dependencies, or subdirectories can need CMake regeneration. Keep architecture, SDK versions, compiler toolset, and library configuration consistent.
Regenerate after changing CMake target definitions, dependency paths, or enabled subdirectories. Changing source within an existing target normally needs that target rebuilt rather than a new solution. If public interfaces or a shared library change, rebuild the affected consumers too. Use a clean rebuild when diagnosing stale binaries or incompatible cached configuration, not as a substitute for checking the actual dependency and installation paths.
Keep a representative role/scenario for the feature being changed, and deploy the matching data alongside the module. Check the installed DLL rather than only the build-directory copy when the application still appears to run old code. Keep diagnostics useful and bounded; the current LOG_* API is described in Toolkit Fundamentals.
The examples root coordinates the individual plugin projects:
Path under examples | Role |
|---|---|
CMakeLists.txt | Root project, dependency variables, subdirectories, and launch shortcuts |
utilities.cmake | Helper functions used by the subprojects |
setupEnv.bat | Machine-specific toolkit environment setup |
buildExampleSolution.bat | Windows solution generation |
batchFiles/vrfVreDISLocalhost.bat | Generated DIS launch shortcut |
batchFiles/vrfVreHLA.bat | Generated HLA launch shortcut |
notification/CMakeLists.txt | Maintained frontend module example |
vehicleBlinker/vehicleBlinkerSim/CMakeLists.txt | Maintained simulation module example |
customPdu/commentMessage/CMakeLists.txt | Maintained shared message library example |
The root examples/CMakeLists.txt includes examples/utilities.cmake and adds maintained example subdirectories. The utility file provides source collection, include/link-directory helpers, library linking, compiler definitions, message generation, and batch-file generation. It does not define libraries named vrEngageFramework or utilities.
For a new project, start from a maintained project of the same plugin type. Frontend examples include notification, qmlHud, and playerStateAttribute. Backend examples include vehicleBlinker/vehicleBlinkerSim and customProjectile. Shared-message examples include customPdu/commentMessage. Preserve their include roots, export definitions, dependencies, and installation configuration.
The generated DIS shortcut and its Visual Studio target are configured this way:
The surrounding file defines BATCH_FILES_DIR and builds disArguments from the VR-Forces and VR-Engage working directories and connection arguments. The HLA target follows the same pattern with its maintained HLA connection name. Retain the working-directory setup when adapting these shortcuts; relative runtime paths depend on it.
The notification example supplies actual startup properties:
The role/model-set data and registered component must also be installed. Selecting a model set does not guarantee that an arbitrary scenario or component is already available.
This enables Debug > Start New Instance on the example project with its own startup configuration. The actual argument string supplies a console request (-c), notification level (-n 3), and the playerStationApp.defaultSimulationModelSets override. The chosen model set is not an automatic replacement for the example's scenario/role prerequisites.
Use this approach when an example needs its own installed .sms file or application settings. For general debugging without example-specific startup properties, use the maintained shortcut targets. If adapting it, replace the model-set path with the project's actual installed data path.
Start with a project of the same extension type, not an empty generic library list:
| Extension | Maintained starting point | Key consideration |
|---|---|---|
| Frontend component | notification or playerStateAttribute | Creator registration, role data, frontend lifecycle |
| Simulation component | vehicleBlinker/vehicleBlinkerSim | Component/descriptor factories, system data, plugin record |
| Shared message library | customPdu/commentMessage | Export definitions, generation, consumer links and deployment |
| Frontend/backend messages | entityDetection | Shared schemas and both transport consumers |
Keep entry points lightweight and keep reusable runtime behavior in the appropriate library. See Plugin Architecture for current signatures, lifecycle, and ownership.
The existing projects provide the following conventions:
utilities.cmake from the root examples project.MODULE target for a plugin, or SHARED for a common runtime library.TARGET where the maintained helper calls use that variable.OUTPUT_NAME, IDE folder, and debugger properties independently of the target name.The notification project begins with:
Its include roots include ${MAK_VREDIR}/include/framework, ${MAK_VREDIR}/include/utilities, and the role/common-role include areas it uses. These make includes such as vrePlayerStation/playerStationApp.h resolvable. Its actual link list is:
Use the full maintained file when adapting the target; these excerpts are not a complete build definition. The helper names are CMake functions, not libraries to link as utilities or vrEngageFramework.
Create its subdirectory and CMake file, then add it to the root examples project's subdirectory list. The maintained root already includes:
Add the equivalent entry for the actual new directory and re-run the generator. Keep private additions separate from the stock examples when maintaining a customer project. Do not re-enable retired examples merely because their source directory remains in the repository.
generateMessages() is defined in examples/utilities.cmake. Its six required parameters are target, schema directory, namespace, export macro, export header, and generated-header include prefix. Optional arguments choose header/source output directories. Use the existing helper; do not manually edit generated message headers.
The maintained Comment library invokes it as follows:
The same CMake file creates target commentMessage, sets output name exampleCommentMessage, collects generated/source files, and applies COMMENTMESSAGE_EXPORTS.
| Parameter | Meaning |
|---|---|
target | Target whose source list receives the generated files |
path | Directory searched for message-schema .lua files |
namespace | Generated C++ namespace, makVre in the maintained examples |
exportMacro | Macro applied to generated public declarations |
exportInclude | Header defining that export/import macro |
headerIncPath | Include prefix passed to the code generator |
Optional headerPath | Generated-header output directory; defaults to path |
Optional sourcePath | Generated-source output directory; defaults to path |
The helper checks MESSAGE_CODE_GEN and the schema directory's files. It discovers generated outputs and supplies a regeneration command for the schema dependencies. Inspect its warnings when the generator is missing or fails; a skipped generation step is not proof that the expected message header exists.
The following is the maintained Comment target, with only comments and a status print removed. It retains source collection, include/link roots, dependencies, export definitions, and installation:
Its export header supplies the matching macro:
Each schema's fileName identifies its generated header and C++ source. For comment.lua, those files are commentMessage.h and commentMessage.cpp; its className produces makVre::CommentMessage. Generated messages provide create(), typed field accessors, serialization/deserialization, and message-factory registration. The standard generated interface also exposes theType(), theId(), createFromData(), and getData().
Consumers include the generated header and link the message library. For example, the Comment network connector uses the generated sender, receiver, and comment accessors when converting a message to a VR-Link Comment interaction. The shared schema does not automatically send that interaction; the connector supplies the transport.
If a generated header is absent in a clean source tree, verify the generator and schema step before adding handwritten replacements. The generated definitions are derived files; change the Lua schema and regenerate rather than editing an accessor or serialized layout in its .h/.cpp.
See Custom PDU for the message library and network consumer, and Entity Detection for a shared library with frontend/backend consumers.
The root examples CMake searches compatible toolkit bin64 directories for messageCodeGen-cxx. The helper reports missing generator/schema files. Generation is performed by the configured workflow, not by declaring a class in guide prose. See Inter-Process Communication for the real Lua schema.
The root examples project reads and caches the toolkit variables listed under prerequisites. MAK_VREDIR is computed from the examples location; the others come from the environment. Review the cached values when switching toolkit installations.
The Visual Studio generator is multi-configuration. The project forces CMAKE_CONFIGURATION_TYPES to RelWithDebInfo; setting CMAKE_BUILD_TYPE in the shell is not a substitute for selecting that Visual Studio configuration or supplying --config RelWithDebInfo.
Check validated dependency directories and cached paths when CMake cannot find headers/libraries. The generator's preflight checks distinguish an unset variable from a directory that does not exist. Check the setupEnv.bat beside the generator, then the CMake cache populated from that environment. Correcting the shell variable alone may leave the old cached path in use.
Check SDK/toolset/configuration compatibility for compilation/link failures. Install the Visual Studio C++ workload and confirm the generator can find the intended VS 2022 instance. Use an x64 build with compatible toolkit libraries. Do not mix a dependency from an unrelated toolkit installation merely because its filename is similar.
An unresolved symbol can indicate a missing link dependency, incorrect import-library path, export definition mismatch, or incompatible library version. Check the maintained project's AddLibrariesToLinkWith() and export header before adding arbitrary libraries. Successful compilation proves the headers were found; it does not prove the required implementation was linked.
For a DLL that does not load, check its output name, install destination, exports, dependencies, and applicable backend plugin record. Use actual diagnostics from the configured application; example log transcripts are not prescribed output. Check the installed binary's timestamp and actual dependencies when a rebuilt project still appears unchanged. For a frontend module, check the export declarations and configured frontend directory. For a simulation module, check the record's application/platform/build/transport selectors and myLoad. For a shared message library, check both consumer deployment locations when the processes use different roots.
See also