-
Notifications
You must be signed in to change notification settings - Fork 25
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
Lag when clicking-and-dragging in certain sets #13
Comments
Yeah, the JavaScript does not have good performance, to put it lightly. Arwen and especially Quistis have many many cels, and each one is a separate PNG. And whenever a mouse action happens, the script is doing a lot of work to figure out where you clicked and so on. Thanks for creating this issue because it'll be a good place to discuss this problem. ^_^ |
Idea for improving performance while click-and-dragging: https://developer.mozilla.org/en-US/docs/Web/API/Canvas_API/Tutorial/Optimizing_canvas IDEA: Instead of updating and drawing everything on every frame: draw everything but the moving object to another canvas, then only update and draw only two things: the canvas and the moving object. DRAWBACK: The moving object won't be layered correctly -- it be on top of everything. FIX: Draw TWO buffers! One is everything beneath the object, one is everything above the object. Draw lower buffer, moving object, upper buffer. I think this could help a lot... It won't work for FKiSS2/3 (when objects start needing to know what other objects are around them as they move) but we can figure a different strategy out then ETA: Might have to be three or more buffers in the case of multi-cel objects. Everything below the lowest cel, everything between the cels of the object, then everything above the top cel. |
I'm not sure if this issue is already resolved for the sets mentioned in the original issue, but I've noticed that currently, very large sets will actually grind the browser tab to halt. Example would be Gwynn Kirkaldy's Do It Thineself Coat of Arms. This set is only FKiSS 1 so it should work fine in Smooch now, but it's also 1.2 MB compressed - it has a lot of cels. I don't know if the strategy from my post from 2017 above is the right one, but it does seems like something needs to change... |
There's a noticeable delay when dragging items in the Arwen, Hyacinth Delilah, and Quistis Trepe sets. For example, in Quistis Trepe, it takes about 4-5 seconds for the item to jump to the new location of the mouse cursor. It's better in Hyacinth Delilah, where the lag is around a couple of seconds. It also happens when I view the sets locally.
Browser: Vivaldi 1.11.917.35 (64-bit)
The text was updated successfully, but these errors were encountered: