flux reports: when re-generating an entity v ... #2416
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/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/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
ugh/petz
ugh/QA main
ugh/QA NOK
ugh/QA OK
No Milestone
No project
No Assignees
3 Participants
Notifications
Due Date
No due date set.
Dependencies
No dependencies set.
Reference: your-land/bugtracker#2416
Loading…
Reference in New Issue
No description provided.
Delete Branch "%!s(<nil>)"
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?
flux reports a bug:
Player position:
Player look:
Player information:
Player meta:
Log identifier
Profiler save:
Status:
Teleport command:
Compass command:
perhaps i could create a generalized "add_entity_queue", which adds at most a fixed # of these "create on load" entities every server tick.
mods which should use this:
from alias:
ugh. this became a rabbit hole.
active_block_range=1
), not when it's loaded (max_block_send_distance=10
), nor when the entities in the block would normally be loaded (active_object_send_range_blocks=3
). this meant that a lot of times, i was throwing away and re-creating entities when i didn't need to be. that wasn't hard to fix - the LBM needed to check to see if the existing entities matched what was expected to be there, and only re-create them then. however, doing those checks is almost as expensive as just re-creating them... but it looks a bit better.this lead me into trying to identify ways to only keep the entities loaded if a player is close enough to see it well. this may have to be an ABM, which ... may help the clients, but will certainly create a lot of processing load.
i wonder if i should just go back to having statically-saved entities and double-checking the state of things whenever one loads (whether via
add_entity
or statically). given that there's only 1 thread, there's ways to avoid the "race condition".if we remain non-static, i wonder if we could benefit of from manually restricting outselves to the declared
max_objects_per_block=512
value. like, if there's that many entities nearby, refuse to create more. then again, a single mapblock rarely has that many entities in it, usually at most a couple hundred.options:
max_objects_per_block
and implement the idea above. downside to that would be that if e.g. several hundred pets unloaded, not all of them might survive.perhaps i should just create a "node_entities" mod to make managing them unified and sensical
testing...
want to finish the cottages update before i work on this more. it's turned into a huge thing.
this turned into 3 mods:
see #2623 for more info.
this issue should stay open, as a tracker of progress in making use of node_entity_queue for the various mods.
Could the engine be optimized in this place? If you need to jump through several API hoops to achieve a small loadbalancing effect, maybe engine upstream needs to improve at this point?
yes, i believe there's several proposals to help out w/ entity and LBM stuff.
i do think i can create a mod which defines a canonical interface for creating such entities, but it's a non-trivial amount of work. it might be a good API mod to incorporate into a game (your-land/administration#174), but it'll be an uphill battle to make other mods depend on it.
upstream engine issue about this, which i should get around to reading sometime https://github.com/minetest/minetest/issues/6963
If it's in the base game, all mods using this game as a basis will depend on it.
Making all modmokers reotroactively add support will be next to impossible.
QA
How would I test this?
note: this is only "fixed" for smartshops - other node entities, e.g. signs and item frames, don't make use of the queue.
first, you need to modify the instrumentation code so that you can see the source of various callbacks in order to differentiate them:
then, you need to create a giant wall of smartshops w/ random items in them. mark two positions with worldedit, and run the following snippet (change "flux" to your name):
now, you need to turn off node_entity_queue and restart the server. when you log back in next to the wall of smartshops, you can check the performance of the smartshop callbacks:
now, re-enable node_entity_queue and restart the server again. check the performance again:
the performance isn't as incredible as i wish it were, but it's reducing the size of the biggest lag spike to 1/3 the previous duration.
the node_entity_queue is now live, though only smartshops make use of it. there's still far more sign and itemframe entities around in general.