Stop the game rescaling when the window is resized #34
Labels
No labels
assets
bug
duplicate
enhancement
help wanted
invalid
question
testing
ui
wontfix
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
liamjd/UntitledColonyBuilder#34
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
There should be a minium resolution and hence minimum window size.
When the window is enlarged, simply show more of the game world. Don't rescale the entire UI and terrain drawing.
Not a bug: the symptom was the editor's embedded Game view
Closing this. The rescaling and the blank space around the game were an artifact
of how the game was being launched, not of the game itself.
The editor's Game view had defaulted to a fixed 1920x1080 embed, so on a
3440x1440 ultrawide the game was drawn at a fixed size inside a much larger
panel, leaving blank space around it. Switching that setting to Stretch to Fit
fills the window as expected.
Two independent confirmations that the game itself is fine:
-srun, and none of them ever reproduced the symptom - which inhindsight was the tell that we were looking at different things.
than embedded) gives the same correct behaviour as the
-sruns.What was measured on the way
A throwaway harness loaded the real
game.tscn, resized the window at runtimeand shot each size, printing the camera and viewport state. Standalone, no editor:
cam.sizeCamera3DisKEEP_HEIGHTandCameraRig._apply_zoom()setssize = zoom, sothe vertical world span is pinned at 60 m regardless of window size, and the
horizontal span is
60 * aspect. That means viewport height determines scaleand viewport width determines coverage.
That behaviour is a design choice rather than a defect, and it is being left as
is. "Enlarging the window shows more world" would require
sizeto scale withviewport pixel height - worth revisiting only if the fixed-world-span behaviour
actually becomes annoying in play.
Loose ends found while investigating
These are unrelated to this ticket and are not fixed by closing it:
MainMenuanchors collapse ingame.tscn. The instance overrides thescene's
anchors_preset = 15with= 8and supplies no offsets, so everyfull-rect Control inside it resolves to zero size. Measured at 1920x1080:
The menu only looks right because a zero-size Control at screen centre puts
a +/-90-offset child where a full-rect parent would.
main_menu.gd:39asserts"The scrim blocks the mouse but not Tab", which the geometry says is not true
today - needs a manual click-through test to confirm. Fix is deleting the
override.
CameraRig.max_zoomhas a stale comment. It justifies 120 as "far enoughout to frame the whole map", derived at 16:9. At 2.389 aspect it yields
287 m of visible width against a 128 m map. The value is fine; the reasoning
in the comment is not.
View extends past the map edge above ~2.13:1 aspect.
visible width = zoom * aspect > 128 mwhenaspect > 2.133, so 21:9 and wider see sky andthe map's cut face at the edges.
_clamp_to_map()bounds the focus point viaedge_margin, a world-space constant that knows nothing about aspect. Judgedcosmetic and acceptable for now.
min_sizedoes not apply on the main menu.get_window().min_sizeis setin
game.gd._ready(), butrun/main_sceneismain_menu.tscnandgame.tscnonly loads on New Game (main_menu.gd:115), so the window isunconstrained until a game starts.
GameStatewould apply it from launch.window/stretch/modeis currently unset (disabled) in the working tree,changed during this investigation. Its effect was never measured against the
previous
canvas_itemsvalue. At 3440x1440disabledleaves the buildingpanel at ~330 px, about 9% of screen width;
canvas_itemswould have scaledit up. Whether that change is an improvement is undecided, and a
player-facing UI scale (
Window.content_scale_factor) is probably the realanswer - see #21.
Not a bug - editor Game view was set to a fixed 1920x1080 embed. Standalone runs (-s harness, and launching from Rider) behave correctly. See the comment above for measurements and the unrelated loose ends found on the way.