1937 Commits

Author SHA1 Message Date
Aaron Suen
7539c410f5 Merge branch 'master' into dev 2021-06-19 10:56:06 -04:00
Aaron Suen
455f5d264e Fix truncated long translation strings 2021-06-19 10:55:51 -04:00
Aaron Suen
005325bc32 Fix fast cook check bug affecting glass quench
It was checking the craft before actually placing
the node, causing the crude glass recipe to
complete when molten glass flowed into a mold
with water below, then it got replaced by the
source node, then it re-quenched to chromatic on
the next ABM pass.  Now it actually quenches
directly to chroma immediately like it should.
2021-06-18 19:24:19 -04:00
Aaron Suen
8683143a32 Fast cook check on placement
As soon as an item is placed run a cooking recipe
check, so auto-furnaces can run at maximum
designed speed instead of having to wait for ABMs,
which may lag.  This should make MP performance
also a lot closer to SP performance...
2021-06-18 19:03:49 -04:00
Aaron Suen
3d2f449532 Checkpoint: start work on fluid wandering API
The idea is to unify cement and glass flowing, plus
add additional features: if there is no available
space, try to find the nearest dropoff to wander
toward even if flows can't actually reach it (assume
that the terrain subtly slopes that way).
2021-06-18 18:26:51 -04:00
Aaron Suen
fd1290582d Start of Esperanto by Bero a.k.a. Flamore 2021-06-17 21:18:12 -04:00
Aaron Suen
f76fd96d6f Russian translation re-completed by Arekusei
Also:
- Catch errors in translation update scripts
- Accept a handful other anonymous suggestions
2021-06-17 16:47:52 -04:00
Aaron Suen
b30f56fde5 Translation updates 2021-06-16 19:47:31 -04:00
Aaron Suen
687c3d25c2 Work around builtin delusions of creative mode
Yet another MTG-ism baked into builtin that needs
to be monkey-patched out.  At least in this case
there's an API for it.
2021-06-13 09:38:11 -04:00
Aaron Suen
1b6a6fb6b6 Workaround pseudo-rubberbanding issue
Old behavior used to round exactly-off-by-half
values up toward +inf, but since
https://github.com/minetest/minetest/pull/10803
they are rounded toward +/-inf, which means that
if a player's y coord was exactly -1.5, it used to
round up to -1.0 but now rounds down to -2.0.

This affects using vector.round to get the pos of
the node the player's feet are standing INSIDE,
because if the player's y coord is exactly -0.5, as
would happen while they're standing perfectly at
rest on top of a node, it will instead give us the
node they're standing ON.

This causes spurious player "pushout" events,
because the game thinks players are standing
inside the node they're actually standing on top
of.

To work around this, just add a small positive
fudge factor to the player's y coord to bias it
toward +inf.
2021-06-11 09:17:06 -04:00
Aaron Suen
c0d72dccc8 Fix totes not running AISMs 2021-06-11 09:11:45 -04:00
Aaron Suen
5ac25775a9 Officialize the matrix room 2021-06-01 06:18:42 -04:00
Aaron Suen
4333c85d47 Fix ABM inversion with multiple candidates
This was apparently causing sand not to cook if it
had another sand node on top of it, because the
inverted cooking ABM would detect the top sand
node only and not process the cook check for the
lower one.
2021-05-28 14:47:32 -04:00
Aaron Suen
883eaf6859 Officially move IRC to Libera.chat 2021-05-26 19:20:19 -04:00
Aaron Suen
981cf1b787 Relax the item throwing hint
Too many players seem to be unable to make
this work, possibly due to lag issues...
2021-04-23 18:16:26 -04:00
Aaron Suen
e8823a8dae Fix pumwater renewal 2021-04-23 06:58:05 -04:00
Aaron Suen
9bf7299430 Remove debugging code 2021-04-16 23:58:21 -04:00
Aaron Suen
c403104193 Return stack on rejecting from node 2021-04-11 12:19:36 -04:00
Aaron Suen
3dd945085e Remove the txp_* overlay image feature
- For inventory and wield images, this is already
  possible via override.txt since 5.3.
- For special tiles, this will be possible in 5.4.
- This complicates things, and introduces warning
  messages into mods built without awareness of
  this feaure.
- As far as I know, no texture packs have actually
  ever used this feature.
2021-04-11 10:42:27 -04:00
Aaron Suen
d414c1f3b0 Move node itemstacks from meta inv to field
Node inventories are sent to clients, while metadata
fields are automatically set private by the server
and not sent to clients.  Not using node meta
inventories may help reduce the amount of data
sent to clients, especially in storage-heavy areas
where we were duplicating the work of sending the
inventory data not used on the client, as well as the
visible item entities.

Automatically convert old-format data to new upon
reading.

Also, needed to provide some APIs for sane access
to data in serialized format, and another way to
signal that a node can accept a stack other than
the size of inventory[solo]
2021-04-10 09:00:39 -04:00
Aaron Suen
f91bc9d2a1 New general artificial water API
Now nodes other than sponges (i.e. downstream
mods) can create artificial temporary water sources
similar to sponge squeezing.

The API allows specifying a source node and position,
so the water will dissipate if the source node is
removed.  A min/max TTL can also be specified, so
like the sponge, it can require external triggering to
maintain the water flow as well as the presence of
the node.
2021-04-10 08:25:21 -04:00
Aaron Suen
693ff3e420 Fix item duplication regression affecting doors
Don't abort non-silk-touch dig when a dig drops
and item, such as yanking the hinge pin out of a
hinged panel.
2021-04-09 07:10:51 -04:00
Aaron Suen
a6308d8378 Don't pre-initialize stone strata arrays
The original theory was that preallocating the array forced lua
to use the "array part" of a table instead of the "hash part",
which should be faster since lookups are a simple linear offset
calculation and not a hash with collision check.

It turns out, however, that in empirical testing, whether the
array-preallocated or the naive-allocated version is faster depends
on circumstances, such as how sparse the array is, how uniform
access is, or how much other load the system is under.  This seems
to suggest that arrays are more computationally-efficient but less
cache-efficient, so cache evictions caused by other concurrent
processes may slow this method down significantly.

Worst-case performance will be the most noticeable here, since a
system that's heavily loaded would have the most need for speed
in the first place, so it's probably better generally to use the
naive allocation.

In all, the naive allocation method also seemed to be the least
sensitive to external factors.  In addition to the array method,
attempts to pre-compile the dynamic checks into a binary tree of
if/then statements (which could be JITted and optimized) failed
as well.
2021-04-07 07:44:13 -04:00
Aaron Suen
1e64c191a0 drop_in_place rework
- Apply logic as first-class support so we can still
  have custom after_dig_node hooks.
- Shared flag nodecore.silktouch_digging that can
  be used in after_dig_node callbacks to determine
  if we're in the middle of a silk-touch dig.
- Add coal particles to tarstone digging if the coal
  is destroyed/dispersed during the dig operation.
2021-04-06 22:24:05 -04:00
Aaron Suen
0bb76ee30b Tarstone no longer drops coal at all
Once coal is mixed into the stone, it's "locked"
away.  Breaking the hardened stone releases the
coal as a fine powder that's not recoverable.

I'd rather violate the 1st law of thermodynamics and
not preserve the coal here than violate the 2nd law
and have it neatly "unmix" itself back into a lump.
2021-04-06 21:21:25 -04:00
Aaron Suen
da88f32416 Fix coal lump duplication bug in tarstone
Thanks to expert975 on IRC for suggesting this fix.
2021-04-06 20:30:19 -04:00
Aaron Suen
56b718f479 Door ablation particles 2021-04-03 19:21:09 -04:00
Aaron Suen
c88f439b87 Full scrolling hint list
Since we switched to a textarea and have proper
word wrap and scrollbars, we might as well use the
space and let players see ALL their hints.
2021-04-02 22:35:45 -04:00
Aaron Suen
161dbf5f68 Merge branch 'dev' into flora 2021-04-01 22:36:07 -04:00
Aaron Suen
7e351e8a1c Try reintroducing dungeon LBM
It doesn't catch 100% of everything, but presumably
it catches at least some things, and has little
marginal cost on top of the ABM alone.

Players have been remarking about the fact that
dungeons sometimes initialize right before their
eyes.  LBMs SHOULD be able to fire outside of the
ABM active range, giving us a chance to catch these
a little earlier before the player is close enough to
notice...?
2021-03-31 20:04:20 -04:00
Aaron Suen
c227aa99f5 Fix ABM statistics 2021-03-25 18:28:54 -04:00
Aaron Suen
4e3e502fed Emergency digging tip no longer needed 2021-03-24 09:41:20 -04:00
Aaron Suen
405833bf32 Remove emergency digging
This was added to allow a player to get out of a
rare softlock (trapped inside a cobble room without
any tools).  Since then we have not seen much use
of it for this intended purpose.

However, it has caused MUCH confusion among new
players, wondering why it takes so long to mine
dirt or tree trunks, instead of trying to figure out how
to make the proper tool.

Emergency digging is causing more problems than
it's solving and thus it makes more sense to remove
it than to keep it.  If we need some mechanic to fill
its niche (i.e. a way out of softlock) then we will need
to consider something that's harder to discover
accidentally to avoid confusion.
2021-03-24 09:36:04 -04:00
Aaron Suen
275714df02 Rework optic domain wall particles
The old system effectively cached cross-block
boundary information forever and never expired
them, even if the node creating them was
removed (that would have been easy to fix) or
an obstacle placed in the path (that would have
been difficult to fix with the old method).

Instead just do the simplest thing and split this
into a separate loop, and run a 2-second DNT with
a separate forward-trace from all active optic
nodes.

Doing a second forward trace for each node output
may not be as efficient but ultimately we create more
problems than we solve when we try to be too clever.
2021-03-24 06:55:30 -04:00
Aaron Suen
4b82eb6d56 Small DNT API cleanups
- Auto-remove deprecated DNTs
- Auto clear meta if no DNTs pending
- Remove redundant code
2021-03-24 06:51:07 -04:00
Aaron Suen
b05180da02 Make scaling exempt from protection
...similar to how loose items are.
- They're emphemeral/air-like anyway
- Prevent exploiting protection areas to make traps to
  capture players or their items.
2021-03-23 22:24:53 -04:00
Aaron Suen
c1588a7656 Combined fair inverse ABM queueing 2021-03-23 21:00:25 -04:00
Aaron Suen
0b39c6703e Limit and spread out fire spark packets
Before we were generating one spark spawner for
each ABM run, which could run hundreds of nodes for
a large blaze, and bunched them together.  Instead,
push into a limited fair queue, and also spread the
actual spark spawning out across time to spread the
network traffic from fire.
2021-03-23 20:39:54 -04:00
Aaron Suen
4ad14dddba Fix remaining manual ABM inversions
- Fire (longest-standing)
- Stone hardening
- Lava renewal
2021-03-23 20:27:35 -04:00
Aaron Suen
98e196035b Merge branch 'master' into dev 2021-03-23 15:29:54 -04:00
Aaron Suen
7216927d00 Fix falling ent displacing hot item crash
To repro: place a sand node at least 2 nodes high above
glowing lode prills and let the sand fall onto the prills and
try to displace them.

Introduced in 01252653-5da0918.

For some reason it seems like a non-player object is being
passed as the digger (I thought it would be nil for non-
players?) and this object apparently imitates a player but
is missing some critical thing such as metadata.

To work around the problem, just add guards to the
phealth functions, since only players are intended to have
"health" anyway.
2021-03-23 15:29:27 -04:00
Aaron Suen
2ffe0e765b Add optic beam block crossing particle effects
Wherever an optic beam strikes a mapblock boundary,
it now creates a particle effect visible to players close
enough.  This can be used to plan circuits so they work
entirely within a single mapblock and thus are never
internally interrupted by unloading.
2021-03-22 09:31:01 -04:00
Aaron Suen
b6f4ebaca7 ABM inversion for brick bonding 2021-03-21 12:09:28 -04:00
Aaron Suen
267450add4 Register a few obvious inversions
Ones that were not done manually before,
and can probably give us a noticeable
speed-up right now.
2021-03-21 12:08:55 -04:00
Aaron Suen
7fd51c1a6c ABM "inversion" API
This is useful when we want to perform an
action on a commonly-occuring node (like
sand or item stacks) with a requirement of
a neighbor of a less common node type (like
igniters).  Checking for B with A nearby can
be a lot faster than A with B nearby if B is
less common, so fewer neighbor checks
actually need to happen.

This was already done "manually" for the
flammable/igniter interaction, but now this is
a general API for all ABMs, that allows the
inversion to be done nearly transparently
with just a flag in the definition, and so the
ABM rules can be written more simply, with
the inversion handled elsewhere.

TODO: Rewrite current manual-inversions,
including the ones for flammable/igniter and
lava/stone hardening/softening.
2021-03-21 12:08:08 -04:00
Aaron Suen
abc5dc2cd2 ABM statistics reporting 2021-03-21 12:04:44 -04:00
Aaron Suen
d949430a65 Make protection exemption exemptable
So nc_exmachina and other downstream
mods can override the protection override
for item stacks too.
2021-03-20 08:08:05 -04:00
Aaron Suen
5dc95a91c4 Unprotect item stack nodes
This prevents a problem where players
can drop items into other players'
protected areas but cannot dig them.

Other solutions to prevent players from
placing items into protected areas in the
first place may be possible, and may still
be explored, but are not foolproof and so
this acts as a fallback at least.
2021-03-20 08:02:51 -04:00
Aaron Suen
28b78f7dce Log teleportations 2021-03-18 09:49:34 -04:00
Aaron Suen
99aec737d5 Dump inventory on all teleports by default
A low-level player teleportation must be explicitly
declared nodecorian via a keepinv property on
the position, or the player must be exempted via
the keepinv priv, to be allowed to teleport without
leaving the inventory behind.

This means that naive mods like /home commands
will now work correctly and teleport only the
player, and not items.
2021-03-17 08:13:36 -04:00