ppy / osu

rhythm is just a *click* away!
https://osu.ppy.sh
MIT License
15.54k stars 2.31k forks source link

Storyboard background offset is not supported #14238

Open Hiviexd opened 3 years ago

Hiviexd commented 3 years ago

Describe the bug: Currently, people use the background offset feature in [Events] section that's found in .osu files, to properly adjust backgrounds so they fit the taiko playfield image

However, this feature doesn't work at all in lazer, which results in backgrounds being improperly cut off by the playfield.

Screenshots or videos showing encountered issue:

How it looks in stable: image

How it looks in lazer: 7WpVfBh

osu!lazer version: 2021.809.0-lazer

Logs: logs.zip

bdach commented 3 years ago

This is technically a storyboard-level feature, not something necessarily specific to taiko (although I imagine usages of it are seen more often on taiko maps).

Hiviexd commented 3 years ago

is it possible to at least make background adjusting a taiko feature that can be changed in the editor? it's almost always used in taiko maps and I never saw it being used in any other mode

bdach commented 3 years ago

Given it's a storyboard-level feature, it should ideally be supported in the (not-yet-started) storyboard editor, surely?

bdach commented 5 months ago

Looked into this further and it turns out it's not all storyboard scripting after all. Yes moving the background around is possible (and also has very weird behaviours wrt to resolution/aspect ratio handling, because of course) but there's also whatever this is:

        internal override void AdjustBackgroundSprite(pSprite backgroundSprite)
        {
            if (ModManager.CheckActive(Mods.Cinema))
                return;

            if (player.eventManager.backgroundEvent == null || player.eventManager.backgroundEvent.Sprite == null)
                return;

            pSprite eventSprite = player.eventManager.backgroundEvent.Sprite;

            backgroundSprite.Position.Y += GameBase.WindowManager.HeightScaled - (GameBase.WindowManager.HeightScaled - (TAIKO_BAR_Y + TAIKO_BAR_HEIGHT + title_height)) / 2f - 240;
            backgroundSprite.OriginPosition.Y = eventSprite.OriginPosition.Y + 15 * (((float)backgroundSprite.Width / backgroundSprite.Height) / 1.333f);
        }

https://github.com/peppy/osu-stable-reference/blob/bb57924c1552adbed11ee3d96cdcde47cf96f2b6/osu!/GameModes/Play/Rulesets/Taiko/RulesetTaiko.cs#L785-L797

I don't even know how to begin addressing any of this so I'm probably leaving this be for the time being. Will probably add support for this same thing for videos (which is also missing but is much easier to actually implement) and leave it there.

bdach commented 5 months ago

Will probably add support for this same thing for videos (which is also missing but is much easier to actually implement) and leave it there.

I take that back this only appears to work sensibly in stable if the video doesn't fill the screen. If it does fill the screen then the effective offset applied seems to depend on window resolution.

I don't want to deal with that right now.