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

Improve the default size of 3D shapes and meshes (Box, Capsule, and Cylinder) #3732

Closed
aaronfranke opened this issue Dec 31, 2021 · 2 comments · Fixed by godotengine/godot#56365

Comments

@aaronfranke
Copy link
Member

aaronfranke commented Dec 31, 2021

Note: The PR that was merged is not quite what this proposal suggests. Instead, a capsule/cylinder radius of 0.5 and height of 2.0 was chosen.

Describe the project you are working on

This applies to any 3D game, especially ones with human or humanoid characters.

Describe the problem or limitation you are having in your project

The current default sizes for 3D shapes is a bit sub-optimal, and they almost always require tweaking.

Screen Shot 2021-12-30 at 4 25 16 PM

  • Box shapes currently have a default size of (2, 2, 2), which is a radius of 1. This means that if a node with a box is scaled by, for example, 7, then the box is 14 meters wide. It would make more sense to have a default size of (1, 1, 1) so that a scale of 7 means it's 7 meters wide.

  • Capsule shapes are commonly used for characters, but the current default size is far too big and too wide to use for a human-sized character (1m radius, 3m height). It would make more sense to have the default be smaller.

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

I propose changing the default sizes to be more suitable. Boxes would have a default size of (1, 1, 1), and capsules/cylinders would have a default size of 0.25m radius and 1.75m height. It would look like this:

Screen Shot 2021-12-30 at 3 30 39 PM

For reference, I looked at GDQuest's 3D mannequin model. This model is a great reference since its size is average human size. The example project for the model has a capsule with the exact dimensions proposed:

Screen Shot 2021-12-30 at 3 16 47 PM

Here's a comparison with both the old and new sizes right next to each other, so you can see how comically large the current defaults are if you tried to use them for a character controller (well, unless this is your character):

Screen Shot 2021-12-30 at 3 40 19 PM

The specific values of 0.25 and 1.75 are also nice because they are exact floats while being easy to remember/write.

The Y position would need to be set to 0.875 to put the bottom of the capsule at Y = 0.

If desired we could change these values to something else. 0.5 and 2.0 would be simpler and still better than 1.0 and 3.0, but I think 0.25 and 1.75 are much nicer values since they are very close to the size of an average human. Average human height is 1.74 meters, so 1.75 is extremely close to that amount.

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

Branch: https://github.com/aaronfranke/godot/tree/default-shape-size

PR: godotengine/godot#56365

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

Yes, it can be easily worked around without using any script. Also, even with improved defaults, the sizes will have to be adjusted in many cases because not all characters are the same, but hopefully with improved defaults the sizes will need to be adjusted less often and adjusted a smaller amount.

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

These are defaults for shape already in the core engine, so it's already core.

@Calinou
Copy link
Member

Calinou commented Dec 31, 2021

Should these changes also be applied to CSG nodes for consistency? I'd personally prefer CSG nodes to be as consistent as possible with their PrimitiveMesh counterparts (see godotengine/godot#49729).

@aaronfranke
Copy link
Member Author

aaronfranke commented Dec 31, 2021

@Calinou Yes, I think so. While CSG nodes are unlikely to be used for character controllers, they'd also probably have to be adjusted for every situation and there isn't one commonly-useful size (ex: how human size is commonly-useful for non-CSG capsule shapes), so the default size doesn't matter much. Therefore it would make sense to me to keep the CSG sizes in sync with the primitive changes proposed here.

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