2767 Commits

Author SHA1 Message Date
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
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
9c63785703 Remove todo item for brick bonding
There IS actually a mechanism to detect it,
though I'm not exactly sure how to use it.
Players need an opportunity to discover that
method and prove whether or not it can be
exploited to make a proper machine.
2022-10-16 09:44:44 -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
a15146dc4c Notes/issues 2022-10-02 09:48:40 -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
Aaron Suen
c407628172 Fix off-by-zero error in dnt timer setting
If the previously set timer is exactly the correct
value for the existing DNT, then don't update/reset
the node timer.

Not sure why this was the way it was before (it
seems like it might have been intentional) but it
caused measurable performance impact, didn't
seem right, and fixing it didn't seem to introduce
new problems in preliminary testing.
2022-09-28 22:45:07 -04:00
Aaron Suen
92afc2c553 Fix inefficient dynamic light checks
Instead of checking to make sure one of the objects
found at a location is the glowing entity (which is
very slow and has to search every object for each
light) just make sure that the entity still exists
(get_pos() does not return nil) and that it's still
within the same node position as before.

This fixes a huge lagspike that was caught on NCC
due to a bunch of dropped glowing lenses.
2022-09-28 22:16:17 -04:00
Aaron Suen
c02df68fa6 Fix dropped shining lenses shining forever 2022-09-28 21:57:20 -04:00
Aaron Suen
b27c696c06 Somehow lost the var name 2022-09-26 07:44:03 -04:00
Aaron Suen
f15e1369f1 Always spawn wield ents at live player pos
Don't use the stored pos, which might be at the time of
player login, and thus arbitrarily far from where the player
is now, such that it might never actually be loaded.
2022-09-26 07:31:20 -04:00
Aaron Suen
b37d01107f Do the distance check before db check
The distance check is less complex and will probably
filter out players a lot faster on a largeish server, so
it's a better check to run first.
2022-09-24 16:36:55 -04:00
Aaron Suen
a9e99f921e Deferrable discovery and witness optimization
- Split "discovery" into 2 stages: a check (to see if
  there is even anything new to discover) and a
  commit.
- When doing witness checks, check to see if there
  is anything to be discovered first, before doing the
  more expensive visibility checks.  If the player
  already knows all the discoveries, then we don't
  need to do any of the raycasts.

This should speed up especially pathological cases
like door catapulting, which can cause witnessing to
happen at multiple points, and causes major
slowdowns when multiple players are within the
distance range and facing the correct direction due
to tons of raycasts happening.
2022-09-24 12:23:24 -04:00
Aaron Suen
dfcfb906a7 Trivial fix for priv cache
Clear the dirty flag after cleaning the cache.  In
practice this will probably make no difference
since game logic makes it very likely the cache
would be dirty after every tick anyway, but it's
more correct at least, and MAY reduce lag on
empty servers.
2022-09-24 12:20:09 -04:00
Aaron Suen
433161466b Unify cached privs checks
All base-game priv checks should now only
require one priv lookup per player per tick,
except in special cases where a player's privs
changed during that tick.
2022-09-24 00:20:27 -04:00
Aaron Suen
5b3a13c459 Cache player interact privs for current tick
Apparently accessing player privileges is
weirdly expensive, regardless of whether
get_player_privs or check_player_privs is used,
and because interact privs are checked so
frequently, it adds up to quite a lot (as much as
a third of the playerstep time).  Since things
controlled by interact privs are probably safe
to delay for a tick (it won't be toggled very
often), just cache it for the current tick to
mitigate this.

In the future it might make sense to (1) trap
the privilege change calls to invalidate the
cache, and (2) consider  doing this for some
other privilege checks.
2022-09-23 23:47:33 -04:00
Aaron Suen
166cfe5f14 Mitigate excess server block sends
The problem was pointed out by Josh
(gitlab.com/krazy-j) in merge request !22.
Apparently MT is not very smart about marking
mapblocks dirty to send to clients based on
calling mt.set_node(), i.e. it will mark them
dirty presumptively even if you set the node to
the same value it had already been.

This behavior can be confirmed by registering
an ABM against a common node like grass and
setting action = minetest.set_node.  This
causes every mapblock containing that node
to be invalidated every interval, causing a big
spike in the packets received each interval
that you can clearly see on the F5 graph.

Rather than just fixing it for the most easily
observed case (fire checks), add utlity functions
to check this for ALL node change situations,
and apply it more or less universally anywhere
that we are not certain that the node is being
changed and we don't need to worry about the
extra overhead cost of the check.

Note that we don't need a
nodecore.set_loud_check call, as set_loud was
only ever being used already in cases where
we were pretty sure we were actually changing
a node.
2022-08-24 20:44:14 -04:00
Aaron Suen
6215c8c670 Translation updates 2022-08-24 20:01:54 -04:00
Aaron Suen
3c9682bf18 Make a few "fundamental constants" configurable 2022-08-14 12:16:18 -04:00
Aaron Suen
e60eaa8294 One more note 2022-08-12 07:31:20 -04:00
Aaron Suen
cebd4e1545 Massive notes dump 2022-08-12 06:37:13 -04:00
Aaron Suen
42d92f4ca9 Disallow basic_debug by default (FINALLY) 2022-08-12 05:47:27 -04:00
Aaron Suen
26ca958083 EOL 5.4, now that 5.6 has been released
Note that we are not YET bumping the protocol version requirement
because (1) the proto bump policy was new as of 5.5, and (2) we
have no known cases yet of 5.4- not working correctly.
2022-08-12 05:45:00 -04:00
Aaron Suen
33be42cbd2 Translation sync 2022-08-12 05:35:56 -04:00
Aaron Suen
3d3f696880 Player name HUD customizability hook
An example of use for this might be attaching images to player
nametags to indicate server roles.
2022-08-12 05:33:59 -04:00
Aaron Suen
c6f054749f Audit and consistentize item drop hooks
Should fix remaining crashes in multicraft
reported by maksym related to item drop
having a nil player.
2022-07-02 11:37:58 -04:00
Aaron Suen
0c7e0e819b Guard against nil player
https://gitlab.com/sztest/nodecore/-/issues/14
Unable to reproduce the crash, but the fix
seems obvious given the symptom.
2022-06-26 08:13:56 -04:00
Aaron Suen
81a5c6dad5 Translation sync 2022-06-08 08:24:07 -04:00
Aaron Suen
4cec30a2eb Add tip about tedium 2022-06-08 08:21:28 -04:00
Aaron Suen
a7b84724c8 Improved smoke API, smoking torches
- Smoke API uses expandable options param instead of positional
- Separate burst qty from automatically adjusted rate
- Backward compat with old API for now
- Standardize burst of smoke puffs for crafting
- Torches emit small smoke particles at increasing rate as they
  start to wear out, to warn players holding them to light another
- Torches now emit a puff of smoke upon snuffing
2022-06-08 08:15:31 -04:00
Aaron Suen
2e5641843b Hide wieldtips for non-interact players who can't have items
Virtual items, esp. the hand of power, were showing up on
join even if the hotbar was hidden.
2022-06-08 08:06:23 -04:00
Aaron Suen
d28a438063 Fix worn wooden tools being stone-tippable 2022-06-08 07:52:17 -04:00
Aaron Suen
10575352f2 Translation update 2022-06-08 03:02:55 -04:00
Aaron Suen
3b9eb9fbaa Remove errant debugging cruft 2022-05-28 07:50:18 -04:00
Aaron Suen
b10da442dc Eggcorn planting automation
A single eggcorn that finds itself "forced" into a node
of loose dirt (e.g. by being displaced by a falling loose
dirt node that settles where it was) will become a
sprout.
2022-05-27 22:32:57 -04:00
Aaron Suen
7bd2d9df94 Document some issues 2022-05-27 22:15:48 -04:00