18 Commits

Author SHA1 Message Date
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
1da5ebcc7f Soaking tickle recipes require placed nodes 2022-01-23 16:51:39 -05:00
Aaron Suen
13a5b64a25 Recipe for leaf bud tickling 2022-01-15 14:42:26 -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
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
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
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
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
2110bbba37 Nerf tree growth rate 2020-06-09 19:25:29 -04:00
Aaron Suen
e7846c9348 Refac HUD api, reduce chat_send usage 2020-03-25 08:49:34 -04:00
Aaron Suen
0cb72f7f2b Updated code standards. 2020-02-27 19:11:12 -05:00
Aaron Suen
9deb64526e Offline tree growth tweaks.
- No tick delays during tree growth.
- Tree growth near unloaded areas will be delayed
  until the areas are loaded.
2020-02-08 14:23:45 -05:00
Aaron Suen
21874672f1 Fix bad code indentation. 2020-01-21 21:37:08 -05:00
Aaron Suen
35475ab56d Fix tree growth hint. 2020-01-21 20:49:31 -05:00
Aaron Suen
7a90dab2b3 Make /growtrees work on leaves too. 2020-01-20 07:05:00 -05:00
Aaron Suen
73d2c4b5e8 Tree refinements, visible planted eggcorn.
- Make planted eggcorns evident via visual and
  description; it was too easy for new players to
  think they screwed up the recipe.
- Leaves inherit growth rate of trunk.
- Growth particles at tip of growing trunk.
- Code cleanup, refactoring, break up large files.
- Minor texture adjustments.
2020-01-20 06:50:34 -05:00