Large loopcounts in storyboard loops may allocate lots of memory
See original GitHub issueDescribe the bug:
Ayane - Nageki no Mori is an example of a ranked storyboard that has a loop with a loopcount of 9999999. The sprite itself isn’t visible for that long, but the events in the loop stretch out to about 1.9 years. This causes lazer to continue allocating memory for the events until at least my computer crashes.
It gets stuck over at this function, which can be confirmed with a breakpoint. Note that closing osu in this state will leave the thread to continue allocating memory, so watch out for that.
In both diff files:
Sprite,Foreground,Centre,"sb\collabpart\_002.png",650,430.75
L,0,9999999
R,5,0,3000,-0.01,0.01
R,5,3000,6000,0.01,-0.01
I don’t know if stable iterates through the loops differently, but it works fine there. There is no outro on stable because loops don’t affect outro time, but in the design editor the invisible sprite can be observed moving way beyond the end of the map. Haven’t tested to see if there is any limit, although not sure if a simple limit would be the correct solution.
Screenshots or videos showing encountered issue:
osu!lazer version:
Latest release: 2021.410.0
Logs:
not needed
Issue Analytics
- State:
- Created 2 years ago
- Reactions:3
- Comments:5 (3 by maintainers)
Top GitHub Comments
The PR linked fixes loops at a framework level. Unfortunately, storyboard command and loop generation is being done locally at the osu! side:
https://github.com/ppy/osu/blob/e330052852a8692c769ed2152a5980a16679b576/osu.Game/Storyboards/StoryboardSprite.cs#L127-L160
I’ll take a quick look into whether we can switch this to using framework native loop support.
Here’s a very partly working diff which will fix the issue osu!-side:
Unfortunately this isn’t the end of our worries. Because storyboards are allowed to rewind, things grind to a half quite quickly as the loop is duplicating itself and increasing the number of transforms until it gets to a point of slowing down to shit:
Going to require further thought and probably further framework side work as well.