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

[CSM] Add fuzzy get_used_nodes #6111

Closed
benrob0329 opened this issue Jul 9, 2017 · 19 comments

Comments

Projects
None yet
5 participants
@benrob0329
Copy link

commented Jul 9, 2017

Right now, CSM mods can pinpoint the location of nodes rather easily. My suggestion is to instead have a fuzzy get_used_nodes function which returns a table of nodes within a radius/mapblock.

used_nodes = {"air", "default:dirt", "default:tree"} in the order of use.

The beauty of this approach is that the larger the area, the less it can be used for cheating, as clients never get the location of the node (outside of C++, which is a problem now anyways).

@raymoo

This comment has been minimized.

Copy link
Contributor

commented Jul 9, 2017

You could still find the positions in time O(m*log r), where m = number of sought nodes and r = searched radius, by narrowing down the positions with smaller areas. This is better than the time it would take (order of r^3) examining each node individually.

@raymoo

This comment has been minimized.

Copy link
Contributor

commented Jul 9, 2017

Though if you can only search centered around the player, or at mapblock resolution, it wouldn't be possible to do it.

EDIT: However, if something is rare enough to only be found in one out of many mapblocks, this fuzzy search would still be a problem.

@benrob0329

This comment has been minimized.

Copy link
Author

commented Jul 10, 2017

While it could tell you whether a rare material is within a rather large area, it would still only see things close by, and to a more fuzzy extent the larger the radius. While it may not be as perfect as raytracing all visible blocks, it is certainly a heck of a lot better than current behavior.

@raymoo

This comment has been minimized.

Copy link
Contributor

commented Jul 10, 2017

Yes, I guess it would still make it harder / take longer to find the nodes.

I think used_nodes though should contain the counts of nodes to be useful. For example, an ambience mod should only trigger ocean sounds if there is lots of water nearby.

@paramat

This comment has been minimized.

Copy link
Member

commented Jul 10, 2017

The node getters are still needed, and will be restricted by server soon, so are no problem.
This suggestion still allows cheating as it shows you what is in a given volume, so by subdividing you can get the rough location of something valuable.
Restricion by range is irrelevant, detecting a hidden node 2 node away is still cheating.
So i see no point having this.

@raymoo

This comment has been minimized.

Copy link
Contributor

commented Jul 10, 2017

@paramat I thought @benrob0329 was implying that searches would be centered on the player, which would mean you couldn't subdivide without moving the player around. I don't see a problem of having this as a separate restrictable thing along with more precise node-getting, because the server could allow this but not the more precise one, allowing some potential for cheating but not the whole deal.

My overall position is still that the API for client-provided clientmods should not include anything (restrictable or otherwise) that could be used for cheating, though.

@benrob0329

This comment has been minimized.

Copy link
Author

commented Jul 10, 2017

@paramat No, this does not allow subdividing.

The whole point of this is to not need range restriction. Detecting something rare in a larger radius is less useful than a small one. (The range is not set by the client, unless calculations are done client side, in which case it would be set in C++) However even a small range is not all that useful, as the player would have to literally be standing close to the rare node, and still has to find the exact position of it. But as I said, this would require an engine change to do so, and the only way to fix that is to have the server do the calculation.

I am assuming that by restricted by the server, you mean turned off entirely, which does not solve the base issue.

@raymoo

This comment has been minimized.

Copy link
Contributor

commented Jul 10, 2017

You could use the small-range search to detect nearby traps

@benrob0329

This comment has been minimized.

Copy link
Author

commented Jul 10, 2017

You could, but only if the range was small. If the range was large, its not all that useful. (Or perhaps the range is set by the server, and could be used for a tool which does that)

@paramat

This comment has been minimized.

Copy link
Member

commented Jul 10, 2017

Ok, i did read the comments and none stated this was centred on the player, "it would still only see things close by" does not necessarily mean centred on the player.
I did not imply this had a subdividing feature, just that it could be used repeatedly in that way.

returns a table of nodes within a radius/mapblock.

You did not state the radius is set by the server, a 'radius' implies one set by the clientmod.

However even a small range is not all that useful, as the player would have to literally be standing close to the rare node, and still has to find the exact position of it.

Still a cheat though, you know when something is nearby, and just have to dig around to find it.

I am assuming that by restricted by the server, you mean turned off entirely, which does not solve the base issue.

Yes it obviously does, if a node getter is disabled cheating is avoided, and it is the only certain way of avoiding cheating.

@benrob0329

This comment has been minimized.

Copy link
Author

commented Jul 10, 2017

Disabling walking also prevents cheating, and disabling digging does as well.

If having a small radius allows cheating, then don't have a small radius. This is a much better alternative to node getters that still provides context awareness whilst limiting the ability to use it for cheating a heck of a lot more than other things that made it into CSM.

I guarantee you that most servers will disable node getters, and why shouldn't they? Its a given that they can be used for cheating. This would at least allow ambiance mods and the like to have something, and give server owners a chance at not completely disabling CSM.

@sfan5

This comment has been minimized.

Copy link
Member

commented Jul 11, 2017

👎
Does not help a lot against cheating and extreme reduces usefulness of CSM.

@benrob0329

This comment has been minimized.

Copy link
Author

commented Jul 11, 2017

How does this not help against cheating? The very concept of the idea is that a larger range reduces the usefulness for cheaters.

And yes, this is useful for mods which need some context about the area surrounding the player (such as ambiance mods). If you would like to use node getters, we shall see how many are still enabled on servers.

@paramat

This comment has been minimized.

Copy link
Member

commented Jul 12, 2017

If having a small radius allows cheating, then don't have a small radius.

My point is all radii allow cheating, a radius large enough to be useless for cheating would also be useless for genuine uses.

I guarantee you that most servers will disable node getters,

Yes, which is why it seems pointless adding soft limits such as radius / line of sight limits for node getters. Any soft limit allows cheating, so i suspect all servers concerned about cheating will disable node getters completely using CSM flavours, any servers not concerned about cheating (private, whitelisted, LAN, singleplayer) will not need soft limits.

Ambience mods will use 'get heat / humidity / biome at pos' which i will add before 0.5.
I'm unconvinced this is useful as an addition to CSM, and i oppose replacing node getters with this, as they are essential for other uses, for example in server-provided CSM mods.
👎

@benrob0329

This comment has been minimized.

Copy link
Author

commented Jul 12, 2017

Yes, which is why it seems pointless adding soft limits such as radius / line of sight limits for node getters. Any soft limit allows cheating

This is not just a soft limit, this is a whole 'nother way of looking at the problem which removes the main problem with node getters (The ability to pinpoint rare node locations)

Ambience mods will use 'get heat / humidity / biome at pos' which i will add before 0.5.

No, no, and no. These are good for some context about the area, but a shop should certainly not have jungle music unless it was built with jungle wood, and a factory should not have Sahara music.

@paramat

This comment has been minimized.

Copy link
Member

commented Jul 12, 2017

Yes, by ambience mod i mean a biome-dependent one.

@benrob0329

This comment has been minimized.

Copy link
Author

commented Jul 12, 2017

By ambiance mod, I mean an every dependant one. Music needs to be done right, and having the same music throughout the whole biom with no context awareness simply isn't right.

In fact, one of the reasons I suggested using maplocks was because buildings could be built on one, to force the music to update when someone enters a shop. To rob the game of further context awareness (and by extention, immersion) would be wrong.

Maybe this doesn't replace node getters, but its better than not having anything at all on most servers.

@paramat

This comment has been minimized.

Copy link
Member

commented Sep 8, 2017

Any server concerned about 'get node' will very likely not allow 'fuzzy get node' because it is still a cheat as i explained.
Other than those points, maybe it is useful, but i'm unsure, and it has no dev support.

@paramat paramat changed the title [CSM] Replace get_node With Fuzzy get_used_nodes [CSM] Add fuzzy get_used_nodes Sep 16, 2017

@paramat

This comment has been minimized.

Copy link
Member

commented Nov 27, 2017

Disapprovals and no support.

@paramat paramat closed this Nov 27, 2017

@paramat paramat added Won't add and removed Possible close labels Nov 27, 2017

@paramat paramat removed this from Requests in Server-sent Client Side Modding Jul 19, 2018

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.