Etterna 0.75.1
Loading...
Searching...
No Matches
Ulbu.h
1#pragma once
2
3#if !defined(STANDALONE_CALC) && !defined(PHPCALC)
4// stepmania garbage
5#include "../FileTypes/XmlFile.h"
6#include "../FileTypes/XmlFileUtil.h"
7#include "RageUtil/File/RageFile.h"
8#include "RageUtil/File/RageFileManager.h"
9#include "RageUtil/Utils/RageUtil.h"
10#endif
11
12// hand agnostic data structures/functions
13#include "Agnostic/MetaRowInfo.h"
14
15// hand agnostic pattern mods
16#include "Agnostic/HA_PatternMods/Stream.h"
17#include "Agnostic/HA_PatternMods/JS.h"
18#include "Agnostic/HA_PatternMods/HS.h"
19#include "Agnostic/HA_PatternMods/CJ.h"
20#include "Agnostic/HA_PatternMods/CJDensity.h"
21#include "Agnostic/HA_PatternMods/HSDensity.h"
22#include "Agnostic/HA_PatternMods/FlamJam.h"
23#include "Agnostic/HA_PatternMods/TheThingFinder.h"
24#include "Agnostic/HA_PatternMods/OldJumpScaler.h"
25
26// hand dependent data structures/functions
27#include "Dependent/MetaHandInfo.h"
28#include "Dependent/MetaIntervalHandInfo.h"
29
30// hand dependent pattern mods
31#include "Dependent/HD_PatternMods/OHJ.h"
32#include "Dependent/HD_PatternMods/CJOHJ.h"
33#include "Dependent/HD_PatternMods/Balance.h"
34#include "Dependent/HD_PatternMods/Roll.h"
35#include "Dependent/HD_PatternMods/RollJS.h"
36#include "Dependent/HD_PatternMods/OHT.h"
37#include "Dependent/HD_PatternMods/VOHT.h"
38#include "Dependent/HD_PatternMods/Chaos.h"
39#include "Dependent/HD_PatternMods/CJOHAnchor.h"
40#include "Dependent/HD_PatternMods/WideRangeBalance.h"
41#include "Dependent/HD_PatternMods/WideRangeRoll.h"
42#include "Dependent/HD_PatternMods/WideRangeJumptrill.h"
43#include "Dependent/HD_PatternMods/WideRangeJJ.h"
44#include "Dependent/HD_PatternMods/WideRangeAnchor.h"
45#include "Dependent/HD_PatternMods/WideRangeCJAnchor.h"
46#include "Dependent/HD_PatternMods/Minijack.h"
47#include "Dependent/HD_PatternMods/RunningMan.h"
48#include "Dependent/HD_PatternMods/OldAnchorScaler.h"
49#include "Dependent/HD_PatternMods/OldOHJScaler.h"
50#include "Dependent/HD_PatternMods/OldRollScaler.h"
51
52// they're useful sometimes
53#include "UlbuAcolytes.h"
54#include "UlbuBase.h"
55
56#include <cmath>
57
61{
62 // tracks meta hand info as well as basic interval tracking data for hand
63 // dependent stuff, like metaitvinfo and itvinfo
64 metaItvHandInfo _mitvhi;
65
66 // meta hand info is the same as meta row info, however it tracks
67 // pattern progression on individual hands rather than on generic rows
68 std::unique_ptr<metaHandInfo> _last_mhi;
69 std::unique_ptr<metaHandInfo> _mhi;
70
72
73 // so we can make pattern mods with these
74 StreamMod _s;
75 JSMod _js;
76 HSMod _hs;
77 CJDensityMod _cjd;
78 HSDensityMod _hsd;
80 CJOHJumpMod _cjohj;
81 RollMod _roll;
82 RollJSMod _rolljs;
83 BalanceMod _bal;
84 OHTrillMod _oht;
85 VOHTrillMod _voht;
86 ChaosMod _ch;
87 CJOHAnchorMod _chain;
88 RunningManMod _rm;
89 MinijackMod _mj;
93 WideRangeJJMod _wrjj;
96 FlamJamMod _fj;
99 OldAnchorScalerMod _old_anch;
100 OldJumpScalerMod _old_jump;
101 OldOHJScalerMod _old_ohj;
102 OldRollScalerMod _old_roll;
103
104 // and put them here
105 PatternMods _pmods;
106
107 // so we can apply them here
108 diffz _diffz;
109 propz _propz;
110
111 explicit TheGreatBazoinkazoinkInTheSky(Calc& calc)
112 : Bazoinkazoink(calc)
113 {
114 // setup our data pointers
115 _last_mhi = std::make_unique<metaHandInfo>(calc);
116 _mhi = std::make_unique<metaHandInfo>(calc);
117 }
118
119 private:
120 const std::array<std::vector<int>, NUM_Skillset> pmods = { {
121 // overall, nothing, don't handle here
122 {},
123
124 // stream
125 {
126 Stream,
127 OHTrill,
128 VOHTrill,
129 Roll,
130 // Chaos,
131 WideRangeRoll,
132 WideRangeJumptrill,
133 WideRangeJJ,
134 FlamJam,
135 // OHJumpMod,
136 // Balance,
137 // RanMan,
138 // WideRangeBalance,
139 },
140
141 // js
142 {
143 JS,
144 // OHJumpMod,
145 // Chaos,
146 // Balance,
147 // TheThing,
148 // TheThing2,
149 WideRangeBalance,
150 WideRangeJumptrill,
151 WideRangeJJ,
152 // WideRangeRoll,
153 // OHTrill,
154 VOHTrill,
155 // Roll,
156 RollJS,
157 // RanMan,
158 FlamJam,
159 // WideRangeAnchor,
160 },
161
162 // hs
163 {
164 HS,
165 OHJumpMod,
166 TheThing,
167 // WideRangeAnchor,
168 WideRangeRoll,
169 WideRangeJumptrill,
170 WideRangeJJ,
171 OHTrill,
172 VOHTrill,
173 // Roll,
174 // RanMan,
175 FlamJam,
176 HSDensity,
177 },
178
179 // stam, nothing, don't handle here
180 {},
181
182 // jackspeed, doesn't use pmods (atm)
183 {},
184
185 // chordjack
186 {
187 // OldOHJScaler is applied directly in a adj_diff_func
188 CJ,
189 OldAnchorScaler,
190 OldJumpScaler,
191 OldRollScaler,
192 CJDensity,
193 WideRangeCJAnchor,
194 WideRangeJumptrill,
195 VOHTrill,
196 FlamJam,
197 },
198
199 // tech, duNNO wat im DOIN
200 {
201 OHTrill,
202 VOHTrill,
203 Balance,
204 Roll,
205 // OHJumpMod,
206 Chaos,
207 WideRangeJumptrill,
208 WideRangeJJ,
209 WideRangeBalance,
210 WideRangeRoll,
211 FlamJam,
212 // RanMan,
213 Minijack,
214 // WideRangeAnchor,
215 TheThing,
216 TheThing2,
217 },
218 } };
219
220 /* since we are no longer using the normalizer system we need to lower the
221 * base difficulty for each skillset and then detect pattern types to push
222 * down OR up, rather than just down and normalizing to a differential since
223 * chorded patterns have lower enps than streams, streams default to 1 and
224 * chordstreams start lower, stam is a special case and may use normalizers
225 * again */
226 const std::array<float, NUM_Skillset> basescalers = { 0.F, 0.91F, 0.75F,
227 0.77F, 0.93F, 1.01F,
228 1.06F, 1.06F };
229
230 public:
231 const std::array<std::vector<int>, NUM_Skillset>& get_pmods() const override
232 {
233 return pmods;
234 }
235 const std::array<float, NUM_Skillset>& get_basescalers() const override
236 {
237 return basescalers;
238 }
239 void adj_diff_func(
240 const size_t& itv,
241 const int& hand,
242 float*& adj_diff,
243 float*& stam_base,
244 const float& adj_npsbase,
245 const int& ss,
246 std::array<float, NUM_Skillset>& pmod_product_cur_interval) override
247 {
248 switch (ss) {
249 case Skill_Stream:
250 break;
251 /* test calculating stam for js/hs on max js/hs diff, also we
252 * want hs to count against js so they are mutually exclusive,
253 * don't know how this functionally interacts with the stam base
254 * stuff, but it might be one reason why js is more problematic
255 * than hs? */
256 case Skill_Jumpstream: {
257 *adj_diff /=
258 std::max<float>(_calc.pmod_vals.at(hand).at(HS).at(itv), 1.F);
259 *adj_diff /= fastsqrt(
260 _calc.pmod_vals.at(hand).at(OHJumpMod).at(itv) * 0.95F);
261
262 auto a = *adj_diff;
263 auto b =
264 _calc.init_base_diff_vals.at(hand).at(NPSBase).at(itv) *
265 pmod_product_cur_interval[Skill_Handstream];
266 *stam_base = std::max<float>(a, b);
267 } break;
268 case Skill_Handstream: {
269
270 // adj_diff /=
271 // fastsqrt(doot.at(hi).at(OHJump).at(i));
272 auto a = adj_npsbase;
273 auto b =
274 _calc.init_base_diff_vals.at(hand).at(NPSBase).at(itv) *
275 pmod_product_cur_interval[Skill_Jumpstream];
276 *stam_base = std::max<float>(a, b);
277 } break;
278 case Skill_JackSpeed:
279 break;
280 case Skill_Chordjack: {
281 // nps based chordjacks (0.57.1 calc 263)
282 auto& pmods = _calc.pmod_vals.at(hand);
283 // (pmod_product_cur_interval is applied before here)
284 *adj_diff *= fastsqrt(pmods.at(OldOHJScaler).at(itv));
285
286 } break;
287 case Skill_Technical:
288 *adj_diff =
289 _calc.init_base_diff_vals.at(hand).at(TechBase).at(itv) *
290 pmod_product_cur_interval.at(ss) * basescalers.at(ss) /
291 std::max<float>(
292 fastpow(_calc.pmod_vals.at(hand).at(CJ).at(itv) + 0.05F,
293 2.F),
294 1.F);
295 *adj_diff *=
296 fastsqrt(_calc.pmod_vals.at(hand).at(OHJumpMod).at(itv));
297 break;
298 default:
299 break;
300 }
301 }
302
303 void apply_keymode_multipliers(
304 std::vector<float>& cur_iteration_skillset_vals) const override
305 {
306 const auto qprop = _propz.get_prop(tap_size::quad);
307 const auto hprop = _propz.get_prop(tap_size::hand);
308 const auto jprop = _propz.get_prop(tap_size::jump);
309 const auto magic_number_awesome = 0.2F;
310 const auto another_magic_number = 1.015F;
311 const auto definitelycj =
312 std::clamp(qprop + hprop + jprop + magic_number_awesome, 0.5F, 1.F);
313
314 cur_iteration_skillset_vals[Skill_Chordjack] *=
315 definitelycj * another_magic_number;
316 }
317
318#pragma region hand agnostic pmod loop
319
320 void full_agnostic_reset() override
321 {
322 _s.full_reset();
323 _js.full_reset();
324 _hs.full_reset();
325 _cj.full_reset();
326 _old_jump.full_reset();
327 _hb.full_reset();
328
329 _mri.get()->reset();
330 _last_mri.get()->reset();
331 _propz.full_reset();
332 }
333
334 void setup_agnostic_pmods() override
335 {
336 /* these pattern mods operate on all columns, only need basic meta
337 * interval data, and do not need any more advanced pattern
338 * sequencing */
339 _s.setup();
340 _fj.setup();
341 _tt.setup();
342 _tt2.setup();
343 }
344
345 void advance_agnostic_sequencing() override
346 {
347 _propz.advance_sequencing(_mri->count);
348
349 _s.advance_sequencing(_mri->ms_now, _mri->notes);
350 _fj.advance_sequencing(_mri->ms_now, _mri->notes);
351 _tt.advance_sequencing(_mri->ms_now, _mri->notes);
352 _tt2.advance_sequencing(_mri->ms_now, _mri->notes);
353 _hb.advance_sequencing(_mri->notes, _calc);
354 }
355
356 void set_agnostic_pmods(const int& itv) override
357 {
358 /* these pattern mods operate on all columns, only need basic meta
359 * interval data, and do not need any more advanced pattern
360 * sequencing. Just set only one hand's values and we'll copy them
361 * over (or figure out how not to need to) later */
362
363 PatternMods::set_agnostic(_s._pmod, _s(_mitvi), itv, _calc);
364 PatternMods::set_agnostic(_js._pmod, _js(_mitvi), itv, _calc);
365 PatternMods::set_agnostic(_hs._pmod, _hs(_mitvi), itv, _calc);
366 PatternMods::set_agnostic(_cj._pmod, _cj(_mitvi), itv, _calc);
367 PatternMods::set_agnostic(_cjd._pmod, _cjd(_mitvi), itv, _calc);
368 PatternMods::set_agnostic(_hsd._pmod, _hsd(_mitvi), itv, _calc);
369 PatternMods::set_agnostic(_fj._pmod, _fj(), itv, _calc);
370 PatternMods::set_agnostic(_tt._pmod, _tt(), itv, _calc);
371 PatternMods::set_agnostic(_tt2._pmod, _tt2(), itv, _calc);
372 PatternMods::set_agnostic(
373 _old_jump._pmod, _old_jump(_mitvi), itv, _calc);
374 PatternMods::set_agnostic(_hb._pmod, _hb(), itv, _calc);
375 }
376
377#pragma endregion
378
379#pragma region hand dependent pmod loop
385 {
386 _ohj.advance_sequencing(_mhi->_ct, _mhi->_bt);
387 _cjohj.advance_sequencing(_mhi->_ct, _mhi->_bt);
388 _chain.advance_sequencing(
389 _mhi->_ct, _mhi->_bt, _mhi->_last_ct, _seq._mw_any_ms.get_now());
390 _oht.advance_sequencing(_mhi->_mt, _seq._mw_any_ms);
391 _voht.advance_sequencing(_mhi->_mt, _seq._mw_any_ms);
392 _rm.advance_sequencing(_mhi->_ct, _mhi->_bt, _mhi->_mt, _seq._as);
393 _wrr.advance_sequencing(_mhi->_bt,
394 _mhi->_mt,
395 _mhi->_last_mt,
396 _seq._mw_any_ms.get_now(),
397 _seq.get_sc_ms_now(_mhi->_ct));
398 _wrjt.advance_sequencing(
399 _mhi->_bt, _mhi->_mt, _mhi->_last_mt, _seq._mw_any_ms);
400 _wrjj.advance_sequencing(_mhi->_ct, row_time);
401 _ch.advance_sequencing(_seq._mw_any_ms);
402 _roll.advance_sequencing(_mhi->_ct, row_time);
403 _rolljs.advance_sequencing(_mhi->_ct, row_time);
404 _mj.advance_sequencing(_mhi->_ct, _seq.get_sc_ms_now(_mhi->_ct));
405 _old_roll.advance_sequencing(_mhi->_ct, _seq._mw_any_ms.get_now());
406 }
407
408 void setup_dependent_mods() override
409 {
410 _oht.setup();
411 _voht.setup();
412 _roll.setup();
413 _rolljs.setup();
414 _rm.setup();
415 _wrr.setup();
416 _wrjt.setup();
417 _wrjj.setup();
418 _wrb.setup();
419 _wra.setup();
420 _wrcja.setup();
421 }
422
423 void set_dependent_pmods(const int& itv) override
424 {
425 PatternMods::set_dependent(hand, _ohj._pmod, _ohj(_mitvhi), itv, _calc);
426 PatternMods::set_dependent(
427 hand, _chain._pmod, _chain(_mitvhi), itv, _calc);
428 PatternMods::set_dependent(
429 hand, _cjohj._pmod, _cjohj(_mitvhi), itv, _calc);
430 PatternMods::set_dependent(
431 hand, _oht._pmod, _oht(_mitvhi._itvhi), itv, _calc);
432 PatternMods::set_dependent(
433 hand, _voht._pmod, _voht(_mitvhi._itvhi), itv, _calc);
434 PatternMods::set_dependent(
435 hand, _bal._pmod, _bal(_mitvhi._itvhi), itv, _calc);
436 PatternMods::set_dependent(
437 hand, _roll._pmod, _roll(_mitvhi._itvhi), itv, _calc);
438 PatternMods::set_dependent(
439 hand, _rolljs._pmod, _rolljs(_mitvhi._itvhi), itv, _calc);
440 PatternMods::set_dependent(
441 hand, _ch._pmod, _ch(_mitvhi._itvhi.get_taps_nowi()), itv, _calc);
442 PatternMods::set_dependent(
443 hand, _rm._pmod, _rm(_mitvhi._itvhi.get_taps_nowi()), itv, _calc);
444 PatternMods::set_dependent(
445 hand, _wrb._pmod, _wrb(_mitvhi._itvhi), itv, _calc);
446 PatternMods::set_dependent(
447 hand, _wrr._pmod, _wrr(_mitvhi._itvhi), itv, _calc);
448 PatternMods::set_dependent(
449 hand, _wrjt._pmod, _wrjt(_mitvhi._itvhi), itv, _calc);
450 PatternMods::set_dependent(
451 hand, _wrjj._pmod, _wrjj(_mitvhi._itvhi), itv, _calc);
452 PatternMods::set_dependent(
453 hand, _wra._pmod, _wra(_mitvhi._itvhi, _seq._as), itv, _calc);
454 PatternMods::set_dependent(
455 hand, _wrcja._pmod, _wrcja(_mitvhi._itvhi, _seq._as), itv, _calc);
456 PatternMods::set_dependent(
457 hand, _mj._pmod, _mj(_mitvhi._itvhi), itv, _calc);
458 PatternMods::set_dependent(
459 hand, _old_anch._pmod, _old_anch(_mitvhi._itvhi), itv, _calc);
460 PatternMods::set_dependent(
461 hand, _old_ohj._pmod, _old_ohj(_mitvhi._itvhi), itv, _calc);
462 PatternMods::set_dependent(
463 hand, _old_roll._pmod, _old_roll(_mitvhi._itvhi), itv, _calc);
464 }
465
469 void full_hand_reset() override
470 {
471 _ohj.full_reset();
472 _chain.full_reset();
473 _cjohj.full_reset();
474 _bal.full_reset();
475 _roll.full_reset();
476 _rolljs.full_reset();
477 _oht.full_reset();
478 _voht.full_reset();
479 _ch.full_reset();
480 _rm.full_reset();
481 _wrr.full_reset();
482 _wrjt.full_reset();
483 _wrjj.full_reset();
484 _wrb.full_reset();
485 _wra.full_reset();
486 _wrcja.full_reset();
487 _mj.full_reset();
488 _old_anch.full_reset();
489 _old_ohj.full_reset();
490 _old_roll.full_reset();
491
492 _seq.full_reset();
493 _mitvhi.zero();
494 _mhi->full_reset();
495 _last_mhi->full_reset();
496 _diffz.full_reset();
497 }
498
499 void handle_dependent_interval_end(const int& itv) override
500 {
501 /* this calls itvhi's interval end, which is what updates the hand
502 * counts, so this _must_ be called before anything else */
503 _mitvhi.interval_end();
504
505 // same thing but for anchor max!!!
506 _seq.interval_end();
507
508 // run pattern mod generation for hand dependent mods
509 set_dependent_pmods(itv);
510
511 // run sequenced base difficulty generation, base diff is always
512 // hand dependent so we do it in this loop
513 set_sequenced_base_diffs(itv);
514
515 _diffz.interval_end();
516 }
517
519 void update_sequenced_base_diffs(const col_type& ct,
520 const int& itv,
521 const int& jack_counter,
522 const float& row_time,
523 const float& any_ms)
524 {
525 auto thing =
526 std::pair{ row_time,
527 ms_to_scaled_nps(_seq._as.get_lowest_jack_ms()) *
528 basescalers[Skill_JackSpeed] };
529 if (std::isnan(thing.second)) {
530 thing.second = 0.F;
531 }
532 // jack speed updates with highest anchor difficulty seen
533 // _between either column_ for _this row_
534 _calc.jack_diff.at(hand).push_back(thing);
535
536 // debug cv stuff
537 if (_calc.debugmode) {
538 switch (ct) {
539 case col_left:
540 _calc.debugMovingWindowCV.at(hand).at(0).emplace_back(
541 row_time, _seq.get_mw_sc_ms(ct).get_cv_of_window(4));
542 break;
543 case col_right:
544 _calc.debugMovingWindowCV.at(hand).at(1).emplace_back(
545 row_time, _seq.get_mw_sc_ms(ct).get_cv_of_window(4));
546 break;
547 case col_ohjump: {
548 _calc.debugMovingWindowCV.at(hand).at(0).emplace_back(
549 row_time, _seq.get_mw_sc_ms(ct).get_cv_of_window(4));
550 _calc.debugMovingWindowCV.at(hand).at(1).emplace_back(
551 row_time, _seq.get_mw_sc_ms(ct).get_cv_of_window(4));
552 break;
553 }
554 default:
555 break;
556 }
557 }
558
559 // chordjack updates
560 _diffz._cj.advance_base(any_ms, _calc);
561
562 // tech updates with a convoluted mess of garbage
563 _diffz._tc.advance_base(_seq, ct, _calc, hand, row_time);
564 _diffz._tc.advance_rm_comp(_rm.get_highest_anchor_difficulty());
565 _diffz._tc.advance_jack_comp(_seq._as.get_lowest_jack_ms());
566 }
567
568 void set_sequenced_base_diffs(const int& itv) const override
569 {
570 // this is no longer done for intervals, but per row, in the row
571 // (calc base anyways)
572 _calc.init_base_diff_vals.at(hand)[JackBase].at(itv) =
573 _diffz._tc.get_itv_jack_diff();
574
575 _calc.init_base_diff_vals.at(hand)[CJBase].at(itv) =
576 _diffz._cj.get_itv_diff(_calc);
577
578 // kinda jank but includes a weighted average vs nps base to prevent
579 // really silly stuff from becoming outliers
580 _calc.init_base_diff_vals.at(hand)[TechBase].at(itv) =
581 _diffz._tc.get_itv_diff(
582 _calc.init_base_diff_vals.at(hand)[NPSBase].at(itv), _calc);
583
584 // mostly for debug output.. optimize later
585 _calc.init_base_diff_vals.at(hand)[RMABase].at(itv) =
586 _diffz._tc.get_itv_rma_diff();
587 }
588
589 void run_dependent_pmod_loop() override
590 {
591 setup_dependent_mods();
592
593 for (const auto& ids : _calc.hand_col_masks) {
594 auto row_time = s_init;
595 auto last_row_time = s_init;
596 auto any_ms = ms_init;
597
598 auto row_notes = 0U;
599
600 auto ct = col_init;
602
603 // arrays are super bug prone with jacks so try vectors for now
604 _calc.jack_diff.at(hand).clear();
605
606 if (_calc.debugmode) {
607 _calc.debugMovingWindowCV.at(hand).fill(
608 std::vector<std::pair<float, float>>());
609 _calc.debugTechVals.at(hand).clear();
610 _calc.debugTechVals.at(hand).shrink_to_fit();
611 }
612
613 nps::actual_cancer(_calc, hand);
614
615 // maybe we _don't_ want this smoothed before the tech pass? and so
616 // it could be constructed parallel? NEEDS TEST
617 Smooth(_calc.init_base_diff_vals.at(hand).at(NPSBase), 0.F, _calc.numitv);
618 MSSmooth(
619 _calc.init_base_diff_vals.at(hand).at(MSBase), 0.F, _calc.numitv);
620
621 for (auto itv = 0; itv < _calc.numitv; ++itv) {
622 auto jack_counter = 0;
623 for (auto row = 0; row < _calc.itv_size.at(itv); ++row) {
624
625 const auto& ri = _calc.adj_ni.at(itv).at(row);
626 row_time = ri.row_time;
627 row_notes = ri.row_notes;
628 const auto row_count = ri.row_count;
629
630 // don't like having this here
631 any_ms = ms_from(row_time, last_row_time);
632
633 // To catch division by 0, not preventing significant issues as-is
634 // So disabled assert for now
635 // assert(any_ms > 0.F);
636
637 ct = determine_col_type(row_notes, ids);
638
639 // handle any special cases that need to be executed on
640 // empty rows for this hand here before moving on, aside
641 // from whatever is in this block _nothing_ else should
642 // update unless there is a note to update with
643 if (ct == col_empty) {
644 _rm.advance_off_hand_sequencing();
645 _mj.advance_off_hand_sequencing();
646 if (row_count == 2) {
647 _rm.advance_off_hand_sequencing();
648 }
649 continue;
650 }
651
652 // cj must always update or maybe not!
653 _diffz._cj.update_flags(row_notes & ids,
654 std::popcount(row_notes & ids));
655
656 // basically a time master, keeps track of different
657 // timings, update first
658 _seq.advance_sequencing(ct, row_time, any_ms);
659
660 // update metahandinfo, it constructs basic and advanced
661 // patterns from where we are now + recent pattern
662 // information constructed by the last iteration of
663 // itself
664 (*_mhi)(*_last_mhi, ct);
665
666 // update interval aggregation of column taps
667 _mitvhi._itvhi.set_col_taps(ct);
668
669 // advance sequencing for all hand dependent mods
671
672 /* jackspeed, and tech use various adjust ms bases that
673 * are sequenced here, meaning they are order dependent
674 * (jack might not be for the moment actually) nps base
675 * is still calculated in the old way */
677 ct, itv, jack_counter, row_time, any_ms);
678 ++jack_counter;
679
680 // only ohj uses this atm (and probably into the future)
681 // so it might kind of be a waste?
682 if (_mhi->_bt != base_type_init) {
683 ++_mitvhi._base_types.at(_mhi->_bt);
684 ++_mitvhi._meta_types.at(_mhi->_mt);
685 }
686
687 // cycle the pointers so now becomes last
688 std::swap(_last_mhi, _mhi);
689 last_row_time = row_time;
690 }
691
692 // maybe this should go back into the diffz object...
693 // _calc->itv_jack_diff_size.at(hand).at(itv) = jack_counter;
694
695 handle_dependent_interval_end(itv);
696 }
697 PatternMods::run_dependent_smoothing_pass(_calc.numitv, _calc);
698 //Smooth(_calc.init_base_diff_vals.at(hand).at(CJBase), 0.F, _calc.numitv);
699
700 // ok this is pretty jank LOL, just increment the hand index
701 // when we finish left hand
702 ++hand;
703 }
704
705 nps::grindscale(_calc);
706 }
707#pragma endregion
708
709#if !defined(STANDALONE_CALC) && !defined(PHPCALC)
710 const std::string get_calc_param_xml() const override
711 {
712 return "Save/CalcParams_4k.xml";
713 }
714
715 void load_calc_params_internal(const XNode& params) const override {
716 // diff params
717 load_params_for_mod(&params, _diffz._cj._params, _diffz._cj.name);
718 load_params_for_mod(&params, _diffz._tc._params, _diffz._tc.name);
719
720 // pmods
721 load_params_for_mod(&params, _s._params, _s.name);
722 load_params_for_mod(&params, _js._params, _js.name);
723 load_params_for_mod(&params, _hs._params, _hs.name);
724 load_params_for_mod(&params, _cj._params, _cj.name);
725 load_params_for_mod(&params, _cjd._params, _cjd.name);
726 load_params_for_mod(&params, _hsd._params, _hsd.name);
727 load_params_for_mod(&params, _ohj._params, _ohj.name);
728 load_params_for_mod(&params, _cjohj._params, _cjohj.name);
729 load_params_for_mod(&params, _chain._params, _chain.name);
730 load_params_for_mod(&params, _bal._params, _bal.name);
731 load_params_for_mod(&params, _oht._params, _oht.name);
732 load_params_for_mod(&params, _voht._params, _voht.name);
733 load_params_for_mod(&params, _ch._params, _ch.name);
734 load_params_for_mod(&params, _rm._params, _rm.name);
735 load_params_for_mod(&params, _roll._params, _roll.name);
736 load_params_for_mod(&params, _rolljs._params, _rolljs.name);
737 load_params_for_mod(&params, _wrb._params, _wrb.name);
738 load_params_for_mod(&params, _wrr._params, _wrr.name);
739 load_params_for_mod(&params, _wrjt._params, _wrjt.name);
740 load_params_for_mod(&params, _wrjj._params, _wrjj.name);
741 load_params_for_mod(&params, _wra._params, _wra.name);
742 load_params_for_mod(&params, _wrcja._params, _wrcja.name);
743 load_params_for_mod(&params, _mj._params, _mj.name);
744 load_params_for_mod(&params, _fj._params, _fj.name);
745 load_params_for_mod(&params, _tt._params, _tt.name);
746 load_params_for_mod(&params, _tt2._params, _tt2.name);
747 load_params_for_mod(&params, _old_anch._params, _old_anch.name);
748 load_params_for_mod(&params, _old_jump._params, _old_jump.name);
749 load_params_for_mod(&params, _old_ohj._params, _old_ohj.name);
750 load_params_for_mod(&params, _old_roll._params, _old_roll.name);
751 load_params_for_mod(&params, _hb._params, _hb.name);
752 }
753
754 XNode* make_param_node_internal(XNode* calcparams) const override
755 {
756 // diff params
757 calcparams->AppendChild(
758 make_mod_param_node(_diffz._cj._params, _diffz._cj.name));
759 calcparams->AppendChild(
760 make_mod_param_node(_diffz._tc._params, _diffz._tc.name));
761
762 // pmods
763 calcparams->AppendChild(make_mod_param_node(_s._params, _s.name));
764 calcparams->AppendChild(make_mod_param_node(_js._params, _js.name));
765 calcparams->AppendChild(make_mod_param_node(_hs._params, _hs.name));
766 calcparams->AppendChild(make_mod_param_node(_cj._params, _cj.name));
767 calcparams->AppendChild(make_mod_param_node(_cjd._params, _cjd.name));
768 calcparams->AppendChild(make_mod_param_node(_hsd._params, _hsd.name));
769 calcparams->AppendChild(make_mod_param_node(_ohj._params, _ohj.name));
770 calcparams->AppendChild(
771 make_mod_param_node(_cjohj._params, _cjohj.name));
772 calcparams->AppendChild(
773 make_mod_param_node(_chain._params, _chain.name));
774 calcparams->AppendChild(make_mod_param_node(_bal._params, _bal.name));
775 calcparams->AppendChild(make_mod_param_node(_oht._params, _oht.name));
776 calcparams->AppendChild(make_mod_param_node(_voht._params, _voht.name));
777 calcparams->AppendChild(make_mod_param_node(_ch._params, _ch.name));
778 calcparams->AppendChild(make_mod_param_node(_rm._params, _rm.name));
779 calcparams->AppendChild(make_mod_param_node(_roll._params, _roll.name));
780 calcparams->AppendChild(make_mod_param_node(_rolljs._params, _rolljs.name));
781 calcparams->AppendChild(make_mod_param_node(_wrb._params, _wrb.name));
782 calcparams->AppendChild(make_mod_param_node(_wrr._params, _wrr.name));
783 calcparams->AppendChild(make_mod_param_node(_wrjt._params, _wrjt.name));
784 calcparams->AppendChild(make_mod_param_node(_wrjj._params, _wrjj.name));
785 calcparams->AppendChild(make_mod_param_node(_wra._params, _wra.name));
786 calcparams->AppendChild(
787 make_mod_param_node(_wrcja._params, _wrcja.name));
788 calcparams->AppendChild(make_mod_param_node(_mj._params, _mj.name));
789 calcparams->AppendChild(make_mod_param_node(_fj._params, _fj.name));
790 calcparams->AppendChild(make_mod_param_node(_tt._params, _tt.name));
791 calcparams->AppendChild(make_mod_param_node(_tt2._params, _tt2.name));
792 calcparams->AppendChild(
793 make_mod_param_node(_old_anch._params, _old_anch.name));
794 calcparams->AppendChild(
795 make_mod_param_node(_old_jump._params, _old_jump.name));
796 calcparams->AppendChild(
797 make_mod_param_node(_old_ohj._params, _old_ohj.name));
798 calcparams->AppendChild(
799 make_mod_param_node(_old_roll._params, _old_roll.name));
800 calcparams->AppendChild(make_mod_param_node(_hb._params, _hb.name));
801
802 return calcparams;
803 }
804#pragma endregion
805#endif
806};
Main driver class for the difficulty calculator as a whole.
Definition MinaCalc.h:82
std::array< std::vector< std::array< float, 4 > >, num_hands > debugTechVals
per hand vector of arrays: techyo chaos values of [row_time, pewp, obliosis, c]
Definition MinaCalc.h:289
std::array< std::array< std::vector< float >, NUM_CalcDiffValue >, num_hands > init_base_diff_vals
Definition MinaCalc.h:187
int numitv
Total number of intervals for the current file/rate (one per half second)
Definition MinaCalc.h:263
std::array< std::array< std::vector< std::pair< float, float > >, 2 >, num_hands > debugMovingWindowCV
Definition MinaCalc.h:286
std::vector< std::array< RowInfo, max_rows_for_single_interval > > adj_ni
Definition MinaCalc.h:162
std::array< std::array< std::vector< float >, NUM_CalcPatternMod >, num_hands > pmod_vals
Definition MinaCalc.h:179
bool debugmode
For debug output. Should only ever be true at music select.
Definition MinaCalc.h:95
std::array< std::vector< std::pair< float, float > >, num_hands > jack_diff
Definition MinaCalc.h:239
std::vector< int > itv_size
Number of rows in each interval.
Definition MinaCalc.h:165
Definition XmlFile.h:95
Definition Balance.h:8
Definition UlbuBase.h:16
Definition CJDensity.h:8
Definition CJOHAnchor.h:10
Definition CJOHJ.h:10
auto get_now() const -> T
get most recent value in moving window
Definition CalcWindow.h:38
Definition Chaos.h:8
Definition FlamJam.h:15
Definition HSDensity.h:8
Definition HS.h:8
auto get_taps_nowi() const -> int
access functions for hand tap counts
Definition IntervalHandInfo.h:135
Definition JS.h:7
Definition Minijack.h:8
Definition OHJ.h:9
Definition OHT.h:14
Hand downscaler based on how many notes are on either finger.
Definition OldAnchorScaler.h:6
Agnostic downscaler based on how many jumps are in the interval.
Definition OldJumpScaler.h:6
Hand downscaler based on how many one hand jumps there are.
Definition OldOHJScaler.h:6
Hand downscaler based on how trilly the hand is.
Definition OldRollScaler.h:6
Definition UlbuAcolytes.h:65
Definition RollJS.h:6
Definition Roll.h:6
Definition RunningMan.h:17
Definition GenericSequencing.h:422
AnchorSequencer _as
Definition GenericSequencing.h:438
CalcMovingWindow< float > _mw_any_ms
Definition GenericSequencing.h:428
Definition Stream.h:13
Definition Ulbu.h:61
void full_hand_reset() override
Definition Ulbu.h:469
void update_sequenced_base_diffs(const col_type &ct, const int &itv, const int &jack_counter, const float &row_time, const float &any_ms)
update base difficulty stuff
Definition Ulbu.h:519
void handle_row_dependent_pattern_advancement(const float &row_time)
Definition Ulbu.h:384
Definition TheThingFinder.h:73
Definition TheThingFinder.h:12
Definition VOHT.h:13
Definition WideRangeAnchor.h:8
Definition WideRangeBalance.h:7
Definition WideRangeCJAnchor.h:9
Definition WideRangeJJ.h:7
Definition WideRangeJumptrill.h:13
Definition WideRangeRoll.h:9
Definition SequencedBaseDiffCalc.h:1031
this may prove to be overkill
Definition MetaIntervalHandInfo.h:6
void zero()
Definition MetaIntervalHandInfo.h:21
void interval_end()
handle end of interval
Definition MetaIntervalHandInfo.h:10
static void grindscale(Calc &calc)
determine grindscaler using smoothed npsbase
Definition SequencedBaseDiffCalc.h:153
static void actual_cancer(Calc &calc, const int &hand)
determine NPSBase, itv_points, CJBase for this hand
Definition SequencedBaseDiffCalc.h:68
Definition SequencedBaseDiffCalc.h:998