Chache reports: We have discovered there is no ... #4988
Labels
No Label
1. kind/balancing
1. kind/breaking
1. kind/bug
1. kind/construction
1. kind/documentation
1. kind/enhancement
1. kind/griefing
1. kind/invalid
1. kind/meme
1. kind/node limit
1. kind/other
1. kind/protocol
2. prio/controversial
2. prio/critical
2. prio/elevated
2. prio/good first issue
2. prio/interesting
2. prio/low
3. source/art
3. source/client
3. source/engine
3. source/ingame
3. source/integration
3. source/lag
3. source/license
3. source/mod upstream
3. source/petz
3. source/testserver
3. source/unknown
3. source/website
4. step/approved
4. step/at work
4. step/blocked
4. step/discussion
4. step/help wanted
4. step/needs confirmation
4. step/partially fixed
4. step/QA main
4. step/QA NOK
4. step/QA OK
4. step/question
4. step/ready to deploy
4. step/ready to QA test
4. step/want approval
5. result/cannot reproduce
5. result/duplicate
5. result/fixed
5. result/maybe
5. result/wontfix
No Milestone
No project
No Assignees
7 Participants
Notifications
Due Date
No due date set.
Dependencies
No dependencies set.
Reference: your-land/bugtracker#4988
Loading…
Reference in New Issue
Block a user
No description provided.
Delete Branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Chache reports a bug:
Player position:
Player look:
Player information:
Player meta:
Log identifier
Profiler save:
Status:
Teleport command:
Compass command:
Setting up a detector at Haven (on the test server, hi Bla!) with radius set to 40000, then dropping an item at Atlantis successfully detects it.
Even if this is not linked to OOM, probably should be limited.
the detector is calling minetest.get_objects_inside_radius(pos, radius)
That will on C++ side walk through all active objects in memory (it will not load any blocks, so essentially only objects from those blocks that are currently loaded for other reasons.
And ... oh no, that is horrible ... every use of the detector (or when searching objects inside a radius anywhere, so maybe other code is affected as well), it walks through list of ALL server objects (and for each one checks radius and adds to output if radius is lower). Who invented this horrible *****?
looking at src/server/activeobjectmgr.cpp ...
getObjectsInsideRadius, getObjectsInArea, getAddedActiveObjectsAroundPos - all this walks through entire list, the objects are stored in
std::unordered_map<u16, T *> m_active_objects
Once there is decent amount of players and some decent amount of active objects around them, this can slow down the server considerably.
active_block_range
andactive_object_send_range_blocks
config values in minetest will influence how large is the area where server holds these active blocks and how many those objects could be.get_objects_inside_radius()
has it's own issue, see #3723Both needs to be addressed: The get_objects_inside_radius in its own issue and this one will deal with limiting the entity detector to a reasonable range - even if it is not root cause of the lag we're hunting. What's a reasonable range? 4? 6? 8? What's the maximum a vacuum tube can grab from?
vacuum tube has max.8- but there may be other uses, object detector may be triggering something nearby at a small distance ... so I guess
(max(active_block_range,active_object_send_range_blocks)+1) * 16
could be reasonable limit, as that distance would still somewhat reliably land into active blocks around player ... and anything beyond then relies on luck that the block of interest somehow happens to be loaded.Also, the adjustable player detector can also have unlimited range - with few of them you can fairly accurately pinpoint anybody's position in the world from a distance :)
Then let's limit the player detector in range as well to the same maximum the entity detector will be.
so far testing has shown that they aren't quite accurate. for example my entity detector in Rivendell was set to 5km, but only detected 1km or Glacierville now reading whosit's theory I will change the range of the detector to 300m so I don't overload the server
these need to have a max range of something like 16
maybe if it's more than 8 nodes, they should detect mobs, but not accurately
Personally, I would suggest making the range large, but not very large - long distance entity detectors can be useful to players who want to build stuff like a large-scale perimeter warning system around their city. Personally, i suggest capping the detection range to 128 or 256 blocks.
Having max range such that single player can have both entity and detector loaded at the same time makes sense.
But idealy some per-detector "budget" should be considered?
How much CPU time we are willing to give to one such detector?
How many objects can be processed in this time?
What is the expected radius that will contain this amount of objects?
(noting that this radius will be significantly smaller for a city with lots of signs and itemframes...)
This gives me another idea:
what if detector will dynamically adjust it's radius? If it got too many objects during previous scan -> reduce actual radius, then slowly increase it if we get less entities up to user-defined one. Kinda like "scanner ratelimiter". I'm sure everyone will love it XD
i do eventually want to get around to writing some general-purpose code scheduler for this game. i may get to that soon if i decide i need it for mob behavior.
it certainly shouldn't extend beyond the active object range of a single player, so at most a max of somewhere around 100 depending on how that's measured
upstream issue: https://github.com/minetest-mods/MoreMesecons/issues/31
it shouldn't be hard to implement something but i'm exhausted rn.
upstream PR https://github.com/minetest-mods/MoreMesecons/pull/32. then again my last PR to that mod got ignored.
upstream PR got accepted. the default maximum radius is 16, but can be overridden w/ the
moremesecons_entity_detector.max_radius
setting if need be.QA
Looks good, even existing ones won't use the "old" setting as far as I can tell.
this is live. my server-wide focus detector no longer works.