82 Commits

Author SHA1 Message Date
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
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
8e94e09aee Unify node update hooks 2021-06-20 08:20:46 -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
c10e80ef87 Set name in mod.conf as demanded by 5.5+ 2021-03-01 20:10:27 -05:00
Aaron Suen
6b3e5f21a1 Allow custom toolgroups for craft check 2020-09-29 22:39:55 -04:00
Aaron Suen
a78bf0ea2a "Lazy" crafting API
Instead of checking for and immediately
completing a craft, the API can be told to
search for a recipe and return a function that
can be used to commit it later.  This way,
we can search for a valid recipe during the
"check" phase of a craft check and then
commit it during the "after" phase.
2020-09-29 21:44:26 -04:00
Aaron Suen
64e917fc95 New witnessing system
If a player is close enough to an event when it
happens (withing "likely hearing" distance) then if
they later punch the node then they can "collect"
the discovery.

The idea is that if a player hears the sound of
something happening, then they might go and
investigate and discover the thing they thought
they had left there isn't what's there anymore.

In retrospect I may want to combine this with a
limited form of the visual witnessing, just as there
may be events that a player is less likely to touch
in aftermath, or may not be practical to (e.g.
if what's left behind is air)
2020-09-26 17:52:09 -04:00
Aaron Suen
de87702497 Door crafting hints and witnessing 2020-09-11 01:08:20 -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
94401942ee Protect doors, standardize protection 2020-07-01 00:30:40 -04:00
Aaron Suen
72839b1a74 Fix press and other late-registered recipes 2020-06-27 19:03:49 -04:00
Aaron Suen
e7911dd7fd Fix crash on empty craft set 2020-06-27 13:32:03 -04:00
Aaron Suen
7ae24bf7fa Further craft set reductions
- Merge the "legacy, could be anyting" sets
  into every other set so we can do only 2
  set lookups instead of 3.
- Make sure we don't do any duplicate
  recipe checks.

N.B. the craft priority order MAY be different
now, since primary node recipes are
checked before visinv stacks.
2020-06-27 13:00:34 -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
e1a558b754 Sneak+punch prevents pummels 2020-06-19 13:45:51 -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
4a4fd996a1 Register cooking to use DNTs 2020-06-19 00:29:49 -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
3d561a229b Optimize stack cook/cool check
If the item type does not at least pratially match any cooking/cooling recipe the first run, assume it never will and cache this fact
so we can quickly skip all stacks of the same
item next run.
2020-06-17 01:23:30 -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
6c640a11b1 Validate log message levels 2020-06-09 19:02:07 -04:00
Aaron Suen
a998009656 Merge branch 'master' of gitlab.com:yamanq/nodecore into dev 2020-06-09 18:57:34 -04:00
Aaron Suen
e9b9bd43d9 Protection support for storeboxes, pummel 2020-06-09 18:10:44 -04:00
Aaron Suen
5f165b4da3 Fix crash on completing stone brick chisel
Bug was introduced in 16a7c9fe, caused by
the fact that sometimes nodes are dug by nil,
i.e. the way the chisel is dug up automatically
in the chiseling process.
2020-06-01 18:08:59 -04:00
Aaron Suen
16a7c9fe26 Completing a dig resets pummel
This should fix false pummel detection on long
hard-stone dig/drop-in-place sequences
2020-05-31 08:51:02 -04:00
Yaman Qalieh
a8147e9875 Add levels to log messages 2020-05-27 14:04:00 -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
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
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
7bc1a4ddad Standardize node placement sounds.
Add node placement sounds to processes
missing them, like tree growth.
2020-01-16 22:02:59 -05:00
Aaron Suen
25be3b07a8 Small pos key calc optimization. 2020-01-10 21:11:52 -05:00
Aaron Suen
c6584d79d4 Settle craft excess immediately. 2020-01-09 22:23:32 -05:00
Aaron Suen
dcfc80b367 Remove explicit names in mod.confs. 2020-01-05 12:38:45 -05:00
Aaron Suen
89020e8340 Major rebuild of item_entity.
This created a ton of dependency inversions, which
necessitated moving a number of API functions up into
higher layers, and restructuring dependency lists for
a number of mods.

BOLO: non-deterministic load errors due to missed
dependencies.
2020-01-05 11:42:22 -05:00
Aaron Suen
3eb21593b6 Block accidental new pummel recipes from hand-dig. 2019-12-29 14:08:27 -05:00
Aaron Suen
5b0459e4bb Speed adjustment settings for many long-running processes.
Many processes that have a significant speed/time component can
now have speeds adjusted (as a multiplier from base rate) via
settings.

Things that can be adjusted:
- Tool speeds (including digging and pummeling)
- Cooking and pummel recipe durations
- Soaking processes like tree growth, peat fermentation

The settings are hierarchical, so groups of rates can be
adjusted together, and a further multiplier can be applied to
each member of the group.

The settings are calculated dynamically, for power users only,
and documenting them is out of scope for the project.

Specifically, this should help tuning for Kimapr's SkyBlock, and
possibly other mods involving signficant gameplay rebalancing.
2019-12-06 07:01:12 -05:00
Aaron Suen
07850123d7 Standardize high-resolution gametime.
Use high-res version in a few places we were using integer-res
timer before.  This should e.g. smooth time variation of wind
strength for ambient sounds.
2019-11-10 08:10:34 -05:00
Aaron Suen
20e4432598 Apply "press" recipes to nodes jamming doors.
Nodes need to have a "backstop" node of some kind
holding them in place.  Automatically convert all
thumpy pummel recipes to press recipes too.
2019-11-01 20:42:44 -04:00
Aaron Suen
e5f54b49f6 Add witness system for cooking/soaking recipes. 2019-10-27 10:05:57 -04:00
Aaron Suen
c147da4dde Convert from depends.txt to mod.conf 2019-10-05 11:24:16 -04:00
Aaron Suen
7e75fd149a Quote consistency. 2019-09-14 09:49:06 -04:00
Aaron Suen
07239de73c Scaling overhaul as a "navigate caves by feel" system.
- Make handhold nodes glow, to visually simulate the player
  character's now "familarity" with them by feel.  We have to
  represent it synesthetically because the game only gives us
  sight and sound to work with.
- Make floors "scalable" so that they glow, even though they
  don't affect maneuverability.

The effect of this is to allow a player who has fallen into a dark
cavern to navigate, slowly, by feel, allowing more extensive
self-rescue possibilities.
2019-09-09 08:14:07 -04:00
Aaron Suen
52de19a28c Unified falling check, check after craft. 2019-09-09 07:05:01 -04:00
Aaron Suen
0c9544d6b5 Some scaling/particle cleanup, make scaling particles distinct. 2019-09-07 09:32:36 -04:00
Aaron Suen
310ce1bc6c Treat NodeCore as a unified thing.
- Collapse all nodecore "core" mods in the /mods listing, so it's
  easier to find the actual add-on mods.
- Parameterize in-game branding to make renaming derivatives just
  a little easier.
2019-09-07 09:08:57 -04:00