-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathindex.html
367 lines (364 loc) · 13.7 KB
/
index.html
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
<!--
Do a Find and Replace for `index` vs `over5` for findTotal() and initPage() function inputs.
NOTE: For the above Find and Replace, put ' ' (and not ` `) around the arg names, to avoid accidental comment changes.
Also do a Find and Replace for `For Runs of Under 5 Minutes` and `For Runs of 5 to 15 Minutes` (og:description meta tag).
NOTE: For the above Find and Replace. put " " (and not ` `) around the arg names, to avoid accidental comment changes.
-->
<!DOCTYPE html>
<html>
<head>
<link rel="stylesheet" href="style.css" />
<link
rel="icon"
href="https://img.icons8.com/color/344/calculator--v1.png"
/>
<script src="index.js"></script>
<meta property="og:title" content="Hitman Milliseconds Time Calculator" />
<meta property="og:description" content="For Runs of Under 5 Minutes" />
<meta
property="og:image"
content="https://img.icons8.com/color/344/calculator--v1.png"
/>
</head>
<body onLoad="return (initPage('index'), findTotal('index'))">
<title>HITMAN Milliseconds Time Calculator</title>
<div class="test">
<h2 class="h_custom" id="titleHeader">
HITMAN Milliseconds Time Calculator
</h2>
<p>
<strong class="p1">Score on Rating Screen: </strong>
<input
onkeyup="findTotal('index')"
type="text"
id="score"
name="printcost"
placeholder="Enter a Score"
class="scoreInput"
/>
</p>
</div>
<div id="totalordercost"></div>
<div id="totalordercost2"></div>
<strong class="p1">
Debug Mode
<input
type="checkbox"
id="debugCheckbox"
name="debug"
value="debug"
class="debugCheckbox"
onclick="findTotal('index')"
/>
</strong>
<br />
<br />
<button type="button" class="saveButton" onClick="clearFields()">
Clear Fields
<!-- https://www.svgrepo.com/ -->
<svg
width="25px"
height="25px"
viewBox="0 0 24 20"
fill="none"
xmlns="http://www.w3.org/2000/svg"
>
<path
d="M9 9L15 15"
stroke="#000000"
stroke-width="2"
stroke-linecap="round"
stroke-linejoin="round"
/>
<path
d="M15 9L9 15"
stroke="#000000"
stroke-width="2"
stroke-linecap="round"
stroke-linejoin="round"
/>
<circle
cx="12"
cy="12"
r="9"
stroke="#000000"
stroke-width="2"
stroke-linecap="round"
stroke-linejoin="round"
/>
</svg>
</button>
<button type="button" class="saveButton" onClick="saveData()">
Save Data as URL
<!-- https://www.svgrepo.com/ -->
<svg
width="25px"
height="25px"
viewBox="0 0 48 48"
xmlns="http://www.w3.org/2000/svg"
>
<title>share-arrow</title>
<g id="Layer_2" data-name="Layer 2">
<g id="invisible_box" data-name="invisible box">
<rect width="48" height="48" fill="none" />
</g>
<g id="Q3_icons" data-name="Q3 icons">
<path
d="M31.2,14.2,41,24.1l-9.8,9.8V26.8L27,27c-6.8.3-12,1-16.1,2.4,3.6-3.8,9.3-6.8,16.7-7.5l3.6-.3V14.2M28.3,6a1.2,1.2,0,0,0-1.1,1.3V17.9C12,19.4,2.2,29.8,2,40.3c0,.6.2,1,.6,1s.7-.3,1.1-1.1c2.4-5.4,7.8-8.5,23.5-9.2v9.7A1.2,1.2,0,0,0,28.3,42a.9.9,0,0,0,.8-.4L45.6,25.1a1.5,1.5,0,0,0,0-2L29.1,6.4a.9.9,0,0,0-.8-.4Z"
/>
</g>
</g>
</svg>
</button>
<br />
<br />
<strong class="p1">Time Calculation (minutes:seconds.milliseconds) </strong>
<br />
<br />
<b class="p2">
<div id="time0" class="p3"></div>
<br />
<button type="button" class="collapsible">
More Info on Time Calculation (Click to Expand)
</button>
<div class="content">
<!-- https://markdowntohtml.com/ -->
<!-- Convert everything in the "content" div (so before the "BioDiv" div) from markdown to html with website above. -->
<!-- For markdown input, copy everything from "Mathematics/ Code Explanation" to the bottom, from the README.md -->
<h3 id="mathematics-code-explanation">Mathematics/ Code Explanation</h3>
<p>
The full mathematical formula for calculating in game time from score,
for runs of less than 5 minutes in-game time, is:
</p>
<p><strong>(210,000 - (N * 100,000 / M)) * (3 / 400)</strong></p>
<p>
The full mathematical formula for calculating in game time from score,
for runs of 5 to 15 minutes, is:
</p>
<p><strong>(175,000 - (N * 100,000 / M)) * (3 / 50)</strong></p>
<p>
Let N = The Score shown on screen.<br />Let M = The Bonuses and
Penalties added up.
</p>
<p>
Each Silent Assassin Bonus (Objectives Complete, Never Spotted, No
Noticed Kills, No Bodies Found, No Recordings) is 20k points towards
the M value, while each nontarget kill is -5k points towards the M
value. Note that the Time Bonus does not count towards the M value.
The maximum M value is 100,000.
</p>
<p>
<a href="https://i.ibb.co/BPPf3wn/detailedscore.png"
>If confused by terminology in above paragraph, refer to this
reference image of Detailed Score (press P on a Hitman mission
rating screen to get to this menu in-game)</a
>
</p>
<p>
Since most players do not show Detailed Score Menu in their run
submissions, this site runs a script to account for all 20 possible M
values, and calculates 20 possible decimal times as a result. The user
is asked to report the the time shown on the rating screen (which
rounds down to the nearest second). The calculated decimal time that
is closest to the time shown on the rating screen is displayed to the
user.
</p>
<h3 id="usage-quirks">Usage Quirks</h3>
<ul>
<li>
<p>
This formula does not work when the N value (Score) and/or M value
(Penalties/Bonuses) are 0. Note that one of the Silent Assassin
bonuses is "Objectives Complete", and you are almost
guaranteed to get points for this simply by killing all targets
and exiting the mission. The score can become 0 either due to:
</p>
</li>
<li>
<p>
Killing too many nontargets (each nontarget kill is -5k in the
Bonuses and Penalties (M) score).
</p>
</li>
<li>
<p>
Finishing the mission in less than 7 seconds (IOI's
"anticheat", currently this only applies to Dubai any%
in terms of main missions).
</p>
</li>
<li>
<p>
Any decimal values smaller than a millisecond in the final result
are rounded down to the nearest millisecond.
</p>
<ul>
<li>Example: 26.1857 rounds down to 26.185.</li>
</ul>
</li>
</ul>
<h3 id="error-calculation">Error Calculation</h3>
<ul>
<li>
Disclaimer: The calculated decimal score is not quite accurate (due
to the game internally tracking decimals in the score). These can be
manually rounded to the next fastest second as needed for
leaderboard purposes.
<ul>
<li>
To be precise:
<strong>Error = (Z * 100,000 / M) * (3 / 400)</strong>
<ul>
<li>
Where M = the penalties and bonuses added up (each SA bonus
20k, each nontarget kill -5k, etc).
</li>
<li>
And Z = how much the score shown on screen is off, between
-0.5 and 0.5.
</li>
</ul>
</li>
<li>
Assuming -0.5 < Z <= 0.5, the error can be as low as
±0.00375 seconds (for SA run) or as high as ±0.75 seconds (any%
run with M score of 5k).
</li>
<li>
Example (calculated time is higher than expected):
<ul>
<li>
SCORE (N): 113593
<ul>
<li><strong>Actual Score Screen</strong>: 0:25.xxx</li>
<li>
Original Time Calc:
<a
href="https://www.google.com/search?q=%28210000+-+%28113593+*+100000+%2F+55000%29%29+*+%283+%2F+400%29"
>0:26.004</a
>
</li>
<li>
Time Calc Error Range: (<a
href="https://www.google.com/search?q=%28210000+-+%28113593.5+*+100000+%2F+55000%29%29+*+%283+%2F+400%29"
>0:25.997</a
>,
<a
href="https://www.google.com/search?q=%28210000+-+%28113592.5+*+100000+%2F+55000%29%29+*+%283+%2F+400%29"
>0:26.011</a
>)
</li>
<li>
Margin of Error (Seconds): ±
<a
href="https://www.google.com/search?q=%280.5+*+100000+%2F+55000%29+*+%283+%2F+400%29"
>0.00681</a
>
</li>
<li>M value: 55000</li>
<li>
<strong>Result for SRC</strong>: Due to the time shown
on rating screen taking precedent, use 25.999 for
leaderboard ranking (if using milliseconds)
</li>
</ul>
</li>
</ul>
</li>
<li>
Example (calculated time is lower than expected):
<ul>
<li>
SCORE: 204667
<ul>
<li>
<strong>Actual Time shown on Rating Screen</strong>:
40.xxx
</li>
<li>
Original Time Calc:
<a
href="https://www.google.com/search?q=%28210000+-+%28204667+*+100000+%2F+100000%29%29+*+%283+%2F+400%29"
>0:39.997</a
>
</li>
<li>
Time Calc Error Range: (<a
href="https://www.google.com/search?q=%28210000+-+%28204667.5+*+100000+%2F+100000%29%29+*+%283+%2F+400%29"
>0:39.993</a
>,
<a
href="https://www.google.com/search?q=%28210000+-+%28204666.5+*+100000+%2F+100000%29%29+*+%283+%2F+400%29"
>0:40.001</a
>]
</li>
<li>
Margin of Error (Seconds): ±
<a
href="https://www.google.com/search?q=%280.5+*+100000+%2F+100000%29+*+%283+%2F+400%29"
>0.00375</a
>
</li>
<li>M value: 100000</li>
<li>
<strong>Result for SRC (tentative)</strong>: Due to the
time shown on rating screen taking precedent, use 40.000
for leaderboard ranking (if using milliseconds)
</li>
<li>
PS: This case seems to confirm that the score rounds up
to the next value, with a rounding cutoff near .5 mark
(score decimals of less than .5 = round down, greater
than or equal to .5 = round up)
</li>
</ul>
</li>
</ul>
</li>
</ul>
</li>
</ul>
</div>
<div class="BioDiv">
<p>
<a href="" class="p1" id="otherPage"
>Calculator for runs of 5 to 15 minutes</a
>
<br />
<br />
<b class="p3">
<a
href="https://github.com/solderq35/time-calc-under-5/blob/main/README.md#usage-instructions-and-screenshots"
class="p1"
>Usage Instructions</a
>
</b>
<br />
<br />
<b class="p3">
Code by
<a href="https://solderq35.github.io/" class="p1">Solderq35</a>
</b>
</p>
</div>
<script>
var coll = document.getElementsByClassName("collapsible");
var i;
for (i = 0; i < coll.length; i++) {
coll[i].addEventListener("click", function () {
this.classList.toggle("active");
var content = this.nextElementSibling;
if (content.style.display === "block") {
content.style.display = "none";
} else {
content.style.display = "block";
}
});
}
</script>
<script>
document.body.style.backgroundColor = "#F5F5DC";
</script>
</b>
</body>
</html>