McKay42 / McOsu

Custom unofficial osu! practice client with Virtual Reality support
GNU General Public License v3.0
429 stars 43 forks source link

Approach rate artifacts flickering #165

Closed Jaymusta closed 6 years ago

Jaymusta commented 6 years ago

This makes it harder to read anything in general. Here's a link to a twitch clip of it happening:

https://clips.twitch.tv/CovertProductiveSnakeTheThing

Here's the same part without approach circles enabled:

https://clips.twitch.tv/DifferentInquisitiveDragonfruitVoHiYo ^there aren't any artifacts there

McKay42 commented 6 years ago

Oh wow, they even flicker completely independently. I have no idea how this is even possible, so here are a few questions:

Jaymusta commented 6 years ago

The artifacts appear on all beatmaps, but mostly on triples, jump sections, and streams so I think it has something to do with how many notes there are on the screen at once. It appears to happen 100% of the time. It seems to occur on all of Seoul's skins (my personal mix in the clip is an edited version of one of them), Yugen, elohere (rafis), hvick+mix (seems to affect all single notes but no sliders), HueShift Glow, Tyguyy's+Skin, and Yasu+bear.

The few skins that don't seem to be affected include McOsu's own default skin, Chitanda, azer8yea (azerite's skin), and AkemiEdit (wilchq's skin).

I'm on the latest version of McOsu in steam on windows 10 with a gtx1070 on driver version 388.43. I've never seen it happen on Peppy's osu.

Jaymusta commented 6 years ago

Ok so I tried combining my main skin with Chitanda to see if that would fix things, but interestingly the problem still happened even though the base skin was chitanda instead of seoul. So I went ahead and looked for a difference between the original chitanda and the hybrid I created and it seems that the artifacts only appeared when the skin had it's own approach circle. I went to check the other skins that were affected and they all didn't use the default approach circle.

To confirm this, I deleted the approach circle my hybrid had and it ended up being completely fine.

McKay42 commented 6 years ago

I've now looked at the code multiple times, and still not found a logical explanation for this.

Especially because in the video, multiple approach circles have different scale values applied to them randomly in the same frame. m_fApproachScale must somehow even go negative (?), since some approach circles became smaller than the circle. Jitter in curPos would require all circles to be affected in the same way, so that can't be it. hitcircleDiameter is constant over an entire frame, same as getApproachTime(). m_iTime is never modified anywhere. Since m_fApproachScale is calculated from these values, it is theoretically impossible for it to be different in multiple circles in the same frame. You mentioning that it goes away if you use the default approachcircle.png makes this even more strange.

The only explanation I have currently is that there is memory corruption somewhere, either caused by my code doing out-of-bounds reads/writes, or by some other software injecting itself into the game (like Discord/Steam overlay etc.) and wreaking havok, or by your RAM being defective (very unlikely).

If you have the time to try a debug build with some logging, hit me up on Discord: https://discord.gg/3UQnt7X

McKay42 commented 6 years ago

https://github.com/McKay42/McOsu/blob/master/src/App/Osu/OsuCircle.cpp#L447