Skip to content

Conversation

@valeronm
Copy link

@valeronm valeronm commented Mar 20, 2025

The game only allows select resolutions with 4:3 aspect ratio and the logic between Generals and Generals ZH is slightly different. With these changes, it's possible to select all supported by display resolutions.

Changes:

  • Extracted duplicated logic for filtering resolutions from W3DDisplay::getDisplayModeCount and W3DDisplay::getDisplayModeDescription into single function isResolutionSupported;
  • Allowed all aspect ratios between instead of fixed 4:3;
  • Applied the same logic for Generals and Generals ZH.

Screenshot

image

Fixes #72

@DevGeniusCode DevGeniusCode added Bug Something is not working right, typically is user facing Critical Severity: Minor < Major < Critical < Blocker Gen Relates to Generals ZH Relates to Zero Hour labels Mar 20, 2025
@DevGeniusCode
Copy link

Great job! I had a chance to review your work and noticed this commit valeronm@d597b7f . I was wondering if it addresses the issue mentioned below. If so, would you be want to submitting another PR?

@valeronm
Copy link
Author

I was wondering if it addresses the issue mentioned below. If so, would you be want to submitting another PR?

Yes, definitely. The commit just combines the code from #78 with some hacks around control bar. I'm going to submit separate PRs for these changes.

@tintinhamans
Copy link

Any reason why are not supporting 21:9, 32:9?

@HossamAbubakr
Copy link

As 16:10 displays are beginning to get a lot more common on premium laptops, is there any chance to allow that as well?
ex: 2560x1600, 1920x1200 etc

Copy link

@xezon xezon left a comment

Choose a reason for hiding this comment

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

Nice, thank you.

@xezon
Copy link

xezon commented Mar 20, 2025

Are you sure this fixes #453 ?

To test it, you need to go to Options.ini in MyDocuments, set an uncommon resolution, launch game in windowed mode, and then reproduce 453.

@valeronm
Copy link
Author

valeronm commented Mar 20, 2025

Any reason why are not supporting 21:9, 32:9?

It's easy to change or remove the check for aspect ratio, and I just used the aspect ratios described in #72 as a baseline for the PR. Will be happy to change it to any values. There is also an issue with fixed FOV of 50° in the game, which effectively zooms everything on resolutions wider than 4:3, so even on 16:9 we can see less than on 4:3, and I imagine that on 32:9 we'll see only several units until #78 will be fixed.

As 16:10 displays are beginning to get a lot more common on premium laptops, is there any chance to allow that as well?
ex: 2560x1600, 1920x1200 etc

16:10 is already supported by the code. It covers all resolutions between 5:4 (aspect ratio 1.25) and 16:9 (aspect ratio 1.778), so 16:10 (1.6) and 3:2 (1.5) are also supported.

Are you sure this fixes #453 ?

To test it, you need to go to Options.ini in MyDocuments, set an uncommon resolution, launch game in windowed mode, and then reproduce 453.

I'm sure that this code doesn't support custom resolutions specified directly in options.ini. But I see that in #453 GenTool prevents overriding standard resolution (1920 x 1080), while in VS6 it's reset to the first available 4:3 resolution just because the game doesn't see 1920 x 1080 as an option. With this change, the problem will be resolved because 1920 x 1080 will be available and selected in the list of resolutions.

@sorcerer86pt
Copy link

ok, resolutions appear:

Command   Conquer - Generals Screenshot 2025 03 21 - 19 43 08 36

And changing to those resolutions work as intended. But if we change the resolution to a invalid one manually (like described on #453 ) the game crashes on launch with error :

forcing_bad_size

Screenshot 2025-03-21 194522

@valeronm
Copy link
Author

I think that supporting non-standard resolutions should be done separately. One reason for that - non-standard resolutions will work only in windowed mode, so there should be conditional logic to differently work in full screen and windowed mode. If we think that #453 is about non-standard one, then it's better to unlink this PR from the ticket. This PR is only about extending the aspect ratio filter implemented in the game to support a wider range of resolutions.

@tintinhamans
Copy link

I think supporting all resolutions supported by the display device should be there. Arbitrarily restricting the aspect ratio will cause issues for people who have for example this monitor: LG DualUp

@xezon
Copy link

xezon commented Mar 21, 2025

I think that supporting non-standard resolutions should be done separately.

Yes. If that is a bug of the retail game.

I prefer to keep changes small, and this change has perfect size and scope.

If the custom resolution issue can be addressed separately from this change, then that can be done in a separate pull request.

@DevGeniusCode
Copy link

Is it necessary to add a yaml file with these fixes? As they affect the user experience, even though users hardly remember this bug since it was fixed in gentool :-)

@xezon
Copy link

xezon commented Mar 21, 2025

Yes this change is user facing and will need to be documented, but Vitex is still working on the change log pipeline. We are not submitting these kind of changes yet, not until the foundation is done.

@valeronm valeronm force-pushed the allow_select_widescreen_resolutions branch from 9ff7433 to 56e614b Compare March 26, 2025 18:35
@valeronm valeronm changed the title Support resolutions with aspect ratios different from 4:3 Allow selecting resolutions with aspect ratios different from 4:3 Mar 26, 2025
@valeronm valeronm changed the title Allow selecting resolutions with aspect ratios different from 4:3 [GEN/ZH] Allow selecting resolutions with aspect ratios different from 4:3 Mar 26, 2025
@valeronm valeronm changed the title [GEN/ZH] Allow selecting resolutions with aspect ratios different from 4:3 [GEN][ZH] Allow selecting resolutions with aspect ratios different from 4:3 Mar 27, 2025
@valeronm valeronm force-pushed the allow_select_widescreen_resolutions branch from 56e614b to 56509dd Compare March 29, 2025 23:51
valeronm added a commit to valeronm/GeneralsGameCode that referenced this pull request Apr 17, 2025
@valeronm valeronm force-pushed the allow_select_widescreen_resolutions branch from 56509dd to 46665b2 Compare April 17, 2025 08:11
@barefootlogician
Copy link
Collaborator

Yes this change is user facing and will need to be documented, but Vitex is still working on the change log pipeline. We are not submitting these kind of changes yet, not until the foundation is done.

Can we atleast have these enabled for vs22 debug and internal builds? It makes it easier to test other things especially on resolutions that users would be likely to actually play on.

@barefootlogician
Copy link
Collaborator

I thought about the advantage aspect and one possible solution could be to make the total viewing area fixed. This would be more work but alternatively we could have the ultrawide use 16:9 for the view but utilize the extra space for things like the mini-map, chart, superpower shortcuts, etc

Since FOV should be restricted on multiplayer (although I think that should be an match option but enabled at default), why not add multiplayer related panels? Things like chat logs or player lists can be added to fill those spaces.

That's kinda what I meant when I said we could "utilize the extra space for things like the mini-map, chart, superpower shortcut".

However, that's a lot of work so I think the best option is to use the full screen for the viewport but balance it by having the zoom level be adjusted accordingly so that the total visible area of the map is the same for all aspect ratios.

Or we could just allow people to set whatever Max zoom they want in the ini file and still be allowed to play multiplayer. Since map shrouding is a thing, past a certain point, zooming out doesn't benefit that much.

@barefootlogician
Copy link
Collaborator

I think we can decide how much to adjust the zoom levels for different aspect ratios in a follow up pr and should just merge this for now with all aspect ratios allowed.

@xezon
Copy link

xezon commented Jun 8, 2025

Is it possible that you choose a 16:9 resolution on a wide-screen and get black-bars rather then a stretched view?

Do you mean black bars left and right in the game window, to fit max 16:9?

@Skyaero42
Copy link

Is it possible that you choose a 16:9 resolution on a wide-screen and get black-bars rather then a stretched view?

Do you mean black bars left and right in the game window, to fit max 16:9?

Correct

@xezon
Copy link

xezon commented Jun 8, 2025

Can you draft a change that implements this so we can test that?

@barefootlogician
Copy link
Collaborator

Can you draft a change that implements this so we can test that?

Can whom implement what?

@xezon
Copy link

xezon commented Jun 9, 2025

This: "Is it possible that you choose a 16:9 resolution on a wide-screen and get black-bars rather then a stretched view?"

@xezon
Copy link

xezon commented Jun 29, 2025

@valeronm Can you please resolve the merge conflicts?

@xezon xezon changed the title [GEN][ZH] Allow selecting resolutions with aspect ratios different from 4:3 [GEN][ZH] Enable resolutions with aspect ratios different from 4:3 in Options Menu Jun 29, 2025
@xezon xezon added Design Is a matter of game design Enhancement Is new feature or request GUI For graphical user interface Major Severity: Minor < Major < Critical < Blocker and removed Bug Something is not working right, typically is user facing Critical Severity: Minor < Major < Critical < Blocker labels Jun 29, 2025
@valeronm valeronm force-pushed the allow_select_widescreen_resolutions branch from 46665b2 to 8a357a6 Compare June 29, 2025 09:56
@valeronm valeronm force-pushed the allow_select_widescreen_resolutions branch from f7c9c4c to 34478fe Compare June 30, 2025 21:08
Copy link

@xezon xezon left a comment

Choose a reason for hiding this comment

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

Code looks good.

@xezon xezon added this to the Important features milestone Jun 30, 2025
@xezon xezon merged commit 762b7af into TheSuperHackers:main Jun 30, 2025
14 checks passed
@valeronm valeronm deleted the allow_select_widescreen_resolutions branch June 30, 2025 22:02
fbraz3 pushed a commit to fbraz3/GeneralsX that referenced this pull request Nov 10, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Design Is a matter of game design Enhancement Is new feature or request Gen Relates to Generals GUI For graphical user interface Major Severity: Minor < Major < Critical < Blocker ZH Relates to Zero Hour

Projects

None yet

Development

Successfully merging this pull request may close these issues.

In-Game options change resets resolution to 800x600 and crashes the game Options menu lists resolutions of 4:3 only