Skip to content

Items overhaul

bones_was_here requested to merge bones_was_here/itemsdesync into master

items: misc cleanup

items: move particle effects to CSQC for bandwidth and consistency

If some packets get delayed and/or resent, it should no longer be possible see the item appear or disappear without the particles, or vice versa.

items: match SVQC .solid behaviour in CSQC

items: don't precache 3d models and textures when simple items are enabled

Precaching is done in CSQC. Doing it in SVQC _StartItem() was unreliable on dedicated servers because clients often connected well after the items spawned in SVQC. Helps towards #2799

items: support toggling cl_simple_items at any time

items: add loot despawn effects

Closes #1046 (closed)

items: use a different CSQC physics code path for smoother motion

Previously it ran physics in whole numbers of server frametimes, which would cause "jumps" when the updates for a thrown item arrived.

items: fix animation interference with physics and reset animation properly if disabled

The CSQC bbox would move up and down... which ofc doesn't happen in SVQC. Spawns item at the sine wave midpoint instead of "fading in".

items: alpha calculation rework

  • more efficient networking
  • clients can now customise the range of the fade effect (as well as disable it)
  • clients can no longer override server maxdist setting (was unfair)
  • replaces vehicle ghost items with a weapon_stay-based effect

Fixes #2059 (closed)

items: replace broken loot think implementation

Implements a slow update rate for loot items, just enough to correct occasional prediction errors. Includes SVQC prerequisites for loot item despawn effects


Fixes #2824 (closed)
Please note:

  • loot item prediction errors are still possible but will now be corrected instead of desyncing permanently. Primary cause is client and server using significantly different bbox sizes which will be fixed in the next version of !1131 (merged)
  • There's some bug involving jump pads where they don't always push the entity even though the touch func is called and tests are passed. This is probably why projectiles have (for many years) not always been pushed by jumppads (only works for specific angles), and can happen with loot items too. I'd guess it can even affect players but isn't noticeable because they're always pressing +forward and have friction instead of stopping dead on collision with the ground.
  • darkplaces#387
  • ISF_SIZE is redundant currently, but I didn't remove it as it's not using any bandwidth and I'll use it in the next version of !1131 (merged)

Merge request reports