3275 Commits

Author SHA1 Message Date
Aaron Suen
911e6372c5 Long overdue translation sync 2024-12-29 09:28:19 -05:00
Aaron Suen
9227d90cd1 Translation sync 2024-11-15 09:41:15 -05:00
Aaron Suen
bcb106c4f7 Fix unoptimized code warning 2024-11-14 19:47:43 -05:00
Aaron Suen
b2ace2c4b8 New 5.10 features 2024-11-14 19:46:43 -05:00
Aaron Suen
99b8fc72e7 Translation updates 2024-11-02 02:41:13 -04:00
Aaron Suen
c3cb2ca946 Text and translation updates
- Add new pumpowder, updated player's guide stuff
- Fix typo in domain name from luantipocalypse
- Full translation sync
2024-10-14 19:04:01 -04:00
Aaron Suen
e353e21897 Remove pumice etch registrations
This clears up extra translated strings and node definitions that
we didn't actually have working recipes for yet.
2024-10-14 19:01:11 -04:00
Aaron Suen
f4402b2d57 Fix engine names in documentation
Mostly this entails just calling the engine "the engine" rather
than committing fully to the new name.  It's better to just specify
which engine this runs on in fewer places.
2024-10-14 18:54:10 -04:00
Aaron Suen
1dd37e31ff The Luantipocalypse
The Minetest engine has now been renamed to Luanti.  The "core"
namespace is now preferred over the "minetest" namespace for
engine/builtin APIs.

As part of this process, add an "nc" alias (now preferred) for
the nodecore API namespace as well, to save us a little code
verbosity.
2024-10-14 18:44:58 -04:00
Aaron Suen
982b273b22 Translations 2024-10-14 17:51:06 -04:00
Aaron Suen
103d557b8d Make pain blur effect non-linear 2024-10-09 17:24:52 -04:00
Aaron Suen
2528242cdc Reduce blur intensity
Even at full damage, this shouldn't "obscure information" so much
as just give a visual sense of the player character's suffering.
2024-10-09 12:18:32 -04:00
Aaron Suen
71a58072a6 Use bloom (blur) for health effects 2024-10-09 11:47:35 -04:00
Aaron Suen
a98b216910 Small unsuspend optimization
If we attempt to unsuspend the node but it fails to actually
change the node, then assume no entities were created and skip
recounting them.
2024-09-30 19:45:10 -04:00
Aaron Suen
ac58b2bd6e Replace rotatable box sizing hack with heuristic
Instead of having to register a special box sizing ratio, detect
it automatically from selection box information on the node
registration.

This also analyzes selection boxes of rotatable things and raises
warning messages on any that don't meet our simplicity/symmetry
expectations.  These warnings represent real problems that should
be fixed as they could cause node selection boxes to move around
as a node is rotated, causing usability issues.
2024-09-29 13:49:24 -04:00
Aaron Suen
fb0de39d0c More exact HUD dot placement on optics
Currently all vanilla rotatable nodes follow a standard of having
a selection box that's a single symmetrical cube centered on the
node position center.  This is already necessary to ensure that
rotating a node doesn't cause the selection box to move out from
under the cursor and cause repeated right-clicks to hit something
else beyond.

Taking advantage of this assumption makes it simple to just add a
single scale factor to:
- Make rotation hit zone regions consistently sized.
- Accurately place the HUD dots indicating the regions.

A more elegant hack may be necessary for nodes that are don't
meet the symmetry requirements, but it may actually just make more
sense to throw warnings if any are registered.
2024-09-29 12:23:26 -04:00
Aaron Suen
96a136cb9f Fix and clean up rotation HUD dots 2024-09-29 10:09:47 -04:00
Aaron Suen
64b849a14b Pumice won't fall if it's resting on a liquid
It "floats" on water or pumwater.  Any liquid that has "liquid
movement physics" for players also supports pumice from falling.
This prevents a pumspill over an ocean from filling the ocean
below it with pumice.

This also slightly optmizes the direct-support-below check path
for pumice, as it's now an index lookup instead of looking up the
node definition and running on the fly heuristics.
2024-09-28 20:45:56 -04:00
Aaron Suen
e3d7d9654d Disable liquid move physics for flux
This was always meant to be a "heavy gas" and not a liquid.  MT
just didn't support that at the time.  Now it finally does.
2024-09-28 20:34:56 -04:00
Aaron Suen
551cd84b14 Don't push growth to new sponges
Since sponges can now grow new lobes "remotely" it's fine (and a
fair bit simpler) to keep the remaining accumulated growth
potential inside the same sponge.
2024-09-25 21:30:53 -04:00
Aaron Suen
45b57d47bd Optimize sponge growth ABM
- Avoid processing the same sponge more than once on a single pass.
  This avoids O(n^2) complexity.
- When any sponge has growth ready to push out, when we do the scan
  to validate growth, also locate places where it could put the new
  sponge "through" the colony.  This compensates for the fact that
  the one sponge "chosen" may be buried.
- Impose a strict limit that sponge colonies must fit in a 6x6x6,
  to prevent a sponge in the "middle" of a long chain from seeing
  only 3 on each side and thinking it can still grow, leading to
  sponge "columns" up to 9 tall.

Tested using the "sponge fields" near spawn town on NCC.
- Before: ~70ms (35% of ABM budget)
- After: ~16ms (8% of ABM budget)
2024-09-25 21:20:45 -04:00
Aaron Suen
3d660e40f1 Don't mark meta private when deleting them
This is a small optimization that may reduce the tendency to
mark blocks as dirty, especially due to soaking ABMs that may
clear meta fields more widely.
2024-09-25 19:33:46 -04:00
Aaron Suen
d63ce33ad7 Rename privateize metadata compat hack
It was previously named for the issue it was meant to work around,
but since that issue was closed, we are no longer waiting and
watching to remove this.
2024-09-25 19:03:41 -04:00
Aaron Suen
318c58172f Tunneling tweaks to prevent accidental activation
- Make it take 5 consecutive placements.
- Reset count back to 1 if there isn't already a scaling node
  there, so players moving away from the area and coming back
  again are less likely to accidentally trigger it.

This isn't as strict as I'd really like, but without tapping into
the scaling node placement checks (which I'm not quite ready to
try yet) it's hard to do better for now.
2024-09-24 23:23:40 -04:00
Aaron Suen
7e5d85109a Compat code to restore old displaced nodes
These may get left on the map from an upgrade, e.g. if a player
disconnected and unloaded the area before displacement could
reverse itself, leaving the node, and then the server was shut
down and updated.
2024-09-24 20:26:14 -04:00
Aaron Suen
f26d007a4c Experimental replacement for "emergency digging"
One of the most confusing features for new players has been the
fact that they seem to be able to dig anything, but many things
take a long time, and when they finish digging it, they get the
weird "displaced node" that they can't interact with.  It has never
really compensated for this problem by being a compelling way to
get "unstuck" when trapped.

Instead, experiment with a new way to get "untrapped" when trapped
within a solid barrier.  By repeatedly doing the "scaling
placement" recipe on the same spot several times, instead of merely
being able to climb it, players can "phase through" solid matter
and quantum-tunnel themselves through/into a wall.  If there is
space for them on the other side, they will be placed there.  If
not, then they will be shoved into the wall, and can rely on the
"push out of solid" mechanism to eventually wander them over to
somewhere else, where they might have a better chance at getting
out.

This now makes being trapped in nearly arbitrarily deep caves
actually theoretically resolvable, because players should have at
their disposal some combination of navigation inside caves by feel
at their disposal, that lets the make clear progress toward going
"up", and can always try to tunnel into a ceiling for hopes of
conversion to a less deeply buried cave.  This gives players a bit
more agency as well.

Some concern has been expressed about the use of this for bad
actors, but those bad actors have already had more effective ways
to circumvent barriers as it is, which don't suffer from some of
the randomness and unreliability of this method, so the downside
to this is expected to be limited.
2024-09-24 18:50:31 -04:00
Aaron Suen
e8bec684e6 Unify spawn point API, make pushout honor it
When players are pushed out of solids, rather than just biasing
toward 0,0,0, if a static_spawnpoint is set, bias them toward
that position, assuming it's a "known good" location.
2024-09-24 07:06:13 -04:00
Aaron Suen
3b7f385e87 Revert "Stack caching in visinv checks"
This reverts commit b77fb35338574ba99e0baa209630f48df76356ab.

Stack visuals are not updating, and the problem this fixes wasn't
necessarily big enough to justify dealing with this.
2024-09-24 01:04:49 -04:00
Aaron Suen
c40e88fa06 Fix more junk metadata writes
We weren't resetting the cooking progress correctly for cooking
item stacks (it was using the wrong meta key).

As pointed out by Lars, clearing a metadata key that's marked as
private seems like it triggers a block resend, even if the client
wouldn't see any difference in the mapblock.  This means that
fixing these sorts of issues reduces server-to-client network
traffic, which is (anecdotally) observed with this change on a
copy of the NCC map near spawn.
2024-09-23 21:46:18 -04:00
Aaron Suen
2fb3f7cf04 Spread out cooking check DNTs
Instead of a thundering herd of DNT calls 1 second after the
initial "regen" ABM has scheduled, them, spread these out over
time a bit to try to reduce lag spikes from them.  The effect is
small but every little bit may help.

In practice this also stretches these calls from 1 to 1.5 seconds
between on average, reducing cooking check intensity by about
a third.
2024-09-23 21:30:13 -04:00
Aaron Suen
b77fb35338 Stack caching in visinv checks
The ItemStack constructor is surprisingly expensive, and calling
it thousands of times per globalstep for visinv checks is pricey.
2024-09-23 20:11:46 -04:00
Aaron Suen
9018812ac7 Avoid accessing node metadata for visinv tween_from
This is for an ephemeral effect, so it's not likely to be relevant
across server restarts anyway, and constantly checking for it in
node metadata is surprisingly costly, especially with it happening
thousands of times per globalstep on mature worlds.
2024-09-23 19:29:23 -04:00
Aaron Suen
616be713fb Remove some debugging noise 2024-09-23 08:11:30 -04:00
Aaron Suen
25bcfb0278 Soaking reform to reduce metadata writes
Instead of always pushing rate * time -> total, only commit this
when there has been a change of rate or override of total.  This
means that rather than updating metadata every time a soaking ABM
runs on a node, it will only get updated when "steady" soaking has
been interrupted, greatly reducing the volume of metadata writes
and dirty mapblocks.

This should work fine because the math was already designed to
work reasonably well when updates are "skipped" due to the map
not being loaded/active there.  The only issue is that there is
a slight "double jeopardy" to soaking completion when the ABM is
running repeatedly because the random parameter is re-rolled each
check, so there's a better chance of getting at least one high roll
that completes the soak if you're making repeated rolls.  This is
expected to be a small effect with current recipes.
2024-09-23 08:07:16 -04:00
Aaron Suen
88afd5f21d Make air equivalents not block tree growth
Instead of checking for literal air, allow things like dynamic
lights, smoke shadows, etc. to exist in this space without
blocking tree growth.
2024-09-23 08:06:18 -04:00
Aaron Suen
b63b98a3c1 Prevent "loose repack" from operating on tree sprouts
This didn't seem to actually ever cause sprouts to repack into
dirt, but it did create some extra node meta value updates due to
contention between soaking ABMs.
2024-09-23 07:38:21 -04:00
Aaron Suen
4d340fbbaa Add API for nodes to "veto" rotation ability
This is useful to make sure that the HUD is synced with gameplay,
e.g. for doors where right-clicking with a "hinge pin" will try to
install the pin, and thus cannot rotate.
2024-09-20 23:57:33 -04:00
Aaron Suen
5a7b2f967e Fix vestiges of gen 2 rotation API
- Doors were trying to canonicalize rotations based on old
  data structures.
- Glued optics weren't stripping off the correct group
2024-09-20 23:50:22 -04:00
Aaron Suen
dd9f56d1f6 Get rid of objects_inside_radius use
These are terribly inefficient, especially when there are a ton
of entities, as is the case when there are a lot of visenv ents.

For nodefall damage, filtering by whether the entity is a player
first is much more efficient than by position, since the rejection
ratio on larger servers is higher.

For checking if doors or totes are obstructed by falling or item
entities, this isn't even strictly necessary and maybe we should
just skip it and allow them to get "tunneled" in and settle
naturally.  At higher step sizes, it's questionable whether these
would even be handled accurately in the first place.
2024-09-20 07:01:41 -04:00
Aaron Suen
32c9833ee6 Hide rotation hud while sneaking 2024-09-20 06:12:59 -04:00
Aaron Suen
1d28f82e3c Fixed function rotation face regions
Each region has a specific function.  If that function is not
available, then that region is "dead" rather than being "taken
over" by another adjacent function.  This makes sure that holding
the cursor in place and right-clicking repeatedly never suddenly
changes the operation, preventing unfair surprises.

In theory, in fact, not only does it never change from one
function to another, but it should never spontaneously become
a "dead" region; pointing at a dead region stays dead, and at
a live one retains the same meaning no matter how often you
rotate it (assuming other players aren't interfering).
2024-09-19 20:49:55 -04:00
Aaron Suen
24e2e7b7b8 3rd generation rotation API
Separate the "which facedirs are valid for a node" aspect from the
"which ways can a node be rotated" aspect.

- Remove the bulky "rotation data" object from node definitions
  and instead just define an optional nc_param2_equivalent func.
- All disallowed param2 values are now automatically fixed at the
  time a node is placed, so downstream mods don't need to do any
  special filtering (though they need to be prepared for the
  actual placed param2 to mismatch what they set).
- There's now a nodecore.param2_canonical(node[, param2]) command
  that returns the correct node table with the correct allowed
  equivalent param2 for mods.
2024-09-19 19:10:09 -04:00
Aaron Suen
ee7203cd9c Consolidate all table_shuffle reimplementations
I've apparently needed to Knuth-shuffle a table pretty often, and
have reimplemented it multiple times.  We should instead assume
that the "standard" table.shuffle extension that MT adds should be
reasonably "optimal" and just use that everywhere.  If it turns
out not to be optimal then it's still valuable to consolidate the
implementations.
2024-09-19 07:04:55 -04:00
Aaron Suen
269a4056c4 Fix loose leaves displacing item stacks
All falling nodes displaced item stacks upon landing, including
loose leaves.  This has always felt a little bothersome, and
poses extra risks on skyblocks.

Now instead, falling nodes that are "insubstantial" enough not to
be walkable (currently only loose leaves) will not displace item
stacks, and will try to displace themselves instead.
2024-09-19 06:52:57 -04:00
Aaron Suen
7b304cf9fa Fix up YCTIWY db save again
- We have already taken care to call savedb() only in places where
  it's actually necessary, so we shouldn't delay it any further.
  In particular, delaying it makes it useless to call on shutdown.
- We can apply at least a little intelligence and not set keys that
  are already set correctly, taking advantage of the fact that keys
  tend to be iterated in a stable order at least when the table has
  not changed, making it easy to compare a table modified in-place
  against a serialized old copy.  This is about the best we can do
  in terms of reducing modstore key writes.
2024-09-18 06:47:05 -04:00
Aaron Suen
a4cdb14be8 Clean up settings
- Remove a bunch of settings that change things that are meant to
  be fixed standard values and not really meant to be tuned.  These
  were originally added to make it easier for modded games to
  adjust, like skyblocks, but:
    - It's better to use modding rather than user-visible settings
      to adjust these.
    - We ended up preferring to use entire new game mechanics to
      adjust things (e.g. adding tree tickling) instead of just
      changing settings (e.g. tree growth speed) because it was
      just a lot more interesting gameplay-wise.
- Clean up setitngs names.
  - Clarify meanings a bit.
  - Use "system - setting" naming convention to make related
    settings lexically group together.
2024-09-18 06:32:17 -04:00
Aaron Suen
1885fb9359 Major wield item rework
Instead of spawning these when players first log in and have the
entities update their state on_step, just run a single globalstep
that walks across all players and inventories, and then across all
entities, in a couple of passes, and reconciles everything.

This should also deal with entities that are lost for random or
arbitrary reasons, which seems to be the remaining known cause of
wield items spontaneously disappearing.

The code is also simpler (a single loop with a few linear passes)
and probably more efficient.
2024-09-17 19:11:33 -04:00
Aaron Suen
6faad01585 Docs update 2024-09-16 22:08:34 -04:00
Aaron Suen
995c1fb6c9 Fix mod.conf warning 2024-09-16 06:27:54 -04:00
Aaron Suen
5b9dbc51e8 Fix rotation HUDs on hinged panels 2024-09-15 22:14:14 -04:00