Skip to content

Increase camera height for wider aspect ratios #480

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Conversation

valeronm
Copy link

@valeronm valeronm commented Mar 22, 2025

The game doesn't support wide screens well because it has static horizontal field of view (FOV) and static maximum camera height. This means that for every resolution, the camera shows the same horizontal amount of terrain, but the vertical field of view becomes narrower for wider resolutions. So on wide screens, we get a center crop of what is visible on 4:3 resolutions (screenshots below).
To get vertical FOV similar to what's visible on 4:3 screens, we need to move the camera further from terrain or change the FOV of the camera. Ability to manipulate FOV of the camera only available in the DEBUG and INTERNAL builds, so changing camera height is more straightforward and this is how GenTool already supports wide resolutions based on #78.

Changes

Screenshots

1600 x 1200 - 4:3 field of view
1600 x 900 - 16:9 field of view (the same camera height as in 4:3)
1600 x 900 - 16:9 field of view (adjusted camera height)

Fixes #78
Depends on #460 to make wide resolutions selectable

@valeronm valeronm force-pushed the increase_camera_height_for_wide_screens branch from a95f06e to bf11d24 Compare March 22, 2025 12:40
@valeronm valeronm marked this pull request as ready for review March 22, 2025 12:41
@DevGeniusCode DevGeniusCode added Bug Something is not working right Critical Severity: Minor < Major < Critical < Blocker Generals Related Generals only ZeroHour Relates to Zero Hour labels Mar 22, 2025
@OmniBlade
Copy link

Why do you think changing the FOV only available in DEBUG/INTERNAL builds? We can make any changes we want anywhere in the code including making changing the FOV accessible when setting/changing resolution. I'd argue that setting the correct FOV and leaving the camera height controls alone is the more correct fix for this.

@bobtista
Copy link

Agreed with OmniBlade. Also are Bug and Critical the correct labels here?

@tintinhamans tintinhamans added Enhancement Is new feature or request Major Severity: Minor < Major < Critical < Blocker and removed Bug Something is not working right Critical Severity: Minor < Major < Critical < Blocker labels Mar 24, 2025
@NGMZero
Copy link

NGMZero commented Mar 24, 2025

I think the camera height need to increase and be fixed for all aspect ratios. this helps give the game a more modern feel, without feeling too close to the terrain. this game was made when monitors were around 800x600 ~ 1024×768 and limited graphics processing. most people are using a FHD 1920x1080 resolution now according to Steam's hardware survey.

and whatever magic with FOV thing to make the game fair between different screen ratio (I know at least Dota 2 do it, I do not know how it work). 4:3 should get more vertical view, while 16:9 get more horizontal one.

@valeronm
Copy link
Author

Why do you think changing the FOV only available in DEBUG/INTERNAL builds? We can make any changes we want anywhere in the code including making changing the FOV accessible when setting/changing resolution.

Yes, we can control FOV now with the code available. I just meant that for some reason developers created m_FOV field on VIew class and even created setFieldOfView method to change it but for some reason they decided to pass it to the camera only in DEBUG/INTERNAL builds. Not sure about what was the reason for this.

I'd argue that setting the correct FOV and leaving the camera height controls alone is the more correct fix for this.

I can experiment with changeing FOV instead of camera height. The height manipulation is just already working solution and was alreddy accepted by everyone using GenTool.

@valeronm
Copy link
Author

The code will not solve the problem for portrait screen orientations and also for screens wider than 16:9, so closing this for now, and I'll try to make another PR using FOV adjustments.

@valeronm valeronm closed this Mar 24, 2025
@valeronm valeronm deleted the increase_camera_height_for_wide_screens branch March 27, 2025 15:42
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Enhancement Is new feature or request Generals Related Generals only Major Severity: Minor < Major < Critical < Blocker ZeroHour Relates to Zero Hour
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Camera height does not scale properly along with aspect ratio of game resolution
6 participants