Items and nodes are listed equally in a single array. This makes
it a lot easier to fairly select random things from the complete
set to return, instead of the de facto stratified random choice
with equal weighting between items and nodes regardless of how
many of each there is.
The stratified weighting wasn't a problem before, when our
expectation was that all items and all nodes would be returned
instantly. Now that we're spacing things out, order matters more.
Instead of blasting returned items in at the maximum possible
rate, insert them back into the world one at a time at a random
pace. They now pop back into existence like popcorn. This
prevents "thundering herd" lagspikes when returning from the
skyrealm.
Instead of returning things as falling item/node entities, try to
scan downward for a place where they would settle and place them
in an already stable position, so we can skip the brief period
where they would be entities that incurs so much extra load.
Both of these combine to make massive item return bursts more
efficient and tolerable.
If there are more than a few objects near a portal that
represent items that could have already fallen from the skyrealm,
then delay other items in the queue until those settle, to
limit how much load these items can create around the area, and
spread out the effect as well.
- Item arrival generally hasn't been known to cause issues because
the area around the portal usually needs to be loaded to be
active enough for the portal DNT to check for arriving items, but
ensure that the entire arrival area is loaded so items are fairly
distributed around.
- Add action logging for movement and transformation of items
performed by the skyrealm itself.
- More fire snuff sounds, and smoke from ash
- Particles and sound for teleporting players. Particles are
derived from player skins
- Particles and sound for teleporting items.
This shouldn't be possible, because we already
checked for destroyed objects via the pos nil
check immediately above, but nevertheless it
seems to happen in some cases anyway?
When items fall off the skyrealm, they are
associated with an island, not a player, and will
spawn near a portal leading to that island as
soon as its loaded instead of waiting for a player
to carry them back.
Destroy the entities and save the contained
items in metadata, so we can rematerialize
them later (TODO).
This should already provide the possibility of
some load control by freezing these things
into metadata so they don't continue to bog
down the server as much.