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

Add "Zoomed" mod #19791

Draft
wants to merge 48 commits into
base: master
Choose a base branch
from
Draft

Add "Zoomed" mod #19791

wants to merge 48 commits into from

Conversation

o-dasher
Copy link
Contributor

@o-dasher o-dasher commented Aug 16, 2022

This mod is based on a concept i made up myself.
The game reduces your "FOV (Field of View)" and you move your cursor across the playfield "Blind traveling" across the playfield.

blind-travel-showcase.mp4

A few notable changes included with this pr is the exposure of a mouse position in ParallaxContainer this is used because the Blind Travel mod changes the background parallax so it is more "immersible" when using auto mod. and the exposure of OsuScreenStack's parallaxContainer.

I am pretty new to pull requests so any heads up will help and I don't have c# experience so feel free to correct me but personally everything feels sane.

Update

The mod now is called "Zoomed"
The game zooms in the screen to your cursor, tracking it accordingly. The game scales the zoom even further the more you raise your combo.

@peppy
Copy link
Member

peppy commented Aug 16, 2022

  • The naming of this mod isn't great. It seems like it should draw from feeling like an FPS or tracking the cursor. "Blind" is too generic and doesn't really explain what the mod does at all.
  • The transition after breaks seems weird and jarring. I'd probably make it much smoother or remove it altogether.
  • The default tweening you have applied means there's a chance the screen won't track on fast jumps and the user will have to try and click off-screen circles. Is that the intention? If not, you might want to make it track more stringently. Also feel weird that the default value is also the minimum.

@mk56-spn
Copy link
Contributor

mk56-spn commented Aug 16, 2022

playtested this a bit, as i thought it has issues with bounding on tablets ( and apparently on mouse now that ive tried it) , im perosnally fine with offscreen circles i think its interesting learning them, but not being able to hit circles at all because you run up against the playfield border is no fun at all. i think it should remain as it right now but allowing you to extend out of your main tablet area to the whole playfield size, this ofcourse poses an issue for full area players but i think thats a compromise that will have to be made

this is what i mean by the way in case its not clear :
osu_2022-08-16_17-00-52

@nagi-desuuu
Copy link

And we can't forget about the mobile players who just want to tap the circles directly.

@mk56-spn
Copy link
Contributor

And we can't forget about the mobile players who just want to tap the circles directly.

very good point but i think theyll have to make do with playfield scaling cant see how else one could work it out, kind of like how no scope will never really work on mobile

@o-dasher
Copy link
Contributor Author

Would "Cursor Focus" be a good naming?

@Flamiii
Copy link

Flamiii commented Aug 16, 2022

Something like "Zoomed In" (similar to peppy's suggestion) would probably be better imo.

@Walavouchey
Copy link
Member

for reference, McOsu has an fps mod which doesn't have any delay in the screen tracking, which to me seems more reasonable https://youtu.be/-o32vwQoyv4

@peppy
Copy link
Member

peppy commented Aug 17, 2022

Defaulting to zero delay would be my preference. It can still exist as a setting to give customisation.

@o-dasher
Copy link
Contributor Author

Defaulting to zero delay would be my preference. It can still exist as a setting to give customisation.

I just did a Zero Delay local version and the screens feels too shaky, i am not sure but if you want i guess it is ok

I am not sure if this should be the default though.
@peppy peppy self-requested a review August 17, 2022 04:36
@peppy peppy changed the title Add Blind travel mod to the osu ruleset Add "Zoomed" mod Aug 17, 2022
@peppy
Copy link
Member

peppy commented Aug 17, 2022

I've done a (mostly rider-automated) code style pass because your naming, styling and everything between was wrong.

Please check the contribution guidelines and read more existing code to make sure you get things right in the future.

I'm not reviewing this further because you've made changes outside the mod class (to ParallaxContainer and the likes). I haven't understood why this is required yet, but if it is, it should be in its own PR and tested separately.

Mod PRs should only touch the mod class.

@smoogipoo
Copy link
Contributor

smoogipoo commented Aug 31, 2022

Visual pass:


At 1.95x zoom (and 2x zoom), the playfield keeps scaling in to what I assume is the final scale even though I have delay and final zoom at combo set to 0. This happens with both autoplay on and off:

2022-08-31.16-51-36.mp4

At 2x zoom, this is completely broken with autoplay:

DON'T WATCH IF EPILEPTIC

https://user-images.githubusercontent.com/1329837/187622259-21a11487-9fe1-4e9f-b08e-9b0763c8e8bc.mp4
Purposefully adding this text here to require manual click on video.

@peppy
Copy link
Member

peppy commented Aug 31, 2022

So basically that's the same feedback loop I was looking to avoid, but it turns out to not be so simple to do so (the RulesetInputManager seems to somehow be inside the playfield...?).

To explain, the mod is moving the playfield, which means even with a stationary cursor, the cursor's actual position will change based on the repositioning / scaling.

Will go back to the drawing board. May have to unapply the playfield's transform matrix.

@peppy peppy added the blocked Don't merge this. label Aug 31, 2022
@smoogipoo smoogipoo removed the next release Pull requests which are almost there. We'll aim to get them in the next release, but no guarantees! label Aug 31, 2022
@o-dasher
Copy link
Contributor Author

o-dasher commented Sep 1, 2022

A proposal here: background should "parallax" too. Ideally, differently from playfield to save background<>playfield movement.

I implemented this originally but doing that is out of scope of this pr because it would require to change some classes that are out of the mods scope, but this could be done in a separate pr.

@o-dasher
Copy link
Contributor Author

o-dasher commented Sep 1, 2022

So basically that's the same feedback loop I was looking to avoid, but it turns out to not be so simple to do so (the RulesetInputManager seems to somehow be inside the playfield...?).

To explain, the mod is moving the playfield, which means even with a stationary cursor, the cursor's actual position will change based on the repositioning / scaling.

Will go back to the drawing board. May have to unapply the playfield's transform matrix.

That's one of the main challenges i had to fight while trying to make a setting for the cursor to be centered, it would be a really nice option but thinking on a way to actually make this implementable is hard

@o-dasher
Copy link
Contributor Author

o-dasher commented Sep 1, 2022

Visual pass:


At 1.95x zoom (and 2x zoom), the playfield keeps scaling in to what I assume is the final scale even though I have delay and final zoom at combo set to 0. This happens with both autoplay on and off:

After looking a bit at the code i figured out on why is that so, although zoom is being set to the final combo if the Final Combo at is set to 0, it still interpolates the playfield from scale 1 to the final scale, this could be fixed by not using DampContinuously if the Final Combo is 0.

@peppy peppy self-requested a review September 2, 2022 09:42
@peppy
Copy link
Member

peppy commented Sep 2, 2022

The delay was intentional for the scale to smooth things off. I'll change that for the case of FinalZoomCombo=0 though.

@peppy
Copy link
Member

peppy commented Sep 2, 2022

The above mentioned feedback issue is due to this function:

if (replayInputManager.ReplayInputHandler != null)
replayInputManager.ReplayInputHandler.GamefieldToScreenSpace = Playfield.GamefieldToScreenSpace;

This is run by the ReplayInputHandler at the start of a frame, and has a one-frame delayed playfield position, causing the feedback loop.

JetBrains.Rider.2022-09-02.at.10.02.10.mp4

Before attempting to fix this, I wanted to bring up something of concern, which is that this also means replays under this mod (or any other mod which adjusts the playfield) would still have replay data cursor positions stored relative to the playfield. I'm not sure if this is what we want?

It will change the path to fixing this issue, so I'll wait for opinions before continuing.

@Feodor0090
Copy link
Contributor

If cursor is stored relative to playfield, we can "disable" mods (#19925) just by disabling them.
If cursor is stored relative to screen/gameplay area/etc., mods like BR and this will require additional transforming of cursor position to place it where it was, for example. It also may be painful for external tools or server-side replays processor (if it exists or ever will be) because they will need to guess where the cursor exactly was.

It's logical to store cursor absolutely, where a player pointed it. But having it stored not in hitobjects' coordinate space may complicate some calculations now or in future, so maybe it's better to leave things as they is.

@peppy
Copy link
Member

peppy commented Sep 8, 2022

I've fixed the jumping issue by moving the update call to UpdateAfterChildren. I think this is more correctly in all cases (ensures any adjustments to the playfield apply to the next frame, so input / autoplay / replay can pick up on them on the correct frame)?

I can still get a bit of weird stuttering when the window isn't focused specifically, but that might be something to do with frame stability. Maybe this is okay for now?

@o-dasher
Copy link
Contributor Author

o-dasher commented Sep 8, 2022

This seems to be the best solution for that in my oppinion, simply because this doesn't require any mod specific code and should work for any future mod that ends up doing something similar.

@peppy peppy removed the blocked Don't merge this. label Sep 8, 2022
@peppy peppy requested a review from smoogipoo September 8, 2022 14:07
peppy
peppy previously approved these changes Sep 8, 2022
@smoogipoo
Copy link
Contributor

At 2x zoom, this is completely broken with autoplay:

This issue still hasn't been fixed.

@peppy
Copy link
Member

peppy commented Sep 9, 2022

that's weird it worked correct for me, must be what i saw with frame stability. does it work if you set your frame limiter lower?

@smoogipoo
Copy link
Contributor

Doesn't seem to. I've tested all the way down to 60fps.

@peppy peppy self-requested a review September 9, 2022 03:30
@peppy
Copy link
Member

peppy commented Sep 9, 2022

@smoogipoo can you take a look into the issue? i've added a test that repro's 100% (i think when i thought i fixed it yesterday i was testing on 1.8x instead of 2x, and apparently that's not enough to trigger it?).

Here's some pointer to the things which are interacting to cause the issue:

Vector2 cursorPositionAdjust = playfield.OriginPosition - playfield.Parent.ToLocalSpace(mousePosition);

inputs.Add(new MousePositionAbsoluteInput { Position = GamefieldToScreenSpace(position) });

updatable.Update(this);

It feels like there's a delay in DrawInfo matrix updates or something. But I've tried to debug and can't figure out why it's occurring yet.

@peppy peppy marked this pull request as draft June 16, 2023 06:09
@ppy ppy deleted a comment Feb 9, 2024
@ppy ppy deleted a comment Feb 9, 2024
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.

8 participants