keeperfx icon indicating copy to clipboard operation
keeperfx copied to clipboard

scale zoom level correctly relative to 640x400 mode

Open eddebaby opened this issue 3 years ago • 5 comments

uses units_per_pixel_best to scale the zoom level (if window wider than 16/10 then scales zoom level relative to height, if the window aspect ratio is the same as 16/10 or narrower then scales the zoom level relative to width)

Default, max, and min zoom level now match 640x400 at all aspect ratios (with exceptions below).

3440x1440 showing default zoom level (matches 640x400, but wider): image

Exceptions:

  • if engine window Aspect Ratio is greater than 14.5/10 (approx measurement) then the min zoom level will be limited relative to the relative width of the engine window.
  • if the screen is narrower than 16/10 then the min zoom level will be limited relative to the relative height of the window. There is also a special consideration for the side menu, when it is turned off, the min zoom level will be further limited relative to the relative width of the game window.

The limit is put in place to prevent the render limit being reached when there are too many slabs(etc) on screen. (https://github.com/dkfans/keeperfx/issues/992#issuecomment-828755609)

Despite this limiting: furthest zoom out distance is in most cases no worse than master, often better, and only marginally worse in some edge cases (when "glitchy slabs" need to be hidden).

Reworks and improves on https://github.com/Loobinex/keeperfx-unofficial/pull/172

eddebaby avatar Apr 30 '21 06:04 eddebaby

I need to remove a debug message, and want to have a go at improving my draft of adjust_min_camera_zoom().

However, the current state of this PR is ready to test:

@Loobinex Please test for any "glitchy slabs"/disappearing boundboxes in busy levels. Test for "dungeon building stage with turtle strategy" and "large combat with typical dungeon size", or any types of real world scenarios with lots of rendering needs. I can tweak the zoom limiting if it needs to be a bit closer.


For the overall zoom level fix: Please test: 5:4 (1280x1024), 4:3 (640x480), 16:10 (640x480), 16:9 (1920x1080), 21:9 (1867x800)

You can compare default, max, and min zoom against:

  • master, for my old version of zoom limiting and scaling.
  • 0.4.7 to see kfx before my old work
  • DK GOG for 640x400 (kfx 0.4.7 should match this)
  • and D3D version for 640x480 (only original version to offer this resolution I believe)

NOTE: If you don't want to spend time checking many versions of game/resolutions - I can produce Photoshop overlays as proof. OR check a few and trust the rest are also correct ;)

If you want to disable the zoom limiting function, and just see the scaling fix (c2fc562), uncomment this line: https://github.com/dkfans/keeperfx/pull/1030/files#diff-7b01638cd3d1af70d668406cf83a18c841eb9143703a23ff1febf272e90e39ddR308


Other feedback also welcomed.

eddebaby avatar Apr 30 '21 07:04 eddebaby

The 1st Person perspective FOV is now HOR+, based on a vertical FOV of 68 (horizontal FOV 94) at 16:10 Original DK at 640x400: image

KeeperFX (as of 6ddfc7c) at 16:9: image

KeeperFX (as of 6ddfc7c) at 48:9: image

eddebaby avatar Apr 30 '21 14:04 eddebaby

That last one does not seem like 21:9, looks more like 21:4.

Loobinex avatar Apr 30 '21 14:04 Loobinex

Just tried this PR to see if the menu scaling issues I've encountered are still present, and they are. In Japanese 640x480, text is off-centre, and I can't properly see all the defined keys. 640x400 is awful; most of it is unreadable. Even English is barely readable in 640x400. It seems to me that the menu texts are relative to 640x480 rather than 640x400.

AdamPlenty avatar Jul 10 '21 17:07 AdamPlenty

Tested this, and read back. This issue is not ready to be merged, because the green lines below your cursor will disappear depending on angle and zoom level. This was not the case in the master.

Loobinex avatar Oct 28 '21 18:10 Loobinex

removed a debug message, and checked if the green line fix also fixed this issue, looks like it does, so marking it as ready for review

PieterVdc avatar Aug 14 '22 09:08 PieterVdc