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
Add many limits to settingtypes #11463
Conversation
Fixes #8979. |
This won't fix the underlying problem though. These limits should primary applied on engine-side. |
I know. That's not the goal here anyway. Consider it as some kind of documentation and/or first step. As for the engine side, I think it makes sense mostly for those values for which I have determined breakage. |
Are the limits in settingtypes.txt not enforced? |
Some are |
I have used 3d_paralax_strength of 0.1 with good effect. (with anaglyph) |
@lhofhansl: Look exactly downwards or upwards. Camera starts shaking. |
(rebase needed) |
9b0eb75
to
075a153
Compare
Rebase done! |
075a153
to
8a2c08a
Compare
Rebase done! |
( @Wuzzy2 you're a triager as well, please remove the label by yourself next time. Same for "Adoption needed" in the other PR you've just closed) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Better than nothing. I'll work on the C++ side to ensure the limits are actually enforced.
@rubenwardy: Done. |
This PR adds the missing upper and lower limits to many settings (int and float) in
settingtypes.txt
. Now I will describe how I came up with those limits:mouse_sensitivity
: Above 10 it's very fast and hard to control, it is close to being unplayable. At 100 (current limit in source code) it's completely unplayable.cloud_radius
: Serious render bugs start to occur above ca. 65. Clouds disappear completely, error message in console: "Too many vertices for 16bit index type, render artifacts may occur.". Note this is not the same as the "sharp cutoff" as stated in the description3d_paralax_strength
: Beyond -0.087 or 0.087, the camera goes wild at certain or all view angles, making it unplayablehud_scale
: HUD is de facto unusable below 0.1gui_scale
: Below 0.5 it becomes too hard to use (tested at multiple resolutions, big and small)font_size
(and similar): 5pt is the smallest size in the default font at which I still can make out letters, barely. At 4pt, it's just a pixel mush. At 1000pt or above, Minetest crashes. At 72pt, the interface starts to break down (Minetest clearly isn't made for large fonts)view_bobbing_amount
: Above 56 the effect is so strong, the camera moves below the ground. Above 16, the camera often moves into the left or right wall when you walk on the center of the nodemovement_liquid_fluidity
: Can't be safely 0 like the othermovement_
settings because of a division by 0 and you'd get teleported to (-nan, -nan, -nan) if you touch any liquid.chunk_size
: The description says there is no reason or benefit for this to be above 5, so 5 is the upper limit then.The overal idea here is, when a (previously permitted) value causes crashes, render bugs, or similar, it must be moved out of the allowed range. And then apply somewhat of a buffer as a "safe zone", just in case.
As for performance, I generally used the maximum value of the C++ data type because those values might work in theory if you have strong enough hardware.
I also made minor changes to the setting descriptions, usually for mentioning the missing unit (milliseconds or seconds).
To do
This PR is ready for review.
How to test
First, just read the changeset and my justifications above and think whether the new number makes sense.
Especially complain if you think a range is too small and there are reasonable values beyond the range I chose.
Also complain if you think that any in-range value might lead to errors, crashes, etc.
Then, check if the All Settings menu still behaves properly.