14 Commits

Author SHA1 Message Date
Aaron Suen
96ac76d8d8 Migrate to a combined return database
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.
2024-10-10 11:30:12 -04:00
Aaron Suen
57a3662483 New item falling item return logic
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.
2024-10-10 11:01:32 -04:00
Aaron Suen
c42395a7ba Fix falling node crash on return 2024-03-03 12:02:02 -05:00
Aaron Suen
077742aa69 Fix items falling back to surface too 2023-12-12 18:14:13 -05:00
Aaron Suen
a027057101 Treat air-equivalent like air 2023-12-10 11:33:30 -05:00
Aaron Suen
e0dd032e9b Don't overwhelm portal exits with objects all at once
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.
2023-04-04 07:13:46 -04:00
Aaron Suen
c12b6b4949 Fix crash in falling item 2022-11-09 18:55:22 -05:00
Aaron Suen
a8e64a20e5 Fix typo in falling item code 2022-11-04 19:23:47 -04:00
Aaron Suen
a267dac282 Add logging to item transforms, check for area loaded on arrival
- 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.
2022-11-04 07:15:38 -04:00
Aaron Suen
0288f4257d Add sound and particle effects
- 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.
2022-10-28 07:02:34 -04:00
Aaron Suen
9a7747312f Guard against inexplicably nil vel
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?
2020-11-09 08:23:26 -05:00
Aaron Suen
0ece83dc35 Return items to portals, not with players
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.
2020-09-20 14:18:59 -04:00
Aaron Suen
6d7865fee9 Restore items on teleporting back 2020-09-11 21:08:23 -04:00
Aaron Suen
4793595f95 Capture things falling off islands
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.
2020-09-11 20:47:55 -04:00