VR-Forces Developer's Guide
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
vrfcore Library API Changes

Table of Contents

This document describes the public API changes in the vrfcore library between VR-Forces 5.2 and VR-Forces 5.3.

It covers the following public headers:

vrfcore is the core toolkit library. Several of the headers listed above declare abstract service interfaces that plug-ins and back-end implementations are expected to implement. Pure virtual methods added to those interfaces break every existing implementation at compile time, so review the Breaking Changes section carefully even if your code only implements a single service.

Changes that are internal to an implementation or limited to comments are not listed.

Breaking Changes

DtDetonationServiceInterface gained a pure virtual method

DtDetonationServiceInterface now requires implementations to supply a detonation power value:

virtual double detonationPower(const DtSimMunition& munition, double rangeFromShooter,
double rangeFromImpact, const DtString& powerType) const = 0;

Every class deriving from DtDetonationServiceInterface must implement this method or it will no longer be instantiable. powerType selects which power curve is consulted for the munition; rangeFromShooter and rangeFromImpact are supplied so the implementation can attenuate the returned power with distance. Implementations that have no meaningful power model should return the munition's nominal power rather than zero, because a zero result is interpreted by the damage assessment code as "no effect".

DtScenarioServiceInterface gained four pure virtual methods

DtScenarioServiceInterface now requires accessors for the snapshot fragment directory and the simulation terrain filename:

virtual void setSimEngineSnapshotFragmentDirectory(const DtFilename&) = 0;
virtual const DtFilename& simEngineSnapshotFragmentDirectory() const = 0;
virtual void setTerrainFilename(const DtFilename&) = 0;
virtual const DtFilename& terrainFilename() const = 0;

All four must be implemented by any class deriving from DtScenarioServiceInterface. The snapshot fragment directory is resolved on access rather than on assignment, so store the DtFilename unmodified and let the caller resolve it. The terrain filename records the terrain that the simulation engine actually loaded, which is not necessarily the terrain named in the scenario file.

DtSimManager::scenarioRunId changed type

The scenario run identifier changed from an int to a DtUUID. This affects both the simulation manager and the DtSimulationServices facade:

// 5.2
virtual void setScenarioRunId(int);
virtual int scenarioRunId() const;
// 5.3
virtual void setScenarioRunId(const DtUUID&);
virtual const DtUUID& scenarioRunId() const;
// 5.2 -- DtSimulationServices
int scenarioRunId() const;
// 5.3 -- DtSimulationServices
const DtUUID& scenarioRunId() const;

Code that stored the run ID in an int, compared it with an integer literal, or wrote it to a stream as a number must be updated to use DtUUID. Comparison and assignment work as before through the DtUUID operators; formatting requires DtUUID::string(). Because the return type is now a reference, do not hold the result beyond the lifetime of the simulation manager.

Run duration was renamed to run until

The "run for a duration" feature was reworked into a "run until a simulation time" feature. The semantics changed along with the names: runForDuration took a delta from the current simulation time, whereas setRunUntilTime takes an absolute simulation time at which the scenario pauses. Call sites must be updated to pass an absolute time, not just renamed.

5.2 declaration 5.3 declaration
DtSimManager::runForDuration(double) DtSimManager::setRunUntilTime(double)
DtSimManager::runDurationTime() const DtSimManager::runUntilTime() const
DtSimManager::stopSimulationDurationTimer() DtSimManager::stopSimulationUntilTimer()
DtSimManager::runDurationCompleteCallback(DtTimer*) DtSimManager::runUntilTimerCompleteCallback(DtTimer*)
DtSimManager::processRunDurationComplete() DtSimManager::processRunUntilComplete()
DtSimManager::addSimulationRunDurationCallback DtSimManager::addSimulationRunUntilCallback
DtSimManager::removeSimulationRunDurationCallback DtSimManager::removeSimulationRunUntilCallback
DtSimulationServices::runForDuration(double) DtSimulationServices::setRunUntilTime(double)
DtSimulationServices::runDurationTime() const DtSimulationServices::runUntilTime() const
DtSimulationServices::stopSimulationDurationTimer() DtSimulationServices::stopSimulationUntilTimer()

The callback function pointer typedef was renamed with it. The signature is unchanged, so only the type name needs to be updated:

// 5.2
typedef void (*DtRunDurationCallbackFcn)(void* userData);
// 5.3
typedef void (*DtRunUntilCallbackFcn)(void* userData);
// 5.2
simManager->runForDuration(300.0); // pause 300 seconds from now
simManager->addSimulationRunDurationCallback(myCallback, this);
// 5.3
simManager->setRunUntilTime(simManager->simulationTime() + 300.0);
simManager->addSimulationRunUntilCallback(myCallback, this);

processRunUntilComplete and runUntilTimerCompleteCallback are virtual and static respectively; subclasses of DtSimManager that overrode processRunDurationComplete must rename the override or it will silently stop being called.

DtRunDurationTimerType was renamed

The timer type constant in vrfcore/timerTypes.h was renamed to match the run until feature. The numeric value is unchanged, so there is no wire or file format impact:

// 5.2
const unsigned int DtRunDurationTimerType = 25;
// 5.3
const unsigned int DtRunUntilTimerType = 25;

Code that compares a DtTimer type against DtRunDurationTimerType must use the new name.

TDL message interface removed from DtSimManager and DtSimulationServices

The TDL message interface is no longer owned or exposed by the simulation manager. The following declarations were removed from DtSimManager:

virtual bool createTDLMessageInterface();
virtual DtVrfTDLMessageInterface* tdlMessageInterface() const;

The corresponding accessor was removed from DtSimulationServices:

DtVrfTDLMessageInterface* tdlMessageInterface() const;

The forward declaration of DtVrfTDLMessageInterface was removed from both headers, so code that relied on either header to declare the type must include the defining header directly. Subclasses of DtSimManager that overrode createTDLMessageInterface must remove the override. There is no replacement accessor in vrfcore; TDL messaging is now obtained from the TDL plug-in itself.

DtSimManager::randSeedCallback removed

The static message callback used to distribute the random seed was removed:

static void randSeedCallback(DtSimMessage* msg, void* usr);

It was registered internally on the simulation manager's message executive and was not intended to be registered or invoked by application code. Code that referenced it should be deleted; the random seed is now handled without an externally visible callback.

DtFrameRateMonitor::DtFrameRateRequesters changed element type

The requester list now holds DtString identifiers rather than simulation addresses:

// 5.2
typedef std::vector<DtSimulationAddress> DtFrameRateRequesters;
// 5.3
typedef std::vector<DtString> DtFrameRateRequesters;

The iterator typedefs DtFrameRateRequestersIter and DtFrameRateRequestersConstIter follow the change. Code that dereferenced an iterator and used the result as a DtSimulationAddress, for example to call siteId() or hostId(), must be reworked to use the string identifier.

DtFrameRateMonitor::generateReport changed signature

The report generator now takes the destination address:

// 5.2
virtual void generateReport();
// 5.3
virtual void generateReport(const DtSimulationAddress& addr = DtSimSendToAll);

Existing call sites continue to compile because the parameter is defaulted to DtSimSendToAll, which preserves the 5.2 broadcast behavior. Subclasses that override generateReport must add the parameter to the override signature; an override that keeps the no-argument form will no longer override the base method and will not be called.

DtVrfSimSettingsManager::addPeriodicSnapshotSettings changed signature

Periodic checkpointing was separated from periodic snapshots, and the method now carries both sets of values:

// 5.2
virtual void addPeriodicSnapshotSettings(std::string name, bool enabled,
double periodicSnapshotTime);
// 5.3
virtual void addPeriodicSnapshotSettings(std::string name, bool snapshots,
double periodicSnapshotTime, bool checkpointEnabled, double periodicCheckpointTime);

The second parameter was renamed from enabled to snapshots but retains its meaning, so existing arguments map directly. Supply false and 0.0 for the two new parameters to preserve the 5.2 behavior of no periodic checkpointing. Subclasses that override this method must update the override signature.

Additions

DtHitZoneDamageParamsManagerInterface

The new header vrfcore/hitZoneDamageParamsManagerInterface.h declares DtHitZoneDamageParamsManagerInterface, an abstract service that supplies hit zone damage probabilities for a detonation. It has a single pure virtual method:

virtual bool getProbabilities(const DtString& hitZoneDamageParameterType,
const DtDetonationContext& detonationContext, DtPrbValueList& probabilities,
bool isDirectDamage) const = 0;

hitZoneDamageParameterType names an entry in the hitZoneDamageParams.mtl file. isDirectDamage selects the direct damage probabilities when true and the collateral damage probabilities when false. The method returns false when no entry matches, in which case probabilities is left untouched.

This is a new service, not a replacement for an existing one. Applications that do not provide an implementation are unaffected; the simulation manager returns a null pointer from hitZoneDamageParamsManager() and the damage code falls back to its existing behavior.

Hit zone damage service accessors on DtSimManager

DtSimManager gained accessors for the new service, following the same pattern as the other service accessors:

virtual void setHitZoneDamageParamsManager(DtHitZoneDamageParamsManagerInterface* hitZoneDamageParams);
virtual DtHitZoneDamageParamsManagerInterface* hitZoneDamageParamsManager();
virtual const DtHitZoneDamageParamsManagerInterface* hitZoneDamageParamsManager() const;

simManager.h now includes hitZoneDamageParamsManagerInterface.h directly, so the type is complete for anyone including simManager.h.

Hit zone damage service accessors on DtSimulationServices

The service facade gained matching installation and access methods:

void installHitZoneDamageParamsService(DtHitZoneDamageParamsManagerInterface* service);
DtHitZoneDamageParamsManagerInterface* hitZoneDamageParamsService();
const DtHitZoneDamageParamsManagerInterface* hitZoneDamageParamsService() const;

A plug-in that provides the service should call installHitZoneDamageParamsService during initialization, in the same place it installs the detonation service. Plug-ins that consume the service must check the returned pointer for null, because installation is optional.

Virtual destructors on service interfaces

DtCreateObjectServiceInterface and DtScenarioServiceInterface now declare defaulted virtual destructors:

virtual ~DtCreateObjectServiceInterface() = default;
virtual ~DtScenarioServiceInterface() = default;

Deleting an implementation through a base class pointer is now well defined. Implementations that declared their own destructor solely to work around the missing virtual destructor can remove it. Note that declaring a destructor suppresses the implicit copy and move operations, so an implementation that relied on implicit move construction of one of these base classes will now see a copy instead.

Return to VR-Forces 5.3 API Migration Guide.

[Home]


Document ID: Generated on Thu Oct 15 21:27:02 EDT 2026 from SVN revision 296421
Copyright © 2005-2026 MAK Technologies. All Rights Reserved (www.mak.com)