2646 Commits

Author SHA1 Message Date
Aaron Suen
ca1d06b8c2 Log node unuspends, don't unsuspend over ignore
Checking stuff at the bottom of the loaded map
causes apparently a lot of delay.

We probably should actually defer these for recheck
at some point...
2023-11-04 21:13:28 -04:00
Aaron Suen
babd919b85 Translation updates 2023-11-03 23:17:42 -04:00
Aaron Suen
10379121fa Fix gravel sitting on bottom of mapchunks
In the special case of gravel that's at the bottom
of a mapchunk, we have no way to tell if it's held
up from below, so for safety, we don't want to
leave it potentially floating, but we also don't want
to carve out air voids underground just because
a gravel deposit sits at the bottom of a chunk, so
replace the bottom gravel with stone, so that the
column will be supported.  Underground, a little
extra stone that just so happens to hold up all
gravel that sits at certain y levels every 80m will
probably not seem remarkable (I was unable to
find obvious examples of this effect while testing
for far longer than it took to notice the air voids).
2023-11-03 23:09:40 -04:00
Aaron Suen
61d8b3af09 Remove gravelfalls instead of suspending
Adding cobble/sandstone just arbitrarily holding
up gravelfalls looks awkward.  Instead, just clear
them out, like they fell long ago when the stone
weakened into gravel but were scattered long ago.
2023-11-03 22:59:55 -04:00
Aaron Suen
94ffa39d2a Remove falling bricks from dungeon ceilings
Just leave holes behind for now, but also tweak the
probabilities so that there are a few more bonded
bricks up there.
2023-11-03 22:46:51 -04:00
Aaron Suen
869ba856dc Shore up cave formations by default
Instead of wasting compute cycles running falling
node physics on freshly generated terrain where
the player would only see the aftermath anyway,
just shore them up with non-falling alternatives.
2023-11-03 22:43:38 -04:00
Aaron Suen
0e69cd301e Rework falling node auto-correction
Nodes are checked for falling automatically upon
mapblocks being loaded, and also every now and
then in the background.  In most cases this should
mean that nodes that should fall will fall as soon as
they are loaded, or pretty shortly therafter, and in
rare cases where something is missed, they should
"catch up" eventually.

Processing falling stuff is surprisingly expensive,
especially when loading an ocean floor where nearly
every node is a sand node, so a lot of complex
optimizations and limits were put in place to prevent
this from lagging the game.  Pre-checks are done to
avoid calling MT's builtin falling check code, which
is surprisingly inefficient (even by MT standards) and
limits prevent it from either taking too much time
itself or spawning falling_node entities beyond a
safe limit.
2023-11-03 22:15:34 -04:00
Aaron Suen
38f852e93d Remove spontaneous cave-ins from vibrations
This basically gets rid of the "jumpscare" factor, and
leaves suspended nodes in place until they are
disturbed directly by players.
2023-11-03 20:08:53 -04:00
Aaron Suen
5b0b48fb76 Make the special "nothing" item not opaque 2023-11-02 02:09:29 -04:00
Aaron Suen
e78eaeb24f Centralized API to keep track of player idle time
Any input control, including chat messages, resets
the idle time.  This can be used to support
mechanics that take effect based on player idle.
2023-11-02 01:52:53 -04:00
Aaron Suen
54c2c0d636 Move AoE cheats to server priv
Snuff, ignite, and growtrees now use server priv
instead of debug, to be more consistent with other
server maintenance cheats like quell and stasis.
The "debug" priv may be granted to give players
read-only access to more info in the world, so use
the "server" priv for more read/write access.
2023-11-01 21:36:56 -04:00
Aaron Suen
1f8f2cc28b Make all non-node items follow the same rules
Before, non-node items (tools and craftitems) were
exempted from opacity entirely and were always
transparent.  Now, they use the same optic_opaque
and optic_transparent groups, are opaque by default,
and honor the sunlight_propagates heuristic (even
though this is rarely used for non-node items).
2023-11-01 18:59:01 -04:00
Aaron Suen
9407dc65a0 MAJOR: Make many things optic-beam-opaque
The following things were nodes that were defined as
sunlight_propagates = true but NOW will be opaque:

- shaftcraft items like sticks, staves, bars, rods, ladders,
  frames, and torches
- flora such as rushes and flowers
- sedges, but only at max growth (make it now possible
  to detect and automate sedge growth)
2023-11-01 18:55:48 -04:00
Aaron Suen
93717fa421 Small optimization to storebox check 2023-11-01 18:42:01 -04:00
Aaron Suen
47f20ac2f0 Don't pack/unpack varargs in nodecore.door_operate
Instead of using variadics, hard-code array accesses for the
expected arity of door_operate_core, throwing away any
"future-proofing" that variadics were supposed to offer.

This is because in Lua 5.1, the length of arrays that contain
nil values anywhere in the sequence is apparently undefined, and
implementations are free to return the position of any value that
is followd by a nil, so length of {1, nil, 3} could be 1 or 3.
PUC lua seems to generally return 3, but LuaJIT takes more
liberties here (presumably exploiting UB for optimizations).
The problem arises when trying to unpack({1, nil, 3}) and LuaJIT
sees the length as 1 so return only <1>, instead of <1, nil, 3>.
This means that calling nodecore.door_operate(pos, ni, dir),
which was INTENDED for this API (it would look up node for you if
you didn't provide one) could result in the dir param being
lost due to packing the args into an array to defer them, and then
that array getting only partially unpacked.

Reference to WONTFIX bug where LuaJIT claims this is allowed UB:
https://github.com/LuaJIT/LuaJIT/issues/527

The solution for now is to stop relying on unpack (which is sort
of easy in its own way since I never really liked it).  In the
specific case of nodecore.door_operate in particular, adding
more positional args (it already has 3) would be bad for other
reasons (should switch to a named passing style).
2023-11-01 01:07:19 -04:00
Aaron Suen
34f09bcd88 Try to canonicalize doors before moving
Some external rotation mods may change the way
node rotation works and put doors into a state where
they are one of the 12 "reversed" rotations instead of
the 12 "canonical" ones.  Renormalize door facing
before processing rotations to ensure that these doors
are corrected automatically.
2023-10-29 03:07:09 -04:00
Aaron Suen
966ed012b2 Expose node spin data in registrations
Deprecate the old APIs that used to close over the
metadata about valid node rotations.  Now expose
this data in the node definition, and use a generic
non-closure function to handle the callback.

nodedef.spindata contains:

qty = number of allowed rotations total
cycle = table keyed on current param2 and valued with
  next param2 for next rotation
equiv = table keyed by each possible param2 (24 keys)
  and valued with canonical equivalent for that param2
2023-10-29 02:49:22 -04:00
Aaron Suen
e35b45c011 Fix getting "find lux" hint upon making a lantern 2023-10-28 15:37:00 -04:00
Aaron Suen
9a0804fae0 Fix broken stylus programming
...along with possibly other downstream bugs.

We had stripped the metadata off the wield item in the
pummel state tracking to make it so that changes to
wield item metadata (especially things that could be
changed by AISM while the player is using the thing)
would not cancel a pummel, but forgot that the wield
metadata that gets put into the pummel state is ALSO
fed to the recipe check.  Use a separate key for this
stripped only-for-comparison version, and keep the
proper itemstack with full meta for recipe checks.
2023-10-28 15:36:40 -04:00
Aaron Suen
0910265cc0 Add a storebox_sealed_always group
NodeCore will probably never use this itself, but it
can be used for mod content (i.e. Winter's waterlogged
containers) that will never allow infiltration of air
whether the sides are open or not.
2023-10-28 11:46:18 -04:00
Aaron Suen
085c862d33 Merge 'copygirl/fix/register-item-strip-colon' into dev 2023-10-27 07:29:08 -04:00
copygirl
2804ad2392 Remove unnecessary ":" prefix stripping 2023-10-27 09:29:51 +02:00
copygirl
84a832ac0f Strip ":" prefix in overridden register_item 2023-10-27 09:09:07 +02:00
Aaron Suen
997cd73cdd Translation update 2023-10-26 20:12:03 -04:00
Aaron Suen
5a10a8cfc5 Translation sync 2023-10-25 00:34:11 -04:00
Aaron Suen
8d08eb3518 Translation update 2023-10-23 19:53:19 -04:00
Aaron Suen
b5060b34cd Don't discredit "same as source" translations in stats
While we don't need to include these in the .tr file, if the
translators verified that the translated string matches the
source string (e.g. lines with only a URL or other technical
information) it still counts toward translation completion %.
2023-10-23 06:57:59 -04:00
Aaron Suen
d0206e13c9 Add weblate URL and translation stats, update translations
Hopefully, showing the weblate URL and translation status will
encourage people to contribute to translations...
2023-10-23 06:48:42 -04:00
Aaron Suen
8836a6d409 Fix non-log node door placement orientation 2023-10-22 22:32:13 -04:00
Aaron Suen
18a3684664 Defer door ablation to end of optics transaction
Optic checks follow a plan-then-commit phased process,
but ablation processing was happening (and modifying
the map) during the "plan" phase, which was almost
certainly the root cause of the optics duplication bug
that was just mitigated.

Add a mandatory "defer" function to the optic_check
protocol that nodes can use to peform additional
custom logic AFTER the commit phase has completed,
and move all door ablation actions there.

The "optic family" mitigation is left in place to also
provide a heuristic for verifying the problem has been
resolved.
2023-10-22 22:04:42 -04:00
Aaron Suen
1b2671c2ee Mitigate optic duplication bug
Optic nodes are each assigned a "family" of nodes that
are equivalent things with different power states.  Optic
commit is not allowed to replace any node with another
node outside of the source node's family.  This at least
prevents optic_commit replacing an air node with an
optic node (the way the dupe manifests).  Log a warning
whenever this happens.

Unfortunately we still don't yet know the actual cause of
the problem, so this is just a workaround, not an actual
fix.
2023-10-22 21:08:32 -04:00
Aaron Suen
fee85c5b56 Consistency 2023-10-22 20:36:05 -04:00
Aaron Suen
85ece02691 Fix overcomplicated optic immediate check
Don't cache the current node for multiple cycles,
just only allow only one node to be modified once
in the immediate transaction.
2023-10-22 19:53:02 -04:00
Aaron Suen
2e68093e8b Support multiple skin textures
If a custom model is in use, or a 2-sided sprite,
then the textures array may need to contain
multiple textures.
2023-10-13 21:53:37 -04:00
Aaron Suen
6f6602fea2 Fix lens selection box asymmetry
All rotatable node selection boxes should be as symmetrical as
possible so that rotating a node without moving the cursor won't
change which node the cursor is pointed at by resizing the
rotated selection box out of the way, which can cause repeated
right-clicking to miss and hit another node.

Prisms were corrected for this some time ago.  Lenses were
apparently close enough that this was missed, or considered not
important enough, but this change makes things much more
consistent, including making the lens and prism hitboxes match.
2023-10-13 20:49:59 -04:00
Aaron Suen
041b15f2b6 Updated new source strings 2023-10-12 19:38:52 -04:00
Aaron Suen
a15c972431 Translation updates 2023-10-12 19:36:01 -04:00
Aaron Suen
cfa0a85bb5 Display player offline time in ghost looktips by default
Show a textual fuzzy description of how long a player has been
offline (in terms of in-game time, not realtime) in player ghost
looktips instead of just "Offline Player", if the last seen time
is actually known.  Can be disabled by a setting.
2023-10-12 19:26:52 -04:00
Aaron Suen
1e130030de Immediate optic state acquisition on placement
When placing an optic node into an existing beam path, it
immediately acquires the correct state rather than being placed
as "inactive" and needing one tick to activate.  This would cause
a "down" pulse to travel down networks when placing a "vampiric
tap" into an existing beam path, even if it was placed with the
correct initial rotation.  This reduces a source of noise in
optic circuit building that doesn't appear to add any meaningful
challenge, only nuisance.
2023-10-12 19:17:42 -04:00
Aaron Suen
b43c02f589 Reduce tongs item meta churn
Prevent stack from doing selection-reanimation
by just setting the time at which annealing would
happen once rather than keeping a count of
elapsed time.
2023-10-11 20:22:37 -04:00
Aaron Suen
5c40b44cc4 Clear item meta on cooling with tongs
This allows non-glowing items to stack again
2023-10-11 20:19:07 -04:00
Aaron Suen
804fd01d85 Fix cache invalidation on wrong command hook 2023-10-11 19:53:54 -04:00
Aaron Suen
16f4068a14 Fix priv cache aliasing issue
The builtin grant/revoke commands modify the privs table returned
from get_player_privs, which can poison the cache if the priv
modification is later aborted due to an error.  Return a clone of
the privs table instead so that modifications of it don't affect
the cached copy.
2023-10-11 19:47:10 -04:00
Aaron Suen
d9321044bb Excess debugging messages 2023-10-10 00:20:27 -04:00
Aaron Suen
82c99d6148 YCTIWY markers visually fade with age 2023-10-10 00:06:24 -04:00
Aaron Suen
90b0659aa1 Hint for tongs recipe 2023-10-09 22:45:11 -04:00
Aaron Suen
e17d322d85 Fix metallurgy witness in tongs 2023-10-09 22:44:16 -04:00
Aaron Suen
87fc2d586c Witness always works within "touch" range
If the transformation happens at the player's actual
location, they don't have to "see" it if they can "feel"
it.  This fixes witness triggers happening inside the
player's inventory.
2023-10-09 22:43:51 -04:00
Aaron Suen
68ca7ad4c3 Tong cooling/quenching recipes
Note that these are separate from the existing
recipes used elsewhere out of necessity.  Lode
also anneals faster when carried (it's exposed
to more air cooling).
2023-10-09 22:37:50 -04:00
Aaron Suen
8e503c9b93 Tongs recipes 2023-10-09 21:50:14 -04:00