Resolve "Toggle Free Look with Hotkey"
[ryzomcore.git] / ryzom / server / src / ai_service / ai_variables.h
blob24cad0a7fe96751d5c6f8b246f42d9947454ea1f
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/>.
17 #ifndef AI_VARIABLES_H
18 #define AI_VARIABLES_H
20 #include "nel/misc/variable.h"
22 namespace AISStat
25 // Managers
26 extern NLMISC::CVariable<uint32> StatMgrTotalUpdCtr;
27 extern NLMISC::CVariable<uint32> StatMgrFaunaUpdCtr;
28 extern NLMISC::CVariable<uint32> StatMgrNpcUpdCtr;
29 extern NLMISC::CVariable<uint32> StatMgrPetUpdCtr;
30 extern NLMISC::CVariable<uint32> StatMgrPlayerUpdCtr;
32 // Groups
33 extern NLMISC::CVariable<uint32> StatGrpTotalUpdCtr;
34 extern NLMISC::CVariable<uint32> StatGrpFaunaUpdCtr;
35 extern NLMISC::CVariable<uint32> StatGrpNpcUpdCtr;
36 extern NLMISC::CVariable<uint32> StatGrpPetUpdCtr;
38 // Bots
39 extern NLMISC::CVariable<uint32> StatBotTotalUpdCtr;
40 extern NLMISC::CVariable<uint32> StatBotFaunaUpdCtr;
41 extern NLMISC::CVariable<uint32> StatBotNpcUpdCtr;
43 // Pathfinding
44 extern NLMISC::CVariable<uint32> StatPathFindingCalls;
45 extern NLMISC::CVariable<float> StatPathFindingIterations;
46 extern NLMISC::CVariable<float> StatPathFindingHeapSize;
47 extern NLMISC::CVariable<uint32> StatPathFindingCallsInside;
48 extern NLMISC::CVariable<float> StatPathFindingIterationsInside;
49 extern NLMISC::CVariable<float> StatPathFindingHeapSizeInside;
51 // Player visibility
52 extern NLMISC::CVariable<uint32> StatGrpFastUpdCtr;
53 extern NLMISC::CVariable<uint32> StatGrpSlowUpdCtr;
54 extern NLMISC::CVariable<uint32> StatVision0Ctr;
55 extern NLMISC::CVariable<uint32> StatVision1To64Ctr;
56 extern NLMISC::CVariable<uint32> StatVision65To127Ctr;
57 extern NLMISC::CVariable<uint32> StatVision128To254Ctr;
58 extern NLMISC::CVariable<uint32> StatVision255Ctr;
60 // Managers
61 extern uint32 MgrTotalUpdCtr;
62 extern uint32 MgrFaunaUpdCtr;
63 extern uint32 MgrNpcUpdCtr;
64 extern uint32 MgrPetUpdCtr;
65 extern uint32 MgrPlayerUpdCtr;
66 // Groups
67 extern uint32 GrpTotalUpdCtr;
68 extern uint32 GrpFaunaUpdCtr;
69 extern uint32 GrpNpcUpdCtr;
70 extern uint32 GrpPetUpdCtr;
71 // Bots
72 extern uint32 BotTotalUpdCtr;
73 extern uint32 BotFaunaUpdCtr;
74 extern uint32 BotNpcUpdCtr;
75 // Pathfinding
76 extern uint32 PathFindingCalls;
77 extern uint32 PathFindingIterations;
78 extern uint32 PathFindingHeapSize;
79 extern uint32 PathFindingCallsInside;
80 extern uint32 PathFindingIterationsInside;
81 extern uint32 PathFindingHeapSizeInside;
82 // Player visibility
83 extern uint32 GrpFastUpdCtr;
84 extern uint32 GrpSlowUpdCtr;
85 extern uint32 VisionCtr[256];
87 inline
88 void countersBegin()
90 // Managers
91 MgrTotalUpdCtr = 0;
92 MgrFaunaUpdCtr = 0;
93 MgrNpcUpdCtr = 0;
94 MgrPetUpdCtr = 0;
95 MgrPlayerUpdCtr = 0;
96 // Groups
97 GrpTotalUpdCtr = 0;
98 GrpFaunaUpdCtr = 0;
99 GrpNpcUpdCtr = 0;
100 GrpPetUpdCtr = 0;
101 // Bots
102 BotTotalUpdCtr = 0;
103 BotFaunaUpdCtr = 0;
104 BotNpcUpdCtr = 0;
105 // Pathfinding
106 PathFindingCalls = 0;
107 PathFindingIterations = 0;
108 PathFindingHeapSize = 0;
109 PathFindingCallsInside = 0;
110 PathFindingIterationsInside = 0;
111 PathFindingHeapSizeInside = 0;
112 // Player visibility
113 AISStat::GrpFastUpdCtr = 0;
114 AISStat::GrpSlowUpdCtr = 0;
115 for (size_t i=0; i<256; ++i)
116 VisionCtr[i] = 0;
119 inline
120 void countersEnd()
122 // Managers
123 StatMgrTotalUpdCtr = MgrTotalUpdCtr;
124 StatMgrFaunaUpdCtr = MgrFaunaUpdCtr;
125 StatMgrNpcUpdCtr = MgrNpcUpdCtr;
126 StatMgrPetUpdCtr = MgrPetUpdCtr;
127 StatMgrPlayerUpdCtr = MgrPlayerUpdCtr;
128 // Groups
129 StatGrpTotalUpdCtr = GrpTotalUpdCtr;
130 StatGrpFaunaUpdCtr = GrpFaunaUpdCtr;
131 StatGrpNpcUpdCtr = GrpNpcUpdCtr;
132 StatGrpPetUpdCtr = GrpPetUpdCtr;
133 // Bots
134 StatBotTotalUpdCtr = BotTotalUpdCtr;
135 StatBotFaunaUpdCtr = BotFaunaUpdCtr;
136 StatBotNpcUpdCtr = BotNpcUpdCtr;
137 // Pathfinding
138 StatPathFindingCalls = PathFindingCalls;
139 StatPathFindingIterations = PathFindingCalls!=0?(float)PathFindingIterations/(float)PathFindingCalls:0.f;
140 StatPathFindingHeapSize = PathFindingCalls!=0?(float)PathFindingHeapSize /(float)PathFindingCalls:0.f;
141 StatPathFindingCallsInside = PathFindingCallsInside;
142 StatPathFindingIterationsInside = PathFindingCallsInside!=0?(float)PathFindingIterationsInside/(float)PathFindingCallsInside:0.f;
143 StatPathFindingHeapSizeInside = PathFindingCallsInside!=0?(float)PathFindingHeapSizeInside /(float)PathFindingCallsInside:0.f;
144 // Player visibility
145 StatGrpFastUpdCtr = GrpFastUpdCtr;
146 StatGrpSlowUpdCtr = GrpSlowUpdCtr;
147 StatVision0Ctr = VisionCtr[0];
148 uint32 total = 0;
149 for (size_t i=1; i<=64; ++i)
150 total += VisionCtr[i];
151 StatVision1To64Ctr = total;
152 total = 0;
153 for (size_t i=65; i<=127; ++i)
154 total += VisionCtr[i];
155 StatVision65To127Ctr = total;
156 total = 0;
157 for (size_t i=128; i<=254; ++i)
158 total += VisionCtr[i];
159 StatVision128To254Ctr = total;
160 StatVision255Ctr = VisionCtr[255];
165 extern NLMISC::CVariable<float> AggroReturnDistCheck;
166 extern NLMISC::CVariable<float> AggroReturnDistCheckFauna;
167 extern NLMISC::CVariable<float> AggroReturnDistCheckNpc;
168 extern NLMISC::CVariable<float> AggroD1Radius;
169 extern NLMISC::CVariable<float> AggroD2Radius;
170 extern NLMISC::CVariable<float> AggroPrimaryGroupDist;
171 extern NLMISC::CVariable<float> AggroPrimaryGroupCoef;
172 extern NLMISC::CVariable<float> AggroSecondaryGroupDist;
173 extern NLMISC::CVariable<float> AggroSecondaryGroupCoef;
174 extern NLMISC::CVariable<float> AggroPropagationRadius;
176 extern NLMISC::CVariable<uint32> HealSpecificDowntime;
177 extern NLMISC::CVariable<uint32> HealSpecificDowntimeSelf;
179 #endif // AI_VARIABLES_H