-
Notifications
You must be signed in to change notification settings - Fork 2k
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
Server enforcement for fog_distance (#13448) to block cheating #13643
Merged
Merged
Changes from 2 commits
Commits
Show all changes
3 commits
Select commit
Hold shift + click to select a range
File filter
Filter by extension
Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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.
I think the minimum is too high. A fog distance of 10 allows for really nice effects, but there could also be use cases for something like 2. The only value I really see no use for is 0.
I don't think we should define an artificial minimum here. Instead, we could just change this
into this
and call it a day. (Not only in the docs, but also in the implementation, of course.)
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.
The client won't allow less than 20.
minetest/src/client/game.cpp
Line 2513 in 25ef8f3
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.
The client won't allow the user to set a value below 20, but via the current
set_sky
API, you can set values below 20 and they will be applied. E.g. this works:And I think there's no good reason to disallow it.
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.
I do not feel strongly. The main part was to avoid was allowing setting this to 0 - which would not render anything.
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.
I'd like to get some consensus. I can change this to only disallow 0 as valid value.
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.
I don't see an issue with setting
fog_distance
even to 0. Why do we need a limit?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.
At 0 you see nothing. Even the wield item is not shaded correctly.
It's not just black (or fog color) it looks like a bug.
Actually: Can you try and see what you think (without this PR)?
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.
Some more testing reveals that for me, any
fog_distance
value below 1 results in only the fog color being visible, both with shaders and with the fixed pipeline. The value offog_start
doesn't seem to make any difference.All screenshots were taken from the same point of view. The first screenshot is always with shaders (
enable_shaders = true
) and the second with the fixed pipeline (enable_shaders = false
). The differences are probably (partially) due to the fact that tone mapping is enabled (tone_mapping = true
).fog_distance = 10
fog_distance = 1
fog_distance = 0.999999
fog_distance = 0.1
fog_distance = 0
So, something seems to break with values below 1.
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.
fog_distance
is an s16, that's why it's rounded.Not seeing anything bug fog is the intended behaviour for
fog_distance=0
, I'd say.And the wieldhand issues are not that severe, imo.
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.
Ok... Make this simpler :)
I'll post an update soon.