Skip to content
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

Use the canvas_items (formerly 2d) stretch mode by default in new projects (instead of disabled) #3939

Open
Calinou opened this issue Feb 9, 2022 · 2 comments

Comments

@Calinou
Copy link
Member

Calinou commented Feb 9, 2022

Related to #2701.

Describe the project you are working on

The Godot editor 🙂

Describe the problem or limitation you are having in your project

With hiDPI support now being enabled by default, supporting multiple resolutions in exported projects is more important than ever.

However, Godot currently uses the disabled stretch mode by default. This is a good approach for applications which should not scale automatically as the window is resized, but it falls short for games as UI elements can quickly become too small. This can harm the gameplay experience (and accessibility) as important information should always be displayed at a readable size.

Scaling 2D elements according to resolution is an approach that works well to support hiDPI displays, since it will result in larger 2D elements at higher resolutions. This is also useful for 3D games to ensure HUD elements always remain readable.

It should also be kept in mind that display resolutions are something that continuously evolves over time. 4K monitors are becoming more and more common, and 5K/6K/8K will likely follow the same steps in a few years' time. It's usually not possible for a developer to account for all those resolutions in advance.
If you've played an old game on a modern display at native resolution, you probably know that the stretch mode chosen by the developer makes all the difference between a playable game at high resolutions and a borderline unplayable experience.1

Describe the feature / enhancement and how it helps to overcome the problem or limitation

Use the canvas_items stretch mode by default. This is the stretch mode that works best for non-pixel art games in general (and even many pixel art games, provided texture filtering is disabled).

Since most people are using Godot to develop games (rather than applications), it makes sense to use a stretch mode that works best for games by default. Another upside of the canvas_items stretch mode is that it levels the playing field in 2D competitive games, as people are more likely to get the same screen real estate regardless of their screen resolution.

Note that I would recommend changing the default window size to be 16:9 as well: godotengine/godot#55032
Otherwise, there will be black bars when playing in fullscreen on a 16:9 monitors in a project that uses the current default resolution (1024×600, which is not 16:9).

Describe how your proposal will work, with code, pseudo-code, mock-ups, and/or diagrams

Replace "disabled" with "canvas_items" here: https://github.com/godotengine/godot/blob/f91e5bad8ce2ae30834e0f46be644dbc1d9daf10/main/main.cpp#L2347

This change would only be applied to Godot 4.0, not Godot 3.x.

If this enhancement will not be used often, can it be worked around with a few lines of script?

No, as this is about changing a default engine setting.

Is there a reason why this should be core and not an add-on in the asset library?

This is about changing a default engine setting to improve the experience of developers and players alike.

Footnotes

  1. And this is "only" 1440p, not even 4K 🙂

@Calinou Calinou added this to the 4.0 milestone Feb 9, 2022
@Calinou Calinou changed the title Use the 2d stretch mode by default (instead of disabled) Use the canvas_items (formerly 2d) stretch mode by default (instead of disabled) Feb 13, 2022
@Calinou Calinou added the breaks compat Proposal will inevitably break compatibility label May 10, 2022
@lesleyrs
Copy link

Godot 4 has some issues with canvas_items that have to be dealt with first: godotengine/godot#70450

The post is about html5 but I mention there it also happens on windows.

@Calinou Calinou changed the title Use the canvas_items (formerly 2d) stretch mode by default (instead of disabled) Use the canvas_items (formerly 2d) stretch mode by default in new projects (instead of disabled) Dec 27, 2022
@Calinou Calinou modified the milestones: 4.0, 4.x Dec 27, 2022
@Calinou Calinou removed the breaks compat Proposal will inevitably break compatibility label Dec 27, 2022
@Calinou
Copy link
Member Author

Calinou commented Dec 27, 2022

Since 4.0 is in feature freeze, we are now avoiding compatibility-breaking changes. As a result, if this proposal is accepted, it should be applied to new projects only by modifying the generated project.godot file when creating a project using the project manager (similar to #4834).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants