Skip to content

Conversation

@xezon
Copy link

@xezon xezon commented Oct 26, 2025

Merge with Rebase

This change fixes and improves the map border camera constraint behavior to allow see all areas of the map comfortably.

The first commit refactors the code a bit to be more readable.

The second commit does a number of changes to implement the improved camera constraints behavior.

TODO

  • Test camera movement
  • Replicate in Generals

@xezon xezon added this to the Major bug fixes milestone Oct 26, 2025
@xezon xezon requested a review from Mauller October 26, 2025 17:28
@xezon xezon added Bug Something is not working right, typically is user facing Enhancement Is new feature or request Major Severity: Minor < Major < Critical < Blocker Gen Relates to Generals ZH Relates to Zero Hour labels Oct 26, 2025
@xezon xezon force-pushed the xezon/fix-camera-constraints branch from 600296d to 6eac2f4 Compare October 27, 2025 16:46
@xezon xezon force-pushed the xezon/fix-camera-constraints branch from 6eac2f4 to 47aeea4 Compare October 27, 2025 16:48
@Skyaero42
Copy link

This is how 3440 x 1440 looks like. This is not playable.

sshot009

@Mauller
Copy link

Mauller commented Oct 27, 2025

This is how 3440 x 1440 looks like. This is not playable.

sshot009

This PR is for fixing camera movement at the edge of the map, my camera height PR does the other stuff.

@Stubbjax
Copy link

Units can still hide at the bottom of the screen.

image

@szeplakib
Copy link

szeplakib commented Oct 28, 2025

@Stubbjax I think we shouldn't test it widescreen until the scale fix is merged

It worked perfectly for me (4:3 1280x1024) :

main:
main
xezon/fix-camera-constraints:
fix-camera-constraints

But I will give it a go with a unit at the bottom of the screen on the same map.

@szeplakib
Copy link

szeplakib commented Oct 28, 2025

Nah, you are right. One can still hide their units in some situations. Also I just figured that you pic is cropped and that is why it is so wide.

fix-camera-constraints_notgood

@xezon
Copy link
Author

xezon commented Oct 28, 2025

I looked into that and issue #1486 is responsible for this. It is related to m_groundLevel. It needs updating, but unfortunately it is more difficult than it seems because of the visual implications.


if (TheGlobalData->m_debugAI) {
offset = -1000; // push out the constraints so we can look at staging areas.
screen.y = 0.95f*getHeight()+m_originY;
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I wonder if this factor of 0.95 is causing some of the problems with the lower edge since it is reducing the calculated height with offset.

They don't seem to do this along the X of the screen.

@xezon xezon marked this pull request as draft November 4, 2025 07:28
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Bug Something is not working right, typically is user facing Enhancement Is new feature or request Gen Relates to Generals Major Severity: Minor < Major < Critical < Blocker ZH Relates to Zero Hour

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Camera does not scroll down far enough if centered on higher elevated terrain

5 participants