97 Commits

Author SHA1 Message Date
Aaron Suen
99254bf726 Simple visinv tweening
- On door convey
- On item ent settling

Only able to support limited cases, and still can't
usefully animate nodes, but at least this makes
some item placement behavior look smoother.
2021-07-05 13:42:46 -04:00
Aaron Suen
11a3790bc6 Fix door ablation spurious refiring 2021-07-05 12:10:47 -04:00
Aaron Suen
2e27f9963f Iterative new approach to compact conveyors
If something is blocked, store it in a separate retry
queue.  If the thing that blocked it moved out of
the way, re-queue the things waiting on it for retry.
This is probably theoretically less efficient than the
old approach since it relies on finding opportunities
to move items on the fly and probably queues a
number of retries that will ultimately fail, but it's
simpler and easier to maintain than the old way.
2021-07-05 10:44:31 -04:00
Aaron Suen
56379676af Massively simplified door conveyance
The old logic was extremely over-complicated, in
an attempt to allow door conveyance to work with
no gaps and support loops.  This led to code that
was unmaintainable, and a node deletion bug that
was too difficult to fix.

The drawback to the new approach is that things
cannot be pushed by doors into spaces that are
occupied by another thing, even if that thing will
be pushed out of the way by the doors on the same
cycle.  This means that chains of items on
conveyors will always have an air-gap between
them.
2021-07-05 10:19:24 -04:00
Aaron Suen
c5d59fcc55 Fix node destruction bug
Unfortunately this also causes conveyors to jam for
one turn if there is no airgap between nodes on
certain conveyors, but it's better than the original
bug.
2021-07-04 19:45:26 -04:00
Aaron Suen
8a11db9825 Fix doors unable to push single item into storeboxes
The special case of trying to push a single item into a storebox
is an overlap between the item catapult and the place-node recipe.
Change the priority order so the catapult check is done first.
This is not expected to cause problems in other cases because in
those, the presence of a "backstop" node causes them not to overlap.
2021-07-01 19:15:58 -04:00
Aaron Suen
56b718f479 Door ablation particles 2021-04-03 19:21:09 -04:00
Aaron Suen
13c633e19e Fix long-standing infinite loop freeze in door logic
Thanks to NoComment for discovering, researching, and reporting.
2021-03-11 08:15:39 -05:00
Aaron Suen
817a9692da Remove redundant door registrations
Don't make door panels out of doors/panels.
2021-03-11 07:58:27 -05:00
Aaron Suen
410ebd5d8d Recompression using ECT
https://github.com/fhanau/Efficient-Compression-Tool
2021-03-09 08:16:23 -05:00
Aaron Suen
c10e80ef87 Set name in mod.conf as demanded by 5.5+ 2021-03-01 20:10:27 -05:00
Aaron Suen
b3af182427 Prevent a door item destruction bug
If two stacks try to move into the same spot at the
same time, both will be placed there and one will
overwrite the other; instead, we should do a check for
the "head" of a moving item chain (the only one that
can be moving into a space not being vacated by
another) and block collisions.
2020-10-15 20:04:01 -04:00
Aaron Suen
08be3a497e Hint wording tweak 2020-10-05 22:01:18 -04:00
Aaron Suen
9bb5c23c39 Fix silk touch when digging by machine 2020-10-05 21:34:28 -04:00
Aaron Suen
a83e2e9e25 New door automation hints 2020-09-29 23:27:41 -04:00
Aaron Suen
16641ff3e9 Fixed door pummel/dig handling
- Use catapult infrastructure instead
- Checks for storebox open sides
- All manual tests passed
2020-09-29 22:54:28 -04:00
Aaron Suen
15282c88a7 Initial working door digging/pummeling 2020-09-29 22:44:09 -04:00
Aaron Suen
8bb999f631 Make sure stack fits in target box 2020-09-29 22:27:05 -04:00
Aaron Suen
a63b38f72a Press injecting into storeboxes 2020-09-29 21:28:34 -04:00
Aaron Suen
9a23e1f65f Separate press/catapult code 2020-09-29 21:13:31 -04:00
Aaron Suen
e776723a3f Code format 2020-09-29 20:52:31 -04:00
Aaron Suen
502192b6ab Presses can eject items out of shelves 2020-09-29 20:52:18 -04:00
Aaron Suen
3203ddc6a9 Fix door hints not saying "hinged panel" 2020-09-26 22:12:57 -04:00
Aaron Suen
723d30897d Fix a couple more hints 2020-09-26 14:55:15 -04:00
Aaron Suen
b03b047f0a Buff door catapult, esp higher level doors 2020-09-16 19:46:10 -04:00
Aaron Suen
81df25633a Add stone brick doors 2020-09-12 21:20:46 -04:00
Aaron Suen
de87702497 Door crafting hints and witnessing 2020-09-11 01:08:20 -04:00
Aaron Suen
c47008bc44 Door presses can now place nodes and craft
Thanks to Kimapr for the basic approach, and proving
the concept.

Doors pressing a single-item stack now place that
item as a node, and trigger placement recipes.  Doors
pressing nodes that don't have a single item stack
node form (sticks, leaves) also trigger placement
craft recipes.

All craft pressing recipes require some form of
backstop to provide pressure.
2020-09-07 10:53:51 -04:00
Aaron Suen
18b01c1ae7 Redistribute hints into each mod
Hints themselves have not been tided up
much, but this makes the project of fixing the
hints for each mod a little more manageable
and breaks up the hard-to-navigate single
monolithic hints file in the old guide mod.

The old guide mod has now been completely
retired.  Hints are now a full-fledged API-layer
standard feature.
2020-09-04 19:07:45 -04:00
Aaron Suen
edea123a1e Start on new unified Hint API
- Move hint handling down to API layer
- Simplify stat data; old nc_stats counting can
  be moved out to a separate mod.  We only
  need whether the player has seen or not.
- Invert inventory tab responsibility.
- Merge witness system in from crafting.

TODO:
- Redistribute hint registration responsibility
  to individual mods.
- Test external mod compat.
- Retire old nc_stats and nc_guide systems.
- Add a way to reset hints.
2020-09-04 16:28:27 -04:00
Aaron Suen
f01be30a00 Tidy up registration reporting 2020-07-16 07:29:11 -04:00
Aaron Suen
7f620c462f Revert door logic position hashing
For some reason pos_to_string gives us correct
behavior, but hash_node_position does not, even
though we check to make sure that nodes are
properly rounded so non-integer issues should not
apply here.
2020-07-09 21:18:18 -04:00
Aaron Suen
94401942ee Protect doors, standardize protection 2020-07-01 00:30:40 -04:00
Aaron Suen
b2f78c0daa Indexing for craft checks
By restricting the recipes we check based
on the name of the central object being
checked, we can do many fewer craft
checks per item and avoid expensive
checks.
2020-06-27 12:20:35 -04:00
Aaron Suen
42f125c716 Make most recipes indexable
Register a "rootmatch" property for all
recipes that represents a broader, quicker
test for recipe eligibility.  False positives are
allowed but false negatives are not.

Since most recipes are eligible, we can
use this to build an index for fast lookups
of subsets of recipes to run and skip most
of the other ones.
2020-06-27 11:06:43 -04:00
Aaron Suen
b8bf2322fa More work on DNTs
- DNTs can have default time value
- Automatic loop option
- Optional node name filter
- Use DNT for scaling particles
- A few tail call optimizations
2020-06-19 09:38:03 -04:00
Aaron Suen
d3dc7f28e1 Trigger door ablation instantly on signal 2020-06-19 00:30:17 -04:00
Aaron Suen
db2d748104 DNT API and reliable door ablation
- New Delayed Node Trigger API that allows
  the use of multiple externally-defined node
  timer events, as long as on_timer of a node
  is not explicitly overridden.
- Use the new DNT system to make door
  ablation reliable.
2020-06-18 22:35:47 -04:00
Aaron Suen
984e87e155 Consistent ABM labeling
- Make sure every ABM has a label
- Use consistent case
- More concise names / consistent voice
2020-06-17 07:09:20 -04:00
Aaron Suen
e0156b4742 Add profiler instrumentation metadata everywhere
N.B. the MT built-in profiler doesn't yet actually support reading
labels from bare-function registrations, so a builtin hack is
needed.
2020-06-15 07:21:39 -04:00
Aaron Suen
0067c5d18d Remove delay/jitter from limited abm
Before, ABM firing was delayed by up to a full
interval, but the fulfillment timer could wander
around relative to the trigger, which could lead
to unreliable door ablation.

Instead, just always run the ABM fulfilment
triggers on the next tick, so limted_abm is
ONLY doing the limiting for events that arrive
within the same tick, as most ABMs do.
2020-06-01 21:44:22 -04:00
Aaron Suen
1d0f9aa81f Fix doors/concrete API registration
When 3rd-party mods try to register extensions, don't
crash on trying to register in wrong namespace.

Keep registrations to original mod namespace for now,
as I'm not certain whether I actually made assumptions
about mod name in some logic.
2020-05-18 18:09:44 -04:00
Aaron Suen
35292eb259 Switch to an internal sound API
Avoid mangling official Minetest API
functions that mods may want to
use directly.
2020-04-05 21:22:51 -04:00
Aaron Suen
5e4df4b1f0 No, wait, still need that dependency 2020-03-29 21:34:59 -04:00
Aaron Suen
e7d4d54b1c Genericize chisels, fix recipe digging
- Register groups for chiseling doors.
- Make recipe digging not use player inventory, but drop
  as an item unconditionally.  N.B. the old "replace with air
  then drop item" method only worked with explicit item
  names and not group detection.
2020-03-29 21:32:15 -04:00
Aaron Suen
7bc24b773f Drop rod chisel as an item instead
Instead of instantly digging the rod, which makes it look like
it disappeared, try just "loosening" it into an item so it can be
scooped up without the pick.

It was always also possible to place the rod as an item and
pound that in, making it easier to pick up, but this may not
have been obvious to most players.
2020-03-29 21:23:45 -04:00
Aaron Suen
98b7e21533 After chiseling a door, automatically dig rod
Also adds the ability to register recipes to automatically
attempt to dig a node upon completion.
2020-03-29 21:18:40 -04:00
Aaron Suen
e575cb9b26 Some more hint bugfixes. 2020-01-21 21:36:05 -05:00
Aaron Suen
e2a5581085 Hint updates! 2020-01-21 21:19:30 -05:00
Aaron Suen
7bc1a4ddad Standardize node placement sounds.
Add node placement sounds to processes
missing them, like tree growth.
2020-01-16 22:02:59 -05:00