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 keep stretch aspect by default (instead of ignore) #2701

Closed
Calinou opened this issue May 9, 2021 · 2 comments · Fixed by godotengine/godot#36872
Closed

Use the keep stretch aspect by default (instead of ignore) #2701

Calinou opened this issue May 9, 2021 · 2 comments · Fixed by godotengine/godot#36872

Comments

@Calinou
Copy link
Member

Calinou commented May 9, 2021

Describe the project you are working on

The Godot editor 🙂

Describe the problem or limitation you are having in your project

Some developers have trouble supporting multiple resolutions and aspect ratios, despite the documentation on the subject being fairly thorough.

Here's an example of this happening in the wild: https://www.gamingonlinux.com/2021/05/free-game-thursday-check-out-office-point-rescue-deja-vu-a-new-retro-fps/comment_id=202920

Unfortunately, it's quite common for Godot games not to support multiple aspect ratios, despite Godot's support being quite good for it. With the right UI node anchor configuration, 48:9 surround setups can even be supported!

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

By changing the default value from ignore to expand, developers have one less setting to change to get multiple resolution and aspect ratio support working.

The developer will still have to choose a stretch mode since expand does nothing if the stretch mode is disabled. Nonetheless, I consider expand to be a "better" default that suits more use cases. (Screen distortion is almost never desired.)

We might also consider also changing the default stretch mode to canvas_items (called 2d in 3.x), but that might be a bit much as it requires UI anchors to be defined to work as expected. You would also pretty much always need to have a Camera2D in your scene for 2D games, even if the camera never moves. This would likely complicate tutorials a bit.

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

Change the default setting of the stretch aspect project setting from ignore to expand.

Why not keep? keep adds black bars at the screen edges. While it is better than distorting the image, it is worse than providing proper support for multiple aspect ratios. Ultrawide monitors are not that rare among gamers nowadays, and some people also play games on 16:10 or 3:2 laptops occasionally. Don't assume everyone is using 16:9 🙂

Edit: In the end, we decided to go for keep as some games aren't designed to work well with multiple aspect ratios.

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 setting value and improving the out of the box developer experience.

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

See above.

@nobuyukinyuu
Copy link

I think keep is a more reasonable default – 2d games in particular are typically designed around one aspect ratio by default and it's not always a reasonable assumption that newbies design something in the area out of bounds for their particular aspect ratio, or worse, have part of their interface cut off.

@boukew99
Copy link

boukew99 commented Jun 1, 2021

We might also consider also changing the default stretch mode to canvas_items (called 2d in 3.x), but that might be a bit much as it requires UI anchors to be defined to work as expected. You would also pretty much always need to have a Camera2D in your scene for 2D games, even if the camera never moves. This would likely complicate tutorials a bit.

UI anchors are not a problem if you use keep, so newbies can switch to that for tutorials, right? And a having a Camera2D in a scene that never moves is not that bad in my opinion, because it centers around the origin (like most 2D scenes) and is useful for screen-shake and other camera effects. Disabled mode is more useful for editors in my experience.

@akien-mga akien-mga added this to the 4.0 milestone Sep 13, 2021
@Calinou Calinou changed the title Use the expand stretch aspect by default Use the keep stretch aspect by default (instead of ignore) Feb 9, 2022
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.

4 participants