Skip to content

Commit

Permalink
unbreak jackspeed partially
Browse files Browse the repository at this point in the history
  • Loading branch information
MinaciousGrace committed Jun 23, 2020
1 parent 176d816 commit 4da5980
Show file tree
Hide file tree
Showing 2 changed files with 31 additions and 31 deletions.
25 changes: 6 additions & 19 deletions src/Etterna/Globals/MinaCalc.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -54,9 +54,9 @@ static const float stam_prop =
// since chorded patterns have lower enps than streams, streams default to 1
// 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.9F, 0.82F, 0.94F, 0.95F, 0.78F, 0.9F
};
static const std::array<float, NUM_Skillset> basescalers = { 0.F, 0.97F, 0.9F,
0.82F, 0.94F, 0.95F,
0.78F, 0.9F };

static inline auto
TotalMaxPoints(const Calc& calc) -> int
Expand Down Expand Up @@ -132,21 +132,9 @@ Calc::CalcMain(const vector<NoteInfo>& NoteInfo,
* tradeoff is files that are close in 2/3 skillsets will have the stam
* bonus stripped from the second and third components, devaluing the
* file as a whole, we could run it for the 2nd/3rd highest skillsets
* but i'm too lazy to implement that right now, the major concern here
* is the cost of jack stam, so i think we can just get away with
* throwing out jack stam calculations for anything that isn't jackspeed
* (or tech since atm they're doubling up a bit) */
* but i'm too lazy to implement that right now */
for (int i = 0; i < NUM_Skillset; ++i) {
if (i == Skill_JackSpeed) {
if (highest_base_skillset == Skill_JackSpeed ||
highest_base_skillset == Skill_Technical) {
mcbloop[i] =
Chisel(mcbloop[i] * 1.F, 0.32F, score_goal, i, true);
}
} else {
mcbloop[i] =
Chisel(mcbloop[i] * 0.9F, 0.32F, score_goal, i, true);
}
mcbloop[i] = Chisel(mcbloop[i] * 0.9F, 0.32F, score_goal, i, true);
}

/* all relative scaling to specific skillsets should occur before this
Expand Down Expand Up @@ -313,8 +301,7 @@ CalcInternal(float& gotpoints,
int hi,
bool debug = false)
{

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

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,9 @@
* other option is "cc_ms", for cross column ms */

// bpm flux float precision etc
static const float anchor_buffer_ms = 10.F;
static const float anchor_spacing_buffer_ms = 10.F;
static const float anchor_speed_increase_cutoff_factor = 1.9F;
static const int len_cap = 6;

enum anch_status
{
Expand Down Expand Up @@ -60,19 +61,23 @@ struct Anchor_Sequencing
*/

int _len = 1;
float _sc_ms = 0.F;
float _sc_ms = ms_init;

// if we exceed this + buffer, break the anchor sequence
float _max_ms = ms_init;

// rather than a buffer cap maybe a len cap will be more scalable, track the
// difficulty at the cap and when queried beyond it, just return this value
float _len_cap_diff = ms_init;

// row_time of last note on this col
float _last = s_init;
float _start = s_init;

inline void full_reset()
{
// never reset col_type
_sc_ms = 0.F;
_sc_ms = ms_init;
_max_ms = ms_init;
_last = s_init;
_len = 1;
Expand All @@ -94,7 +99,7 @@ struct Anchor_Sequencing
// new anchor was the last row_time, and the new max_ms should be the
// current ms value

if (_sc_ms > _max_ms + anchor_buffer_ms) {
if (_sc_ms > _max_ms + anchor_spacing_buffer_ms) {
_status = reset_too_slow;
} else if (_sc_ms * 2.5F < _max_ms) {
_status = reset_too_fast;
Expand Down Expand Up @@ -128,23 +133,31 @@ struct Anchor_Sequencing
// nothing to do
break;
}

_max_ms = _sc_ms;
_last = now;
}

// returns an adjusted MS value, not converted to nps
inline auto get_ms() -> float
{
// too jank?
if (_len <= 2) {
return _sc_ms + 90.F;
}
if (_len == 3) {
assert(_sc_ms > 0.F);

float anchor_time_buffer_ms = 90.F;

// STILL TOO JANK?
if (_len < 4)
anchor_time_buffer_ms = 45.F;

if (_len > len_cap)
return _len_cap_diff;

return _sc_ms + 180.F;
}
float flool = ms_from(_last, _start);
float pule = (flool + 270.F) / static_cast<float>(_len - 1);
float pule = (flool + anchor_time_buffer_ms) / static_cast<float>(_len - 1);

if (_len == len_cap)
_len_cap_diff = pule;

return pule;
}
};
Expand Down

0 comments on commit 4da5980

Please sign in to comment.