Skip to content

Fixing Autopilot by calculating between the lastJudgedObject and currentJudgedObject #33483

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

Open
wants to merge 18 commits into
base: master
Choose a base branch
from

Conversation

TaterToes
Copy link
Contributor

@TaterToes TaterToes commented Jun 6, 2025

I decided to make a different pull request and close down the other pull request down since it seems fairly different, but this pull request is a bit more evolved. The new code remembers where and when you last made a hitobject judgement, then it calculates the percentage of time passed between the last hit object judgement to the next hitobject hitwindow. It applies that percentage to the distance between where the cursor was at the last hit object judgement to the position of the next hit object.

I want to do some heavy simplification on the code and some changes since it's almost 300 lines of code, but I'm again stuck so I decided to post a pull request to show that it works, but may need some changes due to performance issues and the size of the file.

Also personal note, coding this and in general, is really fun.

Here's a video below demonstrating the edited mod

2025-06-10.17-03-13.mp4

TaterToes added 5 commits June 8, 2025 18:27
Ok, let me explain these changes.

frac is changed to progress since it seems more intuitive.

Since progress is clamped we dont need to check distance fractions.

Removed hitwindow_end_offset because I think it doesn't really add much at all.

I moved hitwindow_start_offset around  to better show it as a transition point of some sort. Again intuition.

More comments were added to better explain what was going on and why each piece was there.

Also timeLeft was originally being calculated wrong. If we were hitwindow_start_offset plus 1 ms away from the target, we would take 1 ms to travel to that target. What was expected was hitwindow_start_offset plus that 1 ms.
@TaterToes
Copy link
Contributor Author

TaterToes commented Jun 10, 2025

Ok, here's the current rundown as of currently.

ON INITIALIZATION

  • Cursor is set to where the player last left it on screen.
  • In stable I believe, It rises vertically towards the center. I'm generally inclined that this is the way to go. For personal preference, I just chose to set it where the player last had it before gameplay was fully loaded.

DURING GAMEPLAY (CURSOR MOVEMENT)

  • There are subscriptions events that check the playfield for the last judged object. This will be needed to calculate time and position the cursor needs to travel.

  • Based on last judgement, if we are somewhat far away from the next hitwindow of a hitobject, we will reach the center of the hit object at the time of start of the hitwindow. Keyword here is center, it will not enter the hitobject on start of the hitwindow.

  • This is at the cost of no longer entering the hit object dead center in the hitwindow, which for visual players without rhythm might hurt them. However, this is a rhythm game and I subjectively believe should head in this direction.

  • If we are too close to the hitwindow, I added a feature which doesn't make the cursor suddenly teleport to still make it somewhat visually pleasing. However, scaledTime (which is the mentioned feature) is not needed if we completely ignore visuals.

DURING REPLAY

  • The new implementation interacts with the replay frames somewhat weirdly, so I blocked all the cursor calculations.

ISSUES FOUND

  • When we pause gameplay, and reenter with our cursor at a different place, lastHitInfo.Position gets updated.
  • Some mods cause the cursor to teleport.

OTHER FEATURES THAT COULD BE ADDED QUICKLY

  • Since we no longer rely on replay frames, magnetized and repel could be added back as compatible mods, however rewatching the replay could be a different story.

CONCLUSION

Basically to make cursor reach the start of the hitwindow, the implementation compromises in visual cues, while trying it's best to retain it. The implementation aims to give the player as much room to give judgement on tap.

And personal note, currently ready for review.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants