kionell / osu-parsers

A bundle of decoders/encoders for osu! file formats based on the osu!lazer source code.
MIT License
37 stars 8 forks source link

Inherit point doesn't show properly #25

Closed KenZync closed 6 months ago

KenZync commented 6 months ago

image image

so I have 6 sv but it show just 3 because it is same multiplier? but it should show all because i want to know startTime for each SV

https://osu.ppy.sh/beatmapsets/618710#mania/1321833

image

image

image

KenZync commented 6 months ago

timingPoint ok but difficultyPoint are not

kionell commented 6 months ago

so I have 6 sv but it show just 3 because it is same multiplier?

Correct! I don't know exactly how osu!stable handles timing points, but It's 100% different from osu!lazer. Although I'm not sure what difficulty you meant, since none of them have the same timing points as in the screenshots above, so let's assume it's [4K] CHALLENGE! (Marathon).

image image

As you can see, in osu!stable for each timing point there are corresponding difficulty and effect points.

image image

Meanwhile in osu!lazer default (1.0x) & duplicated points are completely ignored, because only those 3 points make any difference to the gameplay. You can read more about that in the source code.

but it should show all because i want to know startTime for each SV

If I understand correctly, in osu!stable all SV's appear on each timing point. The only possible solution I see is to populate difficulty points manually by using controlPoints.difficultyPointAt() for each time when you reach a new timing point.

KenZync commented 6 months ago

That would cause troublesome for me. I am calculating BPM SV = new BPM which for loop from all points and calculate from TimingPoint.bpm DifficultyPoint.sliderVelocity. but some sv are ignored so it will not correct. What do you think?

kionell commented 6 months ago

I think in that case you can do:

const bpm = beatmap.controlPoints.groups.map((group) => {
  const timingPoint = beatmap.controlPoints.timingPointAt(group.startTime);
  const difficultyPoint = beatmap.controlPoints.difficultyPointAt(group.startTime);

  return timingPoint.bpm * difficultyPoint.slidetVelocity;
});

This will allow you to find the BPM at each moment in time when new control points appear. As an alternative you can iterate over timing points instead of groups

KenZync commented 6 months ago

I think in that case you can do:

const bpm = beatmap.controlPoints.groups.map((group) => {
  const timingPoint = beatmap.controlPoints.timingPointAt(group.startTime);
  const difficultyPoint = beatmap.controlPoints.difficultyPointAt(group.startTime);

  return timingPoint.bpm * difficultyPoint.slidetVelocity;
});

This will allow you to find the BPM at each moment in time when new control points appear. As an alternative you can iterate over timing points instead of groups

oh that would solve issue Thank you! Btw I'm doing Osu to O2Jam converter and it's doing great!