p.Resim.IncompleteHistory
p.Resim.IncompleteHistory
#Overview
name: p.Resim.IncompleteHistory
This variable is created as a Console Variable (cvar).
- type:
Var
- help:
If a valid resim frame can\'t be found, use the requested resim frame and perform a resimulation with incomplete data.
It is referenced in 3
C++ source files.
#Summary
#Usage in the C++ source code
The purpose of p.Resim.IncompleteHistory is to control the behavior of the resimulation system in Unreal Engine’s Chaos physics engine when a valid resimulation frame cannot be found. This setting variable is part of the experimental Chaos physics system, which is used for advanced physics simulations in Unreal Engine 5.
The Chaos physics module in Unreal Engine relies on this setting variable. It is specifically used within the FRewindData class, which is responsible for managing historical physics data for resimulation purposes.
The value of this variable is set using an FAutoConsoleVariableRef, which creates a console variable that can be modified at runtime. It is initialized to false by default.
This variable interacts closely with the bResimIncompleteHistory variable, which is the actual boolean flag used in the code. The console variable p.Resim.IncompleteHistory is linked to bResimIncompleteHistory, allowing runtime modification of the behavior.
Developers must be aware that enabling this variable (setting it to true) can lead to resimulations with incomplete data. This might result in less accurate physics simulations but can be useful in certain scenarios where approximate results are acceptable.
Best practices when using this variable include:
- Only enable it when necessary, as it may lead to less accurate physics results.
- Use it in conjunction with thorough testing to ensure the resulting behavior is acceptable for your specific use case.
- Consider the performance implications, as resimulating with incomplete data might have different performance characteristics.
Regarding the associated variable bResimIncompleteHistory:
The purpose of bResimIncompleteHistory is to serve as the actual boolean flag that controls the behavior defined by p.Resim.IncompleteHistory. It is used directly in the FRewindData::FindValidResimFrame function to determine whether to use the requested resim frame even when a valid frame with complete history cannot be found.
This variable is set through the console variable p.Resim.IncompleteHistory, allowing for runtime modification of the behavior.
The Chaos physics module in Unreal Engine uses this variable to make decisions about resimulation when historical data is incomplete.
The value of this variable is initially set to false and can be changed through the console variable p.Resim.IncompleteHistory.
It interacts directly with the logic in the FindValidResimFrame function, influencing how the function behaves when no valid resimulation frame is found.
Developers should be aware that changing this variable can significantly impact the behavior and accuracy of physics resimulations. It should be used cautiously and with a full understanding of its implications on physics behavior.
Best practices for using this variable include:
- Use it in conjunction with debugging tools to understand the impact on physics simulations.
- Consider creating a project-specific setting that controls this variable, allowing for easier management in different build configurations.
- Document any use of this variable clearly, as it can have subtle effects on physics behavior that might not be immediately apparent.
#References in C++ code
#Callsites
This variable is referenced in the following C++ source code:
#Loc: <Workspace>/Engine/Source/Runtime/Experimental/Chaos/Private/RewindData.cpp:893
Scope (from outer to inner):
file
namespace Chaos
Source code excerpt:
FAutoConsoleVariableRef CVarResimFrameValidationLeniency(TEXT("p.Resim.ResimFrameValidation"), ResimFrameValidation, TEXT("0 = no leniency, all dirty particles need a valid target. 1 = Island leniency, all particles in resim islands need a valid target. 2 = Full leniency, only the particle triggering the resim need a valid target."));
CHAOS_API bool bResimIncompleteHistory = false;
FAutoConsoleVariableRef CVarResimIncompleteHistory(TEXT("p.Resim.IncompleteHistory"), bResimIncompleteHistory, TEXT("If a valid resim frame can't be found, use the requested resim frame and perform a resimulation with incomplete data."));
int32 FRewindData::FindValidResimFrame(const int32 RequestedFrame)
{
int32 ValidFrame = INDEX_NONE;
if (RequestedFrame <= BlockResimFrame)
#Associated Variable and Callsites
This variable is associated with another variable named bResimIncompleteHistory
. They share the same value. See the following C++ source code.
#Loc: <Workspace>/Engine/Source/Runtime/Experimental/Chaos/Private/RewindData.cpp:892
Scope (from outer to inner):
file
namespace Chaos
Source code excerpt:
CHAOS_API int32 ResimFrameValidation = (int32)EResimFrameValidation::IslandValidation;
FAutoConsoleVariableRef CVarResimFrameValidationLeniency(TEXT("p.Resim.ResimFrameValidation"), ResimFrameValidation, TEXT("0 = no leniency, all dirty particles need a valid target. 1 = Island leniency, all particles in resim islands need a valid target. 2 = Full leniency, only the particle triggering the resim need a valid target."));
CHAOS_API bool bResimIncompleteHistory = false;
FAutoConsoleVariableRef CVarResimIncompleteHistory(TEXT("p.Resim.IncompleteHistory"), bResimIncompleteHistory, TEXT("If a valid resim frame can't be found, use the requested resim frame and perform a resimulation with incomplete data."));
int32 FRewindData::FindValidResimFrame(const int32 RequestedFrame)
{
int32 ValidFrame = INDEX_NONE;
if (RequestedFrame <= BlockResimFrame)
#Loc: <Workspace>/Engine/Source/Runtime/Experimental/Chaos/Private/RewindData.cpp:1035
Scope (from outer to inner):
file
namespace Chaos
function int32 FRewindData::FindValidResimFrame
Source code excerpt:
if (!bHasTargetHistory)
{
ValidFrame = bResimIncompleteHistory ? RequestedFrame : INDEX_NONE;
#if DEBUG_REWIND_DATA
UE_LOG(LogTemp, Warning, TEXT("COMMON | PT | FindValidResimFrame | No valid resim frame found | RequestedFrame: %d | ValidFrame: %d | EarliestFrame: %d | HasTargetHistory: %d | EarliestHistoryFrame: %d | CurrentFrame: %d | FramesSaved: %d | ResimFrameValidation: %d"), RequestedFrame, ValidFrame, EarliestFrame, bHasTargetHistory, GetEarliestFrame_Internal(), CurrentFrame(), FramesSaved, ResimFrameValidation);
#endif
}