Play icon indicating copy to clipboard operation
Play copied to clipboard

Note.EndBeat should be inclusive

Open achimmihca opened this issue 2 years ago • 2 comments

Problem or question to be solved

Recently I ran into an issue because I expected Note.EndBeat to be inclusive but it is not.

Example: Note starting on beat 1 with length 1. Currently, this results in:

  • StartBeat: 1
  • Length: 1
  • EndBeat: 2

But what I expected is:

  • StartBeat: 1
  • Length: 1
  • EndBeat: 1

Well, clearly I was aware of this at some time because the game works correctly (score etc). But now I find it very weird. It could be that there are bugs somewhere (song editor) because of this pecularity.

Suggested solution/s

I would like to refactor the value and usage of EndBeat to be inclusive.

Your opinion on the topic

Is there any reason why EndBeat should not be inclusive?

Note that the semantic of the txt file is not affected. The EndBeat is only part of the internal data structure.

achimmihca avatar May 07 '22 15:05 achimmihca

Maybe just rename it to EndBeatExclusive and StartBeatInclusive

achimmihca avatar Jan 06 '23 10:01 achimmihca

A beat in UltraStar is a timespan, not a point in time. Thus, if you want to treat it like a point in time, always choose the beginning of the beat timespan. Thus:

  • StartBeat: beginning of beat span 1
  • Length: timespan of amounts of beats: 1
  • EndBeat: beginning of beat span 2

Hope this helps understand the idea of it.

basisbit avatar Jan 06 '23 21:01 basisbit