2101 Commits

Author SHA1 Message Date
Aaron Suen
57ded7744d Humus is not interchangeable with dirt
This probably breaks using humus as a substitute for
dirt in making adobe, which is probably fine.
2021-12-08 22:06:24 -05:00
Aaron Suen
08593e7132 Allow tarring aggregate via thrown items
This makes agg tarring automatable by catapulting
coal lumps into we aggregate pools.
2021-12-07 23:21:46 -05:00
Aaron Suen
3e262c0a17 Avoid soaking cache collisions
It's possible multiple soaking ABMs are registered
against a single node, and if this happens, make sure
that the qty and time fields in the cache are kept
separate the same way they are in the node meta.
2021-12-07 23:01:14 -05:00
Aaron Suen
25e0219ad8 Desynchronize node ambient sounds
- Removes repeating patterns, creates a richer and
  fuller sound experience
- Larger areas fill sound volume out better instead of
  just repeating more loudly
- Spread network traffic across multiple ticks better
  to reduce packet spikes

Each node position has a set delay, between 0 and 1
second, that's fixed for that pos but varies more or
less randomly between positions.  This ensures that
sounds loop with the same frequency and alignment
for a given single node, but desync across nodes.
2021-12-07 00:57:33 -05:00
Aaron Suen
ffadef37fc Fix misisng grass group 2021-12-07 00:41:29 -05:00
Aaron Suen
1e0b9dbbaa Disallow wind from passing thru solids 2021-12-07 00:35:02 -05:00
Aaron Suen
3ea2ce8827 Much more palpable wind sounds
Instead of statically-positioned wind sounds, many
of which are often outside of hearing range,
attach sounds to moving entities which often tend
to move across the player's position.
2021-12-07 00:11:15 -05:00
Aaron Suen
f0a3c7151b Tote fixes and improvements
- Fix item loss when totes ignite
- Slots used / total in description
2021-12-06 23:40:54 -05:00
Aaron Suen
13abe9a45b Add hard stone support for anvils
Deeper strata can be used, and each is twice as
resistant to weakening as the one above.
2021-12-06 22:26:57 -05:00
Aaron Suen
ada9e11987 Support probabilistic craft node replacement 2021-12-06 22:25:03 -05:00
Aaron Suen
f1c43f0594 Handle open-bottom storeboxes on tote place
When using forms with totes, if the items in forms
are not supported, they should fall.
2021-12-05 15:25:08 -05:00
Aaron Suen
af5056ce54 Looktip for fire, more notes 2021-12-05 14:45:16 -05:00
Aaron Suen
ad8bf99800 Reduce sponge colony growth load 2021-12-05 14:30:11 -05:00
Aaron Suen
ca694993c9 Un-delay inverted ABMs
Instead of queueing inverted ABMs and then running
them out-of-band, run them inside the normal ABM
schedule time.  This should:
- Prevent ABM mux lookup problems caused by nodes
  changing after a delayed inverted ABM schedule and
  the action actually running
- Allow the ABM scheduler to better account for the
  time spent running inverted ABM actions, to ensure
  that they properly count against the default 0.2s
  ABM runtime budget and can't spike lag up higher.
2021-12-05 14:11:01 -05:00
Aaron Suen
bf744aab8b Fix excess meta writes in soaking API
It didn't seem to affect many test cases, but avoid
excess calls to meta:set_*() due to 0/nil disagreement.
2021-12-05 09:10:43 -05:00
Aaron Suen
d99e8ca55c Dirt leaching ABM nano-optimization
Slightly accelerate the most common case, of dirt
not exposed to water at all.
2021-12-05 09:04:59 -05:00
Aaron Suen
f412b7f570 More extensive ABM statistic reporting 2021-12-05 09:04:17 -05:00
Aaron Suen
5d1833c983 Hints for each anvil process type 2021-12-04 21:46:11 -05:00
Aaron Suen
d0132e4127 Flowers will survive but NOT spread on grass 2021-12-04 21:33:40 -05:00
Aaron Suen
8edd665b68 Revert "Make grass node undersides subtly distinguishable from dirt"
This reverts commit b1661c976e3a6420c3917a5322ee72e0dd9ddb6d.

This was done inconsistently and the problem extends to a number
of nodes, which should probably all be fixed at the same time.
2021-12-04 21:31:08 -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
8bf23e6f0a Fix DNTs not being reset on node replace
Invalidate DNT cache when nodes are changed and
force it to be re-read from meta, as meta was also
likely cleared during that operation.
2021-12-03 23:02:31 -05:00
Aaron Suen
8d38fe5421 Make mature sedges easier to spot
Use a taller, fully square selection box for them,
adding 1 extra level worth of box height (from 4/8
to 6/8 instead of 4/8 to 5/8).
2021-12-03 22:41:39 -05:00
Aaron Suen
b1661c976e Make grass node undersides subtly distinguishable from dirt
Add grass root texture to underside (and visible part of dirt
on sides) of grass node.  The difference in node sounds but same
visuals was always an inconsistency, and since touchtips became
looktips, players being able to distinguish grass from dirt from
the underside didn't make sense without an actual visual
difference.
2021-12-03 08:15:56 -05:00
Aaron Suen
34a2562964 Polyfill for player:get_velocity, clean up other hooks
This gets rid of the 5.4+ "deprecated get_player_velocity" warning
and modernizes the code to use get_velocity() everywhere, while
still remaining compatible with 5.3 for now (tested).  The polyfill
had to be on joinplayer because the nc_player_pickup auto-one-time
method of using after() won't reliably patch the player before some
other globalstep tries to read player velocity.

When MT 5.5 is released and 5.3 support ends, the polyfill just
needs to be removed to clean it up.

Also tidied up and consistentized the logging for other hooks.
2021-12-03 08:09:57 -05:00
Aaron Suen
7aaf383f70 Annealed lode forms 2021-12-02 22:07:13 -05:00
Aaron Suen
a861cb7cba Wet things also suffocate grass
Wet or living sponges on top of grass will not allow
air in and will suffocate grass.
2021-12-02 18:39:34 -05:00
Aaron Suen
0f0f4efbff Make leaves and other non-walkables press-diggable
Check for a dig recipe first before attempting to
catapult item through the node.  This should make all
non-solid nodes diggable including loose leaves,
sedges, rushes, flowers, etc.
2021-12-02 18:33:24 -05:00
Aaron Suen
13e71e5c53 Disallow forms inside other storeboxes
Consistent with other shelves
2021-12-02 18:28:14 -05:00
Aaron Suen
af44989f7a Add simple "current tab" indicator 2021-12-02 07:33:01 -05:00
Aaron Suen
44b2aa4b25 Formal API for pushing events into inventory tabs
Mods that are responsible for inventory tabs can setup their
own event hooks, then call inventory_notify to alert inventory
tabs of certain events.

Inventory tabs can include registered handlers for specific events
allowing them to e.g. clear caches, and then if the handler
evaluates to true, the tab is updated.
2021-12-02 07:09:07 -05:00
Aaron Suen
6866bade5b Remember player's last inventory tab
Note that some tabs may have time-dependent contents (e.g. the
hints/challenges tab, or add-on mod tabs) and need to be notified
of this in the event that they are the current tab.  It will
be the responsibility of each tab to watch for appropriate events
and perform background updates as necessary.  The hint tab does
this on an event-driven basis from player discovery.
2021-12-02 06:55:09 -05:00
Aaron Suen
ce27780dd4 Preserve raw forms of ALL base APIs 2021-12-02 06:19:38 -05:00
Aaron Suen
b9d9efe0c1 Make stack columns work with catapult from forms 2021-12-01 20:51:37 -05:00
Aaron Suen
96ba8342ea Fix items tunneling upward from confined spaces
Items being "bumped up" upon landing due to the new column
preserving falling mechanics will never be lifted to higher than
the local maximum posiiton from which they fell.

This should prevent e.g. planks tunneling up several nodes from
a log chopping machine if there isn't enough room for the planks
to escape and the chopping machine is enclosed from above.  Items
can still tunnel using the normal "settling" mechanics, but will
not have the strong upward bias that the column settling mechanic
gave them.
2021-12-01 07:57:08 -05:00
Aaron Suen
36d30ee1aa Storeboxes are always door-diggable from below 2021-12-01 07:46:07 -05:00
Aaron Suen
4acedd01a3 Fix door press crafting recipes
The door could not handle recipes with duplicate
labels, which now includes the anvil recipes.

Switch to just identifying them by reference.
2021-11-30 21:13:41 -05:00
Aaron Suen
413641aa71 Fix delayed witness, finish known form use-cases 2021-11-29 23:10:22 -05:00
Aaron Suen
bba0a17abe Flexible craft discovery API
- Flexible discovery list format for discover and
  witness APIs
- Add "discover" key to recipes that contains a list
  of discoveries to give players so they can act like
  recipe groups and allow different recipes to
  complete hints

Recipe group system should be easier to setup for
hints than having to list all hints individually.  We
can use them especially in recipes that are loop
generated.
2021-11-29 21:08:34 -05:00
Aaron Suen
9120c78511 Compact mod list formatting
Make it easier to fit long lists of related mods in
the About box if possible
2021-11-29 20:41:09 -05:00
Aaron Suen
16022542d9 List non-game mods directly on About screen 2021-11-27 22:03:18 -05:00
Aaron Suen
d0edf8bc38 Fix crash: item settling must always return stacks 2021-11-27 19:57:38 -05:00
Aaron Suen
9235744612 Items can cool in storeboxes, but not cook
Cooking recipes run in all visinv nodes, not just
item stacks, BUT non-stack-only nodes (i.e. all
storeboxes) block flame touchgroups so things
in boxes cannot be heated/melted.

This allows items dropped into boxes from ore
melting to cool, but prevents sand from being
melted in a box which would naively replace
the box with the molten glass entirely.

This also fixes an old rumored bug where forcing
glowing lode items into a shelf with a door would
cause them to stay hot indefinitely.

N.B. lode cooking/cooling used to assume it could
replace the entire node, and deleted the thing
as a fail-safe when an item of the given temper
was not found (e.g. tools w/ handles).  This is
now gone, and invalid tempers will throw errors
if they can ever be achieved in practice.
2021-11-27 19:26:31 -05:00
Aaron Suen
919eec3e1b Wooden forms are choppy
Either dig them with a hatchet/adze, or "collapse"
them back to frames to move them by hand.
Even though it's the same basic material as the
wooden frame, having them too easy to dig
makes it to easy to accidentally dig while trying
to pull items from it.
2021-11-27 18:47:59 -05:00
Aaron Suen
6bbec211e7 Merge branch 'dev' into pezredo 2021-11-27 18:37:56 -05:00
Aaron Suen
c4f79c2f6d Disallow form->frame when occupied
This was destroying the stack inside the form.
2021-11-27 18:37:48 -05:00
Aaron Suen
3a6dab2b62 Fix blockage detection w/ forms 2021-11-27 18:30:15 -05:00
Aaron Suen
597ad823ae New smarter stack settling recursion
When an ent settles, start an iterative process
of checking each ent near it for settling, bumping
ents upward as needed (during the process only)
and keeping them ordered by their starting height
so that things that start lower settle earlier (and
thus remain lower) even if ents have fallen and
bunched up together due to physics and large
timesteps.

Seems to work fully for falling_nodes (keeps
them in a column and settles them in order), and
partially for items (keeps them in a column but
does not always settle them in order).
2021-11-27 18:25:10 -05:00
Aaron Suen
b33769d56f Remove legacy pez dispenser handling
This puts all falling item and node entities on a
level field with items falling through forms again.
2021-11-27 17:39:38 -05:00
Aaron Suen
148790bdcb Merge branch 'dev' into fallthrureform 2021-11-27 16:16:11 -05:00