Added ai command setEquipment
[ryzomcore.git] / ryzom / server / src / ai_service / ai_variables.cpp
blobf90c3e94870ffe95acca7976ddfe262bfd708dd1
1 // Ryzom - MMORPG Framework <http://dev.ryzom.com/projects/ryzom/>
2 // Copyright (C) 2010 Winch Gate Property Limited
3 //
4 // This program is free software: you can redistribute it and/or modify
5 // it under the terms of the GNU Affero General Public License as
6 // published by the Free Software Foundation, either version 3 of the
7 // License, or (at your option) any later version.
8 //
9 // This program is distributed in the hope that it will be useful,
10 // but WITHOUT ANY WARRANTY; without even the implied warranty of
11 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 // GNU Affero General Public License for more details.
14 // You should have received a copy of the GNU Affero General Public License
15 // along with this program. If not, see <http://www.gnu.org/licenses/>.
19 #include "stdpch.h"
20 #include "nel/misc/variable.h"
21 #include "ai_variables.h"
23 using namespace NLMISC;
25 CVariable<TGameCycle> DynamicMaxUpdatePeriod("ai", "DynamicMaxUpdatePeriod", "The maximum update frequency (in ticks) for the dynamic system", 900, 0, true);
27 CVariable<bool> LogAcceptablePos("ai", "LogAcceptablePos", "Log the corrected and invalid world position.", false, 0, true);
29 CVariable<bool> LogGroupCreationFailure("ai", "LogGroupCreationFailure", "Log the dynamic group creation failure details.", false, 0, true);
31 CVariable<bool> LogAliasTreeOwner("ai", "LogAliasTreeOwner", "Log the alias tree owner creation.", false, 0, true);
33 CVariable<bool> LogOutpostDebug("ai", "LogOutpostDebug", "Log the outpost debug log.", false, 0, true);
35 CVariable<uint32> RandomPosMaxRetry("ai", "RandomPosMaxRetry", "The total number of try to find the random position around place.", 32*200, 0, true);
37 CVariable<float> SpeedFactor("ai", "SpeedFactor", "Speed factor to scall up/down all bot speed .", 1, 0, true);
39 void validateTimerSpeedUp(IVariable &var)
41 CVariable<int> &speedUp = static_cast<CVariable<int>&>(var);
42 if (speedUp < 1)
43 speedUp = 1;
46 CVariable<int> TimerSpeedUp("ai", "TimerSpeedUp", "Accelerate timed event triggering. Must between [1- oo]", 1, 0, true, validateTimerSpeedUp);
48 CVariable<int> DefaultWanderMinTimer("ai", "DefaultWanderMinTimer", "Min iddle time (in ticks) in wander behavior)", 50, 0, true);
49 CVariable<int> DefaultWanderMaxTimer("ai", "DefaultWanderMaxTimer", "Min iddle time (in ticks) in wander behavior)", 50, 0, true);
51 CVariable<sint32> FameForGuardAttack("ai", "FameForGuardAttack", "The fame value under witch guard attack the players", -450000, 0, true);
52 CVariable<sint32> FameForGuardHelp("ai", "FameForGuardHelp", "The fame value that allow guard to defend player", -450000, 0, true);
54 CVariable<uint32> DefaultNpcAggroDist("ai", "DefaultNpcAggroDist", "The default aggro distance for NPC", 15, 0, true);
55 CVariable<float> DefaultEscortRange("ai", "DefaultEscortRange", "The default escort range", 10, 0, true);
58 namespace AISStat
61 // managers
62 CVariable<uint32> StatMgrTotalUpdCtr("ai_stat", "StatMgrTotalUpdCtr", "MgrTotalUpdCtr", 0, 100, false);
63 CVariable<uint32> StatMgrFaunaUpdCtr("ai_stat", "StatMgrFaunaUpdCtr", "MgrFaunaUpdCtr", 0, 100, false);
64 CVariable<uint32> StatMgrNpcUpdCtr("ai_stat", "StatMgrNpcUpdCtr", "MgrNpcUpdCtr", 0, 100, false);
65 CVariable<uint32> StatMgrPetUpdCtr("ai_stat", "StatMgrPetUpdCtr", "MgrPetUpdCtr", 0, 100, false);
66 CVariable<uint32> StatMgrPlayerUpdCtr("ai_stat", "StatMgrPlayerUpdCtr", "MgrPlayerUpdCtr", 0, 100, false);
67 // groups
68 CVariable<uint32> StatGrpTotalUpdCtr("ai_stat", "StatGrpTotalUpdCtr", "GrpTotalUpdCtr", 0, 100, false);
69 CVariable<uint32> StatGrpFaunaUpdCtr("ai_stat", "StatGrpFaunaUpdCtr", "GrpFaunaUpdCtr", 0, 100, false);
70 CVariable<uint32> StatGrpNpcUpdCtr("ai_stat", "StatGrpNpcUpdCtr", "GrpNpcUpdCtr", 0, 100, false);
71 CVariable<uint32> StatGrpPetUpdCtr("ai_stat", "StatGrpPetUpdCtr", "GrpPetUpdCtr", 0, 100, false);
72 // bots
73 CVariable<uint32> StatBotTotalUpdCtr("ai_stat", "StatBotTotalUpdCtr", "BotTotalUpdCtr", 0, 100, false);
74 CVariable<uint32> StatBotFaunaUpdCtr("ai_stat", "StatBotFaunaUpdCtr", "BotFaunaUpdCtr", 0, 100, false);
75 CVariable<uint32> StatBotNpcUpdCtr("ai_stat", "StatBotNpcUpdCtr", "BotNpcUpdCtr", 0, 100, false);
76 // Pathfinding
77 CVariable<uint32> StatPathFindingCalls ("ai_stat", "StatPathFindingCalls", "PathFindingCalls", 0, 100, false);
78 CVariable<float> StatPathFindingIterations("ai_stat", "StatPathFindingIterations", "PathFindingIterations", 0.f, 100, false);
79 CVariable<float> StatPathFindingHeapSize ("ai_stat", "StatPathFindingHeapSize", "PathFindingHeapSize", 0.f, 100, false);
80 CVariable<uint32> StatPathFindingCallsInside ("ai_stat", "StatPathFindingCallsInside", "PathFindingCallsInside", 0, 100, false);
81 CVariable<float> StatPathFindingIterationsInside("ai_stat", "StatPathFindingIterationsInside", "PathFindingIterationsInside", 0.f, 100, false);
82 CVariable<float> StatPathFindingHeapSizeInside ("ai_stat", "StatPathFindingHeapSizeInside", "PathFindingHeapSizeInside", 0.f, 100, false);
83 // player visibility
84 CVariable<uint32> StatGrpFastUpdCtr("ai_stat", "StatGrpFastUpdCtr", "GrpFastUpdCtr", 0, 100, false);
85 CVariable<uint32> StatGrpSlowUpdCtr("ai_stat", "StatGrpSlowUpdCtr", "GrpSlowUpdCtr", 0, 100, false);
86 CVariable<uint32> StatVision0Ctr ("ai_stat", "StatVision0Ctr", "Player in vision at 0m", 0, 100, false);
87 CVariable<uint32> StatVision1To64Ctr ("ai_stat", "StatVision1To64Ctr", "Player in vision from 1m to 64m", 0, 100, false);
88 CVariable<uint32> StatVision65To127Ctr ("ai_stat", "StatVision65To127Ctr", "Player in vision from 65m to 127m", 0, 100, false);
89 CVariable<uint32> StatVision128To254Ctr("ai_stat", "StatVision128To254Ctr", "Player in vision from 128m to 254m", 0, 100, false);
90 CVariable<uint32> StatVision255Ctr ("ai_stat", "StatVision255Ctr", "Player in vision at 255m", 0, 100, false);
92 // managers
93 uint32 MgrTotalUpdCtr;
94 uint32 MgrFaunaUpdCtr;
95 uint32 MgrNpcUpdCtr;
96 uint32 MgrPetUpdCtr;
97 uint32 MgrPlayerUpdCtr;
98 // groups
99 uint32 GrpTotalUpdCtr;
100 uint32 GrpFaunaUpdCtr;
101 uint32 GrpNpcUpdCtr;
102 uint32 GrpPetUpdCtr;
103 // bots
104 uint32 BotTotalUpdCtr;
105 uint32 BotFaunaUpdCtr;
106 uint32 BotNpcUpdCtr;
107 // Pathfinding
108 uint32 PathFindingCalls;
109 uint32 PathFindingIterations;
110 uint32 PathFindingHeapSize;
111 uint32 PathFindingCallsInside;
112 uint32 PathFindingIterationsInside;
113 uint32 PathFindingHeapSizeInside;
114 // player visibility
115 uint32 GrpFastUpdCtr;
116 uint32 GrpSlowUpdCtr;
117 uint32 VisionCtr[256];
121 // Aggro parameters
122 CVariable<float> AggroReturnDistCheck("ai_aggro", "AggroReturnDistCheck", "en m", 15.f, 0, true);
123 CVariable<float> AggroReturnDistCheckFauna("ai_aggro", "AggroReturnDistCheckFauna", "en m", 15.f, 0, true);
124 CVariable<float> AggroReturnDistCheckNpc("ai_aggro", "AggroReturnDistCheckNpc", "en m", 1.5f, 0, true);
125 CVariable<float> AggroD1Radius("ai_aggro", "AggroD1Radius", "en m", 100.f, 0, true);
126 CVariable<float> AggroD2Radius("ai_aggro", "AggroD2Radius", "en m", 50.f, 0, true);
127 CVariable<float> AggroPrimaryGroupDist("ai_aggro", "AggroPrimaryGroupDist", "en m", 0.f, 0, true);
128 CVariable<float> AggroPrimaryGroupCoef("ai_aggro", "AggroPrimaryGroupCoef", "%age, entre 0 et 1", 0.f, 0, true);
129 CVariable<float> AggroSecondaryGroupDist("ai_aggro", "AggroSecondaryGroupDist", "en m", 0.f, 0, true);
130 CVariable<float> AggroSecondaryGroupCoef("ai_aggro", "AggroSecondaryGroupCoef", "%age, entre 0 et 1", 0.f, 0, true);
131 CVariable<float> AggroPropagationRadius("ai_aggro", "AggroPropagationRadius", "en m", 60.f, 0, true);
133 CVariable<uint32> HealSpecificDowntime("ai_heal", "HealSpecificDowntime", "", 100, 0, true);
134 CVariable<uint32> HealSpecificDowntimeSelf("ai_heal", "HealSpecificDowntimeSelf", "", 100, 0, true);
138 //max dist for npc selection (ring only)
139 CVariable<double> RingMaxSelectDist("ai", "RingMaxSelectDist", "Max dist used to allow far selection or not.", 20, 0, true);