BVB Source Codes

CRYENGINE Show AIConsoleVariables.cpp Source code

Return Download CRYENGINE: download AIConsoleVariables.cpp Source code - Download CRYENGINE Source code - Type:.cpp
  1. // Copyright 2001-2016 Crytek GmbH / Crytek Group. All rights reserved.
  2.  
  3. #include "StdAfx.h"
  4. #include "AIConsoleVariables.h"
  5. #include "Communication/CommunicationManager.h"
  6. #include "Communication/CommunicationTestManager.h"
  7. #include "Navigation/NavigationSystem/NavigationSystem.h"
  8. #include "BehaviorTree/BehaviorTreeManager.h"
  9. #include <CryAISystem/IAIBubblesSystem.h>
  10.  
  11. void AIConsoleVars::Init()
  12. {
  13.         AILogProgress("[AISYSTEM] Initialization: Creating console vars");
  14.  
  15.         IConsole* pConsole = gEnv->pConsole;
  16.  
  17.         REGISTER_CVAR2("ai_CompatibilityMode", &CompatibilityMode, "", VF_NULL,
  18.                        "Set AI features to behave in earlier milestones - please use sparingly");
  19.  
  20.         REGISTER_CVAR2("ai_DebugDrawAStarOpenList", &DebugDrawAStarOpenList, "0", VF_CHEAT | VF_CHEAT_NOCHECK,
  21.                        "Draws the A* open list for the specified AI agent.\n"
  22.                        "Usage: ai_DebugDrawAStarOpenList [AI agent name]\n"
  23.                        "Default is 0, which disables the debug draw. Requires ai_DebugPathfinding=1 to be activated.");
  24.  
  25.         REGISTER_CVAR2("ai_DebugCheckWalkabilityRadius", &DebugCheckWalkabilityRadius, 0.5f, VF_CHEAT | VF_CHEAT_NOCHECK,
  26.                        "Radius to use for the per-frame debug CheckWalkability test.");
  27.  
  28.         REGISTER_CVAR2("ai_DebugDrawAStarOpenListTime", &DebugDrawAStarOpenListTime, 10.0f, VF_CHEAT | VF_CHEAT_NOCHECK,
  29.                        "The amount of time to draw the A* open list.");
  30.  
  31.         REGISTER_CVAR2("ai_DrawNode", &DrawNode, "none", VF_CHEAT | VF_CHEAT_NOCHECK,
  32.                        "Toggles visibility of named agent's position on AI triangulation.\n"
  33.                        "See also: ai_DrawNodeLinkType and ai_DrawNodeLinkCutoff\n"
  34.                        "Usage: ai_DrawNode [ai agent's name]\n"
  35.                        " none - switch off\n"
  36.                        " all - to display nodes of all the AI agents\n"
  37.                        " player - to display player's node\n"
  38.                        " AI agent's name - to display node of particular agent");
  39.         REGISTER_CVAR2("ai_Locate", &DrawLocate, "none", VF_CHEAT | VF_CHEAT_NOCHECK,
  40.                        "Indicates position and some base states of specified objects.\n"
  41.                        "It will pinpoint position of the agents; it's name; it's attention target;\n"
  42.                        "draw red cone if the agent is allowed to fire; draw purple cone if agent is pressing trigger.\n"
  43.                        " none - off\n"
  44.                        " squad - squadmates\n"
  45.                        " enemy - all the enemies\n"
  46.                        " groupID - members of specified group");
  47.         REGISTER_CVAR2("ai_DrawPath", &DrawPath, "none", VF_CHEAT | VF_CHEAT_NOCHECK,
  48.                        "Draws the generated paths of the AI agents. ai_drawoffset is used.\n"
  49.                        "Usage: ai_DrawPath [name]\n"
  50.                        " none - off (default)\n"
  51.                        " squad - squadmates\n"
  52.                        " enemy - all the enemies");
  53.         REGISTER_CVAR2("ai_DrawPathAdjustment", &DrawPathAdjustment, "", VF_CHEAT | VF_CHEAT_NOCHECK,
  54.                        "Draws the path adjustment for the AI agents.\n"
  55.                        "Usage: ai_DrawPathAdjustment [name]\n"
  56.                        "Default is none (nobody).");
  57.         REGISTER_CVAR2("ai_DrawRefPoints", &DrawRefPoints, "", VF_CHEAT | VF_CHEAT_NOCHECK,
  58.                        "Toggles reference points and beacon view for debugging AI.\n"
  59.                        "Usage: ai_DrawRefPoints \"all\", agent name, group id \n"
  60.                        "Default is the empty string (off). Indicates the AI reference points by drawing\n"
  61.                        "balls at their positions.");
  62.         REGISTER_CVAR2("ai_StatsTarget", &StatsTarget, "none", VF_CHEAT | VF_CHEAT_NOCHECK,
  63.                        "Focus debugging information on a specific AI\n"
  64.                        "Display current goal pipe, current goal, subpipes and agentstats information for the selected AI agent.\n"
  65.                        "Long green line will represent the AI forward direction (game forward).\n"
  66.                        "Long red/blue (if AI firing on/off) line will represent the AI view direction.\n"
  67.                        "Usage: ai_StatsTarget AIName\n"
  68.                        "Default is 'none'. AIName is the name of the AI\n"
  69.                        "on which to focus.");
  70.         DefineConstIntCVarName("ai_DebugDrawPhysicsAccess", DebugDrawPhysicsAccess, 0, VF_CHEAT | VF_CHEAT_NOCHECK,
  71.                                "Displays current physics access statistics for the AI module.");
  72.         REGISTER_CVAR2("ai_DebugBehaviorSelection", &DebugBehaviorSelection, "", VF_CHEAT | VF_CHEAT_NOCHECK,
  73.                        "Display behavior selection information for a specific agent\n"
  74.                        "Usage: ai_DebugBehaviorSelection <name>");
  75.  
  76.         DefineConstIntCVarName("ai_RayCasterQuota", RayCasterQuota, 12, VF_CHEAT | VF_CHEAT_NOCHECK,
  77.                                "Amount of deferred rays allowed to be cast per frame!");
  78.  
  79.         DefineConstIntCVarName("ai_IntersectionTesterQuota", IntersectionTesterQuota, 12, VF_CHEAT | VF_CHEAT_NOCHECK,
  80.                                "Amount of deferred intersection tests allowed to be cast per frame!");
  81.  
  82.         REGISTER_CVAR2("ai_DebugHideSpotName", &DebugHideSpotName, "0", VF_CHEAT | VF_CHEAT_NOCHECK,
  83.                        "Debug HideSpot Name!");
  84.         REGISTER_CVAR2("ai_DrawShooting", &DrawShooting, "none", VF_CHEAT | VF_CHEAT_NOCHECK,
  85.                        "Name of puppet to show fire stats");
  86.         REGISTER_CVAR2("ai_DrawAgentStats", &DrawAgentStats, "NkcBbtGgSfdDL", VF_NULL,
  87.                        "Flag field specifying which of the overhead agent stats to display:\n"
  88.                        "N - name\n"
  89.                        "k - groupID\n"
  90.                        "d - distances\n"
  91.                        "c - cover info\n"
  92.                        "B - currently selected behavior node\n"
  93.                        "b - current behavior\n"
  94.                        "t - target info\n"
  95.                        "G - goal pipe\n"
  96.                        "g - goal op\n"
  97.                        "S - stance\n"
  98.                        "f - fire\n"
  99.                        "w - territory/wave\n"
  100.                        "p - pathfinding status\n"
  101.                        "l - light level (perception) status\n"
  102.                        "D - various direction arrows (aim target, move target, ...) status\n"
  103.                        "L - personal log\n"
  104.                        "a - alertness\n"
  105.                        "\n"
  106.                        "Default is NkcBbtGgSfdDL");
  107.  
  108.         REGISTER_CVAR2("ai_DrawAgentStatsGroupFilter", &DrawAgentStatsGroupFilter, "", VF_NULL,
  109.                        "Filters Debug Draw Agent Stats displays to the specified groupIDs separated by spaces\n"
  110.                        "usage: ai_DrawAgentStatsGroupFilter 1011 1012");
  111.         REGISTER_CVAR2("ai_DrawPerceptionHandlerModifiers", &DrawPerceptionHandlerModifiers, "none", VF_CHEAT | VF_CHEAT_NOCHECK,
  112.                        "Draws perception handler modifiers on a specific AI\n"
  113.                        "Usage: ai_DrawPerceptionHandlerModifiers AIName\n"
  114.                        "Default is 'none'. AIName is the name of the AI");
  115.         REGISTER_CVAR2("ai_ForceAGAction", &ForceAGAction, "0", VF_CHEAT | VF_CHEAT_NOCHECK,
  116.                        "Forces all AI characters to specified AG action input. 0 to disable.\n");
  117.         REGISTER_CVAR2("ai_ForceAGSignal", &ForceAGSignal, "0", VF_CHEAT | VF_CHEAT_NOCHECK,
  118.                        "Forces all AI characters to specified AG signal input. 0 to disable.\n");
  119.         REGISTER_CVAR2("ai_ForcePosture", &ForcePosture, "0", VF_CHEAT | VF_CHEAT_NOCHECK,
  120.                        "Forces all AI characters to specified posture. 0 to disable.\n");
  121.         REGISTER_CVAR2("ai_ForceLookAimTarget", &ForceLookAimTarget, "none", VF_CHEAT | VF_CHEAT_NOCHECK,
  122.                        "Forces all AI characters to use/not use a fixed look/aim target\n"
  123.                        "none disables\n"
  124.                        "x, y, xz or yz sets it to the appropriate direction\n"
  125.                        "otherwise it forces looking/aiming at the entity with this name (no name -> (0, 0, 0))");
  126.  
  127.         REGISTER_CVAR2("ai_CheckWalkabilityOptimalSectionLength", &CheckWalkabilityOptimalSectionLength, 1.75f, VF_NULL,
  128.                        "The maximum segment length used by CheckWalkabilityFast when querying for world geometry from physics.\n"
  129.                        "Default: 1.75\n");
  130.  
  131.         REGISTER_CVAR2("ai_TacticalPointUpdateTime", &TacticalPointUpdateTime, 0.0005f, VF_NULL,
  132.                        "Maximum allowed update time in main AI thread for Tactical Point System\n"
  133.                        "Usage: ai_TacticalPointUpdateTime <number>\n"
  134.                        "Default is 0.0003");
  135.  
  136.         DefineConstIntCVarName("ai_UpdateAllAlways", UpdateAllAlways, 0, VF_CHEAT | VF_CHEAT_NOCHECK,
  137.                                "If non-zero then over-rides the auto-disabling of invisible/distant AI");
  138.         DefineConstIntCVarName("ai_UseCalculationStopperCounter", UseCalculationStopperCounter, 0, VF_CHEAT | VF_CHEAT_NOCHECK,
  139.                                "Uses a (calibrated) counter instead of time in AI updates");
  140.  
  141.         // is not cheat protected because it changes during game, depending on your settings
  142.         REGISTER_CVAR2("ai_UpdateInterval", &AIUpdateInterval, 0.13f, VF_NULL,
  143.                        "In seconds the amount of time between two full updates for AI  \n"
  144.                        "Usage: ai_UpdateInterval <number>\n"
  145.                        "Default is 0.1. Number is time in seconds");
  146.         REGISTER_CVAR2("ai_DynamicWaypointUpdateTime", &DynamicWaypointUpdateTime, 0.00035f, VF_NULL,
  147.                        "How long (max) to spend updating dynamic waypoint regions per AI update (in sec)\n"
  148.                        "0 disables dynamic updates. 0.0005 is a sensible value");
  149.         REGISTER_CVAR2("ai_DynamicVolumeUpdateTime", &DynamicVolumeUpdateTime, 0.000175f, VF_NULL,
  150.                        "How long (max) to spend updating dynamic volume regions per AI update (in sec)\n"
  151.                        "0 disables dynamic updates. 0.002 is a sensible value");
  152.         REGISTER_CVAR2("ai_LayerSwitchDynamicLinkBump", &LayerSwitchDynamicLinkBump, 8.0f, VF_NULL,
  153.                        "Multiplier for the dynamic link update budget when layer switch occurs.");
  154.         REGISTER_CVAR2("ai_LayerSwitchDynamicLinkBumpDuration", &LayerSwitchDynamicLinkBumpDuration, 60, VF_NULL,
  155.                        "Duration of the dynamic link update budget bump in frames.");
  156.         DefineConstIntCVarName("ai_AdjustPathsAroundDynamicObstacles", AdjustPathsAroundDynamicObstacles, 1, VF_CHEAT | VF_CHEAT_NOCHECK,
  157.                                "Set to 1/0 to enable/disable AI path adjustment around dynamic obstacles");
  158.         // is not cheat protected because it changes during game, depending on your settings
  159.         DefineConstIntCVarName("ai_EnableORCA", EnableORCA, 1, VF_CHEAT | VF_CHEAT_NOCHECK,
  160.                                "Enable obstacle avoidance system.");
  161.         DefineConstIntCVarName("ai_CollisionAvoidanceUpdateVelocities", CollisionAvoidanceUpdateVelocities, 1, VF_CHEAT | VF_CHEAT_NOCHECK,
  162.                                "Enable/disable agents updating their velocities after processing collision avoidance.");
  163.         DefineConstIntCVarName("ai_CollisionAvoidanceEnableRadiusIncrement", CollisionAvoidanceEnableRadiusIncrement, 1, VF_CHEAT | VF_CHEAT_NOCHECK,
  164.                                "Enable/disable agents adding an increment to their collision avoidance radius when moving.");
  165.         DefineConstIntCVarName("ai_CollisionAvoidanceClampVelocitiesWithNavigationMesh", CollisionAvoidanceClampVelocitiesWithNavigationMesh, 0, VF_CHEAT | VF_CHEAT_NOCHECK,
  166.                                "Enable/Disable the clamping of the speed resulting from ORCA with the navigation mesh");
  167.         DefineConstIntCVarName("ai_DebugDrawCollisionAvoidance", DebugDrawCollisionAvoidance, 0, VF_CHEAT | VF_CHEAT_NOCHECK,
  168.                                "Enable debugging obstacle avoidance system.");
  169.         // Bubble System cvars
  170.         REGISTER_CVAR2("ai_BubblesSystem", &EnableBubblesSystem, 1, VF_CHEAT | VF_CHEAT_NOCHECK,
  171.                        "Enables/disables bubble notifier.");
  172.         REGISTER_CVAR2("ai_BubblesSystemDecayTime", &BubblesSystemDecayTime, 15.0f, VF_CHEAT | VF_CHEAT_NOCHECK,
  173.                        "Specifies the decay time for the bubbles drawn on screen.");
  174.  
  175.         DefineConstIntCVarName("ai_BubblesSystemAlertnessFilter", BubblesSystemAlertnessFilter, 7, VF_CHEAT | VF_CHEAT_NOCHECK,
  176.                                "Specifies the type of messages you want to receive:\n"
  177.                                "0 - none\n"
  178.                                "1 - Only logs in the console\n"
  179.                                "2 - Only bubbles\n"
  180.                                "3 - Logs and bubbles\n"
  181.                                "4 - Only blocking popups\n"
  182.                                "5 - Blocking popups and logs\n"
  183.                                "6 - Blocking popups and bubbles\n"
  184.                                "7 - All notifications");
  185.         DefineConstIntCVarName("ai_BubblesSystemUseDepthTest", BubblesSystemUseDepthTest, 0, VF_CHEAT | VF_CHEAT_NOCHECK,
  186.                                "Specifies if the BubblesSystem should use the depth test to show the messages"
  187.                                " inside the 3D world.");
  188.         DefineConstIntCVarName("ai_BubblesSystemAllowPrototypeDialogBubbles", BubblesSystemAllowPrototypeDialogBubbles, 0, VF_CHEAT | VF_CHEAT_NOCHECK,
  189.                                "Enabling the visualization of the bubbles created to prototype AI dialogs");
  190.         REGISTER_CVAR2("ai_BubblesSystemFontSize", &BubblesSystemFontSize, 45.0f, VF_CHEAT | VF_CHEAT_NOCHECK, "Font size for the BubblesSystem.");
  191.         REGISTER_CVAR2_CB("ai_BubblesSystemNameFilter", &BubblesSystemNameFilter, "", VF_CHEAT | VF_CHEAT_NOCHECK,
  192.                           "Filter BubblesSystem messages by name. Do not filter, if empty.", &AIBubblesNameFilterCallback);
  193.         // Bubble System cvars
  194.  
  195.         // Pathfinding dangers
  196.         DefineConstIntCVarName("ai_PathfinderDangerCostForAttentionTarget", PathfinderDangerCostForAttentionTarget, 5, VF_CHEAT | VF_CHEAT_NOCHECK,
  197.                                "Cost used in the heuristic calculation for the danger created by the attention target position.");
  198.         DefineConstIntCVarName("ai_PathfinderDangerCostForExplosives", PathfinderDangerCostForExplosives, 2, VF_CHEAT | VF_CHEAT_NOCHECK,
  199.                                "Cost used in the heuristic calculation for the danger created by the position of explosive objects.");
  200.         DefineConstIntCVarName("ai_PathfinderAvoidanceCostForGroupMates", PathfinderAvoidanceCostForGroupMates, 2, VF_CHEAT | VF_CHEAT_NOCHECK,
  201.                                "Cost used in the heuristic calculation for the avoidance of the group mates's positions.");
  202.         REGISTER_CVAR2("ai_PathfinderExplosiveDangerRadius", &PathfinderExplosiveDangerRadius, 5.0f, VF_CHEAT | VF_CHEAT_NOCHECK,
  203.                        "Range used to evaluate the explosive threats in the path calculation. Outside this range a location is considered safe.");
  204.         REGISTER_CVAR2("ai_PathfinderExplosiveDangerMaxThreatDistance", &PathfinderExplosiveDangerMaxThreatDistance, 50.0f, VF_CHEAT | VF_CHEAT_NOCHECK,
  205.                        "Range used to decide if evaluate an explosive danger as an actual threat.");
  206.         REGISTER_CVAR2("ai_PathfinderGroupMatesAvoidanceRadius", &PathfinderGroupMatesAvoidanceRadius, 4.0f, VF_CHEAT | VF_CHEAT_NOCHECK,
  207.                        "Range used to evaluate the group mates avoidance in the path calculation.");
  208.  
  209.         // Pathfinding dangers
  210.  
  211.         DefineConstIntCVarName("ai_DebugMovementSystem", DebugMovementSystem, 0, VF_CHEAT | VF_CHEAT_NOCHECK,
  212.                                "Draw debug information to the screen regarding character movement.");
  213.  
  214.         DefineConstIntCVarName("ai_DebugMovementSystemActorRequests", DebugMovementSystemActorRequests, 0, VF_CHEAT | VF_CHEAT_NOCHECK,
  215.                                "Draw queued movement requests of actors in the world as text above their head.\n"
  216.                                "0 - Off\n"
  217.                                "1 - Draw request queue of only the currently selected agent\n"
  218.                                "2 - Draw request queue of all agents");
  219.  
  220.         DefineConstIntCVarName("ai_OutputPersonalLogToConsole", OutputPersonalLogToConsole, 0, VF_CHEAT | VF_CHEAT_NOCHECK,
  221.                                "Output the personal log messages to the console.");
  222.  
  223.         DefineConstIntCVarName("ai_DrawModularBehaviorTreeStatistics", DrawModularBehaviorTreeStatistics, 0, VF_CHEAT | VF_CHEAT_NOCHECK,
  224.                                "Draw modular behavior statistics to the screen.");
  225.  
  226.         DefineConstIntCVarName("ai_MNMPathfinderPositionInTrianglePredictionType", MNMPathfinderPositionInTrianglePredictionType, 1, VF_CHEAT | VF_CHEAT_NOCHECK,
  227.                                "Defines which type of prediction for the point inside each triangle used by the pathfinder heuristic to search for the "
  228.                                "path with minimal cost.\n"
  229.                                "0 - Triangle center.\n"
  230.                                "1 - Advanced prediction.\n");
  231.  
  232.         REGISTER_CVAR2("ai_MovementSystemPathReplanningEnabled", &MovementSystemPathReplanningEnabled, 0, VF_NULL,
  233.                        "Enable/disable path-replanning of moving actors in the MovementSystem every time\n"
  234.                        "a navigation-mesh change at runtime affects their current path.\n"
  235.                        "Ignores designer-placed paths.\n"
  236.                        "0 - disabled (default)\n"
  237.                        "1 - enabled");
  238.  
  239.         REGISTER_CVAR2("ai_CollisionAvoidanceRange", &CollisionAvoidanceRange, 10.0f, VF_CHEAT | VF_CHEAT_NOCHECK,
  240.                        "Range for collision avoidance.");
  241.         REGISTER_CVAR2("ai_CollisionAvoidanceTargetCutoffRange", &CollisionAvoidanceTargetCutoffRange, 3.0f, VF_CHEAT | VF_CHEAT_NOCHECK,
  242.                        "Distance from it's current target for an agent to stop avoiding obstacles. Other actors will still avoid the agent.");
  243.         REGISTER_CVAR2("ai_CollisionAvoidancePathEndCutoffRange", &CollisionAvoidancePathEndCutoffRange, 0.5f, VF_CHEAT | VF_CHEAT_NOCHECK,
  244.                        "Distance from it's current path end for an agent to stop avoiding obstacles. Other actors will still avoid the agent.");
  245.         REGISTER_CVAR2("ai_CollisionAvoidanceSmartObjectCutoffRange", &CollisionAvoidanceSmartObjectCutoffRange, 1.0f, VF_CHEAT | VF_CHEAT_NOCHECK,
  246.                        "Distance from it's next smart object for an agent to stop avoiding obstacles. Other actors will still avoid the agent.");
  247.         REGISTER_CVAR2("ai_CollisionAvoidanceAgentExtraFat", &CollisionAvoidanceAgentExtraFat, 0.025f, VF_CHEAT | VF_CHEAT_NOCHECK,
  248.                        "Extra radius to use in Collision Avoidance calculations as a buffer.");
  249.         REGISTER_CVAR2("ai_CollisionAvoidanceRadiusIncrementIncreaseRate", &CollisionAvoidanceRadiusIncrementIncreaseRate, 0.25f, VF_CHEAT | VF_CHEAT_NOCHECK,
  250.                        "Increase rate of the collision avoidance radius increment.");
  251.         REGISTER_CVAR2("ai_CollisionAvoidanceRadiusIncrementDecreaseRate", &CollisionAvoidanceRadiusIncrementDecreaseRate, 2.0f, VF_CHEAT | VF_CHEAT_NOCHECK,
  252.                        "Decrease rate of the collision avoidance radius increment.");
  253.         REGISTER_CVAR2("ai_CollisionAvoidanceTimestep", &CollisionAvoidanceTimeStep, 0.1f, VF_CHEAT | VF_CHEAT_NOCHECK,
  254.                        "TimeStep used to calculate an agent's collision free velocity.");
  255.         REGISTER_CVAR2("ai_CollisionAvoidanceMinSpeed", &CollisionAvoidanceMinSpeed, 0.2f, VF_CHEAT | VF_CHEAT_NOCHECK,
  256.                        "Minimum speed allowed to be used by ORCA.");
  257.         REGISTER_CVAR2("ai_CollisionAvoidanceAgentTimeHorizon", &CollisionAvoidanceAgentTimeHorizon, 2.5f, VF_CHEAT | VF_CHEAT_NOCHECK,
  258.                        "Time horizon used to calculate an agent's collision free velocity against other agents.");
  259.         REGISTER_CVAR2("ai_CollisionAvoidanceObstacleTimeHorizon", &CollisionAvoidanceObstacleTimeHorizon, 1.5f, VF_CHEAT | VF_CHEAT_NOCHECK,
  260.                        "Time horizon used to calculate an agent's collision free velocity against static obstacles.");
  261.         REGISTER_CVAR2("ai_DebugCollisionAvoidanceForceSpeed", &DebugCollisionAvoidanceForceSpeed, 0.0f, VF_CHEAT | VF_CHEAT_NOCHECK,
  262.                        "Force agents velocity to it's current direction times the specified value.");
  263.         REGISTER_CVAR2("ai_DebugDrawCollisionAvoidanceAgentName", &DebugDrawCollisionAvoidanceAgentName, "", VF_CHEAT | VF_CHEAT_NOCHECK,
  264.                        "Name of the agent to draw collision avoidance data for.");
  265.         REGISTER_CVAR2("ai_SOMSpeedRelaxed", &SOMSpeedRelaxed, 0.4f, VF_NULL,
  266.                        "Time before the AI will see the enemy while relaxed.\n"
  267.                        "Usage: ai_SOMSpeedRelaxed 0.4\n"
  268.                        "Default is 0.4. A lower value causes the AI to react to the enemy faster.");
  269.         REGISTER_CVAR2("ai_SOMSpeedCombat", &SOMSpeedCombat, 0.15f, VF_NULL,
  270.                        "Time before the AI will see the enemy while alarmed.\n"
  271.                        "Usage: ai_SOMSpeedCombat 0.15\n"
  272.                        "Default is 0.15. A lower value causes the AI to react to the enemy faster.");
  273.  
  274.         REGISTER_CVAR2("ai_SightRangeSuperDarkIllumMod", &SightRangeSuperDarkIllumMod, 0.25f, VF_NULL,
  275.                        "Multiplier for sightrange when the target is in super dark light condition.");
  276.         REGISTER_CVAR2("ai_SightRangeDarkIllumMod", &SightRangeDarkIllumMod, 0.5f, VF_NULL,
  277.                        "Multiplier for sightrange when the target is in dark light condition.");
  278.         REGISTER_CVAR2("ai_SightRangeMediumIllumMod", &SightRangeMediumIllumMod, 0.8f, VF_NULL,
  279.                        "Multiplier for sightrange when the target is in medium light condition.");
  280.         REGISTER_CVAR2("ai_PathfindTimeLimit", &AllowedTimeForPathfinding, 0.08f, VF_NULL,
  281.                        "Specifies how many seconds an individual AI can hold the pathfinder blocked\n"
  282.                        "Usage: ai_PathfindTimeLimit 0.15\n"
  283.                        "Default is 0.08. A lower value will result in more path requests that end in NOPATH -\n"
  284.                        "although the path may actually exist.");
  285.         REGISTER_CVAR2("ai_PathfinderUpdateTime", &PathfinderUpdateTime, 0.0005f, VF_NULL,
  286.                        "Maximum pathfinder time per AI update");
  287.         REGISTER_CVAR2("ai_DrawAgentFOV", &DrawAgentFOV, 0, VF_CHEAT | VF_CHEAT_NOCHECK,
  288.                        "Toggles the vision cone of the AI agent.\n"
  289.                        "Usage: ai_DrawagentFOV [0..1]\n"
  290.                        "Default is 0 (off), value 1 will draw the cone all the way to\n"
  291.                        "the sight range, value 0.1 will draw the cone to distance of 10%\n"
  292.                        "of the sight range, etc. ai_DebugDraw must be enabled before\n"
  293.                        "this tool can be used.");
  294.         REGISTER_CVAR2("ai_FilterAgentName", &FilterAgentName, "", VF_CHEAT | VF_CHEAT_NOCHECK,
  295.                        "Only draws the AI info of the agent with the given name.\n"
  296.                        "Usage: ai_FilterAgentName name\n"
  297.                        "Default is none (draws all of them if ai_debugdraw is on)\n");
  298.         REGISTER_CVAR2("ai_AgentStatsDist", &AgentStatsDist, 150, VF_CHEAT | VF_CHEAT_NOCHECK,
  299.                        "Sets agent statistics draw distance, such as current goalpipe, command and target.\n"
  300.                        "Only information on enabled AI objects will be displayed.\n"
  301.                        "To display more information on particular AI agent, use ai_StatsTarget.\n"
  302.                        "Yellow line represents direction where AI is trying to move;\n"
  303.                        "Red line represents direction where AI is trying to look;\n"
  304.                        "Blue line represents forward dir (entity forward);\n"
  305.                        "Usage: ai_AgentStatsDist [view distance]\n"
  306.                        "Default is 20 meters. Works with ai_DebugDraw enabled.");
  307.         REGISTER_CVAR2("ai_DebugDrawArrowLabelsVisibilityDistance", &DebugDrawArrowLabelsVisibilityDistance, 50.0f, VF_CHEAT | VF_CHEAT_NOCHECK,
  308.                        "Provided ai_DebugDraw > 0, if the camera is closer to an agent than this distance,\n"
  309.                        "agent arrows for look/fire/move arrows will have labels.\n"
  310.                        "Usage: ai_DebugDrawArrowLabelsVisibilityDistance [distance]\n"
  311.                        "Default is 50. \n");
  312.         DefineConstIntCVarName("ai_DebugDraw", DebugDraw, -1, VF_CHEAT | VF_CHEAT_NOCHECK,
  313.                                "Toggles the AI debugging view.\n"
  314.                                "Usage: ai_DebugDraw [-1/0/1]\n"
  315.                                "Default is 0 (minimal), value -1 will draw nothing, value 1 displays AI rays and targets \n"
  316.                                "and enables the view for other AI debugging tools.");
  317.         DefineConstIntCVarName("ai_NetworkDebug", NetworkDebug, 0, VF_CHEAT | VF_CHEAT_NOCHECK,
  318.                                "Toggles the AI network debug.\n"
  319.                                "Usage: ai_NetworkDebug [0/1]\n"
  320.                                "Default is 0 (off). ai_NetworkDebug is used to direct DebugDraw information \n"
  321.                                "from the server to the client.");
  322.         DefineConstIntCVarName("ai_DebugDrawHideSpotSearchRays", DrawHideSpotSearchRays, 0, VF_CHEAT | VF_CHEAT_NOCHECK,
  323.                                "Toggle drawing rays used in HM_ONLY_IF_CAN_SHOOT_FROM_THERE hide spot search option.\n"
  324.                                "Usage: ai_DebugDrawHideSpotSearchRays [0..1]");
  325.         DefineConstIntCVarName("ai_DebugDrawVegetationCollisionDist", DebugDrawVegetationCollisionDist, 0, VF_CHEAT | VF_CHEAT_NOCHECK,
  326.                                "Enables drawing vegetation collision closer than a distance projected onto the terrain.");
  327.         DefineConstIntCVarName("ai_DebugDrawHidespotRange", DebugDrawHideSpotRange, 0, VF_CHEAT | VF_CHEAT_NOCHECK,
  328.                                "Sets the range for drawing hidespots around the player (needs ai_DebugDraw > 0).");
  329.         DefineConstIntCVarName("ai_DebugDrawDynamicHideObjectsRange", DebugDrawDynamicHideObjectsRange, 0, VF_CHEAT | VF_CHEAT_NOCHECK,
  330.                                "Sets the range for drawing dynamic hide objects around the player (needs ai_DebugDraw > 0).");
  331.         DefineConstIntCVarName("ai_DebugDrawVolumeVoxels", DebugDrawVolumeVoxels, 0, VF_CHEAT | VF_CHEAT_NOCHECK,
  332.                                "Toggles the AI debugging drawing of voxels in volume generation.\n"
  333.                                "Usage: ai_DebugDrawVolumeVoxels [0, 1, 2 etc]\n"
  334.                                "Default is 0 (off)\n"
  335.                                "+n draws all voxels with original value >= n\n"
  336.                                "-n draws all voxels with original value =  n");
  337.         DefineConstIntCVarName("ai_DebugPathfinding", DebugPathFinding, 0, VF_CHEAT | VF_CHEAT_NOCHECK,
  338.                                "Toggles output of pathfinding information [default 0 is off]");
  339.         DefineConstIntCVarName("ai_DebugCheckWalkability", DebugCheckWalkability, 0, VF_CHEAT | VF_CHEAT_NOCHECK,
  340.                                "Toggles output of check walkability information, as well as allowing the use of tagpoints named CheckWalkabilityTestStart/End to trigger a test each update. [default 0 is off]");
  341.         DefineConstIntCVarName("ai_DebugWalkabilityCache", DebugWalkabilityCache, 0, VF_CHEAT | VF_CHEAT_NOCHECK,
  342.                                "Toggles allowing the use of tagpoints named WalkabilityCacheOrigin to cache walkability. [default 0 is off]");
  343.         DefineConstIntCVarName("ai_DebugDrawBannedNavsos", DebugDrawBannedNavsos, 0, VF_CHEAT | VF_CHEAT_NOCHECK,
  344.                                "Toggles drawing banned navsos [default 0 is off]");
  345.         DefineConstIntCVarName("ai_DebugDrawGroups", DebugDrawGroups, 0, VF_CHEAT | VF_CHEAT_NOCHECK,
  346.                                "Toggles the AI Groups debugging view.\n"
  347.                                "Usage: ai_DebugDrawGroups [0/1]\n"
  348.                                "Default is 0 (off). ai_DebugDrawGroups displays groups' leaders, members and their desired positions.");
  349.         DefineConstIntCVarName("ai_DebugDrawCoolMisses", DebugDrawCoolMisses, 0, VF_CHEAT | VF_CHEAT_NOCHECK,
  350.                                "Toggles displaying the cool miss locations around the player.\n"
  351.                                "Usage: ai_DebugDrawCoolMisses [0/1]");
  352.         DefineConstIntCVarName("ai_DebugDrawFireCommand", DebugDrawFireCommand, 0, VF_CHEAT | VF_CHEAT_NOCHECK,
  353.                                "Toggles displaying the fire command targets and modifications.\n"
  354.                                "Usage: ai_DebugDrawFireCommand [0/1]");
  355.         DefineConstIntCVarName("ai_UseSimplePathfindingHeuristic", UseSimplePathfindingHeuristic, 0, VF_CHEAT | VF_CHEAT_NOCHECK,
  356.                                "Toggles the AI using a straight simple distance heuristic for debugging.\n"
  357.                                "Usage: ai_UseSimpleHeuristic [0/1]");
  358.         DefineConstIntCVarName("ai_CoverSystem", CoverSystem, 1, VF_CHEAT | VF_CHEAT_NOCHECK,
  359.                                "Enables the cover system.\n"
  360.                                "Usage: ai_CoverSystem [0/1]\n"
  361.                                "Default is 1 (on)\n"
  362.                                "0 - off - use anchors\n"
  363.                                "1 - use offline cover surfaces\n");
  364.         REGISTER_CVAR2("ai_CoverPredictTarget", &CoverPredictTarget, 1.0f, VF_NULL,
  365.                        "Enables simple cover system target location prediction.\n"
  366.                        "Usage: ai_CoverPredictTarget x\n"
  367.                        "Default x is 0.0 (off)\n"
  368.                        "x - how many seconds to look ahead\n");
  369.         REGISTER_CVAR2("ai_CoverSpacing", &CoverSpacing, 0.5f, VF_NULL,
  370.                        "Minimum spacing between agents when choosing cover.\n"
  371.                        "Usage: ai_CoverPredictTarget <x>\n"
  372.                        "x - Spacing width in meters\n");
  373.         DefineConstIntCVarName("ai_CoverExactPositioning", CoverExactPositioning, 0, VF_CHEAT | VF_CHEAT_NOCHECK,
  374.                                "Enables using exact positioning for arriving at cover.\n"
  375.                                "Usage: ai_CoverPredictTarget [0/1]\n"
  376.                                "Default x is 0 (off)\n"
  377.                                "0 - disable\n"
  378.                                "1 - enable\n");
  379.         DefineConstIntCVarName("ai_CoverMaxEyeCount", CoverMaxEyeCount, 2, VF_CHEAT | VF_CHEAT_NOCHECK,
  380.                                "Max numbers of observers to consider when selecting cover.\n"
  381.                                "Usage: ai_CoverMaxEyeCount <x>\n");
  382.         DefineConstIntCVarName("ai_DebugDrawCover", DebugDrawCover, 0, VF_CHEAT | VF_CHEAT_NOCHECK,
  383.                                "Displays cover debug information.\n"
  384.                                "Usage: ai_DebugDrawCover [0/1/2]\n"
  385.                                "Default is 0 (off)\n"
  386.                                "0 - off\n"
  387.                                "1 - currently being used\n"
  388.                                "2 - all in 50m range (slow)\n");
  389.         DefineConstIntCVarName("ai_DebugDrawCoverOccupancy", DebugDrawCoverOccupancy, 0, VF_CHEAT | VF_CHEAT_NOCHECK,
  390.                                "Renders red balls at the location of occupied cover.\n"
  391.                                "Usage: ai_DebugDrawCoverOccupancy [0/1]\n"
  392.                                "Default is 0 (off)\n"
  393.                                "0 - off\n"
  394.                                "1 - render red balls at the location of occupied cover\n");
  395.         DefineConstIntCVarName("ai_DebugDrawNavigation", DebugDrawNavigation, 0, VF_CHEAT | VF_CHEAT_NOCHECK,
  396.                                "Displays the navigation debug information.\n"
  397.                                "Usage: ai_DebugDrawNavigation [0/1]\n"
  398.                                "Default is 0 (off)\n"
  399.                                "0 - off\n"
  400.                                "1 - triangles and contour\n"
  401.                                "2 - triangles, mesh and contours\n"
  402.                                "3 - triangles, mesh contours and external links\n"
  403.                                "4 - triangles, mesh contours, external links and triangle IDs\n"
  404.                                "5 - triangles, mesh contours, external links and island IDs\n"
  405.                                "6 - triangles with backfaces, mesh contours and external links\n");
  406.         DefineConstIntCVarName("ai_IslandConnectionsSystemProfileMemory", IslandConnectionsSystemProfileMemory, 0, VF_CHEAT | VF_CHEAT_NOCHECK,
  407.                                "Enables/Disables the memory profile for the island connections system.");
  408.         DefineConstIntCVarName("ai_NavigationSystemMT", NavigationSystemMT, 1, VF_CHEAT | VF_CHEAT_NOCHECK,
  409.                                "Enables navigation information updates on a separate thread.\n"
  410.                                "Usage: ai_NavigationSystemMT [0/1]\n"
  411.                                "Default is 1 (on)\n"
  412.                                "0 - off\n"
  413.                                "1 - on\n");
  414.         DefineConstIntCVarName("ai_NavGenThreadJobs", NavGenThreadJobs, 1, VF_CHEAT | VF_CHEAT_NOCHECK,
  415.                                "Number of tile generation jobs per thread per frame.\n"
  416.                                "Usage: ai_NavGenThreadJobs [1+]\n"
  417.                                "Default is 1. The more you have, the faster it will go but the frame rate will drop while it works.\n"
  418.                                "Recommendations:\n"
  419.                                " Fast machine [10]\n"
  420.                                " Slow machine [4]\n"
  421.                                " Smooth [1]\n");
  422.         DefineConstIntCVarName("ai_DebugDrawNavigationWorldMonitor", DebugDrawNavigationWorldMonitor, 0, VF_CHEAT | VF_CHEAT_NOCHECK,
  423.                                "Enables displaying bounding boxes for world changes.\n"
  424.                                "Usage: ai_DebugDrawNavigationWorldMonitor [0/1]\n"
  425.                                "Default is 0 (off)\n"
  426.                                "0 - off\n"
  427.                                "1 - on\n");
  428.         DefineConstIntCVarName("ai_DebugDrawCoverPlanes", DebugDrawCoverPlanes, 0, VF_CHEAT | VF_CHEAT_NOCHECK,
  429.                                "Displays cover planes.\n"
  430.                                "Usage: ai_DebugDrawCoverPlanes [0/1]\n"
  431.                                "Default is 0 (off)\n");
  432.         DefineConstIntCVarName("ai_DebugDrawCoverLocations", DebugDrawCoverLocations, 0, VF_CHEAT | VF_CHEAT_NOCHECK,
  433.                                "Displays cover locations.\n"
  434.                                "Usage: ai_DebugDrawCoverLocations [0/1]\n"
  435.                                "Default is 0 (off)\n");
  436.         DefineConstIntCVarName("ai_DebugDrawCoverSampler", DebugDrawCoverSampler, 0, VF_CHEAT | VF_CHEAT_NOCHECK,
  437.                                "Displays cover sampler debug rendering.\n"
  438.                                "Usage: ai_DebugDrawCoverSampler [0/1/2/3]\n"
  439.                                "Default is 0 (off)\n"
  440.                                "0 - off\n"
  441.                                "1 - display floor sampling\n"
  442.                                "2 - display surface sampling\n"
  443.                                "3 - display both\n");
  444.         DefineConstIntCVarName("ai_DebugDrawDynamicCoverSampler", DebugDrawDynamicCoverSampler, 0, VF_CHEAT | VF_CHEAT_NOCHECK,
  445.                                "Displays dynamic cover sampler debug rendering.\n"
  446.                                "Usage: ai_DebugDrawDynamicCoverSampler [0/1]\n"
  447.                                "Default is 0 (off)\n"
  448.                                "0 - off\n"
  449.                                "1 - on\n");
  450.         DefineConstIntCVarName("ai_DebugDrawCommunication", DebugDrawCommunication, 0, VF_CHEAT | VF_CHEAT_NOCHECK,
  451.                                "Displays communication debug information.\n"
  452.                                "Usage: ai_DebugDrawCommunication [0/1/2]\n"
  453.                                " 0 - disabled. (default).\n"
  454.                                " 1 - draw playing and queued comms.\n"
  455.                                " 2 - draw debug history for each entity.\n"
  456.                                " 5 - extended debugging (to log)"
  457.                                " 6 - outputs info about each line played");
  458.         DefineConstIntCVarName("ai_DebugDrawCommunicationHistoryDepth", DebugDrawCommunicationHistoryDepth, 5, VF_CHEAT | VF_CHEAT_NOCHECK,
  459.                                "Tweaks how many historical entries are displayed per entity.\n"
  460.                                "Usage: ai_DebugDrawCommunicationHistoryDepth [depth]");
  461.         DefineConstIntCVarName("ai_RecordCommunicationStats", RecordCommunicationStats, 0, VF_CHEAT | VF_CHEAT_NOCHECK,
  462.                                "Turns on/off recording of communication stats to a log.\n"
  463.                                "Usage: ai_RecordCommunicationStats [0/1]\n"
  464.                                );
  465.         REGISTER_CVAR2("ai_CommunicationManagerHeighThresholdForTargetPosition", &CommunicationManagerHeightThresholdForTargetPosition, 5.0f, VF_CHEAT | VF_CHEAT_NOCHECK,
  466.                        "Defines the threshold used to detect if the target is above or below the entity that wants to play a communication.\n");
  467.         DefineConstIntCVarName("ai_CommunicationForceTestVoicePack", CommunicationForceTestVoicePack, 0, VF_CHEAT | VF_CHEAT_NOCHECK,
  468.                                "Forces all the AI agents to use a test voice pack. The test voice pack will have the specified name in the archetype"
  469.                                " or in the entity and the system will replace the _XX number with the _test string");
  470.         DefineConstIntCVarName("ai_DrawNodeLinkType", DrawNodeLinkType, 0, VF_CHEAT | VF_CHEAT_NOCHECK,
  471.                                "Sets the link parameter to draw with ai_DrawNode.\n"
  472.                                "Values are:\n"
  473.                                " 0 - pass radius (default)\n"
  474.                                " 1 - exposure\n"
  475.                                " 2 - water max depth\n"
  476.                                " 3 - water min depth");
  477.         REGISTER_CVAR2("ai_DrawNodeLinkCutoff", &DrawNodeLinkCutoff, 0.0f, VF_CHEAT | VF_CHEAT_NOCHECK,
  478.                        "Sets the link cutoff value in ai_DrawNodeLinkType. If the link value is more than\n"
  479.                        "ai_DrawNodeLinkCutoff the number gets displayed in green, otherwise red.");
  480.         REGISTER_CVAR2("ai_SystemUpdate", &AiSystem, 1, VF_CHEAT | VF_CHEAT_NOCHECK,
  481.                        "Toggles the regular AI system update.\n"
  482.                        "Usage: ai_SystemUpdate [0/1]\n"
  483.                        "Default is 1 (on). Set to 0 to disable ai system updating.");
  484.         DefineConstIntCVarName("ai_SoundPerception", SoundPerception, 1, VF_CHEAT | VF_CHEAT_NOCHECK,
  485.                                "Toggles AI sound perception.\n"
  486.                                "Usage: ai_SoundPerception [0/1]\n"
  487.                                "Default is 1 (on). Used to prevent AI from hearing sounds for\n"
  488.                                "debugging purposes. Works with ai_DebugDraw enabled.");
  489.         DefineConstIntCVarName("ai_IgnorePlayer", IgnorePlayer, 0, VF_CHEAT | VF_CHEAT_NOCHECK,
  490.                                "Makes AI ignore the player.\n"
  491.                                "Usage: ai_IgnorePlayer [0/1]\n"
  492.                                "Default is 0 (off). Set to 1 to make AI ignore the player.\n"
  493.                                "Used with ai_DebugDraw enabled.");
  494.         DefineConstIntCVarName("ai_IgnoreVisibilityChecks", IgnoreVisibilityChecks, 0, VF_CHEAT | VF_CHEAT_NOCHECK,
  495.                                "Makes certain visibility checks (for teleporting etc) return false.");
  496.         DefineConstIntCVarName("ai_DrawFormations", DrawFormations, 0, VF_CHEAT | VF_CHEAT_NOCHECK,
  497.                                "Draws all the currently active formations of the AI agents.\n"
  498.                                "Usage: ai_DrawFormations [0/1]\n"
  499.                                "Default is 0 (off). Set to 1 to draw the AI formations.");
  500.         DefineConstIntCVarName("ai_DrawSmartObjects", DrawSmartObjects, 0, VF_CHEAT | VF_CHEAT_NOCHECK,
  501.                                "Draws smart object debug information.\n"
  502.                                "Usage: ai_DrawSmartObjects [0/1]\n"
  503.                                "Default is 0 (off). Set to 1 to draw the smart objects.");
  504.         DefineConstIntCVarName("ai_DrawReadibilities", DrawReadibilities, 0, VF_CHEAT | VF_CHEAT_NOCHECK,
  505.                                "Draws all the currently active readibilities of the AI agents.\n"
  506.                                "Usage: ai_DrawReadibilities [0/1]\n"
  507.                                "Default is 0 (off). Set to 1 to draw the AI readibilities.");
  508.         DefineConstIntCVarName("ai_DrawGoals", DrawGoals, 0, VF_CHEAT | VF_CHEAT_NOCHECK,
  509.                                "Draws all the active goal ops debug info.\n"
  510.                                "Usage: ai_DrawGoals [0/1]\n"
  511.                                "Default is 0 (off). Set to 1 to draw the AI goal op debug info.");
  512.         DefineConstIntCVarName("ai_AllTime", AllTime, 0, VF_CHEAT | VF_CHEAT_NOCHECK,
  513.                                "Displays the update times of all agents, in milliseconds.\n"
  514.                                "Usage: ai_AllTime [0/1]\n"
  515.                                "Default is 0 (off). Times all agents and displays the time used updating\n"
  516.                                "each of them. The name is colour coded to represent the update time.\n"
  517.                                "        Green: less than 1 ms (ok)\n"
  518.                                "        White: 1 ms to 5 ms\n"
  519.                                "        Red: more than 5 ms\n"
  520.                                "You must enable ai_DebugDraw before you can use this tool.");
  521.         DefineConstIntCVarName("ai_ProfileGoals", ProfileGoals, 0, VF_CHEAT | VF_CHEAT_NOCHECK,
  522.                                "Toggles timing of AI goal execution.\n"
  523.                                "Usage: ai_ProfileGoals [0/1]\n"
  524.                                "Default is 0 (off). Records the time used for each AI goal (like\n"
  525.                                "approach, run or pathfind) to execute. The longest execution time\n"
  526.                                "is displayed on screen. Used with ai_DebugDraw enabled.");
  527.         DefineConstIntCVarName("ai_BeautifyPath", BeautifyPath, 1, VF_CHEAT | VF_CHEAT_NOCHECK,
  528.                                "Toggles AI optimisation of the generated path.\n"
  529.                                "Usage: ai_BeautifyPath [0/1]\n"
  530.                                "Default is 1 (on). Optimisation is on by default. Set to 0 to\n"
  531.                                "disable path optimisation (AI uses non-optimised path).");
  532.         DefineConstIntCVarName("ai_PathStringPullingIterations", PathStringPullingIterations, 5, VF_CHEAT | VF_CHEAT_NOCHECK,
  533.                                "Defines the number of iteration used for the string pulling operation to simplify the path");
  534.         DefineConstIntCVarName("ai_AttemptStraightPath", AttemptStraightPath, 1, VF_CHEAT | VF_CHEAT_NOCHECK,
  535.                                "Toggles AI attempting a simple straight path when possible.\n"
  536.                                "Default is 1 (on).");
  537.         DefineConstIntCVarName("ai_CrowdControlInPathfind", CrowdControlInPathfind, 0, VF_CHEAT | VF_CHEAT_NOCHECK,
  538.                                "Toggles AI using crowd control in pathfinding.\n"
  539.                                "Usage: ai_CrowdControlInPathfind [0/1]\n"
  540.                                "Default is 0 (off).");
  541.         DefineConstIntCVarName("ai_DebugDrawCrowdControl", DebugDrawCrowdControl, 0, VF_CHEAT | VF_CHEAT_NOCHECK,
  542.                                "Draws crowd control debug information. 0=off, 1=on");
  543.         DefineConstIntCVarName("ai_PredictivePathFollowing", PredictivePathFollowing, 1, VF_CHEAT | VF_CHEAT_NOCHECK,
  544.                                "Sets if AI should use the predictive path following if allowed by the type's config.");
  545.         REGISTER_CVAR2("ai_SteepSlopeUpValue", &SteepSlopeUpValue, 1.0f, VF_CHEAT | VF_CHEAT_NOCHECK,
  546.                        "Indicates slope value that is borderline-walkable up.\n"
  547.                        "Usage: ai_SteepSlopeUpValue 0.5\n"
  548.                        "Default is 1.0 Zero means flat. Infinity means vertical. Set it smaller than ai_SteepSlopeAcrossValue");
  549.         REGISTER_CVAR2("ai_SteepSlopeAcrossValue", &SteepSlopeAcrossValue, 0.6f, VF_CHEAT | VF_CHEAT_NOCHECK,
  550.                        "Indicates slope value that is borderline-walkable across.\n"
  551.                        "Usage: ai_SteepSlopeAcrossValue 0.8\n"
  552.                        "Default is 0.6 Zero means flat. Infinity means vertical. Set it greater than ai_SteepSlopeUpValue");
  553.         DefineConstIntCVarName("ai_UpdateProxy", UpdateProxy, 1, VF_CHEAT | VF_CHEAT_NOCHECK,
  554.                                "Toggles update of AI proxy (model).\n"
  555.                                "Usage: ai_UpdateProxy [0/1]\n"
  556.                                "Default is 1 (on). Updates proxy (AI representation in game)\n"
  557.                                "set to 0 to disable proxy updating.");
  558.         DefineConstIntCVarName("ai_DrawType", DrawType, -1, VF_CHEAT | VF_CHEAT_NOCHECK,
  559.                                "Display all AI object of specified type. If object is enabled it will be displayed.\n"
  560.                                "with blue ball, otherwise with red ball. Yellow line will represent forward direction of the object.\n"
  561.                                " <0 - off\n"
  562.                                " 0 - display all the dummy objects\n"
  563.                                " >0 - type of AI objects to display");
  564.         DefineConstIntCVarName("ai_DrawModifiers", DrawModifiers, 0, VF_CHEAT | VF_CHEAT_NOCHECK,
  565.                                "Toggles the AI debugging view of navigation modifiers.");
  566.         REGISTER_CVAR2("ai_DrawOffset", &DebugDrawOffset, 0.1f, VF_CHEAT | VF_CHEAT_NOCHECK,
  567.                        "vertical offset during debug drawing (graph nodes, navigation paths, ...)");
  568.         DefineConstIntCVarName("ai_DrawTargets", DrawTargets, 0, VF_CHEAT | VF_CHEAT_NOCHECK,
  569.                                "Distance to display the perception events of all enabled puppets.\n"
  570.                                "Displays target type and priority");
  571.         DefineConstIntCVarName("ai_DrawBadAnchors", DrawBadAnchors, -1, VF_CHEAT | VF_CHEAT_NOCHECK,
  572.                                "Toggles drawing out of bounds AI objects of particular type for debugging AI.\n"
  573.                                "Valid only for 3D navigation. Draws red spheres at positions of anchors which are\n"
  574.                                "located out of navigation volumes. Those anchors have to be moved.\n"
  575.                                " 0 - off, 1 - on");
  576.         DefineConstIntCVarName("ai_DrawStats", DrawStats, 0, VF_CHEAT | VF_CHEAT_NOCHECK,
  577.                                "Toggles drawing stats (in a table on top left of screen) for AI objects within specified range.\n"
  578.                                "Will display attention target, goal pipe and current goal.");
  579.         DefineConstIntCVarName("ai_DrawAttentionTargetPositions", DrawAttentionTargetsPosition, 0, VF_CHEAT | VF_CHEAT_NOCHECK,
  580.                                "Displays markers for the AI's current attention target position. ");
  581.         REGISTER_CVAR2("ai_ExtraRadiusDuringBeautification", &ExtraRadiusDuringBeautification, 0.2f, VF_CHEAT | VF_CHEAT_NOCHECK,
  582.                        "Extra radius added to agents during beautification.");
  583.         REGISTER_CVAR2("ai_ExtraForbiddenRadiusDuringBeautification", &ExtraForbiddenRadiusDuringBeautification, 1.0f, VF_CHEAT | VF_CHEAT_NOCHECK,
  584.                        "Extra radius added to agents close to forbidden edges during beautification.");
  585.         DefineConstIntCVarName("ai_RecordLog", RecordLog, 0, VF_CHEAT | VF_CHEAT_NOCHECK,
  586.                                "log all the AI state changes on stats_target");
  587.         DefineConstIntCVarName("ai_DrawGroupTactic", DrawGroupTactic, 0, VF_CHEAT | VF_CHEAT_NOCHECK,
  588.                                "draw group tactic: 0 = disabled, 1 = draw simple, 2 = draw complex.");
  589.         DefineConstIntCVarName("ai_DrawTrajectory", DrawTrajectory, 0, VF_CHEAT | VF_CHEAT_NOCHECK,
  590.                                "Record and draw the actual path taken by the agent specified in ai_StatsTarget.\n"
  591.                                "Path is displayed in aqua, and only a certain length will be displayed, after which\n"
  592.                                "old path gradually disappears as new path is drawn.\n"
  593.                                "0=do not record, 1=record.");
  594.         DefineConstIntCVarName("ai_DrawHidespots", DrawHideSpots, 0, VF_CHEAT | VF_CHEAT_NOCHECK,
  595.                                "Draws latest hide-spot positions for all agents within specified range.");
  596.         DefineConstIntCVarName("ai_DrawRadar", DrawRadar, 0, VF_CHEAT | VF_CHEAT_NOCHECK,
  597.                                "Draws AI radar: 0=no radar, >0 = size of the radar on screen");
  598.         DefineConstIntCVarName("ai_DrawRadarDist", DrawRadarDist, 20, VF_CHEAT | VF_CHEAT_NOCHECK,
  599.                                "AI radar draw distance in meters, default=20m.");
  600.         // should be off for release
  601.         DefineConstIntCVarName("ai_Recorder_Auto", DebugRecordAuto, 0, VF_CHEAT | VF_CHEAT_NOCHECK,
  602.                                "Auto record the AI when in Editor mode game\n");
  603.         DefineConstIntCVarName("ai_Recorder_Buffer", DebugRecordBuffer, 1024, VF_CHEAT | VF_CHEAT_NOCHECK,
  604.                                "Set the size of the AI debug recording buffer");
  605.         DefineConstIntCVarName("ai_DrawDistanceLUT", DrawDistanceLUT, 0, VF_CHEAT | VF_CHEAT_NOCHECK,
  606.                                "Draws the distance lookup table graph overlay.");
  607.         DefineConstIntCVarName("ai_DrawAreas", DrawAreas, 0, VF_CHEAT | VF_CHEAT_NOCHECK,
  608.                                "Enables/Disables drawing behavior related areas.");
  609.         REGISTER_CVAR2("ai_BurstWhileMovingDestinationRange", &BurstWhileMovingDestinationRange, 2.0f, 0,
  610.                        "When using FIREMODE_BURST_WHILE_MOVING - only fire when within this distance to the destination.");
  611.         DefineConstIntCVarName("ai_DrawProbableTarget", DrawProbableTarget, 0, VF_CHEAT | VF_CHEAT_NOCHECK,
  612.                                "Enables/Disables drawing the position of probable target.");
  613.         DefineConstIntCVarName("ai_DebugDrawDamageParts", DebugDrawDamageParts, 0, VF_CHEAT | VF_CHEAT_NOCHECK,
  614.                                "Draws the damage parts of puppets and vehicles.");
  615.         DefineConstIntCVarName("ai_DebugDrawStanceSize", DebugDrawStanceSize, 0, VF_CHEAT | VF_CHEAT_NOCHECK,
  616.                                "Draws the game logic representation of the stance size of the AI agents.");
  617.  
  618.         DefineConstIntCVarName("ai_DebugTargetSilhouette", DebugTargetSilhouette, 0, VF_CHEAT | VF_CHEAT_NOCHECK,
  619.                                "Draws the silhouette used for missing the target while shooting.");
  620.  
  621.         REGISTER_CVAR2("ai_RODAliveTime", &RODAliveTime, 3.0f, VF_NULL,
  622.                        "The base level time the player can survive under fire.");
  623.         REGISTER_CVAR2("ai_RODMoveInc", &RODMoveInc, 3.0f, VF_NULL,
  624.                        "Increment how the speed of the target affects the alive time (the value is doubled for supersprint). 0=disable");
  625.         REGISTER_CVAR2("ai_RODStanceInc", &RODStanceInc, 2.0f, VF_NULL,
  626.                        "Increment how the stance of the target affects the alive time, 0=disable.\n"
  627.                        "The base value is for crouch, and it is doubled for prone.\n"
  628.                        "The crouch inc is disable in kill-zone and prone in kill and combat-near -zones");
  629.         REGISTER_CVAR2("ai_RODDirInc", &RODDirInc, 0.0f, VF_NULL,
  630.                        "Increment how the orientation of the target affects the alive time. 0=disable");
  631.         REGISTER_CVAR2("ai_RODKillZoneInc", &RODKillZoneInc, -4.0f, VF_NULL,
  632.                        "Increment how the target is within the kill-zone of the target.");
  633.         REGISTER_CVAR2("ai_RODFakeHitChance", &RODFakeHitChance, 0.2f, VF_NULL,
  634.                        "Percentage of the missed hits that will instead be hits dealing very little damage.");
  635.         REGISTER_CVAR2("ai_RODAmbientFireInc", &RODAmbientFireInc, 3.0f, VF_NULL,
  636.                        "Increment for the alive time when the target is within the kill-zone of the target.");
  637.  
  638.         REGISTER_CVAR2("ai_RODKillRangeMod", &RODKillRangeMod, 0.15f, VF_NULL,
  639.                        "Kill-zone distance = attackRange * killRangeMod.");
  640.         REGISTER_CVAR2("ai_RODCombatRangeMod", &RODCombatRangeMod, 0.55f, VF_NULL,
  641.                        "Combat-zone distance = attackRange * combatRangeMod.");
  642.  
  643.         REGISTER_CVAR2("ai_RODCoverFireTimeMod", &RODCoverFireTimeMod, 1.0f, VF_NULL,
  644.                        "Multiplier for cover fire times set in weapon descriptor.");
  645.  
  646.         REGISTER_CVAR2("ai_RODReactionTime", &RODReactionTime, 1.0f, VF_NULL,
  647.                        "Uses rate of death as damage control method.");
  648.         REGISTER_CVAR2("ai_RODReactionDistInc", &RODReactionDistInc, 0.1f, VF_NULL,
  649.                        "Increase for the reaction time when the target is in combat-far-zone or warn-zone.\n"
  650.                        "In warn-zone the increase is doubled.");
  651.         REGISTER_CVAR2("ai_RODReactionDirInc", &RODReactionDirInc, 2.0f, VF_NULL,
  652.                        "Increase for the reaction time when the enemy is outside the players FOV or near the edge of the FOV.\n"
  653.                        "The increment is doubled when the target is behind the player.");
  654.         REGISTER_CVAR2("ai_RODReactionLeanInc", &RODReactionLeanInc, 0.2f, VF_NULL,
  655.                        "Increase to the reaction to when the target is leaning.");
  656.         REGISTER_CVAR2("ai_RODReactionSuperDarkIllumInc", &RODReactionSuperDarkIllumInc, 0.4f, VF_NULL,
  657.                        "Increase for reaction time when the target is in super dark light condition.");
  658.         REGISTER_CVAR2("ai_RODReactionDarkIllumInc", &RODReactionDarkIllumInc, 0.3f, VF_NULL,
  659.                        "Increase for reaction time when the target is in dark light condition.");
  660.         REGISTER_CVAR2("ai_RODReactionMediumIllumInc", &RODReactionMediumIllumInc, 0.2f, VF_NULL,
  661.                        "Increase for reaction time when the target is in medium light condition.");
  662.  
  663.         REGISTER_CVAR2("ai_RODLowHealthMercyTime", &RODLowHealthMercyTime, 1.5f, VF_NULL,
  664.                        "The amount of time the AI will not hit the target when the target crosses the low health threshold.");
  665.  
  666.         DefineConstIntCVarName("ai_AmbientFireEnable", AmbientFireEnable, 1, VF_CHEAT | VF_CHEAT_NOCHECK,
  667.                                "Enable ambient fire system.");
  668.         REGISTER_CVAR2("ai_AmbientFireUpdateInterval", &AmbientFireUpdateInterval, 1.0f, VF_NULL,
  669.                        "Ambient fire update interval. Controls how often puppet's ambient fire status is updated.");
  670.         REGISTER_CVAR2("ai_AmbientFireQuota", &AmbientFireQuota, 2, 0,
  671.                        "Number of units allowed to hit the player at a time.");
  672.         DefineConstIntCVarName("ai_DebugDrawAmbientFire", DebugDrawAmbientFire, 0, VF_CHEAT | VF_CHEAT_NOCHECK,
  673.                                "Displays fire quota on puppets.");
  674.  
  675.         DefineConstIntCVarName("ai_PlayerAffectedByLight", PlayerAffectedByLight, 1, VF_CHEAT | VF_CHEAT_NOCHECK,
  676.                                "Sets if player is affected by light from observable perception checks");
  677.  
  678.         DefineConstIntCVarName("ai_DebugDrawExpensiveAccessoryQuota", DebugDrawExpensiveAccessoryQuota, 0, VF_CHEAT | VF_CHEAT_NOCHECK,
  679.                                "Displays expensive accessory usage quota on puppets.");
  680.  
  681.         DefineConstIntCVarName("ai_DebugDrawDamageControl", DebugDrawDamageControl, 0, VF_CHEAT | VF_CHEAT_NOCHECK,
  682.                                "Debugs the damage control system 0=disabled, 1=collect, 2=collect&draw.");
  683.  
  684.         DefineConstIntCVarName("ai_DrawFakeTracers", DrawFakeTracers, 0, VF_CHEAT | VF_CHEAT_NOCHECK,
  685.                                "Draws fake tracers around the player.");
  686.         DefineConstIntCVarName("ai_DrawFakeHitEffects", DrawFakeHitEffects, 0, VF_CHEAT | VF_CHEAT_NOCHECK,
  687.                                "Draws fake hit effects the player.");
  688.         DefineConstIntCVarName("ai_DrawFakeDamageInd", DrawFakeDamageInd, 0, VF_CHEAT | VF_CHEAT_NOCHECK,
  689.                                "Draws fake damage indicators on the player.");
  690.         DefineConstIntCVarName("ai_DrawPlayerRanges", DrawPlayerRanges, 0, VF_CHEAT | VF_CHEAT_NOCHECK,
  691.                                "Draws rings around player to assist in gauging target distance");
  692.         DefineConstIntCVarName("ai_DrawPerceptionIndicators", DrawPerceptionIndicators, 0, VF_CHEAT | VF_CHEAT_NOCHECK,
  693.                                "Draws indicators showing enemy current perception level of player");
  694.         DefineConstIntCVarName("ai_DrawPerceptionDebugging", DrawPerceptionDebugging, 0, VF_CHEAT | VF_CHEAT_NOCHECK,
  695.                                "Draws indicators showing enemy view intersection with perception modifiers");
  696.         DefineConstIntCVarName("ai_DrawPerceptionModifiers", DrawPerceptionModifiers, 0, VF_CHEAT | VF_CHEAT_NOCHECK,
  697.                                "Draws perception modifier areas in game mode");
  698.         DefineConstIntCVarName("ai_DebugPerceptionManager", DebugPerceptionManager, 0, VF_CHEAT | VF_CHEAT_NOCHECK,
  699.                                "Draws perception manager performance overlay. 0=disable, 1=vis checks, 2=stimulus");
  700.         DefineConstIntCVarName("ai_DebugGlobalPerceptionScale", DebugGlobalPerceptionScale, 0, VF_CHEAT | VF_CHEAT_NOCHECK,
  701.                                "Draws global perception scale multipliers on screen");
  702.         DefineConstIntCVarName("ai_TargetTracking", TargetTracking, 1, VF_CHEAT | VF_CHEAT_NOCHECK,
  703.                                "Enable/disable target tracking. 0=disable, any other value = Enable");
  704.         DefineConstIntCVarName("ai_TargetTracks_GlobalTargetLimit", TargetTracks_GlobalTargetLimit, 0, VF_CHEAT | VF_CHEAT_NOCHECK,
  705.                                "Global override to control the number of agents that can actively target another agent (unless there is no other choice)\n"
  706.                                "A value of 0 means no global limit is applied. If the global target limit is less than the agent's target limit, the global limit is used.");
  707.         DefineConstIntCVarName("ai_DebugTargetTracksTarget", TargetTracks_TargetDebugDraw, 0, VF_CHEAT | VF_CHEAT_NOCHECK,
  708.                                "Draws lines to illustrate where each agent's target is\n"
  709.                                "Usage: ai_DebugTargetTracking 0/1/2\n"
  710.                                "0 = Off. 1 = Show best target. 2 = Show all possible targets.");
  711.         REGISTER_CVAR2("ai_DebugTargetTracksAgent", &TargetTracks_AgentDebugDraw, "none", VF_CHEAT | VF_CHEAT_NOCHECK,
  712.                        "Draws the target tracks for the given agent\n"
  713.                        "Usage: ai_DebugTargetTracksAgent AIName\n"
  714.                        "Default is 'none'. AIName is the name of the AI agent to debug");
  715.         DefineConstIntCVarName("ai_DebugTargetTracksConfig", TargetTracks_ConfigDebugDraw, 0, VF_CHEAT | VF_CHEAT_NOCHECK,
  716.                                "Draws the information contained in the loaded target track configurations to the screen");
  717.         REGISTER_CVAR2("ai_DebugTargetTracksConfig_Filter", &TargetTracks_ConfigDebugFilter, "none", VF_CHEAT | VF_CHEAT_NOCHECK,
  718.                        "Filter what configurations are drawn when debugging target tracks\n"
  719.                        "Usage: ai_DebugTargetTracks_Filter Filter\n"
  720.                        "Default is 'none'. Filter is a substring that must be in the configuration name");
  721.  
  722.         REGISTER_CVAR2("ai_DrawSelectedTargets", &DrawSelectedTargets, 0, VF_CHEAT | VF_CHEAT_NOCHECK,
  723.                        "[0-1] Enable/Disable the debug helpers showing the AI's selected targets.");
  724.  
  725.         DefineConstIntCVarName("ai_ForceStance", ForceStance, -1, VF_CHEAT | VF_CHEAT_NOCHECK,
  726.                                "Forces all AI characters to specified stance:\n"
  727.                                "Disable = -1, Stand = 0, Crouch = 1, Prone = 2, Relaxed = 3, Stealth = 4, Cover = 5, Swim = 6, Zero-G = 7");
  728.  
  729.         DefineConstIntCVarName("ai_ForceAllowStrafing", ForceAllowStrafing, -1, VF_CHEAT | VF_CHEAT_NOCHECK,
  730.                                "Forces all AI characters to use/not use strafing (-1 disables)");
  731.  
  732.         DefineConstIntCVarName("ai_InterestSystem", InterestSystem, 1, VF_CHEAT | VF_CHEAT_NOCHECK,
  733.                                "Enable interest system");
  734.         DefineConstIntCVarName("ai_DebugInterestSystem", DebugInterest, 0, VF_CHEAT | VF_CHEAT_NOCHECK,
  735.                                "Display debugging information on interest system");
  736.         DefineConstIntCVarName("ai_InterestSystemCastRays", InterestSystemCastRays, 1, VF_CHEAT | VF_CHEAT_NOCHECK,
  737.                                "Makes the Interest System check visibility with rays");
  738.  
  739.         REGISTER_CVAR2("ai_BannedNavSoTime", &BannedNavSoTime, 15.0f, VF_NULL,
  740.                        "Time indicating how long invalid navsos should be banned.");
  741.         DefineConstIntCVarName("ai_DebugDrawAdaptiveUrgency", DebugDrawAdaptiveUrgency, 0, VF_CHEAT | VF_CHEAT_NOCHECK,
  742.                                "Enables drawing the adaptive movement urgency.");
  743.         DefineConstIntCVarName("ai_DebugDrawReinforcements", DebugDrawReinforcements, -1, VF_CHEAT | VF_CHEAT_NOCHECK,
  744.                                "Enables debug draw for reinforcement logic for specified group.\n"
  745.                                "Usage: ai_DebugDrawReinforcements <groupid>, or -1 to disable.");
  746.         DefineConstIntCVarName("ai_DebugDrawPlayerActions", DebugDrawPlayerActions, 0, VF_CHEAT | VF_CHEAT_NOCHECK,
  747.                                "Debug draw special player actions.");
  748.  
  749.         DefineConstIntCVarName("ai_DrawCollisionEvents", DrawCollisionEvents, 0, VF_CHEAT | VF_CHEAT_NOCHECK,
  750.                                "Debug draw the collision events the AI system processes. 0=disable, 1=enable.");
  751.         DefineConstIntCVarName("ai_DrawBulletEvents", DrawBulletEvents, 0, VF_CHEAT | VF_CHEAT_NOCHECK,
  752.                                "Debug draw the bullet events the AI system processes. 0=disable, 1=enable.");
  753.         DefineConstIntCVarName("ai_DrawSoundEvents", DrawSoundEvents, 0, VF_CHEAT | VF_CHEAT_NOCHECK,
  754.                                "Debug draw the sound events the AI system processes. 0=disable, 1=enable.");
  755.         DefineConstIntCVarName("ai_DrawGrenadeEvents", DrawGrenadeEvents, 0, VF_CHEAT | VF_CHEAT_NOCHECK,
  756.                                "Debug draw the grenade events the AI system processes. 0=disable, 1=enable.");
  757.         DefineConstIntCVarName("ai_DrawExplosions", DrawExplosions, 0, VF_CHEAT | VF_CHEAT_NOCHECK,
  758.                                "Debug draw the explosion events the AI system processes. 0=disable, 1=enable.");
  759.  
  760.         DefineConstIntCVarName("ai_EnableWaterOcclusion", WaterOcclusionEnable, 1, VF_CHEAT | VF_CHEAT_NOCHECK,
  761.                                "Enables applying water occlusion to AI target visibility checks");
  762.         REGISTER_CVAR2("ai_WaterOcclusion", &WaterOcclusionScale, .5f, VF_NULL,
  763.                        "scales how much water hides player from AI");
  764.  
  765.         DefineConstIntCVarName("ai_DebugDrawEnabledActors", DebugDrawEnabledActors, 0, VF_CHEAT | VF_CHEAT_NOCHECK,
  766.                                "list of AI Actors that are enabled and metadata");
  767.         DefineConstIntCVarName("ai_DebugDrawEnabledPlayers", DebugDrawEnabledPlayers, 0, VF_CHEAT | VF_CHEAT_NOCHECK,
  768.                                "list of AI players that are enabled and metadata");
  769.  
  770.         DefineConstIntCVarName("ai_DrawUpdate", DebugDrawUpdate, 0, VF_CHEAT | VF_CHEAT_NOCHECK,
  771.                                "list of AI forceUpdated entities");
  772.  
  773.         DefineConstIntCVarName("ai_DebugDrawLightLevel", DebugDrawLightLevel, 0, VF_CHEAT | VF_CHEAT_NOCHECK,
  774.                                "Debug AI light level manager");
  775.  
  776.         DefineConstIntCVarName("ai_SimpleWayptPassability", SimpleWayptPassability, 1, VF_CHEAT | VF_CHEAT_NOCHECK,
  777.                                "Use simplified and faster passability recalculation for human waypoint links where possible.");
  778.  
  779.         REGISTER_CVAR2("ai_MinActorDynamicObstacleAvoidanceRadius", &MinActorDynamicObstacleAvoidanceRadius, 0.6f, VF_NULL,
  780.                        "Minimum value in meters to be added to the obstacle's own size for actors\n"
  781.                        "(pathRadius property can override it if bigger)");
  782.         REGISTER_CVAR2("ai_ExtraVehicleAvoidanceRadiusBig", &ExtraVehicleAvoidanceRadiusBig, 4.0f, VF_NULL,
  783.                        "Value in meters to be added to a big obstacle's own size while computing obstacle\n"
  784.                        "size for purposes of vehicle steering. See also ai_ObstacleSizeThreshold.");
  785.         REGISTER_CVAR2("ai_ExtraVehicleAvoidanceRadiusSmall", &ExtraVehicleAvoidanceRadiusSmall, 0.5f, VF_NULL,
  786.                        "Value in meters to be added to a big obstacle's own size while computing obstacle\n"
  787.                        "size for purposes of vehicle steering. See also ai_ObstacleSizeThreshold.");
  788.         REGISTER_CVAR2("ai_ObstacleSizeThreshold", &ObstacleSizeThreshold, 1.2f, VF_NULL,
  789.                        "Obstacle size in meters that differentiates small obstacles from big ones so that vehicles can ignore the small ones");
  790.         REGISTER_CVAR2("ai_DrawGetEnclosingFailures", &DrawGetEnclosingFailures, 0.0f, VF_CHEAT | VF_CHEAT_NOCHECK,
  791.                        "Set to the number of seconds you want GetEnclosing() failures visualized.  Set to 0 to turn visualization off.");
  792.  
  793.         DefineConstIntCVarName("ai_CodeCoverageMode", CodeCoverage, 0, VF_CHEAT | VF_CHEAT_NOCHECK,
  794.                                "Set current mode of Code Coverage system.\n0 = off, 1 = smart, 2 = silent, 3 = force");
  795.  
  796.         DefineConstIntCVarName("ai_EnablePerceptionStanceVisibleRange", EnablePerceptionStanceVisibleRange, 0, VF_CHEAT | VF_CHEAT_NOCHECK, "Turn on use of max perception range for AI based on player's stance");
  797.         REGISTER_CVAR2("ai_CrouchVisibleRange", &CrouchVisibleRange, 15.0f, VF_CHEAT | VF_CHEAT_NOCHECK, "Max perception range for AI when player is crouching");
  798.         REGISTER_CVAR2("ai_ProneVisibleRange", &ProneVisibleRange, 6.0f, VF_CHEAT | VF_CHEAT_NOCHECK, "Max perception range for AI when player is proning");
  799.         DefineConstIntCVarName("ai_IgnoreVisualStimulus", IgnoreVisualStimulus, 0, VF_CHEAT | VF_CHEAT_NOCHECK, "Have the Perception Handler ignore all visual stimulus always");
  800.         DefineConstIntCVarName("ai_IgnoreSoundStimulus", IgnoreSoundStimulus, 0, VF_CHEAT | VF_CHEAT_NOCHECK, "Have the Perception Handler ignore all sound stimulus always");
  801.         DefineConstIntCVarName("ai_IgnoreBulletRainStimulus", IgnoreBulletRainStimulus, 0, VF_CHEAT | VF_CHEAT_NOCHECK, "Have the Perception Handler ignore all bullet rain stimulus always");
  802.  
  803.         REGISTER_CVAR2("ai_MNMPathFinderQuota", &MNMPathFinderQuota, 0.001f, VF_CHEAT | VF_CHEAT_NOCHECK,
  804.                        "Set path finding frame time quota in seconds (Set to 0 for no limit)");
  805.         REGISTER_CVAR2("ai_MNMPathFinderDebug", &MNMPathFinderDebug, 0, VF_CHEAT | VF_CHEAT_NOCHECK,
  806.                        "[0-1] Enable/Disable debug draw statistics on pathfinder load");
  807.  
  808.         REGISTER_CVAR2("ai_MNMProfileMemory", &MNMProfileMemory, 0, VF_CHEAT | VF_CHEAT_NOCHECK,
  809.                        "[0-1] Display navigation system memory statistics");
  810.  
  811.         REGISTER_CVAR2("ai_MNMDebugAccessibility", &MNMDebugAccessibility, 0, VF_CHEAT | VF_CHEAT_NOCHECK,
  812.                        "[0-1] Display navigation reachable areas in blue and not reachable areas in red");
  813.  
  814.         REGISTER_CVAR2("ai_MNMEditorBackgroundUpdate", &MNMEditorBackgroundUpdate, 1, VF_NULL,
  815.                        "[0-1] Enable/Disable editor background update of the Navigation Meshes");
  816.  
  817.         DefineConstIntCVarName("ai_UseSmartPathFollower", UseSmartPathFollower, 1, VF_CHEAT | VF_CHEAT_NOCHECK, "Enables Smart PathFollower (default: 1).");
  818.         DefineConstIntCVarName("ai_UseSmartPathFollower_AABB_based", SmartpathFollower_UseAABB_CheckWalkibility, 1, VF_CHEAT | VF_CHEAT_NOCHECK, "Enables Smart PathFollower to use AABB checks and other optimizations");
  819.         REGISTER_CVAR2("ai_UseSmartPathFollower_LookAheadDistance", &SmartPathFollower_LookAheadDistance, 10.0f, VF_NULL, "LookAheadDistance of SmartPathFollower");
  820.         REGISTER_CVAR2("ai_SmartPathFollower_LookAheadPredictionTimeForMovingAlongPathWalk", &SmartPathFollower_LookAheadPredictionTimeForMovingAlongPathWalk, 0.5f, VF_NULL,
  821.                        "Defines the time frame the AI is allowed to look ahead while moving strictly along a path to decide whether to cut towards the next point. (Walk only)\n");
  822.         REGISTER_CVAR2("ai_SmartPathFollower_LookAheadPredictionTimeForMovingAlongPathRunAndSprint", &SmartPathFollower_LookAheadPredictionTimeForMovingAlongPathRunAndSprint, 0.25f, VF_NULL,
  823.                        "Defines the time frame the AI is allowed to look ahead while moving strictly along a path to decide whether to cut towards the next point. (Run and Sprint only)\n");
  824.         REGISTER_CVAR2("ai_SmartPathFollower_decelerationHuman", &SmartPathFollower_decelerationHuman, 7.75f, VF_NULL, "Deceleration multiplier for non-vehicles");
  825.         REGISTER_CVAR2("ai_SmartPathFollower_decelerationVehicle", &SmartPathFollower_decelerationVehicle, 1.0f, VF_NULL, "Deceleration multiplier for vehicles");
  826.  
  827.         DefineConstIntCVarName("ai_MNMPathfinderMT", MNMPathfinderMT, 1, VF_CHEAT | VF_CHEAT_NOCHECK, "Enable/Disable Multi Threading for the pathfinder.");
  828.         DefineConstIntCVarName("ai_MNMPathfinderConcurrentRequests", MNMPathfinderConcurrentRequests, 4, VF_CHEAT | VF_CHEAT_NOCHECK,
  829.                                "Defines the amount of concurrent pathfinder requests that can be served at the same time.");
  830.  
  831.         DefineConstIntCVarName("ai_MNMRaycastImplementation", MNMRaycastImplementation, 1, VF_CHEAT | VF_CHEAT_NOCHECK,
  832.                                "Defines which type of raycast implementation to use on the MNM meshes."
  833.                                "0 - Old one. This version will be deprecated as it sometimes does not handle correctly the cases where the ray coincides with triangle egdes, which has been fixed in the new version.\n"
  834.                                "1 - New one.\n"
  835.                                "Any other value is used for the new one");
  836.  
  837.         DefineConstIntCVarName("ai_SmartPathFollower_useAdvancedPathShortcutting", SmartPathFollower_useAdvancedPathShortcutting, 1, VF_NULL, "Enables a more failsafe way of preventing the AI to shortcut through obstacles (0 = disable, any other value = enable)");
  838.         DefineConstIntCVarName("ai_SmartPathFollower_useAdvancedPathShortcutting_debug", SmartPathFollower_useAdvancedPathShortcutting_debug, 0, VF_NULL, "Show debug lines for when CVar ai_SmartPathFollower_useAdvancedPathShortcutting_debug is enabled");
  839.  
  840.         DefineConstIntCVarName("ai_DrawPathFollower", DrawPathFollower, 0, VF_CHEAT | VF_CHEAT_NOCHECK, "Enables PathFollower debug drawing displaying agent paths and safe follow target.");
  841.  
  842. #ifdef CONSOLE_CONST_CVAR_MODE
  843.         DefineConstIntCVarName("ai_LogConsoleVerbosity", LogConsoleVerbosity, 0, VF_CHEAT | VF_CHEAT_NOCHECK, "None = 0, progress/errors/warnings = 1, event = 2, comment = 3");
  844.         DefineConstIntCVarName("ai_LogFileVerbosity", LogFileVerbosity, 0, VF_CHEAT | VF_CHEAT_NOCHECK, "None = 0, progress/errors/warnings = 1, event = 2, comment = 3");
  845.         DefineConstIntCVarName("ai_EnableWarningsErrors", EnableWarningsErrors, 0, VF_CHEAT | VF_CHEAT_NOCHECK, "Enable AI warnings and errors: 1 or 0");
  846. #else
  847.         DefineConstIntCVarName("ai_LogConsoleVerbosity", LogConsoleVerbosity, AI_LOG_OFF, VF_CHEAT | VF_CHEAT_NOCHECK, "None = 0, progress/errors/warnings = 1, event = 2, comment = 3");
  848.         DefineConstIntCVarName("ai_LogFileVerbosity", LogFileVerbosity, AI_LOG_PROGRESS, VF_CHEAT | VF_CHEAT_NOCHECK, "None = 0, progress/errors/warnings = 1, event = 2, comment = 3");
  849.         DefineConstIntCVarName("ai_EnableWarningsErrors", EnableWarningsErrors, 1, VF_CHEAT | VF_CHEAT_NOCHECK, "Enable AI warnings and errors: 1 or 0");
  850. #endif
  851.  
  852.         REGISTER_CVAR2("ai_OverlayMessageDuration", &OverlayMessageDuration, 5.0f, VF_DUMPTODISK, "How long (seconds) to overlay AI warnings/errors");
  853.  
  854.         DefineConstIntCVarName("ai_Recorder", Recorder, 0, VF_CHEAT | VF_CHEAT_NOCHECK, "Sets AI Recorder mode. Default is 0 - off.");
  855.         DefineConstIntCVarName("ai_StatsDisplayMode", StatsDisplayMode, 0, VF_CHEAT | VF_CHEAT_NOCHECK,
  856.                                "Select display mode for the AI stats manager\n"
  857.                                "Usage: 0 - Hidden, 1 - Show\n");
  858.  
  859.         DefineConstIntCVarName("ai_VisionMapNumberOfPVSUpdatesPerFrame", VisionMapNumberOfPVSUpdatesPerFrame, 1, VF_CHEAT | VF_CHEAT_NOCHECK, "");
  860.         DefineConstIntCVarName("ai_VisionMapNumberOfVisibilityUpdatesPerFrame", VisionMapNumberOfVisibilityUpdatesPerFrame, 1, VF_CHEAT | VF_CHEAT_NOCHECK, "");
  861.  
  862.         DefineConstIntCVarName("ai_DebugDrawVisionMap", DebugDrawVisionMap, 0, VF_CHEAT | VF_CHEAT_NOCHECK,
  863.                                "Toggles the debug drawing of the AI VisionMap.");
  864.  
  865.         DefineConstIntCVarName("ai_DebugDrawVisionMapStats", DebugDrawVisionMapStats, 1, VF_CHEAT | VF_CHEAT_NOCHECK,
  866.                                "Enables the debug drawing of the AI VisionMap to show stats information.");
  867.  
  868.         DefineConstIntCVarName("ai_DebugDrawVisionMapVisibilityChecks", DebugDrawVisionMapVisibilityChecks, 1, VF_CHEAT | VF_CHEAT_NOCHECK,
  869.                                "Enables the debug drawing of the AI VisionMap to show the status of the visibility checks.");
  870.  
  871.         DefineConstIntCVarName("ai_DebugDrawVisionMapObservers", DebugDrawVisionMapObservers, 1, VF_CHEAT | VF_CHEAT_NOCHECK,
  872.                                "Enables the debug drawing of the AI VisionMap to show the location/stats of the observers.\n");
  873.  
  874.         DefineConstIntCVarName("ai_DebugDrawVisionMapObserversFOV", DebugDrawVisionMapObserversFOV, 0, VF_CHEAT | VF_CHEAT_NOCHECK,
  875.                                "Enables the debug drawing of the AI VisionMap to draw representations of the observers FOV.\n");
  876.  
  877.         DefineConstIntCVarName("ai_DebugDrawVisionMapObservables", DebugDrawVisionMapObservables, 1, VF_CHEAT | VF_CHEAT_NOCHECK,
  878.                                "Enables the debug drawing of the AI VisionMap to show the location/stats of the observables.");
  879.  
  880.         DefineConstIntCVarName("ai_DrawFireEffectEnabled", DrawFireEffectEnabled, 1, VF_CHEAT | VF_CHEAT_NOCHECK,
  881.                                "Enabled AI to sweep fire when starting to shoot after a break.");
  882.  
  883.         REGISTER_CVAR2("ai_DrawFireEffectDecayRange", &DrawFireEffectDecayRange, 30.0f, VF_CHEAT | VF_CHEAT_NOCHECK,
  884.                        "Distance under which the draw fire duration starts decaying linearly.");
  885.  
  886.         REGISTER_CVAR2("ai_DrawFireEffectMinDistance", &DrawFireEffectMinDistance, 7.5f, VF_CHEAT | VF_CHEAT_NOCHECK,
  887.                        "Distance under which the draw fire will be disabled.");
  888.  
  889.         REGISTER_CVAR2("ai_DrawFireEffectMinTargetFOV", &DrawFireEffectMinTargetFOV, 7.5f, VF_CHEAT | VF_CHEAT_NOCHECK,
  890.                        "FOV under which the draw fire will be disabled.");
  891.  
  892.         REGISTER_CVAR2("ai_DrawFireEffectMaxAngle", &DrawFireEffectMaxAngle, 5.0f, VF_CHEAT | VF_CHEAT_NOCHECK,
  893.                        "Maximum angle actors actors are allowed to go away from their aiming direction during draw fire.");
  894.  
  895.         REGISTER_CVAR2("ai_DrawFireEffectTimeScale", &DrawFireEffectTimeScale, 1.0f, VF_NULL,
  896.                        "Scale for the weapon's draw fire time setting.");
  897.  
  898.         DefineConstIntCVarName("ai_AllowedToHitPlayer", AllowedToHitPlayer, 1, VF_CHEAT | VF_CHEAT_NOCHECK,
  899.                                "If turned off, all agents will miss the player all the time.");
  900.  
  901.         DefineConstIntCVarName("ai_AllowedToHit", AllowedToHit, 1, VF_CHEAT | VF_CHEAT_NOCHECK,
  902.                                "If turned off, all agents will miss all the time.");
  903.  
  904.         DefineConstIntCVarName("ai_EnableCoolMisses", EnableCoolMisses, 1, VF_CHEAT | VF_CHEAT_NOCHECK,
  905.                                "If turned on, when agents miss the player, they will pick cool objects to shoot at.");
  906.  
  907.         REGISTER_CVAR2("ai_CoolMissesBoxSize", &CoolMissesBoxSize, 10.0f, VF_NULL,
  908.                        "Horizontal size of the box to collect potential cool objects to shoot at.");
  909.  
  910.         REGISTER_CVAR2("ai_CoolMissesBoxHeight", &CoolMissesBoxHeight, 2.5f, VF_NULL,
  911.                        "Vertical size of the box to collect potential cool objects to shoot at.");
  912.  
  913.         REGISTER_CVAR2("ai_CoolMissesMinMissDistance", &CoolMissesMinMissDistance, 7.5f, VF_NULL,
  914.                        "Maximum distance to go away from the player.");
  915.  
  916.         REGISTER_CVAR2("ai_CoolMissesMaxLightweightEntityMass", &CoolMissesMaxLightweightEntityMass, 20.0f, VF_NULL,
  917.                        "Maximum mass of a non-destroyable, non-deformable, non-breakable rigid body entity to be considered.");
  918.  
  919.         REGISTER_CVAR2("ai_CoolMissesProbability", &CoolMissesProbability, 0.35f, VF_NULL,
  920.                        "Agents' chance to perform a cool miss!");
  921.  
  922.         REGISTER_CVAR2("ai_CoolMissesCooldown", &CoolMissesCooldown, 0.25f, VF_NULL,
  923.                        "Global time between potential cool misses.");
  924.  
  925.         DefineConstIntCVarName("ai_DynamicHidespotsEnabled", DynamicHidespotsEnabled, 0, VF_CHEAT | VF_CHEAT_NOCHECK,
  926.                                "If enabled, dynamic hidespots are considered when evaluating.");
  927.  
  928.         DefineConstIntCVarName("ai_ForceSerializeAllObjects", ForceSerializeAllObjects, 0, VF_CHEAT | VF_CHEAT_NOCHECK,
  929.                                "Serialize all AI objects (ignore NO_SAVE flag).");
  930.  
  931.         REGISTER_CVAR2("ai_LobThrowMinAllowedDistanceFromFriends", &LobThrowMinAllowedDistanceFromFriends, 15.0f, VF_CHEAT | VF_CHEAT_NOCHECK,
  932.                        "Minimum distance a grenade (or any object thrown using a lob) should land from mates to accept the throw trajectory.");
  933.         REGISTER_CVAR2("ai_LobThrowTimePredictionForFriendPositions", &LobThrowTimePredictionForFriendPositions, 2.0f, VF_CHEAT | VF_CHEAT_NOCHECK,
  934.                        "Time frame used to predict the next position of moving mates to score the landing position of the lob throw");
  935.         REGISTER_CVAR2("ai_LobThrowPercentageOfDistanceToTargetUsedForInaccuracySimulation", &LobThrowPercentageOfDistanceToTargetUsedForInaccuracySimulation, 0.0,
  936.                        VF_CHEAT | VF_CHEAT_NOCHECK, "This value identifies percentage of the distance to the target that will be used to simulate human inaccuracy with parabolic throws.");
  937.         DefineConstIntCVarName("ai_LobThrowUseRandomForInaccuracySimulation", LobThrowSimulateRandomInaccuracy, 0, VF_CHEAT | VF_CHEAT_NOCHECK,
  938.                                "Uses random variation for simulating inaccuracy in the lob throw.");
  939.  
  940.         REGISTER_CVAR2("ai_LogSignals", &LogSignals, 0, VF_CHEAT | VF_CHEAT_NOCHECK,
  941.                        "Logs all the signals received in CAIActor::NotifySignalReceived.");
  942.  
  943.         REGISTER_COMMAND("ai_commTest", CommTest, VF_NULL,
  944.                          "Tests communication for the specified AI actor.\n"
  945.                          "If no communication name is specified all communications will be played.\n"
  946.                          "Usage: ai_commTest <actorName> [commName]\n");
  947.  
  948.         REGISTER_COMMAND("ai_commTestStop", CommTestStop, VF_NULL,
  949.                          "Stop currently playing communication for the specified AI actor.\n"
  950.                          "Usage: ai_commTestStop <actorName>\n");
  951.  
  952.         REGISTER_COMMAND("ai_writeCommStats", CommWriteStats, VF_NULL,
  953.                          "Dumps current statistics to log file.\n"
  954.                          "Usage: ai_writeCommStats\n");
  955.  
  956.         REGISTER_COMMAND("ai_resetCommStats", CommResetStats, VF_NULL,
  957.                          "Resets current communication statistics.\n"
  958.                          "Usage: ai_resetCommStats\n");
  959.  
  960.         REGISTER_COMMAND("ai_debugMNMAgentType", DebugMNMAgentType, VF_NULL,
  961.                          "Enabled MNM debug draw for an specific agent type.\n"
  962.                          "Usage: ai_debugMNMAgentType [AgentTypeName]\n");
  963.  
  964.         REGISTER_COMMAND("ai_MNMCalculateAccessibility", MNMCalculateAccessibility, VF_NULL,
  965.                          "Calculate mesh reachability starting from designers placed MNM Seeds.\n");
  966.  
  967.         REGISTER_COMMAND("ai_MNMComputeConnectedIslands", MNMComputeConnectedIslands, VF_DEV_ONLY,
  968.                          "Computes connected islands on the mnm mesh.\n");
  969.  
  970.         REGISTER_COMMAND("ai_NavigationReloadConfig", NavigationReloadConfig, VF_DEV_ONLY,
  971.                          "Usage: ai_NavigationReloadConfig\n"
  972.                          "Reloads navigation config file. May lead to broken subsystems and weird bugs. For DEBUG purposes ONLY!\n");
  973.  
  974.         REGISTER_COMMAND("ai_DebugAgent", DebugAgent, VF_NULL,
  975.                          "Start debugging an agent more in-depth. Pick by name, closest or in center of view.\n"
  976.                          "Example: ai_DebugAgent closest\n"
  977.                          "Example: ai_DebugAgent centerview\n"
  978.                          "Example: ai_DebugAgent name\n"
  979.                          "Call without parameters to stop the in-depth debugging.\n"
  980.                          "Example: ai_DebugAgent\n"
  981.                          );
  982.         REGISTER_CVAR2("ai_ModularBehaviorTree", &ModularBehaviorTree, 1, VF_CHEAT | VF_CHEAT_NOCHECK,
  983.                        "[0-1] Enable/Disable the usage of the modular behavior tree system.");
  984.  
  985.         REGISTER_CVAR2("ai_DebugTimestamps", &DebugTimestamps, 1, VF_CHEAT | VF_CHEAT_NOCHECK,
  986.                        "[0-1] Enable/Disable the debug text of the modular behavior tree's timestamps.");
  987.  
  988.         DefineConstIntCVarName("ai_LogModularBehaviorTreeExecutionStacks", LogModularBehaviorTreeExecutionStacks, 0, VF_CHEAT | VF_CHEAT_NOCHECK,
  989.                                "[0-2] Enable/Disable logging of the execution stacks of modular behavior trees to individual files in the MBT_Logs directory.\n"
  990.                                "0 - Off\n"
  991.                                "1 - Log execution stacks of only the currently selected agent\n"
  992.                                "2 - Log execution stacks of all currently active agents");
  993.  
  994.         REGISTER_CVAR2("ai_MNMAllowDynamicRegenInEditor", &MNMAllowDynamicRegenInEditor, 0, VF_CHEAT | VF_CHEAT_NOCHECK,
  995.                        "[0-1] Allow dynamic regeneration of MNM when in the editor, when in game mode. Put this CVar in your configuration file rather than changing it during execution.");
  996.  
  997. }
  998.  
  999. void AIConsoleVars::CommTest(IConsoleCmdArgs* args)
  1000. {
  1001.         if (args->GetArgCount() < 2)
  1002.         {
  1003.                 AIWarning("<CommTest> Expecting actorName as parameter.");
  1004.  
  1005.                 return;
  1006.         }
  1007.  
  1008.         CAIActor* actor = 0;
  1009.  
  1010.         if (IEntity* entity = gEnv->pEntitySystem->FindEntityByName(args->GetArg(1)))
  1011.                 if (IAIObject* aiObject = entity->GetAI())
  1012.                         actor = aiObject->CastToCAIActor();
  1013.  
  1014.         if (!actor)
  1015.         {
  1016.                 AIWarning("<CommTest> Could not find entity named '%s' or it's not an actor.", args->GetArg(1));
  1017.  
  1018.                 return;
  1019.         }
  1020.  
  1021.         const char* commName = 0;
  1022.  
  1023.         if (args->GetArgCount() > 2)
  1024.                 commName = args->GetArg(2);
  1025.  
  1026.         int variationNumber = 0;
  1027.  
  1028.         if (args->GetArgCount() > 3)
  1029.                 variationNumber = atoi(args->GetArg(3));
  1030.  
  1031.         gAIEnv.pCommunicationManager->GetTestManager().StartFor(actor->GetEntityID(), commName, variationNumber);
  1032. }
  1033.  
  1034. void AIConsoleVars::CommTestStop(IConsoleCmdArgs* args)
  1035. {
  1036.         if (args->GetArgCount() < 2)
  1037.         {
  1038.                 AIWarning("<CommTest> Expecting actorName as parameter.");
  1039.  
  1040.                 return;
  1041.         }
  1042.  
  1043.         CAIActor* actor = 0;
  1044.  
  1045.         if (IEntity* entity = gEnv->pEntitySystem->FindEntityByName(args->GetArg(1)))
  1046.                 if (IAIObject* aiObject = entity->GetAI())
  1047.                         actor = aiObject->CastToCAIActor();
  1048.  
  1049.         if (!actor)
  1050.         {
  1051.                 AIWarning("<CommTest> Could not find entity named '%s' or it's not an actor.", args->GetArg(1));
  1052.  
  1053.                 return;
  1054.         }
  1055.  
  1056.         gAIEnv.pCommunicationManager->GetTestManager().Stop(actor->GetEntityID());
  1057. }
  1058.  
  1059. void AIConsoleVars::CommWriteStats(IConsoleCmdArgs* args)
  1060. {
  1061.         gAIEnv.pCommunicationManager->WriteStatistics();
  1062. }
  1063.  
  1064. void AIConsoleVars::CommResetStats(IConsoleCmdArgs* args)
  1065. {
  1066.         gAIEnv.pCommunicationManager->ResetStatistics();
  1067. }
  1068.  
  1069. void AIConsoleVars::DebugMNMAgentType(IConsoleCmdArgs* args)
  1070. {
  1071.         if (args->GetArgCount() < 2)
  1072.         {
  1073.                 AIWarning("<DebugMNMAgentType> Expecting Agent Type as parameter.");
  1074.                 return;
  1075.         }
  1076.  
  1077.         const char* agentTypeName = args->GetArg(1);
  1078.  
  1079.         NavigationAgentTypeID agentTypeID = gAIEnv.pNavigationSystem->GetAgentTypeID(agentTypeName);
  1080.         gAIEnv.pNavigationSystem->SetDebugDisplayAgentType(agentTypeID);
  1081. }
  1082.  
  1083. void AIConsoleVars::MNMCalculateAccessibility(IConsoleCmdArgs* args)
  1084. {
  1085.         gAIEnv.pNavigationSystem->CalculateAccessibility();
  1086. }
  1087.  
  1088. namespace
  1089. {
  1090. struct PotentialDebugAgent
  1091. {
  1092.         Vec3        entityPosition;
  1093.         EntityId    entityId;
  1094.         const char* name;     // Pointer directly to the entity name
  1095.  
  1096.         PotentialDebugAgent()
  1097.                 : entityPosition(ZERO)
  1098.                 , entityId(0)
  1099.                 , name(NULL)
  1100.         {
  1101.         }
  1102. };
  1103.  
  1104. typedef DynArray<PotentialDebugAgent> PotentialDebugAgents;
  1105.  
  1106. void GatherPotentialDebugAgents(PotentialDebugAgents& agents)
  1107. {
  1108.         // Add ai actors
  1109.         AutoAIObjectIter it(gEnv->pAISystem->GetAIObjectManager()->GetFirstAIObject(OBJFILTER_TYPE, AIOBJECT_ACTOR));
  1110.         for (; it->GetObject(); it->Next())
  1111.         {
  1112.                 IAIObject* object = it->GetObject();
  1113.                 IAIActor* actor = object ? object->CastToIAIActor() : NULL;
  1114.                 IEntity* entity = object ? object->GetEntity() : NULL;
  1115.  
  1116.                 if (entity && actor && actor->IsActive())
  1117.                 {
  1118.                         PotentialDebugAgent agent;
  1119.                         agent.entityPosition = entity->GetWorldPos();
  1120.                         agent.entityId = entity->GetId();
  1121.                         agent.name = entity->GetName();
  1122.                         agents.push_back(agent);
  1123.                 }
  1124.         }
  1125.  
  1126.         // Add entities running modular behavior trees
  1127.         BehaviorTree::BehaviorTreeManager* behaviorTreeManager = gAIEnv.pBehaviorTreeManager;
  1128.         const size_t count = behaviorTreeManager->GetTreeInstanceCount();
  1129.         for (size_t index = 0; index < count; ++index)
  1130.         {
  1131.                 const EntityId entityId = behaviorTreeManager->GetTreeInstanceEntityIdByIndex(index);
  1132.                 if (IEntity* entity = gEnv->pEntitySystem->GetEntity(entityId))
  1133.                 {
  1134.                         PotentialDebugAgent agent;
  1135.                         agent.entityPosition = entity->GetWorldPos();
  1136.                         agent.entityId = entity->GetId();
  1137.                         agent.name = entity->GetName();
  1138.                         agents.push_back(agent);
  1139.                 }
  1140.         }
  1141. }
  1142. }
  1143.  
  1144. void AIConsoleVars::MNMComputeConnectedIslands(IConsoleCmdArgs* args)
  1145. {
  1146.         gAIEnv.pNavigationSystem->ComputeIslands();
  1147. }
  1148.  
  1149. void AIConsoleVars::NavigationReloadConfig(IConsoleCmdArgs* args)
  1150. {
  1151.         if (INavigationSystem* pNavigationSystem = gAIEnv.pNavigationSystem)
  1152.         {
  1153.                 // TODO pavloi 2016.03.09: hack implementation. See comments in ReloadConfig.
  1154.                 if (pNavigationSystem->ReloadConfig())
  1155.                 {
  1156.                         pNavigationSystem->ClearAndNotify();
  1157.                 }
  1158.                 else
  1159.                 {
  1160.                         AIWarning("Errors during config reloading");
  1161.                 }
  1162.                 return;
  1163.         }
  1164.         AIWarning("Unable to obtain navigation system to reload config.");
  1165. }
  1166.  
  1167. void AIConsoleVars::DebugAgent(IConsoleCmdArgs* args)
  1168. {
  1169.         EntityId debugTargetEntity = 0;
  1170.         Vec3 debugTargetEntityPos(ZERO);
  1171.  
  1172.         if (args->GetArgCount() >= 2)
  1173.         {
  1174.                 PotentialDebugAgents agents;
  1175.                 GatherPotentialDebugAgents(agents);
  1176.  
  1177.                 const stack_string str = args->GetArg(1);
  1178.  
  1179.                 if (str == "closest")
  1180.                 {
  1181.                         // Find the closest agent to the camera
  1182.                         const Vec3 cameraPosition = GetISystem()->GetViewCamera().GetMatrix().GetTranslation();
  1183.  
  1184.                         EntityId closestId = 0;
  1185.                         float closestSqDist = std::numeric_limits<float>::max();
  1186.                         const char* name = NULL;
  1187.  
  1188.                         PotentialDebugAgents::iterator it = agents.begin();
  1189.                         PotentialDebugAgents::iterator end = agents.end();
  1190.  
  1191.                         for (; it != end; ++it)
  1192.                         {
  1193.                                 const PotentialDebugAgent& agent = (*it);
  1194.                                 const Vec3 entityPosition = agent.entityPosition;
  1195.                                 const float sqDistToCamera = Distance::Point_Point2D(cameraPosition, entityPosition);
  1196.                                 if (sqDistToCamera < closestSqDist)
  1197.                                 {
  1198.                                         closestId = agent.entityId;
  1199.                                         closestSqDist = sqDistToCamera;
  1200.                                         name = agent.name;
  1201.                                         debugTargetEntityPos = entityPosition;
  1202.                                 }
  1203.                         }
  1204.  
  1205.                         if (closestId)
  1206.                         {
  1207.                                 debugTargetEntity = closestId;
  1208.                                 gEnv->pLog->Log("Started debugging agent with name '%s', who is closest to the camera.", name);
  1209.                         }
  1210.                         else
  1211.                         {
  1212.                                 gEnv->pLog->LogWarning("Could not find an agent to debug.");
  1213.                         }
  1214.                 }
  1215.                 else if (str == "centerview" || str == "centermost")
  1216.                 {
  1217.                         // Find the agent most in center of view
  1218.                         const Vec3 cameraPosition = GetISystem()->GetViewCamera().GetMatrix().GetTranslation();
  1219.                         const Vec3 cameraForward = GetISystem()->GetViewCamera().GetMatrix().GetColumn1().GetNormalized();
  1220.  
  1221.                         EntityId closestToCenterOfView = 0;
  1222.                         float highestDotProduct = -1.0f;
  1223.                         const char* name = NULL;
  1224.  
  1225.                         PotentialDebugAgents::iterator it = agents.begin();
  1226.                         PotentialDebugAgents::iterator end = agents.end();
  1227.  
  1228.                         for (; it != end; ++it)
  1229.                         {
  1230.                                 const PotentialDebugAgent& agent = (*it);
  1231.                                 const Vec3 entityPosition = agent.entityPosition;
  1232.                                 const Vec3 cameraToAgentDir = (entityPosition - cameraPosition).GetNormalized();
  1233.                                 const float dotProduct = cameraForward.Dot(cameraToAgentDir);
  1234.                                 if (dotProduct > highestDotProduct)
  1235.                                 {
  1236.                                         closestToCenterOfView = agent.entityId;
  1237.                                         highestDotProduct = dotProduct;
  1238.                                         name = agent.name;
  1239.                                         debugTargetEntityPos = entityPosition;
  1240.                                 }
  1241.                         }
  1242.  
  1243.                         if (closestToCenterOfView)
  1244.                         {
  1245.                                 debugTargetEntity = closestToCenterOfView;
  1246.                                 gEnv->pLog->Log("Started debugging agent with name '%s', who is centermost in the view.", name);
  1247.                         }
  1248.                         else
  1249.                         {
  1250.                                 gEnv->pLog->LogWarning("Could not find an agent to debug.");
  1251.                         }
  1252.                 }
  1253.                 else
  1254.                 {
  1255.                         // Find the agent by name
  1256.                         if (IEntity* entity = gEnv->pEntitySystem->FindEntityByName(str))
  1257.                         {
  1258.                                 debugTargetEntity = entity->GetId();
  1259.                                 debugTargetEntityPos = entity->GetWorldPos() + Vec3(0, 2, 0);
  1260.                                 gEnv->pLog->Log("Started debugging agent with name '%s'.", str.c_str());
  1261.                         }
  1262.                         else
  1263.                         {
  1264.                                 gEnv->pLog->LogWarning("Could not debug agent with name '%s' because the entity doesn't exist.", str.c_str());
  1265.                         }
  1266.                 }
  1267.         }
  1268.  
  1269. #ifdef CRYAISYSTEM_DEBUG
  1270.         if (GetAISystem()->GetAgentDebugTarget() != debugTargetEntity)
  1271.         {
  1272.                 GetAISystem()->SetAgentDebugTarget(debugTargetEntity);
  1273.  
  1274.                 gEnv->pLog->Log("Debug target is at position %f, %f, %f",
  1275.                                 debugTargetEntityPos.x,
  1276.                                 debugTargetEntityPos.y,
  1277.                                 debugTargetEntityPos.z);
  1278.         }
  1279.         else
  1280.         {
  1281.                 GetAISystem()->SetAgentDebugTarget(0);
  1282.         }
  1283. #endif
  1284.  
  1285. }
  1286.  
  1287. void AIConsoleVars::AIBubblesNameFilterCallback(ICVar* pCvar)
  1288. {
  1289.         if (IAIBubblesSystem* pBubblesSystem = GetAISystem()->GetAIBubblesSystem())
  1290.         {
  1291.                 pBubblesSystem->SetNameFilter(pCvar->GetString());
  1292.         }
  1293. }
  1294.  
downloadAIConsoleVariables.cpp Source code - Download CRYENGINE Source code
Related Source Codes/Software:
postal - 2017-06-11
reactide - Reactide is the first dedicated IDE for React web ... 2017-06-11
rkt - rkt is a pod-native container engine for Linux. It... 2017-06-11
uWebSockets - Tiny WebSockets https://for... 2017-06-11
realworld - TodoMVC for the RealWorld - Exemplary fullstack Me... 2017-06-11
CRYENGINE - CRYENGINE is a powerful real-time game development... 2017-06-11
goreplay - GoReplay is an open-source tool for capturing and ... 2017-06-10
pyenv - Simple Python version management 2017-06-10
redux-saga - An alternative side effect model for Redux apps ... 2017-06-10
angular-starter - 2017-06-10

 Back to top