[FIXED][BUG][PLAYER] 2 zoom bugs: rounding and mouse trapping

Started by Simon, May 29, 2019, 03:19:14 PM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

Simon

(Moved: Bug #1: On assignment for frame n, first erase old assignment for n)

Bug #2. Zoom such that the right-most column of terrain pixels is only partially visible in your NL game window. Toggle pause several times. The right-most column of pixels sometimes is black, sometimes it shows the terrain properly. Expected instead: Always shows the terrain properly. Speculation: You have code duplication in the camera.

Bug #3. Have a gigantic screen, and zoom out to 1x. Have a large grey dead area at top/bottom of map. The mouse is trapped in the playable area, mouse cannot go to the dead area. Open the load-replay dialog. Your mouse cursor is still trapped within the map, the mouse cursor cannot move everywhere in the dialog, I can't click some files in the dialog. Expected instead: Trap mouse only if the game isn't the focused window.

-- Simon

namida

#1
Quote2. Zoom such that the right-most column of terrain pixels is only partially visible in your NL game window. Toggle pause several times. The right-most column of pixels sometimes is black, sometimes it shows the terrain properly. Expected instead: Always shows the terrain properly. Speculation: You have code duplication in the camera.

Speculation with close knowledge of how this part of the code works: When the high quality minimap is disabled, NL takes a lot of shortcuts in rendering the level (it can't take these shortcuts when the high quality map is on, as it needs a full-detail image of the entire level to shrink down to the minimap), in particular including that it doesn't render many parts of the level that aren't currently on-screen. I suspect the algorithm that calculates which part of the level to render, is rounding down at a point where it should be rounding up. It might be simpler to just always add a few padding pixels of "gets-drawn" area to each side, rather than find and fix exactly where this bug is. Removing the shortcuts is a possible solution, though I'd like to keep them - they offer a fairly noticable speed increase on weaker machines, especially on large levels.

If my guess is correct, this bug should not occur when the high-quality minimap is on. Additionally, it should be possible to trigger with a single pause, or at most, one pause-unpause-pause cycle. EDIT: Actually, unless there's sepearate code generating the area when paused vs when unpaused, pause should be irrelevant except to the extent of "if you pause then scroll, the bug fixes until you unpause" (as if you scroll a bit when paused, NL renders the entire level without shortcuts, so it doesn't have to render again if you scroll more).

EDIT: I've reproduced this bug and after actually seeing it in action, I'm almost 100% sure my speculation was correct.

Quote3. Have a gigantic screen, and zoom out to 1x. Have a large grey dead area at top/bottom of map. The mouse is trapped in the playable area, mouse cannot go to the dead area. Open the load-replay dialog. Your mouse cursor is still trapped within the map, the mouse cursor cannot move everywhere in the dialog, I can't click some files in the dialog. Expected instead: Trap mouse only if the game isn't the focused window.

Known issue, but it either doesn't have a topic or the topic is long buried. Good, having a visible topic for it will remind us to fix this.
My projects
2D Lemmings: NeoLemmix (engine) | Lemmings Plus Series (level packs) | Doomsday Lemmings (level pack)
3D Lemmings: Loap (engine) | L3DEdit (level / graphics editor) | L3DUtils (replay / etc utility) | Lemmings Plus 3D (level pack)
Non-Lemmings: Commander Keen: Galaxy Reimagined (a Commander Keen fangame)

namida

#2
Bug #2 fixed in commit aa775fc, cherry-picked to V12.4.1 WIP in commit d791f21. No real workaround (other than using the high quality minimap, if your PC can handle it) but also negligable impact.
Bug #3 fixed in commit 1a69b6a, cherry-picked to V12.4.1 WIP in commit 034f3df. If you don't use edge scrolling, disabling it should also prevent this bug from occuring, as the mouse shouldn't get trapped in the first place in such a case.

Haven't looked into bug #1 yet.
My projects
2D Lemmings: NeoLemmix (engine) | Lemmings Plus Series (level packs) | Doomsday Lemmings (level pack)
3D Lemmings: Loap (engine) | L3DEdit (level / graphics editor) | L3DUtils (replay / etc utility) | Lemmings Plus 3D (level pack)
Non-Lemmings: Commander Keen: Galaxy Reimagined (a Commander Keen fangame)