Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[OpenTaikoChart] "offset": (negative) should not behave similar to "offset": (positive) #106

Open
IepIweidieng opened this issue Sep 17, 2024 · 0 comments

Comments

@IepIweidieng
Copy link

Version

  • Koioto Ver.1.0
  • OpenTaikoChart Ver.3.0 (Supported Rev.: 2.4)

Current Behavior

In Open Taiko Chart Information file, both "offset": x and "offset": -x make the first measure abs(x) seconds later than when the audio starts.
For example, both "offset": 2.416 and "offset": -2.416 makes the first measure 2.416 seconds later than when the audio starts.

movieoffset has the expected behavior.

Expected Behavior

"offset": x and "offset": -x should offset the first measure in the opposite direction.

If I interpret the documentation correctly, the equation should be offset = time-point-of-chart-starttime-point-of-audio-beginning.
For example, "offset": 2.416 should make the first measure 2.416 seconds later than when the audio starts, and "offset": -2.416 should make the first measure 2.416 seconds earlier than when the audio starts.

This means that Open Taiko Chart Information offset takes the opposite sign of TJA OFFSET:
For example, "offset": 2.416 in Open Taiko Chart Information would be equivalent to OFFSET:-2.416 in TJA.

See https://github.com/IepIweidieng/TJAPlayer3/blob/gh-pages/tja.md#offset

Test Cases

Metal-Pipe.zip

Edit Metal-Pipe.tci to change offset and movieoffset.

Koioto.offset.and.movieoffset.test.mp4

Possible Solutions

See https://github.com/Koioto/OpenTaikoChart/blob/b6855a3dc635462584344cadb34f0fd1f3f3ff4c/CourseParser.cs#L45-L68.

After these lines, nowTime will be the time of the first measure, and nowTime - bgmStartChip.Time == offset should be true. However, the fails to be true for the case offset < 0.

It might be possible to solve by changing line 52

Time = nowTime - (long)(Math.Abs(offset) * 1000.0 * 1000.0),

into

Time = nowTime + (long)(Math.Abs(offset) * 1000.0 * 1000.0),
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant