[BUG] Level Select unresponsiveness & Cursor swapping bug

Started by WillLem, April 22, 2024, 11:42:13 AM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

WillLem

Quote from: Tygerboi on April 21, 2024, 12:15:28 AMI have found that sometimes the mouse cursor will revert to the Lemming hand cursor used in the title screen instead of the Windows mouse pointer ... I have experienced this if the Level Select screen is on-screen and then Alt-Tab or the Windows key is used to switch back to the desktop/another app, and then switched back to SLX.

From a quick look at the code, I can't see anything that would be causing this and I haven't been able to replicate the bug.

If possible, can you give a step-by-step of exactly what leads to this happening as this would greatly help me to find a possible cause (and therefore a fix).

Does it happen in NeoLemmix with the NL menu screen cursor? Has anyone else experienced this?

jkapp76

I've definitely seen this happen.

When you more recently made an update I no longer saw this though. I'd open the level-select and open up some level lists and it'd eventually change to the hand.

I can't get mine to do this anymore. you fixed something else about this menu hanging or something and mine never did this again. It was around the time you fixed the menu tile looping thing so it'd stop at the highest difficulty.
...Jeremy Kapp

WillLem

OK, thanks Jeremy.

Come to think of it, I think I remember something like this happening when I very first implemented the Amiga cursor, but haven't had it happen in a long time and I'm also struggling to get it to happen.

@Tygerboi - which version of SLX are you using?

Tygerboi

Quote from: WillLem on April 22, 2024, 09:18:58 PM
OK, thanks Jeremy.

Come to think of it, I think I remember something like this happening when I very first implemented the Amiga cursor, but haven't had it happen in a long time and I'm also struggling to get it to happen.

@Tygerboi - which version of SLX are you using?


I was actually using v2.7.1.  I have just realised that you're now up to 2.7.3, so have just downloaded that, and the styles pack, so will update my installation and then get back to you with the info you asked for, if the problem recurs.

WillLem

OK, I'll keep the topic open for now. Go ahead and let me know if you notice it again, and I'll also keep my eye out for it as well.

Tygerboi

OK, this is still happening in v2.7.3 (screenshot attached).  I have been able to replicate this numerous times now.  It seems to occur when I browse through the different level pack/groups, expanding and then contracting different levels in the tree structure on the left.  It will work fine to start with, then will temporarily freeze/lock up, and the level select window will get the "...(Not Responding)" message in the title bar.  Then it will refresh and become functional again, but with the lemming hand cursor.  If I close the level select window and then reopen it, the cursor reverts back to the Windows mouse cursor again.  Sometimes (less frequently though) when it stops responding it kills SLX entirely, and I have to completely restart it.  This happened when I was testing immediately prior to posting this message.


I am running Windows 10 Pro v22H2 on an Aspire E15 E5-552 (SNID: 54000963676) laptop with 8GB RAM and AMD Radeon R6 on-board graphics, 40GB+ free HD space.  I have no other open apps (apart from MS Edge as I had this page open) and all latest drivers/Windows Updates, etc are installed.  Since I originally posted this issue I have cleared my system and user profile Temp folders, and have obviously shut down/rebooted numerous times.  I do have NordVPN running, but even when I have closed this and all of its associated services (and the same for my AV app), the issue with SLX level select occurs.


It's not a major game-busting issue, and is easy enough to work around, but still is a little frustrating.  I will test again on my desktop PC, which is also running the same version of Windows, with a loosely similar spec - for this issue and the panel issue I raised - to see if I can replicate the issues on there, and then let you know.

WillLem

Quote from: Tygerboi on May 16, 2024, 02:27:58 AM
OK, this is still happening in v2.7.3 (screenshot attached).  I have been able to replicate this numerous times now.  It seems to occur when I browse through the different level pack/groups, expanding and then contracting different levels in the tree structure on the left.

OK, I've added this to the list of known bugs and will try to find a fix at some point.

Quote from: Tygerboi on May 16, 2024, 02:27:58 AM
It will work fine to start with, then will temporarily freeze/lock up, and the level select window will get the "...(Not Responding)" message in the title bar.

I've noticed this as well, it's been happening for quite a while. I've also added this to the list of known bugs; the level select menu in general could do with some debugging and bottleneck fixing. I'll take a look at it and see what can be done.

WillLem

I'm about 88% sure this is fixed (see commit 354c8a6a).

Since I haven't been able to reliably replicate the bug, it's difficult to say for sure whether the fix has worked. But basically, the cursor will not be reloaded if either the config menu or the level select window are active.

I wonder whether the call to reload the cursor was somehow being triggered by whatever also caused the level select window to become unresponsive (this hasn't been happening for the last few versions of SLX either, thankfully); most likely loading/reloading of assets or settings, perhaps. Whatever the cause, the cursor reload now simply won't happen if the window is still active.

For testing purposes, I opened the level select window and clicked a bunch of times, opening and closing tree branches, and clicking packs to trigger full info loads (which can be quite resource-intensive). The cursor stayed stable, and in spite of a bit of lag now and again even the treeview managed to keep up!

So, this fix will be present in the next update (2.8.6). Please do let me know if you notice the bug happening again, or if you've been able to reliably use SLX for several sessions without it happening, that would also be useful to know as well.

EDIT: The fix didn't work. Investigating further.

WillLem

Nope, the bug is still present even after the attempted fix. I'm going to have another look at the level select treeview and see if there's anything else I can do to optimise it and ensure responsiveness.

WillLem

OK, made some further optimisations to the Level Select menu and added more visual feedback.

• All UI-intensive tasks now regularly call for the app to process the message queue; the theory here is that it should prevent the sort of buildup that causes the app to go unresponsive. So far so good after a bit of testing, but I'll do some more extensive tests before the next release to ensure that this is as stable as it can be.

• Added a progress bar and loading info label which is displayed during the more UI-intensive tasks to show that something is happening.

• Data loading has been broken down into smaller tasks which are only called when needed, and the more UI-intensive stuff isn't called at all when the pack is a compilation (determined by number of sub-folders).

Overall, the menu is now quicker and more predictable, opening the Level Select menu should now be much snappier, and any delays caused by large level packs/compilations should either be reduced or eliminated altogether depending on pack structuring. Importantly, the UI will remain responsive throughout (i.e. no having to close SLX with Task Manager!)

To be honest though, even with these improvements I don't think it's ever going to be perfect. It's just... that bit better.

WillLem

This bug should now be fixed in SuperLemmix 2.8.7.

If anybody reports it after this release (or if I notice it myself), I'm officially out of ideas and would need someone to help me fix this for both SLX and NL-CE.

As it is though, the Level Select menu is now quicker and more responsive than ever, even for large packs. I'm happy to call it here on implementing any further optimisations for now. Let's see how we do with 2.8.7.

NOTE: The same fixes are also implemented in NeoLemmix CE 1.0. It's safe to assume from now on that if a UI bug has been fixed in one, it's also been fixed in the other.