Example #1
0
void CMovementExtension::PostInit(IGameObject* pGameObject)
{
	pGameObject->EnablePostUpdates(this);

	REGISTER_CVAR2("gamezero_pl_movementSpeed", &m_movementSpeed, 20.0f, VF_NULL, "Player movement speed.");
	REGISTER_CVAR2("gamezero_pl_boostMultiplier", &m_boostMultiplier, 2.0f, VF_NULL, "Player boost multiplier.");
}
Example #2
0
//------------------------------------------------------------------------
CViewSystem::CViewSystem(ISystem* const pSystem) :
	m_pSystem(pSystem),
	m_activeViewId(0),
	m_nextViewIdToAssign(1000),
	m_preSequenceViewId(0),
	m_cutsceneViewId(0),
	m_cutsceneCount(0),
	m_bOverridenCameraRotation(false),
	m_bActiveViewFromSequence(false),
	m_fBlendInPosSpeed(0.0f),
	m_fBlendInRotSpeed(0.0f),
	m_bPerformBlendOut(false),
	m_useDeferredViewSystemUpdate(false),
	m_bControlsAudioListeners(true)
{
	REGISTER_CVAR2("cl_camera_noise",&m_fCameraNoise,-1,0,
	               "Adds hand-held like camera noise to the camera view. \n The higher the value, the higher the noise.\n A value <= 0 disables it.");
	REGISTER_CVAR2("cl_camera_noise_freq",&m_fCameraNoiseFrequency,2.5326173f,0,
	               "Defines camera noise frequency for the camera view. \n The higher the value, the higher the noise.");

	REGISTER_CVAR2("cl_ViewSystemDebug",&m_nViewSystemDebug,0,VF_CHEAT,
	               "Sets Debug information of the ViewSystem.");

	REGISTER_CVAR2("cl_DefaultNearPlane", &m_fDefaultCameraNearZ, DEFAULT_NEAR, 0,
	               "The default camera near plane. ");

	//Register as level system listener
	if (CCryAction::GetCryAction()->GetILevelSystem())
		CCryAction::GetCryAction()->GetILevelSystem()->AddListener(this);
}
CGameTokenSystem::CGameTokenSystem()
{
	CGameToken::g_pGameTokenSystem = this;
	m_pScriptBind = new CScriptBind_GameToken(this);
	m_pGameTokensMap = new GameTokensMap();

#ifdef _GAMETOKENSDEBUGINFO	
	m_debugHistory.resize( DBG_HISTORYSIZE );
	ClearDebugHistory();
	REGISTER_CVAR2("gt_show", &CGameTokenSystem::m_CVarShowDebugInfo, 0, 0, "Show Game Tokens debug info. 1=screen and log, 2=screen only, 3=log only");
	REGISTER_CVAR2("gt_showPosX", &CGameTokenSystem::m_CVarPosX, 0, 0, "Defines the starting column in screen for game tokens debug info");
	REGISTER_CVAR2("gt_showPosY", &CGameTokenSystem::m_CVarPosY, 0, 0, "Defines the starting line in screen for game tokens debug info");
	REGISTER_CVAR2("gt_showLines", &CGameTokenSystem::m_CVarNumHistoricLines, DBG_HISTORYSIZE, 0, "How many lines is used by the historic list");
	m_pCVarFilter = REGISTER_STRING("gt_showFilter", NULL, VF_NULL, "In the historic list only shows game tokens that include the filter string" );
	REGISTER_COMMAND( "gt_AddToDebugList", AddGameTokenToDebugList, VF_CHEAT,"Adds a game token by name to the list of game tokens to be shown on screen" );
	REGISTER_COMMAND( "gt_RemoveFromDebugList", RemoveGameTokenFromDebugList, VF_CHEAT,"Removes a game token by name from the list of game tokens to be shown on screen" );
#endif
}
//---------------------------------------------------
SafeAreaRenderer::SafeAreaRenderer( C2DRenderUtils* p2dRenderUtils, ScreenLayoutManager* pScreenLayout )
{
	m_p2dRenderUtils = p2dRenderUtils;
	m_pScreenLayout = pScreenLayout;

#if ENABLE_HUD_EXTRA_DEBUG
	m_interactiveResize = 0;
	m_pResizer=NULL;

	REGISTER_CVAR2("HUD_interactiveSafeAreas", &m_interactiveResize, 0, 0, "Interactively resize safe areas.");
#endif
}
CCodeCheckpointDebugMgr::CCodeCheckpointDebugMgr()
:REGISTER_GAME_MECHANISM(CCodeCheckpointDebugMgr),m_timeSinceLastRun(0)
{
	m_debug_ccoverage = 0;
	m_debug_ccoverage_rate = 0.05f;
	m_debug_ccoverage_maxlines = 10;
	m_debug_ccoverage_filter_maxcount = 0;
	m_debug_ccoverage_filter_mincount = 0;

	REGISTER_COMMAND("ft_debug_checkpoint_search", CmdCodeCheckPointSearch, VF_CHEAT, "FEATURE TESTER: Search for code checkpoints that have been encountered by substring");

	REGISTER_CVAR2("ft_debug_ccoverage", &m_debug_ccoverage, m_debug_ccoverage, VF_CHEAT, "FEATURE TESTER: Turn on debug drawing of code checkpoints. 1 = watched checkpoints only. 2 = unwatched only. 3 = both with watched higher priority. 4 = both equal prioirity");
	REGISTER_CVAR2("ft_debug_ccoverage_rate", &m_debug_ccoverage_rate, m_debug_ccoverage_rate, VF_CHEAT, "FEATURE TESTER: Max number of code checkpoints to output");
	REGISTER_CVAR2("ft_debug_ccoverage_maxlines", &m_debug_ccoverage_maxlines, m_debug_ccoverage_maxlines, VF_CHEAT, "FEATURE TESTER: Max number of code checkpoints to output");
	REGISTER_CVAR2("ft_debug_ccoverage_filter_maxcount", &m_debug_ccoverage_filter_maxcount, m_debug_ccoverage_filter_maxcount, VF_CHEAT, "FEATURE TEST: Only print out checkpoints with less than this number of hits");
	REGISTER_CVAR2("ft_debug_ccoverage_filter_mincount", &m_debug_ccoverage_filter_mincount, m_debug_ccoverage_filter_mincount, VF_CHEAT, "FEATURE TEST: Only print out checkpoints with more than this number of hit");

	string filePath = PathUtil::Make( "../USER", "CodeCheckpointList.txt" );
	ReadFile(filePath.c_str());

}
Example #6
0
CGameStateRecorder::CGameStateRecorder() 
{
	m_mode = GPM_Disabled;
	m_bRecording = false;
	m_bEnable = false;
	m_bLogWarning = true;
	m_currentFrame = 0;
	m_pSingleActor = NULL;
	//m_pRecordGameEventFtor = new RecordGameEventFtor(this);
	m_demo_actorInfo = REGISTER_STRING( "demo_actor_info","player",0,"name of actor which game state info is displayed" );
	m_demo_actorFilter = REGISTER_STRING( "demo_actor_filter","player",0,"name of actor which game state is recorded ('player','all',<entity name>" );
	REGISTER_CVAR2( "demo_force_game_state",&m_demo_forceGameState,2,0,"Forces game state values into game while playing timedemo: only health and suit energy (1) or all (2)" );

}
Example #7
0
C2DRenderUtils::C2DRenderUtils(ScreenLayoutManager* pLayoutManager)
{
    m_pLayoutManager = pLayoutManager;
    m_pRenderer = gEnv->pRenderer;

    // TODO : Init/compile for Render-Testing only or get from Textures.h...
    m_white_texture = m_pRenderer->EF_LoadTexture( "EngineAssets/Textures/White.dds", FT_DONT_RELEASE | FT_DONT_STREAM | FT_DONT_RESIZE );

    m_pAuxGeom = gEnv->pRenderer->GetIRenderAuxGeom();

    SetFont(gEnv->pCryFont->GetFont("default"));

#if ENABLE_HUD_EXTRA_DEBUG
    REGISTER_CVAR2("hud_2DtestRenderType", &s_debugTestLevel, 0, 0, "Draw 2D calibration graphics.");
#endif
}
Example #8
0
void CGodMode::RegisterConsoleVars(IConsole* pConsole)
{
    REGISTER_CVAR2(m_godModeCVarName, &m_godMode, 0, VF_CHEAT, "God Mode");
    REGISTER_CVAR2(m_demiGodRevivesAtCheckpointCVarName, &m_demiGodRevivesAtCheckpoint, 1, VF_CHEAT, "Demi God Mode warps you to the last checkpoint");
}
Example #9
0
CAnimationGraphCVars::CAnimationGraphCVars()
{
	assert (s_pThis == 0);
	s_pThis = this;

	IConsole *pConsole = gEnv->pConsole;
	assert(pConsole);

	// TODO: remove once animation graph transition is complete
	REGISTER_CVAR2( "ag_debugExactPos", &m_debugExactPos, 0, VF_CHEAT, "Enable/disable exact positioning debugger" );
	// ~TODO

	REGISTER_CVAR2( "ac_forceSimpleMovement", &m_forceSimpleMovement, 0, VF_CHEAT, "Force enable simplified movement (not visible, dedicated server, etc)." );

	REGISTER_CVAR2( "ac_debugAnimEffects", &m_debugAnimEffects, 0, VF_CHEAT, "Print log messages when anim events spawn effects." );

	REGISTER_CVAR2( "ac_movementControlMethodHor", &m_MCMH, 0, VF_CHEAT, "Overrides the horizontal movement control method specified by AG (overrides filter)." );
	REGISTER_CVAR2( "ac_movementControlMethodVer", &m_MCMV, 0, VF_CHEAT, "Overrides the vertical movement control method specified by AG (overrides filter)." );
	REGISTER_CVAR2( "ac_movementControlMethodFilter", &m_MCMFilter, 0, VF_CHEAT, "Force reinterprets Decoupled/CatchUp MCM specified by AG as Entity MCM (H/V overrides override this)." );
	REGISTER_CVAR2( "ac_templateMCMs", &m_TemplateMCMs, 1, VF_CHEAT, "Use MCMs from AG state templates instead of AG state headers." );
	REGISTER_CVAR2( "ac_ColliderModePlayer", &m_forceColliderModePlayer, 0, VF_CHEAT, "Force override collider mode for all players." );
	REGISTER_CVAR2( "ac_ColliderModeAI", &m_forceColliderModeAI, 0, VF_CHEAT, "Force override collider mode for all AI." );
	REGISTER_CVAR2( "ac_enableExtraSolidCollider", &m_enableExtraSolidCollider, 1, VF_CHEAT, "Enable extra solid collider (for non-pushable characters)." );

	REGISTER_CVAR2( "ac_entityAnimClamp", &m_entityAnimClamp, 1, VF_CHEAT, "Forces the entity movement to be limited by animation." );
	REGISTER_CVAR2( "ac_debugAnimTarget", &m_debugAnimTarget, 0, 0, "Display debug history graphs of anim target correction." );
	REGISTER_CVAR2( "ac_debugLocationsGraphs", &m_debugLocationsGraphs, 0, 0, "Display debug history graphs of entity locations and movement." );

	REGISTER_CVAR2( "ac_debugLocations", &m_debugLocations, 0, 0, "Debug render entity location." );
	REGISTER_CVAR2( "ac_debugMotionParams", &m_debugMotionParams, 0, 0, "Display graph of motion parameters." );

	REGISTER_CVAR2( "ac_frametime", &m_debugFrameTime, 0, 0, "Display a graph of the frametime." );

	REGISTER_CVAR2( "ac_debugText", &m_debugText, 0, 0, "Display entity/animation location/movement values, etc." );
	REGISTER_CVAR2( "ac_debugXXXValues", &m_debugTempValues, 0, 0, "Display some values temporarily hooked into temp history graphs." );
	REGISTER_CVAR2( "ac_debugEntityParams", &m_debugEntityParams, 0 , VF_CHEAT, "Display entity params graphs" );
	m_pDebugFilter = REGISTER_STRING( "ac_DebugFilter", "0", 0, "Debug specified entity name only." );

	REGISTER_CVAR2( "ac_debugColliderMode", &m_debugColliderMode, 0, 0, "Display filtered and requested collider modes." );
	REGISTER_CVAR2( "ac_debugMovementControlMethods", &m_debugMovementControlMethods, 0, 0, "Display movement control methods." );

	REGISTER_CVAR2( "ac_disableSlidingContactEvents", &m_disableSlidingContactEvents, 0, 0, "Force disable sliding contact events." );
	REGISTER_CVAR2( "ac_useMovementPrediction", &m_useMovementPrediction, 1, 0, "When using animation driven motion sample animation for the root one frame ahead to take into account 1 frame of physics delay" );
	REGISTER_CVAR2( "ac_useQueuedRotation", &m_useQueuedRotation, 0, 0, "Instead of applying rotation directly, queue it until the beginning of the next frame (synchronizes rotation with translation coming from asynchronous physics)" );

	REGISTER_CVAR2( "g_landingBobTimeFactor", &m_landingBobTimeFactor, 0.2f, VF_CHEAT, "Fraction of the bob time to release full compression");
	REGISTER_CVAR2( "g_landingBobLandTimeFactor", &m_landingBobLandTimeFactor, 0.1f, VF_CHEAT, "Fraction of the bob time to be at full compression");

	REGISTER_CVAR2( "g_distanceForceNoIk", &m_distanceForceNoIk, 0.0f, VF_NULL, "Distance at which to disable ground alignment IK");
	REGISTER_CVAR2( "g_distanceForceNoLegRaycasts", &m_distanceForceNoLegRaycasts, 5.0f, VF_NULL, "Distance at which to disable ground alignment IKs raycasts");
	REGISTER_CVAR2( "g_spectatorCollisions", &m_spectatorCollisions, 1, VF_CHEAT, "Collide against the geometry in spectator mode");

	REGISTER_CVAR2( "g_groundAlignAll", &m_groundAlignAll, 1, VF_NULL, "Enable ground alignment for every character that supports it." );

	REGISTER_CVAR2("ag_turnSpeedParamScale", &m_turnSpeedParamScale, 0.2f, VF_NULL, "Scale the turn speed animation param (used for leaning)");
	REGISTER_CVAR2("ag_turnSpeedSmoothing", &m_enableTurnSpeedSmoothing, 1, VF_NULL, "Enables/Disables turn speed smoothing.");
	REGISTER_CVAR2("ag_turnAngleSmoothing", &m_enableTurnAngleSmoothing, 1, VF_NULL, "Enables/Disables turn angle smoothing.");
	REGISTER_CVAR2("ag_travelSpeedSmoothing", &m_enableTravelSpeedSmoothing, 1, VF_NULL, "Enables/Disables travel speed smoothing.");

	PoseAligner::CVars::GetInstance();
}
Example #10
0
//--------------------------------------------------------------------------------------------------
// Name: CBreakableGlassSystem
// Desc: Constructor
//--------------------------------------------------------------------------------------------------
CBreakableGlassSystem::CBreakableGlassSystem()
: m_enabled(false)
{
	// Add physics callback
	if (IPhysicalWorld* pPhysWorld = gEnv->pPhysicalWorld)
	{
		const float listenerPriority = 2001.0f;
		pPhysWorld->AddEventClient(EventPhysCollision::id, &CBreakableGlassSystem::HandleImpact, 1, listenerPriority);
	}

	// Hook up debug cvars
	if (m_pGlassCVars = new SBreakableGlassCVars())
	{
#ifdef GLASS_DEBUG_MODE
		// Rendering
		REGISTER_CVAR2("g_glassSystem_draw",								&m_pGlassCVars->m_draw,						1,			VF_CHEAT,	"Toggles drawing of glass nodes");
		REGISTER_CVAR2("g_glassSystem_drawWireframe",				&m_pGlassCVars->m_drawWireframe,	0,			VF_CHEAT,	"Toggles drawing of glass node wireframe");
		REGISTER_CVAR2("g_glassSystem_drawDebugData",				&m_pGlassCVars->m_drawDebugData,	0,			VF_CHEAT,	"Toggles drawing of glass node break/impact data");
		REGISTER_CVAR2("g_glassSystem_drawFragData",				&m_pGlassCVars->m_drawFragData,		0,			VF_CHEAT,	"Toggles drawing of glass physicalized fragment data");

		// Impact decals
		REGISTER_CVAR2("g_glassSystem_decalAlwaysRebuild",	&m_pGlassCVars->m_decalAlwaysRebuild,	0,			VF_CHEAT,	"Forces decals to rebuild every frame, allowing real-time tweaking.");
		REGISTER_CVAR2("g_glassSystem_decalScale",					&m_pGlassCVars->m_decalScale,					2.5f,		VF_CHEAT,	"Scale of procedural impact decals on glass");
		REGISTER_CVAR2("g_glassSystem_decalMinRadius",			&m_pGlassCVars->m_decalMinRadius,			0.25f,	VF_CHEAT,	"Minimum size of decal around impact");	
		REGISTER_CVAR2("g_glassSystem_decalMaxRadius",			&m_pGlassCVars->m_decalMaxRadius,			1.25f,	VF_CHEAT,	"Maximum size of decal around impact");
		REGISTER_CVAR2("g_glassSystem_decalRandChance",			&m_pGlassCVars->m_decalRandChance,		0.67f,	VF_CHEAT,	"Chance for a decal to randomly be scaled up");
		REGISTER_CVAR2("g_glassSystem_decalRandScale",			&m_pGlassCVars->m_decalRandScale,			1.6f,		VF_CHEAT,	"Scale of decal if selected randomly");
		REGISTER_CVAR2("g_glassSystem_decalMinImpactSpeed", &m_pGlassCVars->m_minImpactSpeed,			400.0f,	VF_CHEAT,	"Minimum speed for an impact to use the bullet decal");

		// Physicalized fragments
		REGISTER_CVAR2("g_glassSystem_fragImpulseScale",			&m_pGlassCVars->m_fragImpulseScale,			5.0f,	VF_CHEAT,	"Scales impulse applied to fragments when physicalized");
		REGISTER_CVAR2("g_glassSystem_fragAngImpulseScale",		&m_pGlassCVars->m_fragAngImpulseScale,	0.1f,	VF_CHEAT,	"Scales *angular* impulse applied to fragments when physicalized");
		REGISTER_CVAR2("g_glassSystem_fragImpulseDampen",			&m_pGlassCVars->m_fragImpulseDampen,		0.3f,	VF_CHEAT,	"Dampens impulse applied to non-directly impacted fragments");
		REGISTER_CVAR2("g_glassSystem_fragAngImpulseDampen",	&m_pGlassCVars->m_fragAngImpulseDampen,	0.4f,	VF_CHEAT,	"Dampens *angular* impulse applied to non-directly impacted fragments");
		REGISTER_CVAR2("g_glassSystem_fragSpread",						&m_pGlassCVars->m_fragSpread,						1.5f,	VF_CHEAT,	"Spread velocity to apply to impacted fragments");
		REGISTER_CVAR2("g_glassSystem_fragMaxSpeed",					&m_pGlassCVars->m_fragMaxSpeed,					4.0f,	VF_CHEAT,	"Maximum speed to apply to physicalized fragments");

		// Impact breaks
		REGISTER_CVAR2("g_glassSystem_impactSplitMinRadius",	&m_pGlassCVars->m_impactSplitMinRadius,	0.05f,	VF_CHEAT,	"Minimum radius for split around impact");
		REGISTER_CVAR2("g_glassSystem_impactSplitRandMin",		&m_pGlassCVars->m_impactSplitRandMin,		0.5f,		VF_CHEAT,	"Minimum radius variation for split around impact");
		REGISTER_CVAR2("g_glassSystem_impactSplitRandMax",		&m_pGlassCVars->m_impactSplitRandMax,		1.5f,		VF_CHEAT,	"Maximum radius variation for split around impact");
		REGISTER_CVAR2("g_glassSystem_impactEdgeFadeScale",		&m_pGlassCVars->m_impactEdgeFadeScale,	2.0f,		VF_CHEAT,	"Scales radial crack fade distance");

		// Particle effects
		REGISTER_CVAR2("g_glassSystem_particleFXEnable",			&m_pGlassCVars->m_particleFXEnable,			1,			VF_CHEAT,	"Toggles particle effects being played when fragments are broken");
		REGISTER_CVAR2("g_glassSystem_particleFXUseColours",	&m_pGlassCVars->m_particleFXUseColours,	0,			VF_CHEAT,	"Toggles particle effects being coloured to match the glass");
		REGISTER_CVAR2("g_glassSystem_particleFXScale",				&m_pGlassCVars->m_particleFXScale,			0.25f,	VF_CHEAT,	"Scales the glass particle effects spawned");
#endif // GLASS_DEBUG_MODE
	}

	// Add callback for system enabled cvar
	IConsole* pConsole = gEnv->pConsole;
	ICVar* pSysEnabledCvar = pConsole ? pConsole->GetCVar("g_glassSystemEnable") : NULL;

	if (pSysEnabledCvar)
	{
		m_enabled = (pSysEnabledCvar->GetIVal() != 0);
		pSysEnabledCvar->SetOnChangeCallback(OnEnabledCVarChange);
	}
}//-------------------------------------------------------------------------------------------------
void NetInputChainInitCVars()
{
	REGISTER_STRING("net_input_trace", "0", VF_CHEAT, "trace an entities input processing to assist finding sync errors")->SetOnChangeCallback(OnChangeEntity);
	REGISTER_CVAR2("net_input_dump", &dump, 0, VF_CHEAT, "write net_input_trace output to a file (netinput.log)");
}