2417 Commits

Author SHA1 Message Date
Aaron Suen
adc8710a91 Shrink empty mod storage, earlier recheck on join/leave
When a player joins or leaves, schedule a recheck on the next
tick to prevent entities from lingering out of date by several
seconds.
2022-10-23 14:00:29 -04:00
Aaron Suen
ee7bc90ba9 Fix bug in disabled db pruning 2022-10-23 13:56:06 -04:00
Aaron Suen
d123dbded9 Fix core mod registration, settings 2022-10-23 13:44:59 -04:00
Aaron Suen
0673f3094a Add options to disable YCTIWY
There's a "soft disable" that just hides the entities
but keeps the database up to date, and a "hard
disable" that clears the database, keeping only
minimal data, until existing transactions (taken
items, dumped inventories) are flushed to the
world.
2022-10-23 13:22:14 -04:00
Aaron Suen
941d1545f2 Import YCTIWY mod nearly unaltered
I had wanted this to be a standard feature of the
game for a while but put off merging it because:
- I had hoped to find a better visual design for the
  ghost player entities that matched the bandolier
  in nc_player_wield better, and
- I had scalability concerns with large servers with
  thousands of offline players.

However, in practice it seems like the scalability
issues are not as critical, and the visuals are
acceptable as they are for now.

In making this a standard game feature, it
will probably also make sense to add an option
to effectively disable parts of it (e.g. avoiding
creating the ents, or even avoiding filling the
database except where players' items are already
taken).
2022-10-23 12:44:25 -04:00
Aaron Suen
8f1a538452 Lantern charging/discharging reforms/simplification
- Clean up group expansion logic
- Lanterns covered in lux will never net-discharge, even if they
  are not getting enough power to charge, so that they can be
  carried and installed as light fixtures, with a supply of
  flux from above, and can be "paused" in a flux flow when not
  in use without discharging.
2022-10-21 21:39:52 -04:00
Aaron Suen
ba284b52f8 Simplify door group check code 2022-10-21 21:39:32 -04:00
Aaron Suen
ff091fd3bc Attempt hotfix for automation-dug totes too 2022-10-21 07:26:14 -04:00
Aaron Suen
2e54974a09 Hotfix for totes placed by automation 2022-10-21 07:20:47 -04:00
Aaron Suen
650b44f7c0 Add LiberaPay link 2022-10-20 18:35:59 -04:00
Aaron Suen
d9e4af9ece Fix place_as_node facedir anisotropy
When a facedir node drops/lands on the ground, it should be
facing a random direction instead of biased toward one
specific orientation.
2022-10-20 07:27:03 -04:00
Aaron Suen
015b1fafff Digging light sources leaves dynamic light behind briefly
This helps to bridge the latency gap between the dig completing
on the client side, and the server sending the result, which might
include adding dynamic lights from a now-handheld light emitter,
e.g. for torches or lanterns.
2022-10-20 07:22:45 -04:00
Aaron Suen
ee48e9684f Convert lanterns from always-item to mainly-node
Relying on the dynamic light thing for lanterns when they are
placed on the ground causes unexpected behavior when it comes to
lens activation and the displacement of dynamic light outside of
the node space of the lantern itself.  It also causes issues with
lanterns lost deep underwater, i.e. they don't emit light when
they effectively should.
2022-10-20 07:20:48 -04:00
Aaron Suen
d0a508f029 Fix missing core mod registration 2022-10-20 00:04:05 -04:00
Aaron Suen
44e2ccc92b Preserve original tweenfrom in door double-move
When lifting an item using the new door vertical
movement mechanic, tween the item from its
original position, not the intermediate one.
2022-10-19 23:04:03 -04:00
Aaron Suen
dcfed74689 Fix placement of lantern on craft
Put it where the tote was, not where the chroma
glass is being placed on the side.
2022-10-19 22:56:49 -04:00
Aaron Suen
29e1b82506 Merge branch 'lantern' into dev 2022-10-19 22:37:00 -04:00
Aaron Suen
334946fcdd Increase effect of player wield light leading
When the player is moving forward, take autorun
speed into account for distance to lead, to better
counteract server latency and let players run at higher
speeds.  When standing still, still extend the light in
the player's looking direction a little bit, to get more
favorable "rounding".
2022-10-19 22:36:51 -04:00
Aaron Suen
fffe9e5d81 Nerf lanter charge capacity, buff water resistance 2022-10-19 22:25:42 -04:00
Aaron Suen
9764680fc5 Fixes and debug/tracing
- Check for water in same node (carried by player) and
  one node above (esp. for placed stack)
- Slightly optimize node group check
- Fix float rounding error, since meta floats are not
  perfectly round-tripped, to reduce spurious rate changes
- Add debugging info to trace phase transitions on all
  lantern items
- Correct initial charge setting (for /giveme'd items)
2022-10-19 22:06:21 -04:00
Aaron Suen
b78539dc5c Remove debug tracing 2022-10-19 21:38:44 -04:00
Aaron Suen
ad5f830fe0 Simplified/corrected charge/discharge logic
- Fix failure to detect immersion in water
- Reduce re-wield animations

Compute current charge based on past rate and
time, like a soaking AISM, but do NOT update the
totals in metadata unless the rate changed or
we crossed a charge level threshold.  This means
that we should only see the re-wield anim when
the charge level changes, the item is brought
in or out of water, or moved around a reactor.

We are losing the randomness factor from the
soaking AISM, but it's probably fine to have a
more exact discharge time for this sort of item.
2022-10-19 21:38:12 -04:00
Aaron Suen
bcfef7d749 Lantern code refactor and hints 2022-10-19 21:16:01 -04:00
Aaron Suen
553893b60a Detect accidental global sound playing
Every sound in the game (and all known mods for
it) should play either at a specific location, to a
specific player (e.g. chat beeps or notifications),
or bound to a specific physical object.  Detect any
that might be played globally by accident, e.g.
like a bug that existed in NC ZipRunes for a while,
to aid in debugging.
2022-10-19 19:22:55 -04:00
Aaron Suen
7c5ff2ff18 Merge branch 'dev' into lantern 2022-10-19 00:31:36 -04:00
Aaron Suen
0cc42fef14 Retire ABM performance stats
TurkeyMcMac's JIT Profiler mod provides much
better performance data anyway, and these
ABM stats haven't pointed out any really
useful actionable issues for a while.
2022-10-19 00:31:23 -04:00
Aaron Suen
8201017628 A few more things we don't need 2022-10-19 00:21:45 -04:00
Aaron Suen
2e6d1ab61c Place as item means we don't need facedir 2022-10-19 00:21:08 -04:00
Aaron Suen
5ac3a878db Place as stack, nerf charge, rename
Increase discharge bias, reduce total charge.
Place as stack means we only need the AISM.
2022-10-19 00:18:40 -04:00
Aaron Suen
2f215d2c9d Lantern balancing
- Discharge a bit faster when exposed to water
- Cut radiation levels in half
2022-10-18 23:47:27 -04:00
Aaron Suen
c24324c540 Charging/discharging
Basically works, but there are a few issues with it:
- I don't especially like the linearity of it
- Item "rewield" animation every 10 seconds
2022-10-18 23:30:30 -04:00
Aaron Suen
87975129d1 Craft and recycle recipes 2022-10-18 22:58:37 -04:00
Aaron Suen
e0c62ba6d7 Initial lantern node defs
- 8 different levels, from empty to full
- Models, textures
- Emit light, radiation
2022-10-18 22:45:39 -04:00
Aaron Suen
dd04f8ffe3 Tote handle facing direction rotate
Based on the direction player is facing, not based
on absolute cardinal directions.
2022-10-18 22:24:00 -04:00
Aaron Suen
a4310cd5ce Fix operate_door API returning success 2022-10-16 10:53:28 -04:00
Aaron Suen
724937e546 Simplify door queue running code 2022-10-16 10:40:37 -04:00
Aaron Suen
f3b20c7f0c Make vertical door conveyors useful
Add a centrifugal/centripetal component to door
conveyance when it's on the vertical axis, to
help prevent gravity from immediately undoing
the work.
- Items propelled by the bottom of a door are
  also pushed outward.
- Items propelled by the top a door are also
  pulled inward, landing atop where the door was.
2022-10-16 10:39:27 -04:00
Aaron Suen
1666909a14 Door timing determinism fix
Door recursion is now always:
- Breadth-first, so paths with fewer door-to-door
  interactions always "win".
- Random-ordered within each depth layer, so
  there are are no biases in door operation order.
2022-10-16 09:25:00 -04:00
Aaron Suen
4996b74a85 Remove all changes to mods chat command
This information is now presented in its
optimal compact form on the About GUI,
so we no longer need the same level of
human-readability for the chat command
and can restore its compatibility for
e.g. script purposes.
2022-10-15 10:46:36 -04:00
Aaron Suen
f5a43c580b Make wieldlights lead a forward-moving player slightly
This helps compensate for network latency and makes traveling
with torches less torturous.
2022-10-12 08:32:16 -04:00
Aaron Suen
dcb1eeb51c Add API for getting player color scheme 2022-10-10 15:54:49 -04:00
Aaron Suen
6054b43848 Fix rush light level check
It's the light level incident on the rush itself, not
in the space above, that we care about.  We also
don't need air above the rush, because there's air
IN the rush node.
2022-10-10 13:09:58 -04:00
Aaron Suen
cdc8f4726a Rushes require light to spread
They can still survive in the dark.
2022-10-09 12:55:42 -04:00
Aaron Suen
585aae3b74 Allow overriding visible fluid medium in node defs
This allows e.g. non-sunlight-propagates nodes to
behave like sunlight-propagates ones for purposes
of nametag display.

This should complete the changes necessary to
make NodeCore "darkcore" mode feasible with
true darkness by disabling sunlight_propagates
for air to block moonlight, but still pass optics,
nametags, and radiant heat as if transparent.
2022-10-09 12:09:31 -04:00
Aaron Suen
e92d6f6d64 Allow group overriding for radiant heat
Another option to override sunlight_propagates
heuristics.
2022-10-09 12:06:32 -04:00
Aaron Suen
b7261ab792 Allow overriding optic opacity via groups
Looking into the possibility of making everything
overridable for game-logic purposes by group, it
turned out to be a bit of a nightmare.  Also, instead
of overriding them at the "heuristic" layer, it's
probably better to simply allow overriding at the
specific game logic level, e.g. so that multiple
systems that use the same source data for heuristic
purposes can have differing behavior.
2022-10-09 11:57:36 -04:00
Aaron Suen
a40077f6c0 Hotfix for default_privs not working
- If we fail to get the player name, instead of returning a dummy
  object with no privs, defer to the wrapped function without the
  cache, to preserve the old behavior.
- Clear cache more aggressively when the player joins or leaves.
  This may help ensure that stale cache data doesn't affect things
  for too long, and also allow the cache to be GC'd more on servers
  with more player turnover.
2022-10-07 14:35:43 -04:00
Aaron Suen
ee99c24d52 More aggressive priv caching strategy
Instead of caching privs only for the current tick, and only for
NodeCore itself, change the base API to use caching universally,
including for naive mod code.  Privs are cached until invalidated
by a change; it's assumed here that the "auth_reload" command
exists in the first place because this kind of caching is allowed
and accounted for, even if it's not actually done by the engine
or builtin.
2022-10-07 06:59:04 -04:00
Aaron Suen
243f67c0d7 Change player guide climbing spot wording 2022-09-29 23:51:18 -04:00
Aaron Suen
923f1be464 Hotfix for DNTs not firing
- Clear the cached timer when the timer has fired.
- Simplify the save-timer-save cycle and just rely
  on dnt_timer to do the save, to eliminate
  redundant saves.
2022-09-29 14:12:26 -04:00