16 Commits

Author SHA1 Message Date
Aaron Suen
2ce0a3b246 Fix wrong item display on drop-all items
If an item was settling too far away from where the item ent
landed, e.g. if pushed out by other settling items at the same
place, then it was using entity position to get visinv data
instead of node position.

Inform visinv ents of their actual node position instead of relying
on the object being reasonably close and rounding.  This fixes
multiple potential issues with visinv entity display and allows
these entities to be displaced arbitrarily far from their home
node and still function.
2021-07-06 07:25:03 -04:00
Aaron Suen
90dbadb5bd Fix thrown item stack settling flicker
When a thrown item settles into a node space and
becomes a visinv node, reuse the existing entity instead
of deleting the old one and creating a new one, if
possible.
2021-07-06 07:14:14 -04:00
Aaron Suen
99254bf726 Simple visinv tweening
- On door convey
- On item ent settling

Only able to support limited cases, and still can't
usefully animate nodes, but at least this makes
some item placement behavior look smoother.
2021-07-05 13:42:46 -04:00
Aaron Suen
cfeae44a72 Fix items settling into shelves too eagerly
Items now try to settle into air and open stacks
first, and only squeeze into shelves/storeboxes if
there is no other available space.
2020-09-14 08:33:32 -04:00
Aaron Suen
b1c1ffb86a Fix item ents settling on map lower bound. 2020-03-22 11:10:47 -04:00
Aaron Suen
5d7f033c81 Rudimentary (inefficient) item merge. 2020-01-05 14:21:54 -05:00
Aaron Suen
c2e014a776 Attenuate scans for dropped items. 2020-01-05 13:48:53 -05:00
Aaron Suen
89020e8340 Major rebuild of item_entity.
This created a ton of dependency inversions, which
necessitated moving a number of API functions up into
higher layers, and restructuring dependency lists for
a number of mods.

BOLO: non-deterministic load errors due to missed
dependencies.
2020-01-05 11:42:22 -05:00
Aaron Suen
b1fab67491 Start work on unifying/simplifying builtins.
falling_node rebuilt from scratch so far.
2020-01-04 10:51:10 -05:00
Aaron Suen
511455fff9 Player/ent freefall physics cleanup.
- Thrown objects inherit initial velocity.
- Player and objects have matched terminal
  velocity and can free-fall in tandem.
- Thrown objects experience horizontal air
  friction too.
2020-01-02 23:03:23 -05:00
Aaron Suen
fa24151782 Fix the jumping eggcorn bug. 2019-12-15 08:43:33 -05:00
Aaron Suen
d514f8f56d More dynamic item settling random management.
Instead of shuffling all the shells once for each tick used,
shuffle only those shells actually used once per tick.  This
should save us more time in common cases where we need
to only check a few shells to find a place to settle.
2019-12-07 11:26:10 -05:00
Aaron Suen
e0f2cb5b6d Item settling overhaul.
- Always prefer closest place first, then lowest height.
- Simplify search order; use a pre-built order instead of scan.
- Randomize search order only once per tick, if used.
2019-12-07 11:12:55 -05:00
Aaron Suen
d016885364 Attempt to settle items stuck inside nodes. 2019-11-28 08:40:28 -05:00
Aaron Suen
8a0f073592 Simplify item settling, make instant.
The old method was designed for 0.4 compatibility.  Since 5.0
there appears to be a flag we can just check to see if the item
is still moving according to physics or settled.
2019-09-12 21:56:06 -04:00
Aaron Suen
247bebe417 Finally break up the nc_items monstrosity. 2019-09-07 09:44:30 -04:00