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

Increase max objects per block defaults #12055

Merged

Conversation

appgurueu
Copy link
Contributor

@appgurueu appgurueu commented Feb 5, 2022

Minetest will currently delete all items in a mapblock if this max value is exceeded. This means it should only deal with the most pathological cases where the game & user otherwise could hardly recover from instead of happily deleting clusters of user-dropped items (and even those should probably be dealt with manually using clearobjects). The previous defaults of 64 on desktop and 20 on mobile were definitely way too low. I increased both to 256=16x16 (a full 16² plane filled with dropped items) and removed the distinction so that playtesting on desktop with default settings yields similar results to playing on mobile.

@appgurueu appgurueu force-pushed the increase-max-objects-per-block-defaults branch from 98f1bd8 to 68be9e6 Compare February 5, 2022 11:57
@lhofhansl lhofhansl self-requested a review February 5, 2022 18:16
Copy link
Contributor

@lhofhansl lhofhansl left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Big +1. I have had these changed to 256 for years locally.

@sorcerykid
Copy link
Contributor

Shouldn't it be almost unrestricted in singleplayer? I believe the limitation is mostly in place to prevent abuse on servers, but what users wish to do with their own local maps is much less of concern. Is there any way to have a different default value depending on whether the game is in singleplayer or not?

@appgurueu
Copy link
Contributor Author

I believe the limitation is mostly in place to prevent abuse on servers, but what users wish to do with their own local maps is much less of concern.

Using the current implementation, griefers can force deletion of foreign entities in a mapblock by just spamming their own, which is trivial (just dropping items which don't merge, for example).

@sorcerykid
Copy link
Contributor

That didn't answer my question, about why there should be any restriction for singleplayer.

Also a strong argument could be made that the way it should work is that entities with the longer lifetime have lower priority during the removal of excess entities. This would essentially prevent the issue that you are describing in a much more reasonable and effective way than messing around with the default max objects per block.

@appgurueu
Copy link
Contributor Author

That didn't answer my question, about why there should be any restriction for singleplayer.

To prevent players making their worlds unusable by spamming entities, I guess... I wouldn't have an issue with completely removing it though.

Also a strong argument could be made that the way it should work is that entities with the longer lifetime have lower priority during the removal of excess entities.

Sounds reasonable, but out of scope for this PR, which aims to be trivial. In the end mods should be able to have the final say on when their entities get removed. "Spawn rate limiting" should also be implemented by mods.

This would essentially prevent the issue that you are describing in a much more reasonable and effective way than messing around with the default max objects per block.

This PR doesn't exist as a mitigation for this abuse - it's sole purpose is a sane default value for the limitation as to prevent players (especially on Android) accidentally running into it. Whether the mechanism of just deleting entities should be changed (IMO it definitely should be) is up to a different PR.

@lhofhansl
Copy link
Contributor

@sorcerykid I think we just need to find a good default. A savvy admin or even singleplayer person can change it.
Maybe down the road we can devise other ways to protect the server, perhaps an overall visible entity limit or something.

@sfan5 sfan5 merged commit ad1da99 into minetest:master Feb 8, 2022
LoneWolfHT pushed a commit to LoneWolfHT/minetest that referenced this pull request Mar 17, 2022
@appgurueu appgurueu deleted the increase-max-objects-per-block-defaults branch March 31, 2024 18:43
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants