Skip to content

Commit c875c16

Browse files
committed
revert cj again to cjbase instead of msbase | 479
lol i guess approx equivalent to calc 396
1 parent 9ff71c6 commit c875c16

File tree

10 files changed

+173
-22
lines changed

10 files changed

+173
-22
lines changed

src/Etterna/MinaCalc/Agnostic/HA_PatternMods/CJ.h

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -18,17 +18,17 @@ struct CJMod
1818

1919
float total_prop_min = min_mod;
2020
float total_prop_max = max_mod;
21-
float total_prop_scaler = 1.5F;
21+
float total_prop_scaler = 5.428F;
2222

23-
float jack_base = 1.F;
23+
float jack_base = 2.F;
2424
float jack_min = 0.625F;
2525
float jack_max = 1.F;
2626
float jack_scaler = 1.F;
2727

28-
float not_jack_pool = 1.15F;
29-
float not_jack_min = 0.9F;
28+
float not_jack_pool = 1.2F;
29+
float not_jack_min = 0.4F;
3030
float not_jack_max = 1.F;
31-
float not_jack_scaler = 1.75F;
31+
float not_jack_scaler = 1.F;
3232

3333
float vibro_flag = 1.F;
3434
float decay_factor = 0.1F;

src/Etterna/MinaCalc/Agnostic/HA_PatternMods/CJDensity.h

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -12,14 +12,14 @@ struct CJDensityMod
1212

1313
#pragma region params
1414

15-
float min_mod = 0.85F;
16-
float max_mod = 1.15F;
15+
float min_mod = 0.98F;
16+
float max_mod = 1.08F;
1717
float base = 0.F;
1818

1919
float single_scaler = 1.F;
20-
float jump_scaler = 1.6F;
20+
float jump_scaler = 1.25F;
2121
float hand_scaler = 0.9F;
22-
float quad_scaler = 0.7F;
22+
float quad_scaler = 1.15F;
2323

2424
const std::vector<std::pair<std::string, float*>> _params{
2525
{ "min_mod", &min_mod },

src/Etterna/MinaCalc/Dependent/HD_PatternMods/CJOHAnchor.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ struct CJOHAnchorMod
1414
#pragma region params
1515

1616
float min_mod = 1.F;
17-
float max_mod = 1.2F;
17+
float max_mod = 1.F;
1818

1919
float anchor_len_weight = 1.F;
2020
float len_scaler = 0.175F;

src/Etterna/MinaCalc/Dependent/HD_PatternMods/CJOHJ.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ struct CJOHJumpMod
1313

1414
#pragma region params
1515

16-
float min_mod = 0.5F;
16+
float min_mod = 1.F;
1717
float max_mod = 1.F;
1818

1919
float prop_pool = 1.4F;

src/Etterna/MinaCalc/MinaCalc.cpp

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -683,7 +683,7 @@ Calc::Chisel(const float player_skill,
683683
for (auto i = 0; i < numitv; ++i) {
684684
debugTotalPatternMod.at(hand).at(ss).at(i) =
685685
base_adj_diff.at(hand).at(ss).at(i) /
686-
init_base_diff_vals.at(hand)[MSBase].at(i);
686+
init_base_diff_vals.at(hand)[CJBase].at(i);
687687
}
688688
} else {
689689
// everything else uses nps base
@@ -780,8 +780,8 @@ Calc::InitAdjDiff(Calc& calc, const int& hand)
780780
// chordjack
781781
{
782782
CJ,
783-
// CJDensity,
784-
CJOHJump, // SQRTD BELOW
783+
CJDensity,
784+
CJOHJump,
785785
CJOHAnchor,
786786
VOHTrill,
787787
// WideRangeAnchor,
@@ -887,7 +887,7 @@ Calc::InitAdjDiff(Calc& calc, const int& hand)
887887
break;
888888
case Skill_Chordjack:
889889
*adj_diff =
890-
calc.init_base_diff_vals.at(hand).at(MSBase).at(i) *
890+
calc.init_base_diff_vals.at(hand).at(CJBase).at(i) *
891891
basescalers.at(Skill_Chordjack) *
892892
pmod_product_cur_interval[Skill_Chordjack];
893893
// we leave stam_base alone here, still based on nps
@@ -1004,7 +1004,7 @@ MinaSDCalcDebug(
10041004
}
10051005
}
10061006

1007-
int mina_calc_version = 478;
1007+
int mina_calc_version = 479;
10081008
auto
10091009
GetCalcVersion() -> int
10101010
{

src/Etterna/MinaCalc/MinaCalc.h

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -235,6 +235,11 @@ class Calc
235235
*/
236236
std::array<float, max_rows_for_single_interval> tc_static{};
237237

238+
/** Base Chordjack difficulty per row of current interval being scanned.
239+
* See struct ceejay for the intense details ...
240+
*/
241+
std::array<float, max_rows_for_single_interval> cj_static{};
242+
238243
/// Total number of intervals for the current file/rate (one per half second)
239244
int numitv = 0;
240245

src/Etterna/MinaCalc/SequencedBaseDiffCalc.h

Lines changed: 138 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -215,6 +215,133 @@ struct nps
215215
}
216216
};
217217

218+
struct ceejay
219+
{
220+
void update_flags(const unsigned& row_notes, const int& row_count)
221+
{
222+
is_cj = last_row_count > 1 && row_count > 1;
223+
was_cj = last_row_count > 1 && last_last_row_count > 1;
224+
225+
is_scj = (row_count == 1 && last_row_count > 1) &&
226+
((row_notes & last_row_notes) != 0u);
227+
228+
is_at_least_3_note_anch =
229+
((row_notes & last_row_notes) & last_last_row_notes) != 0u;
230+
231+
last_last_row_count = last_row_count;
232+
last_row_count = row_count;
233+
234+
last_last_row_notes = last_row_notes;
235+
last_row_notes = row_notes;
236+
237+
last_was_3_note_anch = is_at_least_3_note_anch;
238+
}
239+
240+
void advance_base(const float& any_ms, Calc& calc)
241+
{
242+
if (row_counter >= max_rows_for_single_interval) {
243+
{
244+
{
245+
return;
246+
}
247+
}
248+
}
249+
250+
// pushing back ms values, so multiply to nerf
251+
float pewpew = 3.F;
252+
253+
if (is_at_least_3_note_anch && last_was_3_note_anch) {
254+
// biggy boy anchors and beyond
255+
pewpew = 1.F;
256+
} else if (is_at_least_3_note_anch) {
257+
// big boy anchors
258+
pewpew = 1.F;
259+
} else {
260+
// single note
261+
if (!is_cj) {
262+
if (is_scj) {
263+
// was cj a little bit ago..
264+
if (was_cj) {
265+
// single note jack with 2 chords behind it
266+
pewpew = 1.25F;
267+
} else {
268+
// single note, not a jack, 2 chords behind
269+
// it
270+
pewpew = 1.5F;
271+
}
272+
}
273+
} else {
274+
// actual cj
275+
if (was_cj) {
276+
// cj now and was cj before, but not necessarily
277+
// with strong anchors
278+
pewpew = 1.15F;
279+
} else {
280+
// cj now but wasn't even cj before
281+
pewpew = 1.25F;
282+
}
283+
}
284+
}
285+
286+
// single note streams / regular jacks should retain the 3x
287+
// multiplier
288+
289+
calc.cj_static.at(row_counter) = std::max(75.F, any_ms * pewpew);
290+
++row_counter;
291+
}
292+
293+
// final output difficulty for this interval
294+
auto get_itv_diff(Calc& calc) const -> float
295+
{
296+
if (row_counter == 0) {
297+
return 0.F;
298+
}
299+
300+
float ms_total = 0.F;
301+
for (int i = 0; i < row_counter; ++i) {
302+
{
303+
{
304+
ms_total += calc.cj_static.at(i);
305+
}
306+
}
307+
}
308+
309+
float ms_mean = ms_total / static_cast<float>(row_counter);
310+
return ms_to_scaled_nps(ms_mean);
311+
}
312+
313+
void interval_end() { row_counter = 0; }
314+
void full_reset()
315+
{
316+
is_cj = false;
317+
was_cj = false;
318+
is_scj = false;
319+
is_at_least_3_note_anch = false;
320+
last_was_3_note_anch = false;
321+
322+
last_row_count = 0;
323+
last_last_row_count = 0;
324+
325+
last_row_notes = 0U;
326+
last_last_row_notes = 0U;
327+
}
328+
329+
private:
330+
int row_counter = 0;
331+
332+
bool is_cj = false;
333+
bool was_cj = false;
334+
bool is_scj = false;
335+
bool is_at_least_3_note_anch = false;
336+
bool last_was_3_note_anch = false;
337+
338+
int last_row_count = 0;
339+
int last_last_row_count = 0;
340+
341+
unsigned last_row_notes = 0U;
342+
unsigned last_last_row_notes = 0U;
343+
};
344+
218345
struct techyo
219346
{
220347
// if this looks ridiculous, that's because it is
@@ -342,8 +469,17 @@ struct diffz
342469
{
343470
nps _nps;
344471
techyo _tc;
472+
ceejay _cj;
345473

346-
void interval_end() { _tc.interval_end(); }
474+
void interval_end()
475+
{
476+
_tc.interval_end();
477+
_cj.interval_end();
478+
}
347479

348-
void full_reset() { interval_end(); }
480+
void full_reset()
481+
{
482+
interval_end();
483+
_cj.full_reset();
484+
}
349485
};

src/Etterna/MinaCalc/Ulbu.h

Lines changed: 12 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -339,7 +339,8 @@ struct TheGreatBazoinkazoinkInTheSky
339339
void update_sequenced_base_diffs(const col_type& ct,
340340
const int& itv,
341341
const int& jack_counter,
342-
const float& row_time)
342+
const float& row_time,
343+
const float& any_ms)
343344
{
344345
auto thing =
345346
std::pair{ row_time,
@@ -352,6 +353,9 @@ struct TheGreatBazoinkazoinkInTheSky
352353
// _between either column_ for _this row_
353354
_calc.jack_diff.at(hand).push_back(thing);
354355

356+
// chordjack updates
357+
_diffz._cj.advance_base(any_ms, _calc);
358+
355359
// tech updates with a convoluted mess of garbage
356360
_diffz._tc.advance_base(_seq, ct, _calc);
357361
_diffz._tc.advance_rm_comp(_rm.get_highest_anchor_difficulty());
@@ -363,6 +367,9 @@ struct TheGreatBazoinkazoinkInTheSky
363367
// loop _calc->soap.at(hand)[JackBase].at(itv) =
364368
// _diffz._jk.get_itv_diff();
365369

370+
_calc.init_base_diff_vals.at(hand)[CJBase].at(itv) =
371+
_diffz._cj.get_itv_diff(_calc);
372+
366373
// kinda jank but includes a weighted average vs nps base to prevent
367374
// really silly stuff from becoming outliers
368375
_calc.init_base_diff_vals.at(hand)[TechBase].at(itv) =
@@ -417,6 +424,9 @@ struct TheGreatBazoinkazoinkInTheSky
417424

418425
ct = determine_col_type(row_notes, ids);
419426

427+
// cj must always update
428+
_diffz._cj.update_flags(row_notes, row_count);
429+
420430
// handle any special cases that need to be executed on
421431
// empty rows for this hand here before moving on, aside
422432
// from whatever is in this block _nothing_ else should
@@ -450,7 +460,7 @@ struct TheGreatBazoinkazoinkInTheSky
450460
* (jack might not be for the moment actually) nps base
451461
* is still calculated in the old way */
452462
update_sequenced_base_diffs(
453-
ct, itv, jack_counter, row_time);
463+
ct, itv, jack_counter, row_time, any_ms);
454464
++jack_counter;
455465

456466
// only ohj uses this atm (and probably into the future)

src/Etterna/Models/Misc/GameConstantsAndTypes.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -262,7 +262,7 @@ LuaXType(CalcPatternMod);
262262
static const char* CalcDiffValueNames[] = { "NPSBase",
263263
"MSBase",
264264
// "JackBase",
265-
// "CJBase",
265+
"CJBase",
266266
"TechBase",
267267
"RMABase",
268268
"MSD" };

src/Etterna/Models/NoteData/NoteDataStructures.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -82,7 +82,7 @@ enum CalcDiffValue
8282
NPSBase,
8383
MSBase,
8484
// JackBase,
85-
// CJBase,
85+
CJBase,
8686
TechBase,
8787
RMABase,
8888
MSD,

0 commit comments

Comments
 (0)