Sacred 2:Toughness - formulas and tables

From SacredWiki
Revision as of 14:59, 29 November 2024 by Maneus (talk | contribs)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to navigation Jump to search

The skill definition can be found in creatures.txt.

mgr.createSkill {
	skill_name = "skill_toughness",
	advance_level = 75,
	min_level = 1,
	mean_value = 200,
	advance_mean_value = 300,
	skillgroup = "SKG_DEFENCE",
	adv_skill_name = "skill_advanced_toughness",
}


Almost all skills (including this one) use the following method to determine a single "SkillValue":

For pre-mastery skill levels:

MeanValue = mean_value

AdjustedSkillLevel = SkillLevel

For post-mastery skill levels:

MeanValue = advance_mean_value

AdjustedSkillLevel = SkillLevel - FLOOR((advance_level + 1) / 2.222)

Then:

SkillValue = FLOOR(20 * MeanValue * (AdjustedSkillLevel + SkillPivotPoint * 0.015) / (AdjustedSkillLevel + SkillPivotPoint))

Where:

  • SkillLevel - total skill points in the skill.
  • SkillPivotPoint - from balance.txt. Default value is 100.
  • mean_value - from the skill definition in creatures.txt.
  • advance_level - from the skill definition in creatures.txt.
  • advance_mean_value - from the skill definition in creatures.txt.


This "SkillValue" is then used to determine the value of each bonus that the skill provides. Toughness provides two bonuses: Armor per Damage Type +X and Opponent's Damage -X%.


The formula for Armor per Damage Type +X is:

For pre-mastery skill levels:

ValueOfBonus = FLOOR(SkillValue / 20)

For post-mastery skill levels:

ValueOfBonus = FLOOR(SkillValue / 15)

Then:

TooltipValue = ValueOfBonus


The formula for Opponent's Damage -X% is:

For pre-mastery skill levels:

ValueOfBonus = FLOOR(SkillValue / 20)

For post-mastery skill levels:

ValueOfBonus = FLOOR(SkillValue / 15)

Then:

TooltipValue = -0.1 * ValueOfBonus

This TooltipValue is then subject to precision loss from 32-bit floats, and is rounded down to one decimal place. In short, the resulting value may end up being lower by 0.1.


Since most of the parameters are known in advance, we can simplify the formulas:

For pre-mastery skill levels:

SkillValue = FLOOR(20 * MeanValue * (AdjustedSkillLevel + SkillPivotPoint * 0.015) / (AdjustedSkillLevel + SkillPivotPoint))

SkillValue = FLOOR(20 * 200 * (SkillLevel + 100 * 0.015) / (SkillLevel + 100))

SkillValue = FLOOR(4000 * (SkillLevel + 1.5) / (SkillLevel + 100))

For post-mastery skill levels:

AdjustedSkillLevel = SkillLevel - FLOOR((advance_level + 1) / 2.222)

AdjustedSkillLevel = SkillLevel - FLOOR((75 + 1) / 2.222)

AdjustedSkillLevel = SkillLevel - FLOOR(76 / 2.222)

AdjustedSkillLevel = SkillLevel - FLOOR(34.2034203420342)

AdjustedSkillLevel = SkillLevel - 34

SkillValue = FLOOR(20 * MeanValue * (AdjustedSkillLevel + SkillPivotPoint * 0.015) / (AdjustedSkillLevel + SkillPivotPoint))

SkillValue = FLOOR(20 * 300 * (SkillLevel - 34 + 100 * 0.015) / (SkillLevel - 34 + 100))

SkillValue = FLOOR(6000 * (SkillLevel - 34 + 1.5) / (SkillLevel + 66))

SkillValue = FLOOR(6000 * (SkillLevel - 32.5) / (SkillLevel + 66))


And now, by using these formulas, we can fill in the following table:

  • Note: The values for Opponent's Damage -X% are without precision loss, because that happens only in the tooltip.
Skill level Pre-mastery Post-mastery
Armor per Damage Type +X Opponent's Damage -X% Armor per Damage Type +X Opponent's Damage -X%
1 +4 -0.4%
2 +6 -0.6%
3 +8 -0.8%
4 +10 -1%
5 +12 -1.2%
6 +14 -1.4%
7 +15 -1.5%
8 +17 -1.7%
9 +19 -1.9%
10 +20 -2%
11 +22 -2.2%
12 +24 -2.4%
13 +25 -2.5%
14 +27 -2.7%
15 +28 -2.8%
16 +30 -3%
17 +31 -3.1%
18 +33 -3.3%
19 +34 -3.4%
20 +35 -3.5%
21 +37 -3.7%
22 +38 -3.8%
23 +39 -3.9%
24 +41 -4.1%
25 +42 -4.2%
26 +43 -4.3%
27 +44 -4.4%
28 +46 -4.6%
29 +47 -4.7%
30 +48 -4.8%
31 +49 -4.9%
32 +50 -5%
33 +51 -5.1%
34 +52 -5.2%
35 +54 -5.4%
36 +55 -5.5%
37 +56 -5.6%
38 +57 -5.7%
39 +58 -5.8%
40 +59 -5.9%
41 +60 -6%
42 +61 -6.1%
43 +62 -6.2%
44 +63 -6.3%
45 +64 -6.4%
46 +65 -6.5%
47 +65 -6.5%
48 +66 -6.6%
49 +67 -6.7%
50 +68 -6.8%
51 +69 -6.9%
52 +70 -7%
53 +71 -7.1%
54 +72 -7.2%
55 +72 -7.2%
56 +73 -7.3%
57 +74 -7.4%
58 +75 -7.5%
59 +76 -7.6%
60 +76 -7.6%
61 +77 -7.7%
62 +78 -7.8%
63 +79 -7.9%
64 +79 -7.9%
65 +80 -8%
66 +81 -8.1%
67 +82 -8.2%
68 +82 -8.2%
69 +83 -8.3%
70 +84 -8.4%
71 +84 -8.4%
72 +85 -8.5%
73 +86 -8.6%
74 +86 -8.6%
75 +87 -8.7% +120 -12%
76 +88 -8.8% +122 -12.2%
77 +88 -8.8% +124 -12.4%
78 +89 -8.9% +126 -12.6%
79 +89 -8.9% +128 -12.8%
80 +90 -9% +130 -13%
81 +91 -9.1% +131 -13.1%
82 +91 -9.1% +133 -13.3%
83 +92 -9.2% +135 -13.5%
84 +92 -9.2% +137 -13.7%
85 +93 -9.3% +139 -13.9%
86 +94 -9.4% +140 -14%
87 +94 -9.4% +142 -14.2%
88 +95 -9.5% +144 -14.4%
89 +95 -9.5% +145 -14.5%
90 +96 -9.6% +147 -14.7%
91 +96 -9.6% +149 -14.9%
92 +97 -9.7% +150 -15%
93 +97 -9.7% +152 -15.2%
94 +98 -9.8% +153 -15.3%
95 +98 -9.8% +155 -15.5%
96 +99 -9.9% +156 -15.6%
97 +100 -10% +158 -15.8%
98 +100 -10% +159 -15.9%
99 +101 -10.1% +161 -16.1%
100 +101 -10.1% +162 -16.2%
101 +101 -10.1% +164 -16.4%
102 +102 -10.2% +165 -16.5%
103 +102 -10.2% +166 -16.6%
104 +103 -10.3% +168 -16.8%
105 +103 -10.3% +169 -16.9%
106 +104 -10.4% +170 -17%
107 +104 -10.4% +172 -17.2%
108 +105 -10.5% +173 -17.3%
109 +105 -10.5% +174 -17.4%
110 +106 -10.6% +176 -17.6%
111 +106 -10.6% +177 -17.7%
112 +107 -10.7% +178 -17.8%
113 +107 -10.7% +179 -17.9%
114 +107 -10.7% +181 -18.1%
115 +108 -10.8% +182 -18.2%
116 +108 -10.8% +183 -18.3%
117 +109 -10.9% +184 -18.4%
118 +109 -10.9% +185 -18.5%
119 +110 -11% +187 -18.7%
120 +110 -11% +188 -18.8%
121 +110 -11% +189 -18.9%
122 +111 -11.1% +190 -19%
123 +111 -11.1% +191 -19.1%
124 +112 -11.2% +192 -19.2%
125 +112 -11.2% +193 -19.3%
126 +112 -11.2% +194 -19.4%
127 +113 -11.3% +195 -19.5%
128 +113 -11.3% +196 -19.6%
129 +113 -11.3% +197 -19.7%
130 +114 -11.4% +198 -19.8%
131 +114 -11.4% +200 -20%
132 +115 -11.5% +201 -20.1%
133 +115 -11.5% +202 -20.2%
134 +115 -11.5% +203 -20.3%
135 +116 -11.6% +203 -20.3%
136 +116 -11.6% +204 -20.4%
137 +116 -11.6% +205 -20.5%
138 +117 -11.7% +206 -20.6%
139 +117 -11.7% +207 -20.7%
140 +117 -11.7% +208 -20.8%
141 +118 -11.8% +209 -20.9%
142 +118 -11.8% +210 -21%
143 +118 -11.8% +211 -21.1%
144 +119 -11.9% +212 -21.2%
145 +119 -11.9% +213 -21.3%
146 +119 -11.9% +214 -21.4%
147 +120 -12% +215 -21.5%
148 +120 -12% +215 -21.5%
149 +120 -12% +216 -21.6%
150 +121 -12.1% +217 -21.7%
151 +121 -12.1% +218 -21.8%
152 +121 -12.1% +219 -21.9%
153 +122 -12.2% +220 -22%
154 +122 -12.2% +220 -22%
155 +122 -12.2% +221 -22.1%
156 +123 -12.3% +222 -22.2%
157 +123 -12.3% +223 -22.3%
158 +123 -12.3% +224 -22.4%
159 +123 -12.3% +224 -22.4%
160 +124 -12.4% +225 -22.5%
161 +124 -12.4% +226 -22.6%
162 +124 -12.4% +227 -22.7%
163 +125 -12.5% +227 -22.7%
164 +125 -12.5% +228 -22.8%
165 +125 -12.5% +229 -22.9%
166 +125 -12.5% +230 -23%
167 +126 -12.6% +230 -23%
168 +126 -12.6% +231 -23.1%
169 +126 -12.6% +232 -23.2%
170 +127 -12.7% +233 -23.3%
171 +127 -12.7% +233 -23.3%
172 +127 -12.7% +234 -23.4%
173 +127 -12.7% +235 -23.5%
174 +128 -12.8% +235 -23.5%
175 +128 -12.8% +236 -23.6%
176 +128 -12.8% +237 -23.7%
177 +128 -12.8% +237 -23.7%
178 +129 -12.9% +238 -23.8%
179 +129 -12.9% +239 -23.9%
180 +129 -12.9% +239 -23.9%
181 +129 -12.9% +240 -24%
182 +130 -13% +241 -24.1%
183 +130 -13% +241 -24.1%
184 +130 -13% +242 -24.2%
185 +130 -13% +243 -24.3%
186 +131 -13.1% +243 -24.3%
187 +131 -13.1% +244 -24.4%
188 +131 -13.1% +244 -24.4%
189 +131 -13.1% +245 -24.5%
190 +132 -13.2% +246 -24.6%
191 +132 -13.2% +246 -24.6%
192 +132 -13.2% +247 -24.7%
193 +132 -13.2% +247 -24.7%
194 +132 -13.2% +248 -24.8%
195 +133 -13.3% +249 -24.9%
196 +133 -13.3% +249 -24.9%
197 +133 -13.3% +250 -25%
198 +133 -13.3% +250 -25%
199 +134 -13.4% +251 -25.1%
200 +134 -13.4% +251 -25.1%
201 +134 -13.4% +252 -25.2%
202 +134 -13.4% +252 -25.2%
203 +134 -13.4% +253 -25.3%
204 +135 -13.5% +254 -25.4%
205 +135 -13.5% +254 -25.4%
206 +135 -13.5% +255 -25.5%
207 +135 -13.5% +255 -25.5%
208 +136 -13.6% +256 -25.6%
209 +136 -13.6% +256 -25.6%
210 +136 -13.6% +257 -25.7%
211 +136 -13.6% +257 -25.7%
212 +136 -13.6% +258 -25.8%
213 +137 -13.7% +258 -25.8%
214 +137 -13.7% +259 -25.9%
215 +137 -13.7% +259 -25.9%
216 +137 -13.7% +260 -26%
217 +137 -13.7% +260 -26%
218 +138 -13.8% +261 -26.1%
219 +138 -13.8% +261 -26.1%
220 +138 -13.8% +262 -26.2%
221 +138 -13.8% +262 -26.2%
222 +138 -13.8% +263 -26.3%
223 +139 -13.9% +263 -26.3%
224 +139 -13.9% +264 -26.4%
225 +139 -13.9% +264 -26.4%
226 +139 -13.9% +265 -26.5%
227 +139 -13.9% +265 -26.5%
228 +139 -13.9% +265 -26.5%
229 +140 -14% +266 -26.6%
230 +140 -14% +266 -26.6%
231 +140 -14% +267 -26.7%
232 +140 -14% +267 -26.7%
233 +140 -14% +268 -26.8%
234 +141 -14.1% +268 -26.8%
235 +141 -14.1% +269 -26.9%
236 +141 -14.1% +269 -26.9%
237 +141 -14.1% +269 -26.9%
238 +141 -14.1% +270 -27%
239 +141 -14.1% +270 -27%
240 +142 -14.2% +271 -27.1%
241 +142 -14.2% +271 -27.1%
242 +142 -14.2% +272 -27.2%
243 +142 -14.2% +272 -27.2%
244 +142 -14.2% +272 -27.2%
245 +142 -14.2% +273 -27.3%
246 +143 -14.3% +273 -27.3%
247 +143 -14.3% +274 -27.4%
248 +143 -14.3% +274 -27.4%
249 +143 -14.3% +274 -27.4%
250 +143 -14.3% +275 -27.5%
251 +143 -14.3% +275 -27.5%
252 +144 -14.4% +276 -27.6%
253 +144 -14.4% +276 -27.6%
254 +144 -14.4% +276 -27.6%
255 +144 -14.4% +277 -27.7%
256 +144 -14.4% +277 -27.7%
257 +144 -14.4% +278 -27.8%
258 +144 -14.4% +278 -27.8%
259 +145 -14.5% +278 -27.8%
260 +145 -14.5% +279 -27.9%
261 +145 -14.5% +279 -27.9%
262 +145 -14.5% +279 -27.9%
263 +145 -14.5% +280 -28%
264 +145 -14.5% +280 -28%
265 +146 -14.6% +280 -28%
266 +146 -14.6% +281 -28.1%
267 +146 -14.6% +281 -28.1%
268 +146 -14.6% +282 -28.2%
269 +146 -14.6% +282 -28.2%
270 +146 -14.6% +282 -28.2%
271 +146 -14.6% +283 -28.3%
272 +147 -14.7% +283 -28.3%
273 +147 -14.7% +283 -28.3%
274 +147 -14.7% +284 -28.4%
275 +147 -14.7% +284 -28.4%
276 +147 -14.7% +284 -28.4%
277 +147 -14.7% +285 -28.5%
278 +147 -14.7% +285 -28.5%
279 +148 -14.8% +285 -28.5%
280 +148 -14.8% +286 -28.6%
281 +148 -14.8% +286 -28.6%
282 +148 -14.8% +286 -28.6%
283 +148 -14.8% +287 -28.7%
284 +148 -14.8% +287 -28.7%
285 +148 -14.8% +287 -28.7%
286 +148 -14.8% +288 -28.8%
287 +149 -14.9% +288 -28.8%
288 +149 -14.9% +288 -28.8%
289 +149 -14.9% +289 -28.9%
290 +149 -14.9% +289 -28.9%
291 +149 -14.9% +289 -28.9%
292 +149 -14.9% +289 -28.9%
293 +149 -14.9% +290 -29%
294 +150 -15% +290 -29%
295 +150 -15% +290 -29%
296 +150 -15% +291 -29.1%
297 +150 -15% +291 -29.1%
298 +150 -15% +291 -29.1%
299 +150 -15% +292 -29.2%
300 +150 -15% +292 -29.2%
301 +150 -15% +292 -29.2%
302 +150 -15% +292 -29.2%
303 +151 -15.1% +293 -29.3%
304 +151 -15.1% +293 -29.3%
305 +151 -15.1% +293 -29.3%
306 +151 -15.1% +294 -29.4%
307 +151 -15.1% +294 -29.4%
308 +151 -15.1% +294 -29.4%
309 +151 -15.1% +294 -29.4%
310 +151 -15.1% +295 -29.5%
311 +152 -15.2% +295 -29.5%
312 +152 -15.2% +295 -29.5%
313 +152 -15.2% +296 -29.6%
314 +152 -15.2% +296 -29.6%
315 +152 -15.2% +296 -29.6%
316 +152 -15.2% +296 -29.6%
317 +152 -15.2% +297 -29.7%
318 +152 -15.2% +297 -29.7%
319 +152 -15.2% +297 -29.7%
320 +153 -15.3% +297 -29.7%
321 +153 -15.3% +298 -29.8%
322 +153 -15.3% +298 -29.8%
323 +153 -15.3% +298 -29.8%
324 +153 -15.3% +298 -29.8%
325 +153 -15.3% +299 -29.9%
326 +153 -15.3% +299 -29.9%
327 +153 -15.3% +299 -29.9%
328 +153 -15.3% +300 -30%
329 +154 -15.4% +300 -30%
330 +154 -15.4% +300 -30%
331 +154 -15.4% +300 -30%
332 +154 -15.4% +301 -30.1%
333 +154 -15.4% +301 -30.1%
334 +154 -15.4% +301 -30.1%
335 +154 -15.4% +301 -30.1%
336 +154 -15.4% +301 -30.1%
337 +154 -15.4% +302 -30.2%
338 +155 -15.5% +302 -30.2%
339 +155 -15.5% +302 -30.2%
340 +155 -15.5% +302 -30.2%
341 +155 -15.5% +303 -30.3%
342 +155 -15.5% +303 -30.3%
343 +155 -15.5% +303 -30.3%
344 +155 -15.5% +303 -30.3%
345 +155 -15.5% +304 -30.4%
346 +155 -15.5% +304 -30.4%
347 +155 -15.5% +304 -30.4%
348 +156 -15.6% +304 -30.4%
349 +156 -15.6% +305 -30.5%
350 +156 -15.6% +305 -30.5%
351 +156 -15.6% +305 -30.5%
352 +156 -15.6% +305 -30.5%
353 +156 -15.6% +305 -30.5%
354 +156 -15.6% +306 -30.6%
355 +156 -15.6% +306 -30.6%
356 +156 -15.6% +306 -30.6%
357 +156 -15.6% +306 -30.6%
358 +156 -15.6% +307 -30.7%
359 +157 -15.7% +307 -30.7%
360 +157 -15.7% +307 -30.7%
361 +157 -15.7% +307 -30.7%
362 +157 -15.7% +307 -30.7%
363 +157 -15.7% +308 -30.8%
364 +157 -15.7% +308 -30.8%
365 +157 -15.7% +308 -30.8%
366 +157 -15.7% +308 -30.8%
367 +157 -15.7% +309 -30.9%
368 +157 -15.7% +309 -30.9%
369 +157 -15.7% +309 -30.9%
370 +158 -15.8% +309 -30.9%
371 +158 -15.8% +309 -30.9%
372 +158 -15.8% +310 -31%
373 +158 -15.8% +310 -31%
374 +158 -15.8% +310 -31%
375 +158 -15.8% +310 -31%
376 +158 -15.8% +310 -31%
377 +158 -15.8% +311 -31.1%
378 +158 -15.8% +311 -31.1%
379 +158 -15.8% +311 -31.1%
380 +158 -15.8% +311 -31.1%
381 +159 -15.9% +311 -31.1%
382 +159 -15.9% +312 -31.2%
383 +159 -15.9% +312 -31.2%
384 +159 -15.9% +312 -31.2%
385 +159 -15.9% +312 -31.2%
386 +159 -15.9% +312 -31.2%
387 +159 -15.9% +313 -31.3%
388 +159 -15.9% +313 -31.3%
389 +159 -15.9% +313 -31.3%
390 +159 -15.9% +313 -31.3%
391 +159 -15.9% +313 -31.3%
392 +159 -15.9% +313 -31.3%
393 +160 -16% +314 -31.4%
394 +160 -16% +314 -31.4%
395 +160 -16% +314 -31.4%
396 +160 -16% +314 -31.4%
397 +160 -16% +314 -31.4%
398 +160 -16% +315 -31.5%
399 +160 -16% +315 -31.5%
400 +160 -16% +315 -31.5%

References