1937 Commits

Author SHA1 Message Date
Aaron Suen
dd009343f9 Fix DNT retriggering bug 2021-08-04 17:15:04 -04:00
Aaron Suen
19652c2fe1 Begin major rework of nodenames matching, autostart DNTs
- Unify logic for expanding nodenames/itemnames lists into indexes
  of matching names, and comparing item names/defs to lists,
  with group expansion and deferral.
- Add "autostart" option to DNTs which registers construction traps
  and a patrol ABM automatically, use for some things that are a
  good match.
- Note that some things are doing more complex logic in ABMs, such
  as determining if a node is eligible, or custom timing logic;
  leave these as-is for now.
2021-08-04 07:41:00 -04:00
Aaron Suen
d4c8d32171 Microoptimization of node update checks 2021-08-04 07:39:52 -04:00
Aaron Suen
bedfa4b211 Fix some APIs bypassing on_nodeupdate hooks 2021-08-04 07:36:31 -04:00
Aaron Suen
3dc6a0d6c1 Make "connected" glass non-optional
The game was designed with this appearance in mind, especially the
appearance of float glass, and having this turned off can have a
major impact on the aesthetics and even function (accessibility)
of builds.

The ability to enable/disable connected glass is of unproven value
even to lower-end systems, as most of the additional work is in
the background mesh-building thread, and by now the game is complex
enough that other factors completely overpower the impact this has
on performance.

Forcing this mitigates the risk that players who have connected
glass turned off will not experience the proper results of using
float glass, and that their builds will appear very different for
other players.
2021-08-04 07:27:53 -04:00
Aaron Suen
011e171e2d Float glass tanks too now 2021-08-04 06:42:14 -04:00
Aaron Suen
964f2c5044 Make sure glass DNTs are queued 2021-08-03 21:08:57 -04:00
Aaron Suen
00b3dc477a Unified fluid wandering system
- New fluid wandering API, mostly unified logic, only needs
  some parameters, plus the "generation check".
- More sophisticated behavior seeking down-slopes beyond simple
  immediate flowing node reach ("subtle slope" detection).
- More reliable timing using DNTs.
- Set firm movement rate of concrete, molten glass.
- Reduce molten glass generations, since it can now be more
  reliably directed.
2021-08-02 07:17:51 -04:00
Aaron Suen
1f913bf402 Merge branch 'dev' into fluidwander 2021-08-02 07:55:11 -04:00
Aaron Suen
531d259775 Fix looktip darkness punch fallback 2021-07-31 22:23:36 -04:00
Aaron Suen
6927552f8b Touchtips for ents 2021-07-31 21:05:52 -04:00
Aaron Suen
cbb3d59b2f Enable looktips for non-interact players too 2021-07-31 20:40:30 -04:00
Aaron Suen
cb7b3f7bea Redo touchtips into looktips
- Separate touchtips into in-world looktips vs
  wieldtips for inventory.
- Automatically raycast and show tips for
  anything we're looking at.
- Looktips don't work in full darkness, punch
  to activate a temporary touchtip for it, or
  use synesthesia lighting.
- nodecore.show_touchtip API stubbed out
  (used in yctiwy).

TODO:
- Need to rework hint discovery to use raycast
  instead of just punching
2021-07-31 15:54:11 -04:00
Aaron Suen
6e1df14c1b Dynamic custom crosshair
- Crosshair hidden when !interact
- Fade out crosshair when not pointing
- Makes crosshair HUD-scalable (not sure if
  this is definitely good or bad yet)
- Forces crosshair appearance on mobile to
  match desktop

Since the crosshair position is already used in
gameplay i.e. for item dropping on mobile, it's
important that mobile have consistent access
to it compared to desktop.

Also, mobile's lack of crosshair was one of the
main blockers to having look-tips instead of
touch-tips, so forcing a crosshair opens that
up again.  Forcing punch interactions to see
anything causes issues with ember/pumwater
where punching hurts.

A crosshair would also be necessary for
star navigation assistance tools.
2021-07-31 08:43:38 -04:00
Aaron Suen
9995d9bfc8 Add a use for dry sponges
Dry sponges act as air tanks while diving, but the effect is
limited by their tendency to soak up water from the environment.
2021-07-27 07:42:40 -04:00
Aaron Suen
352fd58339 Revert "Optimize and reorder player skin layers"
This reverts commit 5bb89ebae9af630922af81f895737ce4682ef183.
2021-07-25 14:55:24 -04:00
Aaron Suen
f240bf5990 Revert "Fix singleplayer skin"
This reverts commit c326d24d1b438e4de93c6fa8e2b565ace7cae3ea.
2021-07-25 14:54:47 -04:00
Aaron Suen
9f7598b375 Revert "Remove redundant singleplayer check"
This reverts commit c865746d7fde470a205320f6c79f75b992c67fcc.
2021-07-25 14:54:45 -04:00
Aaron Suen
3f0c49a31a Revert "Fix hand wield model regression"
This reverts commit 134977cb49ebae2b8086f2a47fce299f4cbaa0c9.
2021-07-25 14:54:38 -04:00
Aaron Suen
134977cb49 Fix hand wield model regression 2021-07-25 09:59:43 -04:00
Aaron Suen
c865746d7f Remove redundant singleplayer check 2021-07-25 09:59:05 -04:00
Aaron Suen
c326d24d1b Fix singleplayer skin
Handle single player as a special case and use the
default, un-colorized skin.  This should also make
it easier for people to change the SP skin without
having to interact with the colorization system.
2021-07-25 09:58:01 -04:00
Aaron Suen
5bb89ebae9 Optimize and reorder player skin layers
- Put base skin on top so custom skins can more
  easily override colored regions.
- Eliminate redundant texture areas.
- General image optimizations.
2021-07-24 21:48:58 -04:00
Aaron Suen
138e3c80a9 A little more whitespace in about dialog
Separate out group of "where to get it" from
group of "where to chat about it"
2021-07-23 23:52:40 -04:00
Aaron Suen
e77094d39d Try to fix missing footstep sounds
Apparently "rounding error" margin for the bounding box for feet
was too large for MT to detect player's feet on the ground.
Shrink it to a very small amount that should be large enough not
to be lost in rounding error but small enough to allow footstep
sounds.
2021-07-21 07:08:18 -04:00
Aaron Suen
87e8cf4291 Revert item->visinv entity reuse
Apparently an object having had automatic
rotate set in properties in the past will cause its
rotation to retain some unknowable offset,
presumably calculated client-side and not
matching the ent's yaw.  Entity replacement
(i.e. backing out reuse) is the simplest fix and
the transient one-time flicker is better than
losing the stack fullness indicator from yaw.
2021-07-11 22:33:32 -04:00
Aaron Suen
87e6e72d76 Offline-soaking sponge growth 2021-07-11 20:28:05 -04:00
Aaron Suen
0642839aea Simplify rush hitbox 2021-07-11 16:28:21 -04:00
Aaron Suen
a16ceda69a Detect cheat status changes bypassing events 2021-07-11 15:25:27 -04:00
Aaron Suen
068e9b6995 Remove debugging code 2021-07-11 14:51:35 -04:00
Aaron Suen
e24112a2d9 Fix soaking with cache
Soaking recipe fails will result in a lot of clearing
of old soaking values out of node meta, which is
very slow in the common case of e.g. dirt that's
not near water and thus should not be soaking in
the first place.

Skip node meta writes if the node meta already
contains the correct data, by doing a cached read
and check before writing, instead of blindly
writing.
2021-07-11 14:50:33 -04:00
Aaron Suen
03948cfe0f In-memory cache for soaking
This speeds up performance of soaking API by
quite a lot, especially in the more or less
pathological case of soaking dirt to sand, which
involves clearing the metadata from thousands
of nodes each run.  Knowing that the nodes
had already had their metadata cleared is
very helpful.
2021-07-11 14:36:55 -04:00
Aaron Suen
4be7398ff4 Fix setting interval/chance in soaking 2021-07-11 14:13:04 -04:00
Aaron Suen
c92762dabb Log ezschematic node summary
Useful for things like the various skyblock mods,
to verify exact counts.
2021-07-11 09:38:19 -04:00
Aaron Suen
385856d23c Fix a misimplemented fischer-yates shuffle 2021-07-10 23:49:07 -04:00
Aaron Suen
074e8035bf Add padding to bottom of player collisionbox
- This nudges the player upward a bit and gets the
  feet of the model out of the ground.
- This also compensates for a rounding issue that
  causes players to be detected as stuck in the
  node below their feet instead of the space above
  it.  The old workaround worked for pushout but
  didn't help with mods like ziprunes.
2021-07-10 23:13:08 -04:00
Aaron Suen
293b3de9ee Move ablation cooldown to RAM, fix meta loss
Apparently metarefs are cached somehow such that
values written to them are not returned from subsequent
reads.  Must be an engine bug, but it's probably not
worth trying to fix it at this point.  Some startup jank
is apparently inevitable anyway, and a 2 second cooldown
time is not easily exploitable by restarting the world.
2021-07-10 18:31:18 -04:00
Aaron Suen
cf8364199c Simplify soaking metadata clearing 2021-07-10 11:25:49 -04:00
Aaron Suen
135701f4f8 Remove soaking neighbor checks
These cause some issues, like the ability to soak
dirt under water for a short time to initialize the
soaking metadata, then remove the water flow,
then add it in and have leaching complete instantly
because the neighbor check prevented the soaking
ABM from firing to detect that the water was
removed.

In the course of investigating why ABMs are so slow
to begin with, it was discovered that having neighbor
checks can slow an ABM down by a factor of something
like 7x, so clearly the assumption that the neigbor check
being done in C++ as "efficient" was false.  This means
that we may be better off just always firing the ABM and
letting Lua check only a couple of relevant nodes (e.g.
for water flows in the space above) instead for
performance.

The main performance concern was dirt leaching, since
dirt generates naturally in the world in bulk, but if the
single check for water above may be faster than checking
all 26 neighbors in C++ anyway, we might as well let the
soaking API run for it so that it can detect the water having
been removed and reset the counters.
2021-07-10 11:23:09 -04:00
Aaron Suen
1ccbf0bb8c Fix formatting confused by parens in long string 2021-07-10 11:14:07 -04:00
Aaron Suen
9fb4cf55b2 Deprecate register_limited_abm
This has just been an alias to minetest.register_abm
for a while now, and all ABM enhancement features
have been added directly to the core API.
2021-07-10 11:09:44 -04:00
Aaron Suen
8a8bed8e5d Major settings cleanup
- Run all settings through a common API.
- Use modname prefix consistently for setting
  keys instead of "nodecore".
- Add automatic dumping of settingtypes.txt
  metadata for maintenance.
- Include initial settingtypes.txt for game for
  main menu use.
- Remove per-recipe tuning for pummel recipes,
  as there were way too many of those to be
  possibly useful and it was clogging up the
  settings menu.  Use tool rate adjustments to
  control it instead.
- Remove vestigial enable_damage setting.
2021-07-10 10:04:03 -04:00
Aaron Suen
61a7414f4b Remove vestigial creative mode cruft 2021-07-10 08:37:55 -04:00
Aaron Suen
700e0484d2 Remove debugging code 2021-07-10 08:27:25 -04:00
Aaron Suen
15936859c3 Persist stasis in modstore, not settings 2021-07-10 08:14:08 -04:00
Aaron Suen
053a55bc39 Merge branch 'fluidhook' into dev
The corresponding engine feature has been merged and will become
available in MT 5.5+, and the corresponding NodeCore code already
detects whether it's available or not and falls back gracefully
for existing releases.

https://github.com/minetest/minetest/pull/11405#event-5000287764
2021-07-09 09:11:18 -04:00
Aaron Suen
2a51c9af9b Fix reversed door hub movement priority
Items placed on top of a spinning horizontal door are
supposed to be flung outward preferentially and only
stay near the hub if held back by a wall.  Rewriting the
door conveyance logic apparently switched this.
2021-07-09 08:21:57 -04:00
Aaron Suen
7d41fc53c3 Door ablation check on load
Try to make sure doors don't have to wait arbitrarily long
for a patrol ABM to fire if their DNT was lost and they're
part of a stable circuit.  This seems to have caused some
sponge squeezers in particularly busy areas to stop for a
while when first loaded sometimes, which can interrupt
the water flow they provide, which can lead to a fire
hazard.
2021-07-09 08:18:55 -04:00
Aaron Suen
e3337de123 Add "redecorate" cheat to add new flora to maps
Admins can fly around, pick spots for new flower/grass fields,
and then run this cheat command to spawn a bunch of the new
flora in the given area.
2021-07-08 07:23:10 -04:00
Aaron Suen
2ce0a3b246 Fix wrong item display on drop-all items
If an item was settling too far away from where the item ent
landed, e.g. if pushed out by other settling items at the same
place, then it was using entity position to get visinv data
instead of node position.

Inform visinv ents of their actual node position instead of relying
on the object being reasonably close and rounding.  This fixes
multiple potential issues with visinv entity display and allows
these entities to be displaced arbitrarily far from their home
node and still function.
2021-07-06 07:25:03 -04:00