201 Commits

Author SHA1 Message Date
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
c02df68fa6 Fix dropped shining lenses shining forever 2022-09-28 21:57:20 -04:00
Aaron Suen
3c9682bf18 Make a few "fundamental constants" configurable 2022-08-14 12:16:18 -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
d668c5c06b Certain puffs of smoke can block optics
This can be used to detect some recipe
completions, esp. cooking, cooling, quenching,
and curing.
2022-05-01 00:42:19 -04:00
Aaron Suen
952c1bc63e Lenses react to light beams 2022-04-30 21:55:05 -04:00
Aaron Suen
cf4bd2d749 Fix quench check on heating recipes
If there's any coolant near a node, that blocks
all application of heat and prevents it from being
cooked, and also prevents any passive slow-cooling
recipes from operating on it (i.e. racing against
the quenched recipes).

Use coolant neargroups for quench check too,
for consistency.  Add memoization to the recipe
data on the check, so to avoid doing the quench
scan for each recipe separately.
2022-04-05 20:32:33 -04:00
Aaron Suen
96b4947c13 Simplify node/stack change optic notification
Instead of adding a special hook for storeboxes, just treat all
stack changes as node changes and notify all update listeners.
2022-03-14 07:13:43 -04:00
Giuseppe Bilotta
512c6b05cd Properly check for param2 in optic_commit 2022-03-13 23:24:17 +01:00
Giuseppe Bilotta
bdc27cf304 Fix typo 2022-03-13 23:24:17 +01:00
Giuseppe Bilotta
26ca863b68 Check dependent optics on storebox content change
Changes to the stack stored in a storebox do not trigger a node update,
which meant that affected optics to not get updated until the next ABM.

Use the newly introduced storebox_register_on_stack_change to trigger
a check on dependent optics just like node updates.
2022-03-13 23:24:17 +01:00
Giuseppe Bilotta
0cc6604207 Storeboxes should let light through their open sides
Storeboxes such as shelves do not let sunshine propagate because some of
the sides are opaque, but some sides are still open, and these should
still let light through.

During the optic scan phase, handle opaque nodes with visible inventory
by checking if the light travel direction also allows storebox access,
(from both the front and back face) and consider the node transparent in
such a case (unless, of course, the contained items are opaque).
2022-03-13 23:24:17 +01:00
Aaron Suen
a2f81d9ee1 DNT auto-start refinements
- Regen with LBM too.
- Allow different delay time for "just loaded" case.
- Use DNT auto-start for more things, replacing
  regen ABM/LBM where possible.

Also tried to improve door ablation reliabiity:
- Use DNT autostart for door ablation.
- Faster DNT check so we don't need the ABM
  neighbor scan anymore.
- On early ablation trigger, set DNT for right after
  cooldown ends instead of letting DNT loop die,
  removing one scenario that could cause
  sponge squeezer stalls.
2022-02-10 22:08:58 -05:00
Aaron Suen
91e5c615c2 ABM delay, prevent "prompt critical" ignition
During processing of the flammable ignition ABM,
nodes could ignite, causing the new ember nodes
created by this ignition to trigger fire propagation
instantly during the same tick by nodes still yet
to be processed for ABM checks during the same
scan.  This often caused large areas of flammable
nodes, like wooden plank skyblocks, to be ignited
instantly in a specific direction from any source
ignition.  This led to some "cheap shots" where
players were ruined by fire far more rapidly than
they should be.

Instead of processing flammability checks in
sync, delay them until the next tick, so that we
find all flammables to check before any new
igniters are created.  This should tame fire
spreading back down to normal levels.
2022-01-22 16:20:10 -05:00
Aaron Suen
d1b6c0333b Change how optic ungluing works
Instead of digging the glue off by hand and freeing
up the optic to rotate again, it must be fully dug by
a tool, to further prevent accidental ungluing.
2022-01-11 23:24:57 -05:00
Aaron Suen
ce2b2ddfd3 Fix glued lens activation 2022-01-09 13:28:45 -05:00
Aaron Suen
d37e9e9ace Genericize lens beam emitters
Look for optic_lens_emit group instead of explicit
lens_on node, to support multiple lens beam emitting
nodes (e.g. glued/unglued) for firestarting, door
ablation, etc.
2022-01-09 13:07:16 -05:00
Aaron Suen
894fab64e1 Don't break timers/meta on optic gluing
This in particular seemed to affect shining lenses.
2022-01-09 13:02:45 -05:00
Aaron Suen
727dce0e37 Hint for optic gluing 2022-01-09 12:57:10 -05:00
Aaron Suen
7dc3933aaf Restore glued optics default right-click action
Allow placing against them, scaling them, etc.
2022-01-09 12:54:31 -05:00
Aaron Suen
85c96c8094 Glue optics in place with an eggcorn
This makes it possible to lock optics against
accidental rotation, which has been a problem.
2022-01-09 12:52:54 -05:00
Aaron Suen
8c9a8b7843 Warning message cleanup 2022-01-09 10:52:26 -05:00
Aaron Suen
0144a3edd7 Hints for forms and new shelf recipes 2022-01-04 06:19:49 -05:00
Aaron Suen
741955e097 Fix item deletion on crafting storage boxes
Since items inside box would be deleted, just don't
allow crafting of storeboxes/totes if there's already
an item trapped in the form.
2022-01-02 21:31:15 -05:00
Aaron Suen
4304c47c6f MAJOR: Shelf recipe rework
Finally use the new Forms to craft shelves
using a 2-component recipe, and replace the
old 3x3 recipes.  This affects:
- Wood shelves
- Clear glass cases
- Float glass cases
- Lode crates
- Tote handles

For now, we're just going with the simplest
recipe of just putting an item into the form.
If players want to store things in the form
without assembling a shelf, they'll have to
remember to drop items in through the top
only.

Forms may have served a purpose as makeshift
storage when actual shelves are too expensive
but this is NOT their purpose.  They are
primarily intended as crafting ingredients for
proper storage, and secondarily as hoppers for
stack-fed machines.  Any ability to use them as
actual player-controlled storage devices is
purely coincidental and not guaranteed.
2021-12-30 12:05:29 -05:00
Aaron Suen
2537bb7c27 Finish basic hint reform 2021-12-16 22:49:07 -05:00
Aaron Suen
7f5155f91d Glowing lens slow-start
Lenses enter a "glowing" state to propagate signal
immediately as before, but now they don't actually
produce light until powered steadily for 2 seconds.

This should mitigate the risk of "strobe" circuits that
cause excess lighting recalculations and irritate some
sensitive players.
2021-12-03 23:04:58 -05:00
Aaron Suen
1a1a4255db Rename Glass Tank to Glass Case
This caused copious confusion for new players, who assume the
glass "tank" is like an aquarium tank and can be used to carry
water.  Originally it was intended to seal in "moisture" for
sponge transport, but that has become a far less important use
case (and in fact sponge transport is probably best done just by
building submerged pathways, like the way amalgam transport is
done) and glass "tanks" are more like "display cases" now, or an
intermediate storage container that adds top access (useful for
totes).
2021-10-15 06:46:27 -04:00
Aaron Suen
25ae91cb17 More distinct non-lava-like look for molten glass 2021-10-01 07:02:07 -04:00
Aaron Suen
b73d1d1290 Pre-clean-transparent filter on all textures
Some users may use filtering but not have the "clean transparent"
filter enabled in the Minetest engine config.  Bake this filter
into all images to (1) avoid the consequences of this (i.e. black
halos), and (2) possibly speed up startup time (the filter will
converge immediately).
2021-09-23 07:36:21 -04:00
Aaron Suen
38fc6ab5d7 Subtler domain wall particles 2021-08-07 00:33:48 -04:00
Aaron Suen
d5d9cb07aa Tone down extreme glass brightness a bit 2021-08-07 00:16:54 -04:00
Aaron Suen
58968f39b7 Crude glass falls upon cooling 2021-08-06 23:05:09 -04:00
Aaron Suen
0e0a423e7e Make all liquids never exist as item stacks
Any liquids that are dropped should become
placed nodes.  It was observed before this that
wet concrete may have been displaced in such
a way that it created a stack node; this ensures
such things are precluded as much as possible.
2021-08-06 21:20:45 -04:00
Aaron Suen
ffb25a9162 More exact DNT names
Keep actual name of DNTs distinct and self-describing instead of
relying on modname, which sometimes changes when things are
refactored.
2021-08-05 07:35:20 -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
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
54a18a6097 Make lenses a bit more sensitive to activation
Specifically, molten glass should now trigger them
(intended) as well as 1 more tier of lux (probably
not important).
2021-06-22 00:50:22 -04:00
Aaron Suen
8e94e09aee Unify node update hooks 2021-06-20 08:20:46 -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
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
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
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
c3519ca37c Fix backface culling on most mesh nodes 2021-03-15 19:17:25 -04:00