Skip to content

Commit

Permalink
The more complexity I add to the calc, the more janky it becomes -_- 388
Browse files Browse the repository at this point in the history
  • Loading branch information
MinaciousGrace committed Jun 11, 2020
1 parent 4f939d3 commit 4e61c90
Show file tree
Hide file tree
Showing 4 changed files with 58 additions and 79 deletions.
87 changes: 28 additions & 59 deletions src/Etterna/Globals/MinaCalc.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ static const float stam_prop =
// and chordstreams start lower
// stam is a special case and may use normalizers again
static const std::array<float, NUM_Skillset> basescalers = {
0.F, 0.97F, 0.92F, 0.83F, 0.94F, 0.715F, 0.73F, 0.95F
0.F, 0.97F, 0.92F, 0.83F, 0.94F, 0.95F, 0.73F, 1.F
};

void
Expand Down Expand Up @@ -755,56 +755,20 @@ Calc::Chisel(float player_skill,
return player_skill;
}
player_skill += resolution;
if (ss == Skill_Overall || ss == Skill_Stamina ||
ss == Skill_JackSpeed) {
if (ss == Skill_Overall || ss == Skill_Stamina) {
return 0.F; // not how we set these values
}

// reset tallied score, always deduct rather than accumulate now
gotpoints = static_cast<float>(MaxPoints);
//#define DEBUG_JACK_MODELS
#ifdef DEBUG_JACK_MODELS
if (ss == Skill_Jumpstream) {
left_hand.CalcInternal(gotpoints, player_skill, ss, stamina);
right_hand.CalcInternal(gotpoints, player_skill, ss, stamina);
}

if (ss == Skill_JackSpeed)
gotpoints -=
JackLoss(player_skill, 1, max_points_lost, stamina);
else if (ss == Skill_Chordjack)
gotpoints -=
JackLoss(player_skill, 2, max_points_lost, stamina);
else if (ss == Skill_Technical)
gotpoints -=
JackLoss(player_skill, 3, max_points_lost, stamina);
else if (ss == Skill_Stream)
gotpoints -=
JackLoss(player_skill, 0, max_points_lost, stamina) / 7.5f;
#else
// jack sequencer point loss for jack speed and (maybe?)
// cj
// if (ss == Skill_JackSpeed) {
// // this is slow but gives the best results, do separate
// // passes for different jack types and figure out which
// // is the most prominent of the file. We _don't_ want to
// // do something like take the highest of a given type at
// // multiple points throughout a file, that just results
// // in oversaturation and bad grouping
// jloss =
// max(JackLoss(player_skill, 1, max_points_lost, stamina),
// max(JackLoss(player_skill, 2, max_points_lost, stamina),
// JackLoss(player_skill, 3, max_points_lost, stamina)));
// gotpoints -= jloss;
//} else {
left_hand.CalcInternal(gotpoints, player_skill, ss, stamina);

// already can't reach goal, move on
if (gotpoints > reqpoints) {
right_hand.CalcInternal(gotpoints, player_skill, ss, stamina);
}
//}
#endif

} while (gotpoints < reqpoints);
player_skill -= resolution;
resolution /= 2.F;
Expand All @@ -815,20 +779,6 @@ Calc::Chisel(float player_skill,
// be recalculated with the final value already determined
// getting the jackstam debug output right is lame i know
if (debugoutput) {
float jl1 =
JackLoss(player_skill, 1, max_points_lost, stamina, debugoutput);
float jl2 =
JackLoss(player_skill, 2, max_points_lost, stamina, debugoutput);
float jl3 =
JackLoss(player_skill, 3, max_points_lost, stamina, debugoutput);
if (jl1 > jl2 && jl1 > jl3) {
JackLoss(player_skill, 1, max_points_lost, stamina, debugoutput);
} else if (jl2 > jl3) {
JackLoss(player_skill, 2, max_points_lost, stamina, debugoutput);
} else {
JackLoss(player_skill, 3, max_points_lost, stamina, debugoutput);
}

left_hand.CalcInternal(
gotpoints, player_skill, ss, stamina, debugoutput);
right_hand.CalcInternal(
Expand Down Expand Up @@ -906,9 +856,23 @@ Hand::InitAdjDiff()

// stam, nothing, don't handle here
{},

// jackspeed, ignore for now
{},

// jackspeed
{
OHTrill,
Balance,
Roll,
OHJumpMod,
Chaos,
WideRangeJumptrill,
WideRangeBalance,
WideRangeRoll,
FlamJam,
RanMan,
WideRangeAnchor,
TheThing,
TheThing2,
},

// chordjack
{ CJ, CJDensity, WideRangeAnchor },
Expand Down Expand Up @@ -940,7 +904,7 @@ Hand::InitAdjDiff()
// ok this loop is pretty wack i know, for each interval
for (int i = 0; i < soap[NPSBase].size(); ++i) {
float tp_mods[NUM_Skillset] = {
1.F, 1.F, 1.F, 1.F, 1.F, 0.1F, 1.F, 1.F
1.F, 1.F, 1.F, 1.F, 1.F, 1.F, 1.F, 1.F
};

// total pattern mods for each skillset, we want this to be
Expand Down Expand Up @@ -1003,6 +967,11 @@ Hand::InitAdjDiff()
stam_base =
max(funk, soap[NPSBase][i] * tp_mods[Skill_Jumpstream]);
break;
case Skill_JackSpeed:
adj_diff = soap[JackBase][i] * tp_mods[Skill_JackSpeed] *
basescalers[ss] /
max(fastpow(doot[CJ][i], 2.F), 1.F);
break;
case Skill_Chordjack:
adj_diff =
soap[CJBase][i] * tp_mods[Skill_Chordjack] *
Expand Down Expand Up @@ -1030,7 +999,7 @@ void
Hand::CalcInternal(float& gotpoints, float& x, int ss, bool stam, bool debug)
{

if (stam) {
if (stam && ss != Skill_JackSpeed) {
StamAdjust(x, ss);
}

Expand Down Expand Up @@ -1184,7 +1153,7 @@ MinaSDCalcDebug(const vector<NoteInfo>& NoteInfo,
}
#pragma endregion

int mina_calc_version = 387;
int mina_calc_version = 388;
auto
GetCalcVersion() -> int
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@

// bpm flux float precision etc
static const float anchor_buffer_ms = 10.F;
static const float anchor_speed_increase_cutoff_factor = 1.9F;
static const float anchor_speed_increase_cutoff_factor = 2.1F;

enum anch_status
{
Expand Down Expand Up @@ -118,26 +118,28 @@ struct Anchor_Sequencing
// current ms and len to 2

_start = _last;
_max_ms = _sc_ms;
_len = 2;
break;
case anchoring:
// increase anchor length and set new cutoff point
++_len;
_max_ms = _sc_ms;
break;
case anch_init:
// nothing to do
break;
}

_max_ms = _sc_ms;
_last = now;
}

inline auto get_difficulty() -> float
{
if (_len <= 2)
return ms_to_scaled_nps(_sc_ms + 90.F);
if (_len == 3)
return ms_to_scaled_nps(_sc_ms + 180.F);
float flool = ms_from(_last, _start);
float pule = (flool + 360.F) / static_cast<float>(_len);
float pule = (flool + 270.F) / static_cast<float>(_len - 1);
float drool = ms_to_scaled_nps(pule);
return drool;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -533,10 +533,10 @@ struct RM_Sequencer

// may be unnecessary
float glunk =
CalcClamp(static_cast<float>(_rm.off_taps_sh) / 2.f, 0.1f, 1.f);
CalcClamp(static_cast<float>(_rm.off_taps_sh) / 3.f, 0.1f, 1.f);

float pule = (flool + 50.F) / static_cast<float>(_rm._len - 1);
float drool = ms_to_scaled_nps(pule) * 2.F;
return drool;
float pule = (flool + 25.F) / static_cast<float>(_rm._len - 1);
float drool = ms_to_scaled_nps(pule);
return drool * glunk;
}
};
30 changes: 19 additions & 11 deletions src/Etterna/Globals/MinaCalc/Ulbu.h
Original file line number Diff line number Diff line change
Expand Up @@ -184,7 +184,7 @@ struct TheGreatBazoinkazoinkInTheSky
inline void advance_agnostic_sequencing()
{
_fj.advance_sequencing(_mri->ms_now, _mri->notes);
_tt.advance_sequencing(_mri->ms_now, _mri->notes);
_tt.advance_sequencing(_mri->ms_now, _mri->notes);
_tt2.advance_sequencing(_mri->ms_now, _mri->notes);
}
inline void setup_agnostic_pmods()
Expand Down Expand Up @@ -423,11 +423,15 @@ struct TheGreatBazoinkazoinkInTheSky
// the pass is limited to like... a couple floats and 2 ints)
vector<float> the_simpsons;
vector<float> futurama;
vector<float> futuramaTEWO;
vector<float> bort;
float futuramaTEWO = 0.f;
float barnie = 0.f;
for (int itv = 0; itv < _itv_rows.size(); ++itv) {
the_simpsons.clear();
futurama.clear();
futuramaTEWO.clear();
bort.clear();
futuramaTEWO = 0.f;
barnie = 0.f;

// run the row by row construction for interval info
for (auto& row : _itv_rows[itv]) {
Expand Down Expand Up @@ -469,6 +473,10 @@ struct TheGreatBazoinkazoinkInTheSky
// this will keep track of timings from now on
_seq.advance_sequencing(ct, row_time, ms_any);

bort.push_back(_seq._as.get_highest_anchor_difficulty());
barnie =
max(barnie, _seq._as.get_highest_anchor_difficulty());

// mhi will exclusively track pattern configurations
(*_mhi)(*_last_mhi, ct);

Expand Down Expand Up @@ -589,8 +597,8 @@ struct TheGreatBazoinkazoinkInTheSky
++_mitvhi._meta_types[_mhi->_mt];
}

futuramaTEWO.push_back(_rm.get_highest_anchor_difficulty());

futuramaTEWO = max(futuramaTEWO, _rm.get_highest_anchor_difficulty());
std::swap(_last_mhi, _mhi);
_mhi->offhand_ohjumps = 0;
_mhi->offhand_taps = 0;
Expand All @@ -600,12 +608,12 @@ struct TheGreatBazoinkazoinkInTheSky

_diffs[hand][CJBase][itv] =
CJBaseDifficultySequencing(the_simpsons);

float berp = TechBaseDifficultySequencing(futurama) * 2.F;
float scwerp = 0.F;
if (!futuramaTEWO.empty())
scwerp = mean(futuramaTEWO);
_diffs[hand][TechBase][itv] = scwerp;
_diffs[hand][JackBase][itv] = (mean(bort) + barnie) / 2.F;
float berp = TechBaseDifficultySequencing(futurama);
float scwerp = futuramaTEWO;
float shlop =
weighted_average(berp, _diffs[hand][NPSBase][itv], 5.5F, 9.F);
_diffs[hand][TechBase][itv] = max(shlop, scwerp);
}
run_dependent_smoothing_pass(_doots[hand]);
DifficultyMSSmooth(_diffs[hand][JackBase]);
Expand Down

0 comments on commit 4e61c90

Please sign in to comment.