![]() |
VR-Forces Developer's Guide
|
This document describes the public API changes in the vrfmsgs library between VR-Forces 5.2 and VR-Forces 5.3.
The vrfmsgs library defines the interface message content classes exchanged between the VR-Forces front-end, the back-end simulation engines, and any remote-control application built against the VR-Forces toolkit. Because these classes describe the wire format, changes here affect both compile-time source compatibility and run-time interoperability: a 5.2 remote-control application will not correctly interoperate with a 5.3 back-end without being rebuilt against the 5.3 headers.
The 5.3 release makes four large changes to this library. The scenario run identifier changed from an int to a DtUUID across every message that carries it. The "run duration" concept was renamed to "run until time" throughout. The random-number-seed message and its accessors were removed. The entire VR-Forces TDL message family was removed. In addition, a new family of scenario checkpoint messages was added, along with an ownership-transfer response message and a global weather creation message.
Changes that are internal to an implementation or limited to comments are not listed.
Every message that carries a scenario run ID now uses DtUUID instead of int. The run ID distinguishes messages belonging to one scenario run from those belonging to a previous run, and the integer form was not sufficiently unique across a distributed exercise. Each message that constructs a run ID now generates a random UUID rather than a random integer.
The following classes are affected. In every case the accessor names are unchanged and only the parameter and return types changed.
Note that the getter now returns a const reference rather than a value. Code that stored the result in an int must be changed to hold a DtUUID or a reference to one. Code that compared run IDs with == continues to work, because DtUUID provides comparison operators. Code that passed a literal such as 0 to indicate "no run ID" must instead pass a default-constructed DtUUID.
The protected member that backs the accessor changed type as well, which affects derived classes:
The concept of a scenario "run duration" was renamed to "run until time" to reflect that the value is interpreted as an absolute simulation stop time unless a message explicitly flags it as a delta. The rename spans message accessors, a message class, a message type constant, and a control type constant.
The following accessors were renamed. The signatures are otherwise unchanged.
| Class | 5.2 declaration | 5.3 declaration |
|---|---|---|
DtIfControl | virtual double duration() const | virtual double runUntilTime() const |
DtIfControl | virtual void setDuration(double) | virtual void setRunUntilTime(double) |
DtIfLoadScenario | virtual double runDurationTime() const | virtual double runUntilTime() const |
DtIfLoadScenario | virtual void setRunDurationTime(double) | virtual void setRunUntilTime(double) |
DtIfSaveComplete | virtual double runDurationTime() const | virtual double runUntilTime() const |
DtIfSaveComplete | virtual void setRunDurationTime(double) | virtual void setRunUntilTime(double) |
DtIfStatus | virtual double runDurationTime() const | virtual double runUntilTime() const |
DtIfStatus | virtual void setRunDurationTime(double) | virtual void setRunUntilTime(double) |
The corresponding protected members were renamed from myTime or myRunDurationTime to myRunUntilTime, which affects derived classes.
vrfmsgs/ifSetRunDuration.h was replaced by vrfmsgs/ifSetRunUntilTime.h, and the class it declares was renamed. The class body is otherwise identical: setIsDuration, isDuration, setDuration, and duration all retain their names and signatures, as do the overridden DtSimInterfaceContent methods and the static creator.
The associated constants were renamed as well. The numeric values are unchanged, so this is a source-level change only.
| 5.2 constant | 5.3 constant | Value |
|---|---|---|
DtSetRunDurationMessageType | DtSetRunUntilTimeMessageType | 172 |
DtRunDurationControlType | DtRunUntilTimeControlType | 3 |
The scenario random number seed is no longer carried in interface messages. vrfmsgs/ifSetRandomNumberSeed.h was removed along with the DtIfSetRandomNumberSeed class and the DtNetIfSetRandomNumberSeed network structure. There is no replacement message.
The corresponding accessors were removed from two composite messages:
The protected DtU32 myRandomNumberSeed member was removed from both classes.
DtSetRandomSeedMessageType (value 30) still exists in vrfmsgs/messageTypes.h so that the numeric space is not reused, but no message uses it. Code that sent or handled this message type should be deleted. Applications that need deterministic random behavior must configure it through the simulation model parameters rather than through an interface message.
All VR-Forces TDL message classes were removed from vrfmsgs. The following headers no longer exist: vrfTDLMessage.h, vrfTDLMessageFactory.h, defaultVrfTDLMessageFactory.h, vrfTDLContactMessage.h, vrfTDLPPLIMessage.h, vrfTDLRemoveMessage.h, vrfTDLStatusMessage.h, and tdlMessageTypes.h. The classes they declared, including DtVrfTDLMessage, the DtVrfTDLMessageHeader network structure, DtVrfTDLMessageFactory, and DtDefaultVrfTDLMessageFactory, are gone.
The DtVrfTDLMessageType constant was removed from vrfmsgs/messageTypes.h. Its slot (MAX_USER_INTERFACE_MESSAGE_TYPE + 9) is reserved and not reused.
There is no replacement in vrfmsgs. Applications that defined custom TDL messages on top of DtVrfTDLMessage must define their own message transport, or use the standard VR-Link interaction and data message mechanisms. The related tdlmessagesim example was removed.
The scenario capabilities enumeration and its helper functions were moved out of vrfmsgs/ifStatus.h into the new header vrfutil/scenarioCapabilities.h. The enumerators, their values, the function signatures, and DtScenarioCapabilities_All are unchanged; only the header location and the DLL export macro changed.
Source files that used DtScenarioCapabilities but did not include vrfmsgs/ifStatus.h directly may still compile, because ifStatus.h includes the new header. Source files that used the enumeration without including ifStatus.h at all must add #include <vrfutil/scenarioCapabilities.h>. Projects that link against vrfmsgs but not vrfutil must add the vrfutil link dependency.
DtIfCreateVrfObject and DtLocalObjectCreateInformation replaced their boolean ground-clamping flag with a pair of properties that express an explicit altitude above the terrain. The semantics also changed: in 5.2 the default was to clamp; in 5.3 the default is to place the object at the exact position given, and clamping is opt-in.
DtLocalObjectCreateInformation also provides an inline setClampToTerrain(bool) that forwards to setUseAltitudeAboveTerrain, which eases the update for setter call sites. There is no equivalent alias for the getter, and DtIfCreateVrfObject has no alias at all. When the flag is set, the object is placed at altitudeAboveTerrain above the nearest non-ocean polygon at the requested location, falling back to the ocean surface where that is the only surface present. For a multi-point object, each point is clamped independently.
Because the default changed, code that relied on 5.2 clamping behavior without calling the setter must now call setUseAltitudeAboveTerrain(true) explicitly.
DtIfModifyVrfObject inherits these four methods but does not support them. It overrides all four as protected no-op stubs, so calls that were previously legal on a DtIfModifyVrfObject reference now fail to compile. Use the location accessors to reposition a single-point object instead.
DtNetIfFrameRateRequest, the fixed-length network layout structure declared in vrfmsgs/ifFrameRateRequest.h, was removed. Applications that referenced this structure to decode the message payload by hand must use the DtIfFrameRateRequest accessors instead. The header also switched from an include guard to #pragma once, and the protected myPopulationSize member changed from unsigned int to DtU32.
The gesture setter gained a trailing parameter carrying per-gesture durations. The parameter has a default value, so existing call sites continue to compile, but any code that took the address of this member function or that overrode it in a derived class must be updated.
The nested DtIfDiGuyAppearAndAnimationsResponse data structure gained a DtDiGuyCharacterData::GestureDurationMap gestureDurations member, and a matching diGuyGestureDurations accessor was added.
DtSuccessNoCheckpointFile indicates that a save succeeded but that the back-end produced no checkpoint file. Switch statements over DtSaveResult that do not have a default case will produce an unhandled-enumerator warning until the new value is handled. Treat it as a success for the purpose of deciding whether the save operation completed.
DtTestResultMessageType moved from 213 to 214 because 213 had been assigned to DtSimOperationsInProgressRequestMessageType. A 5.2 application that hard-coded 213 for test result messages must be rebuilt; the constant should be used rather than the literal.
Two message version constants were incremented because the message payloads changed. Applications that compare against these constants, or that implement their own decoding of these messages, must account for the new layouts.
| Constant | 5.2 | 5.3 |
|---|---|---|
DtIfStatusVersion | 10 | 12 |
DtIfScenarioStatusVersion | 1 | 2 |
VR-Forces 5.3 adds back-end-hosted scenario checkpoints, in which each back-end writes its own fragment of the scenario state to disk and can later reload it. Four new headers implement the remote-control interface to this feature.
vrfmsgs/ifRequestCheckpointFiles.h declares DtIfRequestCheckpointFiles, which requests one level of the checkpoint file hierarchy. An empty path returns the top level. The path separator is machine agnostic, so either / or \ may be used, and the first path element carries no leading separator.
vrfmsgs/ifCheckpointFilesResponse.h declares DtIfCheckpointFilesResponse, the reply. It carries an indexed list of file and directory names, each with an associated key/value map of extended data.
The extended data always contains a TYPE key whose value is directory or scenariofile. It may also contain DATE (GMT modification time), INFORMATION (the contents of the .scn portion of the .scnx file), BACKEND (the back-end required to load this checkpoint), and REMOVED (present when the path or file was deleted). Because checkpoint state is distributed across back-ends, the BACKEND key identifies only one contributor and is not a complete list of the back-ends needed to load a checkpoint.
vrfmsgs/ifCheckpointOperation.h declares DtIfCheckpointOperation, which performs an operation on the checkpoint store of the back-end that receives it. The operation is selected from a nested enumeration:
The class exposes setScenarioName, setRunId, setSimTime, setOperation, setRequestId, and a key/value setData/data pair, along with the matching getters. setOperation and operation use int rather than the Operation enumeration, so an explicit cast is required when reading the value back. A Delete targeting a simulation time matches any checkpoint within two seconds of that time. MetaData merges into existing metadata rather than replacing it.
vrfmsgs/ifLoadScenarioCheckpoint.h declares DtIfLoadScenarioCheckpoint, which asks every back-end holding a scenario fragment near the given simulation time to load it. The message exposes setScenarioName, setRunId, setSimTime, and setScenarioRunId. The scenario run ID organizes the loaded fragments across all back-ends; if it is not set, the message generates one on construction. If the run ID is not specified, each back-end uses its own latest run, which can cause back-ends to load mismatched fragments. Set the run ID explicitly when coordination matters.
The new message type constants are:
| Constant | Value |
|---|---|
DtRequestCheckpointFilesType | MAX_USER_INTERFACE_MESSAGE_TYPE + 45 |
DtCheckpointFilesResponseType | MAX_USER_INTERFACE_MESSAGE_TYPE + 46 |
DtLoadScenarioCheckpointMessageType | MAX_USER_INTERFACE_MESSAGE_TYPE + 47 |
DtCheckpointOperationMessageType | MAX_USER_INTERFACE_MESSAGE_TYPE + 48 |
Three existing messages gained accessors that support the checkpoint workflow.
DtIfSaveScenario can now name an on-disk checkpoint and the run it belongs to. If no run ID is given, the latest run ID on each back-end is used, which may differ between back-ends.
DtIfCloseScenario gained a hint that the next load will come from a back-end-hosted checkpoint, which lets the back-end retain state that would otherwise be discarded:
DtIfStatus gained a flag indicating that the current load or close involves a scenario fragment rather than a complete scenario:
vrfmsgs/ifTakeOwnershipResponse.h declares DtIfTakeOwnershipResponse, which reports the outcome and intermediate progress of an ownership transfer request. The message carries the UUID of the object in question and a status value:
Note that the setter is setUUID while the getter is takeOwnershipOf. The message type constant is DtIfTakeOwnershipOfResponseMessageType, defined as MAX_USER_INTERFACE_MESSAGE_TYPE + 49. Because a single request can produce several responses as the transfer progresses, handlers should be prepared to receive InProgress and WillTransfer before a terminal status.
vrfmsgs/ifCreateGlobalWeather.h requests creation of the global weather entity. The message has no payload, so it is defined as a specialization of the existing empty-content template:
The new message type constant DtCreateGlobalWeatherMessageType has the value 215.
DtIfScenarioStatus can now be sent as a lightweight periodic heartbeat in addition to a full status update. A heartbeat carries only the simulation model sets currently loaded in the back-end.
The generation counter is incremented by the sender each time a non-heartbeat status is sent, which lets a receiver detect that it missed an update. DtIfStatus mirrors the most recent non-heartbeat generation from the same back-end through a parallel pair of accessors:
The class also gained a Flags enumeration that identifies which fields a status message carries:
The symbol identification code used for the two-dimensional display of an object can now be supplied when the object is created or modified. The SIDC affects visuals only; the entity type remains the authority on what is actually created. When the SIDC is blank, the visual application uses the default SIDC for the object type.
A new accessor reports whether the create information was produced in response to a DtIfCreateVrfObject message rather than originating locally:
The embarkation message gained a flag controlling whether the embarkation or debarkation location is clamped to the terrain:
Frame rate requests can now identify the requestor explicitly, so that several applications can subscribe to frame rate reports independently. If no requestor is set, the message sender is used.
| Removed header | Replacement |
|---|---|
vrfmsgs/ifSetRunDuration.h | vrfmsgs/ifSetRunUntilTime.h (class renamed to DtIfSetRunUntilTime) |
vrfmsgs/ifSetRandomNumberSeed.h | None |
vrfmsgs/tdlMessageTypes.h | None |
vrfmsgs/vrfTDLMessage.h | None |
vrfmsgs/vrfTDLMessageFactory.h | None |
vrfmsgs/defaultVrfTDLMessageFactory.h | None |
vrfmsgs/vrfTDLContactMessage.h | None |
vrfmsgs/vrfTDLPPLIMessage.h | None |
vrfmsgs/vrfTDLRemoveMessage.h | None |
vrfmsgs/vrfTDLStatusMessage.h | None |
| Constant | Change |
|---|---|
DtSetRunDurationMessageType | Renamed to DtSetRunUntilTimeMessageType (value 172, unchanged) |
DtRunDurationControlType | Renamed to DtRunUntilTimeControlType (value 3, unchanged) |
DtSetRandomSeedMessageType | Retained at value 30 but no longer used by any message |
DtVrfTDLMessageType | Removed; slot reserved and not reused |
DtTestResultMessageType | Value changed from 213 to 214 |
DtCreateGlobalWeatherMessageType | Added, value 215 |
DtRequestCheckpointFilesType | Added, MAX_USER_INTERFACE_MESSAGE_TYPE + 45 |
DtCheckpointFilesResponseType | Added, MAX_USER_INTERFACE_MESSAGE_TYPE + 46 |
DtLoadScenarioCheckpointMessageType | Added, MAX_USER_INTERFACE_MESSAGE_TYPE + 47 |
DtCheckpointOperationMessageType | Added, MAX_USER_INTERFACE_MESSAGE_TYPE + 48 |
DtIfTakeOwnershipOfResponseMessageType | Added, MAX_USER_INTERFACE_MESSAGE_TYPE + 49 |
Return to VR-Forces 5.3 API Migration Guide.
[Home]