Skip to content

Commit

Permalink
rework horizontal triples mod to only affect half-doubles+
Browse files Browse the repository at this point in the history
  • Loading branch information
hwabis committed Oct 16, 2024
1 parent df295f9 commit 4a8db3d
Show file tree
Hide file tree
Showing 7 changed files with 51 additions and 27 deletions.
38 changes: 26 additions & 12 deletions osu.Game.Rulesets.PumpTrainer/Beatmaps/NextHitObjectGenerator.cs
Original file line number Diff line number Diff line change
Expand Up @@ -424,24 +424,38 @@ private void banColumnsCausingBannedPatterns(List<Column> candidateColumns, Foot
// Ban horizontal triples
if (random.NextDouble() > Settings.HorizontalTripleFrequency)
{
int previousPhysicalColumn = columnToPhysicalColumn[previousColumn];
int previousPreviousPhysicalColumn = columnToPhysicalColumn[previousPreviousColumn];

if (previousPhysicalColumn - previousPreviousPhysicalColumn == 1)
{
// Going right!
List<Column> columnsToBan = columnToPhysicalColumn.Where(entry => entry.Value == previousPhysicalColumn + 1).Select(entry => entry.Key).ToList();
candidateColumns.RemoveAll(columnsToBan.Contains);
}
else if (previousPhysicalColumn - previousPreviousPhysicalColumn == -1)
// Only bother banning ban if both previous columns are in the half-doubles zone
if (columnIsInHalfDoublesZone(previousColumn) && columnIsInHalfDoublesZone(previousPreviousColumn))
{
// Going left!
List<Column> columnsToBan = columnToPhysicalColumn.Where(entry => entry.Value == previousPhysicalColumn - 1).Select(entry => entry.Key).ToList();
int previousPhysicalColumn = columnToPhysicalColumn[previousColumn];
int previousPreviousPhysicalColumn = columnToPhysicalColumn[previousPreviousColumn];

List<Column> columnsToBan = [];

if (previousPhysicalColumn - previousPreviousPhysicalColumn == 1)
{
// Going right!
columnsToBan = columnToPhysicalColumn.Where(entry => entry.Value == previousPhysicalColumn + 1).Select(entry => entry.Key).ToList();
}
else if (previousPhysicalColumn - previousPreviousPhysicalColumn == -1)
{
// Going left!
columnsToBan = columnToPhysicalColumn.Where(entry => entry.Value == previousPhysicalColumn - 1).Select(entry => entry.Key).ToList();
}

// Only ban columns that are in the half-doubles zone
columnsToBan = columnsToBan.Where(columnIsInHalfDoublesZone).ToList();

candidateColumns.RemoveAll(columnsToBan.Contains);
}
}
}

private bool columnIsInHalfDoublesZone(Column column)
{
return columnToPhysicalColumn[column] >= 1 && columnToPhysicalColumn[column] <= 4;
}

private Column getRandomCandidateColumn(List<Column> candidateColumns, int nonRepeatExtraWeight)
{
if (candidateColumns.Count == 0)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -50,11 +50,13 @@ public class PumpTrainerBeatmapConverterSettings
public double DiagonalSkipFrequency = 0;

/// <summary>
/// 0 to 1 determining how frequently to generate 3 adjacent notes that span consecutive, unique columns on the physical dance pad.
/// 0 to 1 determining how frequently to generate 3 adjacent notes that span consecutive, unique columns on the physical dance pad,
/// in the half-double region (not a singles pad).
/// Higher means more likely. For example, P1UR and P1DR are on the same unique column on the physical dance pad.
/// Example starting left foot: P1C --> P1DR --> P2UL
/// Example starting right foot: P2UL --> P1DR --> P1C (horizontal twists would have to be on for this to happen)
/// The following would NOT count as a horizontal triple, starting left foot: P1C --> P2UL --> P1DR
/// NOT a horizontal triple: starting left foot: P1C --> P2UL --> P1DR
/// NOT a horizontal triple, starting left foot: P1UL --> P1C --> P1UR (because it only spans a singles pad)
/// </summary>
public double HorizontalTripleFrequency = 0;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ public class PumpTrainerModBanSinglesTwists : Mod, IApplicableToBeatmapConverter
Precision = 0.1,
};

public override string Name => "[P1Single+] Ban Singles Twists";
public override string Name => "[P1Single+] Ban Simple Twists";
public override string Acronym => "S";
public override LocalisableString Description =>
"Reduces the frequency of the right foot hitting the left pads, and vice versa, in the context of a single pad.";
Expand Down
Original file line number Diff line number Diff line change
@@ -1,29 +1,40 @@
using osu.Framework.Bindables;
using System;
using osu.Framework.Bindables;
using osu.Framework.Localisation;
using osu.Game.Beatmaps;
using osu.Game.Configuration;
using osu.Game.Rulesets.Mods;
using osu.Game.Rulesets.PumpTrainer.Beatmaps;
using osu.Game.Rulesets.PumpTrainer.Mods.ExcludeColumns;

namespace osu.Game.Rulesets.PumpTrainer.Mods
{
public class PumpTrainerModHorizontalTriples : Mod, IApplicableToBeatmapConverter
{
[SettingSource("Frequency")]
public Bindable<double> HorizontalTripleFrequency { get; } = new BindableDouble(1.0)
public Bindable<double> HorizontalTripleFrequency { get; } = new BindableDouble(0.5)
{
MinValue = 0.1,
MaxValue = 1.0,
Default = 1.0,
Default = 0.5,
Precision = 0.1,
};

public override string Name => "Horizontal Triples";
public override string Name => "[Half-Dbl+] Horizontal Triples";
public override string Acronym => "HHH";
public override LocalisableString Description =>
"Three consecutive notes spanning three physical dance pad columns (not note columns) in one direction.";
"Three consecutive notes spanning three physical dance pad columns (not note columns) in one direction, in the half-doubles region.";
public override double ScoreMultiplier => 1;
public override ModType Type => ModType.DifficultyIncrease;
public override Type[] IncompatibleMods => new Type[]
{
typeof(PumpTrainerModExcludeP1C),
typeof(PumpTrainerModExcludeP1UR),
typeof(PumpTrainerModExcludeP1DR),
typeof(PumpTrainerModExcludeP2DL),
typeof(PumpTrainerModExcludeP2UL),
typeof(PumpTrainerModExcludeP2C),
};

public void ApplyToBeatmapConverter(IBeatmapConverter beatmapConverter)
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,7 @@ public class PumpTrainerModHorizontalTwists : Mod, IApplicableToBeatmapConverter
public override string Name => "Horizontal Twists";
public override string Acronym => "H";
public override LocalisableString Description =>
"Horizontal crossovers involving a center panel.\n" +
"Requires the \"horizontal triples\" mod to be enabled.";
"Horizontal crossovers involving a center panel.";
public override double ScoreMultiplier => 1;
public override ModType Type => ModType.DifficultyIncrease;

Expand Down
Original file line number Diff line number Diff line change
@@ -1,15 +1,13 @@
using osu.Framework.Bindables;
using osu.Framework.Localisation;
using osu.Framework.Localisation;
using osu.Game.Beatmaps;
using osu.Game.Configuration;
using osu.Game.Rulesets.Mods;
using osu.Game.Rulesets.PumpTrainer.Beatmaps;

namespace osu.Game.Rulesets.PumpTrainer.Mods
{
public class PumpTrainerModIgnoreOsuSliderEnds : Mod, IApplicableToBeatmapConverter
{
public override string Name => "Ignore osu! slider ends";
public override string Name => "Ignore osu! Slider Ends";
public override string Acronym => "SE";
public override LocalisableString Description =>
"Recommended for osu! \"tech\"-style maps which have difficult rhythms.";
Expand Down
2 changes: 1 addition & 1 deletion osu.Game.Rulesets.PumpTrainer/PumpTrainerRuleset.cs
Original file line number Diff line number Diff line change
Expand Up @@ -45,10 +45,10 @@ public override IEnumerable<Mod> GetModsFor(ModType type)
case ModType.DifficultyIncrease:
return new Mod[]
{
new PumpTrainerModHorizontalTriples(),
new PumpTrainerModHorizontalTwists(),
new PumpTrainerModDiagonalTwists(),
new PumpTrainerModDiagonalSkips(),
new PumpTrainerModHorizontalTriples(),
new PumpTrainerModDoubleTime(),
};

Expand Down

0 comments on commit 4a8db3d

Please sign in to comment.