220 Commits

Author SHA1 Message Date
Aaron Suen
dea2432325 Add stasis/quell state to cheat HUD, detect more node types 2023-06-20 08:01:43 -04:00
Aaron Suen
5d8e2d9eb4 Add radius param to some cheats
This should make it easier to snuff mass
fires created by griefers quickly.
2023-06-09 21:45:18 -04:00
Aaron Suen
c4db970cfa Revert "Exact sprout selectionbox tweak"
This reverts commit 16ed60d43fdba76d01d5800e561bd0c401085399.

After playing with this for a while, it's too ugly and the sprout
bit itself isn't really tall enough to warrant a tiny extra
selectionbox.  I had done this because the catrealm mod has a
bush stem node that's bigger, and applying it to the bush sprout
was consistent, and thus the eggcorn sprout too ... but maybe
it makes more sense to just exempt the tiny sprouts.
2023-06-01 21:12:25 -04:00
Aaron Suen
16ed60d43f Exact sprout selectionbox tweak 2023-05-26 19:21:37 -04:00
Aaron Suen
49e649349d Flammable eggcorn sprouts, plantlike_rooted ignite API 2023-05-21 19:53:22 -04:00
Aaron Suen
eaa1f34c3f Fix peat auto-fermenting bug
Peat should never ferment on its own, it should require face
contact with some kind of soil.  Unifying it with tree growth rate
code caused it to ferment on its own because the assumption that
tree roots contain their own soil and base moisture.  Peat should
only have its own moisture but not its own soil.

This also allows peat to be used as an emergency "moist" node on
its own in e.g. skyrealms for cultivating flora, as long as it's
contained so that only its moisture can leak out but it cannot
be exposed to fermenting microorganisms from nearby soil.
2023-05-06 19:48:28 -04:00
Aaron Suen
7b4d953c1f Prevent ticking-automation exploits
The soaking-tickling mechanism was intended only to speed up
otherwise very boring "waiting" gameplay gates in skyblock play,
by allowing players to trade attention for time.  It seems it has
been exploited in vanilla play, though, by triggering the tickling
recipes far faster than they normally should be triggered by
hand, using doors, breaking the time cost balance of things like
leaching or growing trees.

Add a "cuddly" dig group to the hand, and ONLY the hand, and make
the tickling recipes use this group so they only work with the
player's actual hand.

N.B. this group can be used for other pummel recipes in mods,
where a gentler touch is needed that cannot be gotten from a tool
or a machine, such as petting animals.
2023-04-26 07:10:34 -04:00
Aaron Suen
5bc651e067 Change leaf decay to use groups 2023-01-14 11:49:36 -05:00
Aaron Suen
16b6fb96e5 Fix black spouts when smooth lighting off
Apparently the eggcorn_planted node needs to
have paramtype="light" to have actual light for
the sprout part, and we have to deal with the
fact that the base probably passes light now.
Using smooth lighting hides the lighting glitch.
2022-12-14 19:07:49 -05:00
Aaron Suen
63b9ba5909 Don't convert tree trunks to logs in falling ents 2022-12-10 14:06:15 -05:00
Aaron Suen
dd2a12d8c1 Hotfix for a texture alpha warning 2022-10-27 08:00:42 -04:00
Aaron Suen
af691675b9 Refactor, simplify, and limit to specific nodes
- Use the existing on_stack_change hook instead of creating new
  on_stack_[un]fill hooks, to simplify util_stack.
- Automatically register bulk nodes, but only for nodes being
  registered that request bulk optimization.
- Remove some code duplication and registration complexity.
- Hand-pick nodes for bulk storage optimization based on a survey
  of actual usage from a dump of the NodeCore Community server
  world map.
- Use a separate group for visinvs with hidden entities.
2022-10-26 07:58:23 -04:00
Aaron Suen
166cfe5f14 Mitigate excess server block sends
The problem was pointed out by Josh
(gitlab.com/krazy-j) in merge request !22.
Apparently MT is not very smart about marking
mapblocks dirty to send to clients based on
calling mt.set_node(), i.e. it will mark them
dirty presumptively even if you set the node to
the same value it had already been.

This behavior can be confirmed by registering
an ABM against a common node like grass and
setting action = minetest.set_node.  This
causes every mapblock containing that node
to be invalidated every interval, causing a big
spike in the packets received each interval
that you can clearly see on the F5 graph.

Rather than just fixing it for the most easily
observed case (fire checks), add utlity functions
to check this for ALL node change situations,
and apply it more or less universally anywhere
that we are not certain that the node is being
changed and we don't need to worry about the
extra overhead cost of the check.

Note that we don't need a
nodecore.set_loud_check call, as set_loud was
only ever being used already in cases where
we were pretty sure we were actually changing
a node.
2022-08-24 20:44:14 -04:00
Aaron Suen
3b9eb9fbaa Remove errant debugging cruft 2022-05-28 07:50:18 -04:00
Aaron Suen
b10da442dc Eggcorn planting automation
A single eggcorn that finds itself "forced" into a node
of loose dirt (e.g. by being displaced by a falling loose
dirt node that settles where it was) will become a
sprout.
2022-05-27 22:32:57 -04:00
Aaron Suen
275cd18d43 Fix accidentally silk-touchable leaves
This was also apparently an item dupe bug at the
same time...
2022-04-05 19:10:40 -04:00
Aaron Suen
1da5ebcc7f Soaking tickle recipes require placed nodes 2022-01-23 16:51:39 -05:00
Aaron Suen
9637299f4c Fix leaf decay forcing, changed field name
Handles both natural decay and manual digging.
New field name more properly reflects actual meaning.
2022-01-16 14:04:42 -05:00
Aaron Suen
32b2ea1591 Allow forcing leaf drops via node meta
This can be useful for skyblock mods to ensure that a
"starting tree" has at least enough of certain items to
craft basic tools and start sustained tree farming.
2022-01-16 13:34:05 -05:00
Aaron Suen
13a5b64a25 Recipe for leaf bud tickling 2022-01-15 14:42:26 -05:00
Aaron Suen
81b0d85418 Tickling recipe for peat composting 2022-01-15 13:54:35 -05:00
Aaron Suen
f0ea46e4f6 Standardize "tickling" rate
Base rate on the natural ABM soaking rate, so
that quality of environment can still be used
to increase rate.
2022-01-15 13:54:11 -05:00
Aaron Suen
db8f5c79b7 "Tickling" recipes for tree growth 2022-01-15 13:40:02 -05:00
Aaron Suen
acd4156ed8 Soaking "tickle" API, standardize particles 2022-01-15 13:29:50 -05:00
Aaron Suen
7152c487ce Access to flora as weeds via peat fermentation
- Made grass from peat more common
- Flowers spontaneously grow on humus under sun
- Sedges spontaneously grow on grass
- Rushes can spawn near water and sedges
2022-01-15 12:03:28 -05:00
Aaron Suen
fde1d0ade7 Fix leaf decay check destoying loose leaves 2021-12-25 23:57:26 -05:00
Aaron Suen
a1b2df3941 Begin standardization of unload bounds check
- New near_unloaded API that supports custom
  distance parameter, map bounds check, and
  some optimizations.
- Add area automatic unload check support to ABM
  API and add to applicable ABMs, replacing many
  old manual checks.

Note that the explicit unload check is only strictly
necessary when something will happen due to
a node NOT being present in the area, e.g. something
igniting due to absent coolant, or soaking quantity
being reset due to missing sources.  In simple cases
where the absence of a thing causes the ABM to do
nothing, then the standard check can work because
the default action is to do nothing anyway.
2021-12-18 11:28:14 -05:00
Aaron Suen
2537bb7c27 Finish basic hint reform 2021-12-16 22:49:07 -05:00
Aaron Suen
fb76d23f36 Expand peat grinding to groups
- Use groups so it's easier for mods to add things
  that can be ground into peat.
- Pretty much all flora can be ground into peat as well.
2021-12-16 20:47:13 -05:00
Aaron Suen
0e96a579b1 Fix leaching hints 2021-12-12 00:33:17 -05:00
Aaron Suen
f5e966480b Fix delayed witness mis-ordering
Witness checks include data about the node in
place at the time that the witness even occurred,
so players are not awarded credit if the node they
see there was changed again afterwards.  A lot of
old witness code inserted the witness right
before the node was changed, since the node
change was done as a tail call, but this does not
work with delayed witnessing because the
delayed witness data would be tied to the old
node, not the replacement one.

Moving witness to after node setting should fix
a number of broken hints that should have been
delayed-witnessable, e.g. brick bonding.
2021-12-12 00:04:37 -05:00
Aaron Suen
c34bc39530 Soil leaching now requires raked soils
This is a design compromise to knock out the
worst offender in ABM cost, by requiring a node
that must be created by player action instead
of ubiquitous naturally-occuring nodes that all
need to be checked.

Leaching is really meant to be more of a minor
gameplay element anyway, for either skyblock
purposes, or for people who are bored enough
that they want to take on a challenge like a
neutral eco footprint; most normal players just
gather the materials from mapgen and hardly
bother with leaching recipes anyway.
2021-12-11 11:25:18 -05:00
Aaron Suen
7db1beee70 Add raked dirt and humus
These also function as "farmland", as raking enhances
the nutrient bioavailiability.
2021-12-08 22:30:50 -05:00
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
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
b2269d4424 Fix opaque leaves appearance
Draw faint (and code-configurable) outlines
of leaves when opaque, and don't let
texture_clean_transparent completely fill
in the gaps with green.
2021-08-19 00:48:14 -04:00
Aaron Suen
5639ec773c Simplify early-game hints
Lock more things behind prerequisite hints, even if
they're not absolutely strictly necessary to complete
in that order, if they would commonly be done in
that order.  This reduces players being overwhelmed
by available hints very early in the game, and avoids
red herrings like "find lux" which can technically be
accomplished but yields no useful results until the
player can act on them.
2021-08-14 08:29:27 -04:00
Aaron Suen
d7dbde8765 New stackapply recipe type
For "applying" an item to a stack using right-click.
So far, replaces the old eggcorn planting recipe; to
be done include tool stone-tipping and adze
graveling.

Using the new recipe allows more inversion of control
/ dependency injection, so we don't have to override
on_place or on_rightclick in definitions anymore, and
stop having to recreate some of the base logic from
the crafting system, e.g. discovery, placement sounds.
2021-08-14 08:01:50 -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
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
e6463eb259 Rush spreading and refinements 2021-06-28 21:05:31 -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
95f0fb0ee9 Heaviest image compression option 2021-03-09 08:33:58 -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
6b5f7e9ace Higher-quality soil gives eggcorns a boost
Just as surrounding sprouts with higher quality
soil causes them to mature faster, planting them
direcly in higher-quality soil gives them a oneshot
boost (since the soil quality is consumed
immediately).
2021-03-02 20:09:19 -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
7a21096731 Accelerate leaf decay
When leaves decay, they accelerate checks for
decay of nearby leaves, so overall tree leaves
decay much faster, but without increasing load
at steady-state i.e. for stable trees.
2021-02-28 16:45:02 -05:00
Aaron Suen
3548dc9c12 Fix loose humus repose bug 2020-12-31 09:51:29 -05:00
Aaron Suen
aebc0c6124 Expand stickwork selection hulls 2020-09-16 20:18:15 -04:00
Aaron Suen
95d0368f46 Tree and writing hints 2020-09-05 21:51:10 -04:00