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

Feat: support stretching bar roll as in TaikoJiro #757

Merged
merged 6 commits into from
Dec 9, 2024

Conversation

IepIweidieng
Copy link
Contributor

@IepIweidieng IepIweidieng commented Dec 3, 2024

Features

  • make bar drumrolls stretchable as in TaikoJiro
  • detect and hide screen-obscuring bar drumrolls when any tips are out of screen

Fixes

  • fix bar drumroll end stuck at judgement mark if occurred at 0ms since #START
  • fix fuze rolls stretched back when exploded
  • fix balloon-type notes not stayed on judgement mark vertically during their duration
  • fix wrong drawn position of rotated bar-type roll tails

This also fixes #558 & #579 completely

Limitations

These limitations will be addressed in future PRs.

  • A bar roll can have its body intersect with screen in X position but still out-of-screen. Such a roll will not have its SENote hidden.
  • The roll position in HB/BMScroll is determined by the timing settings of player 1. (existent issue) reverified, false
  • An out-of-screen bar roll is forced to show only when the gameplay time position is within its time duration, but not when the gameplay beat position is within its beat duration (for HB/BMScroll). The TaikoJiro 連打背景 (drumroll background) gimmick will not work currently.
  • The roll end is not hidden along with the hidden bar roll.

Test Cases

Tutorial ~ Advanced Notes Ex.tja

OpenTaiko.PR.2024-12-10.Tutorial.Advanced.Notes.Ex.tja.-.0.00.39-0.02.10.mp4

Note that the note draw order in this chart can sometimes be different than this video. It is because the current draw order is determined (almost) purely by notes' play time, not purely by notes' definition order as in TaikoJiro.

⭕ Katharsis [Oni] (OpenTaiko Chapter 1)

You can also play any TaikoJiro gimmick chart with stretching bar drumrolls. Also see #758.

@0auBSQ
Copy link
Owner

0auBSQ commented Dec 6, 2024

Hello, thank you for your contribution!

@IepIweidieng
Copy link
Contributor Author

Just discovered that there are issues with balloon-type rolls. I also intend to keep the bar roll head visible. Please wait until there are finished.

However, the other parts of this PR are finished and are ready for review.

  • About the HideObscuringRoll function, does it hide a roll like the one on the attached image?

The hiding algorithm currently works as follow:

// display judging rolls
if (nowTime >= pChip.n発声時刻ms && nowTime <= pChip.nNoteEndTimems) {
pChip.bShowRoll = true;
return;
}

("Passing" judgement mark, bar body shown no matter what.)

// ignore already out-of-screen rolls
bool isBodyYInScreen = (Math.Min(yHead, yEnd) < OpenTaiko.Skin.Resolution[1] && Math.Max(yHead, yEnd) > 0 - OpenTaiko.Skin.Game_Notes_Size[1]);
if (!(isBodyXInScreen && isBodyYInScreen)) {
return;
}

(hide the bar body of obviously out-of-screen rolls.)

// display completely in-screen rolls
bool headInScreen = (xHead > 0 - OpenTaiko.Skin.Game_Notes_Size[0] && xHead < OpenTaiko.Skin.Resolution[0])
&& (yHead > 0 - OpenTaiko.Skin.Game_Notes_Size[1] && yHead < OpenTaiko.Skin.Resolution[1]);
bool endInScreen = (xEnd > 0 - OpenTaiko.Skin.Game_Notes_Size[0] && xEnd < OpenTaiko.Skin.Resolution[0])
&& (yEnd > 0 - OpenTaiko.Skin.Game_Notes_Size[1] && yEnd < OpenTaiko.Skin.Resolution[1]);
if (headInScreen && endInScreen) {
pChip.bShowRoll = true;
return;
}

(the most trivial case)

int drCanMoveAwayMin = (OpenTaiko.Skin.Game_Notes_Size.Max() + 1) / 2;
// If the nearest point is roll tip, all moves may prevent obscuring.
// If the nearest point is roll body, only orthogonal moves may prevent obscuring.
float drAway = (pos > 0 && pos < 1) ? Math.Abs(Vector2.Dot(dr, rollNorm)) : dr.Length();
bool canMoveAway = drAway >= drCanMoveAwayMin;
pChip.bShowRoll = canMoveAway;

For the remaining case, the nearest point of the bar to the judgement mark and its (interpolated) velocity is calculated to determine whether to show the bar body.

(show the bar body of fast-moving rolls, hide the bar body of slow-moving rolls.)

The weakness is that it does not consider whether the bar body is approaching or departing.

So, for the question whether the bar body of the drumroll is hidden, it depends on the velocity of the tips of the bar body.

Explanation image project file: HideObscuringRoll_explanation.xcf.zip

Probably the texture is stretched too much or the coordination variable overflowed. These may also happen for non-stretching bar rolls. These issues can be prevented by using line-clipping algorithms such as fast clipping, but is too far to be addressed in this PR.

@IepIweidieng IepIweidieng force-pushed the feat-stretching-bar-roll branch from 3d62fd3 to e78e33a Compare December 9, 2024 11:53
@IepIweidieng IepIweidieng force-pushed the feat-stretching-bar-roll branch 3 times, most recently from 515b9f5 to 983cbca Compare December 9, 2024 14:30
@IepIweidieng IepIweidieng force-pushed the feat-stretching-bar-roll branch from 983cbca to 2b0ec24 Compare December 9, 2024 14:48
@IepIweidieng
Copy link
Contributor Author

Just discovered that there are issues with balloon-type rolls. I also intend to keep the bar roll head visible. Please wait until there are finished.

This PR is now finished.

@0auBSQ 0auBSQ merged commit 1aa4f58 into 0auBSQ:main Dec 9, 2024
@IepIweidieng IepIweidieng deleted the feat-stretching-bar-roll branch December 9, 2024 20:33
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

Successfully merging this pull request may close these issues.

[Bug] The drumrolls visual position is oddly wrong when the scroll speed value is negative and very low
2 participants